Skip to content

Commit 33f4f39

Browse files
authored
[AMDGPU] New GFX11 v_cmp_tru_* aliases for integer comparisons (#118976)
This is for compatibility with SP3. It only affects GFX11 because the v_cmp_t_* instructions were removed in GFX12.
1 parent 807726f commit 33f4f39

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

llvm/lib/Target/AMDGPU/VOPCInstructions.td

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,17 @@ defm V_CMPX_CLASS_F16_fake16 : VOPCX_Real_t16_gfx11_gfx12<0x0fd, "v_cmpx_class_f
19561956
defm V_CMPX_CLASS_F32 : VOPCX_Real_gfx11_gfx12<0x0fe>;
19571957
defm V_CMPX_CLASS_F64 : VOPCX_Real_gfx11_gfx12<0x0ff>;
19581958

1959+
let AssemblerPredicate = isGFX11Only in {
1960+
def : AMDGPUMnemonicAlias<"v_cmp_tru_i32", "v_cmp_t_i32">;
1961+
def : AMDGPUMnemonicAlias<"v_cmp_tru_u32", "v_cmp_t_u32">;
1962+
def : AMDGPUMnemonicAlias<"v_cmp_tru_i64", "v_cmp_t_i64">;
1963+
def : AMDGPUMnemonicAlias<"v_cmp_tru_u64", "v_cmp_t_u64">;
1964+
def : AMDGPUMnemonicAlias<"v_cmpx_tru_i32", "v_cmpx_t_i32">;
1965+
def : AMDGPUMnemonicAlias<"v_cmpx_tru_u32", "v_cmpx_t_u32">;
1966+
def : AMDGPUMnemonicAlias<"v_cmpx_tru_i64", "v_cmpx_t_i64">;
1967+
def : AMDGPUMnemonicAlias<"v_cmpx_tru_u64", "v_cmpx_t_u64">;
1968+
}
1969+
19591970
//===----------------------------------------------------------------------===//
19601971
// GFX10.
19611972
//===----------------------------------------------------------------------===//
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
2+
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64 -show-encoding %s | FileCheck -check-prefix=GFX11 %s
3+
4+
v_cmp_tru_i32 vcc, v1, v2
5+
// GFX11: v_cmp_t_i32_e32 vcc, v1, v2 ; encoding: [0x01,0x05,0x8e,0x7c]
6+
7+
v_cmp_tru_u32 vcc, v1, v2
8+
// GFX11: v_cmp_t_u32_e32 vcc, v1, v2 ; encoding: [0x01,0x05,0x9e,0x7c]
9+
10+
v_cmp_tru_i64 vcc, v[1:2], v[2:3]
11+
// GFX11: v_cmp_t_i64_e32 vcc, v[1:2], v[2:3] ; encoding: [0x01,0x05,0xae,0x7c]
12+
13+
v_cmp_tru_u64 vcc, v[1:2], v[2:3]
14+
// GFX11: v_cmp_t_u64_e32 vcc, v[1:2], v[2:3] ; encoding: [0x01,0x05,0xbe,0x7c]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
2+
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64 -show-encoding %s | FileCheck -check-prefix=GFX11 %s
3+
4+
v_cmpx_tru_i32 v1, v2
5+
// GFX11: v_cmpx_t_i32_e32 v1, v2 ; encoding: [0x01,0x05,0x8e,0x7d]
6+
7+
v_cmpx_tru_u32 v1, v2
8+
// GFX11: v_cmpx_t_u32_e32 v1, v2 ; encoding: [0x01,0x05,0x9e,0x7d]
9+
10+
v_cmpx_tru_i64 v[1:2], v[2:3]
11+
// GFX11: v_cmpx_t_i64_e32 v[1:2], v[2:3] ; encoding: [0x01,0x05,0xae,0x7d]
12+
13+
v_cmpx_tru_u64 v[1:2], v[2:3]
14+
// GFX11: v_cmpx_t_u64_e32 v[1:2], v[2:3] ; encoding: [0x01,0x05,0xbe,0x7d]

0 commit comments

Comments
 (0)