Skip to content

Commit

Permalink
[AMDGPU] Add new aliases ds_subrev_u32/u64 for ds_rsub_u32/u64 (#83118)
Browse files Browse the repository at this point in the history
Note that the instructions have not been renamed and that there are no
corresponding aliases for ds_rsub_rtn_u32/u64. This matches SP3
behavior.
  • Loading branch information
jayfoad committed Feb 27, 2024
1 parent 2c9b6c1 commit ca0560d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Target/AMDGPU/DSInstructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,10 @@ defm DS_PK_ADD_RTN_F16 : DS_Real_gfx12<0x0aa>;
defm DS_PK_ADD_BF16 : DS_Real_gfx12<0x09b>;
defm DS_PK_ADD_RTN_BF16 : DS_Real_gfx12<0x0ab>;

// New aliases added in GFX12 without renaming the instructions.
def : MnemonicAlias<"ds_subrev_u32", "ds_rsub_u32">, Requires<[isGFX12Plus]>;
def : MnemonicAlias<"ds_subrev_u64", "ds_rsub_u64">, Requires<[isGFX12Plus]>;

//===----------------------------------------------------------------------===//
// GFX11.
//===----------------------------------------------------------------------===//
Expand Down
6 changes: 6 additions & 0 deletions llvm/test/MC/AMDGPU/gfx12_asm_ds_alias.s
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ ds_min_rtn_f32 v5, v1, v2

ds_min_rtn_f64 v[5:6], v1, v[2:3]
// GFX12: [0x00,0x00,0xc8,0xd9,0x01,0x02,0x00,0x05]

ds_subrev_u32 v1, v2
// GFX12: ds_rsub_u32 v1, v2 ; encoding: [0x00,0x00,0x08,0xd8,0x01,0x02,0x00,0x00]

ds_subrev_u64 v1, v[2:3]
// GFX12: ds_rsub_u64 v1, v[2:3] ; encoding: [0x00,0x00,0x08,0xd9,0x01,0x02,0x00,0x00]

0 comments on commit ca0560d

Please sign in to comment.