Skip to content

Commit 20fe83b

Browse files
authored
[AMDGPU] Add new aliases ds_subrev_rtn_u32/u64 for ds_rsub_rtn_u32/u64 (#83408)
Following on from #83118, this adds aliases for the "rtn" forms of these instructions. The fact that they were missing from SP3 was an oversight which has been fixed now.
1 parent 31295bb commit 20fe83b

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

llvm/lib/Target/AMDGPU/DSInstructions.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,9 @@ defm DS_PK_ADD_RTN_BF16 : DS_Real_gfx12<0x0ab>;
12621262

12631263
// New aliases added in GFX12 without renaming the instructions.
12641264
def : MnemonicAlias<"ds_subrev_u32", "ds_rsub_u32">, Requires<[isGFX12Plus]>;
1265+
def : MnemonicAlias<"ds_subrev_rtn_u32", "ds_rsub_rtn_u32">, Requires<[isGFX12Plus]>;
12651266
def : MnemonicAlias<"ds_subrev_u64", "ds_rsub_u64">, Requires<[isGFX12Plus]>;
1267+
def : MnemonicAlias<"ds_subrev_rtn_u64", "ds_rsub_rtn_u64">, Requires<[isGFX12Plus]>;
12661268

12671269
//===----------------------------------------------------------------------===//
12681270
// GFX11.

llvm/test/MC/AMDGPU/gfx11_unsupported.s

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,3 +2052,15 @@ global_atomic_cond_sub_u32 v0, v2, s[0:1] offset:64
20522052

20532053
global_atomic_ordered_add_b64 v0, v[2:3], s[0:1] offset:64
20542054
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
2055+
2056+
ds_subrev_u32 v1, v2
2057+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
2058+
2059+
ds_subrev_rtn_u32 v5, v1, v2
2060+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
2061+
2062+
ds_subrev_u64 v1, v[2:3]
2063+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
2064+
2065+
ds_subrev_rtn_u64 v[5:6], v1, v[2:3]
2066+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU

llvm/test/MC/AMDGPU/gfx12_asm_ds_alias.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,11 @@ ds_min_rtn_f64 v[5:6], v1, v[2:3]
2727
ds_subrev_u32 v1, v2
2828
// GFX12: ds_rsub_u32 v1, v2 ; encoding: [0x00,0x00,0x08,0xd8,0x01,0x02,0x00,0x00]
2929

30+
ds_subrev_rtn_u32 v5, v1, v2
31+
// GFX12: ds_rsub_rtn_u32 v5, v1, v2 ; encoding: [0x00,0x00,0x88,0xd8,0x01,0x02,0x00,0x05]
32+
3033
ds_subrev_u64 v1, v[2:3]
3134
// GFX12: ds_rsub_u64 v1, v[2:3] ; encoding: [0x00,0x00,0x08,0xd9,0x01,0x02,0x00,0x00]
35+
36+
ds_subrev_rtn_u64 v[5:6], v1, v[2:3]
37+
// GFX12: ds_rsub_rtn_u64 v[5:6], v1, v[2:3] ; encoding: [0x00,0x00,0x88,0xd9,0x01,0x02,0x00,0x05]

0 commit comments

Comments
 (0)