Skip to content

[AMDGPU] New GFX11 v_cmp_tru_* aliases for integer comparisons #118976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions llvm/lib/Target/AMDGPU/VOPCInstructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,17 @@ defm V_CMPX_CLASS_F16_fake16 : VOPCX_Real_t16_gfx11_gfx12<0x0fd, "v_cmpx_class_f
defm V_CMPX_CLASS_F32 : VOPCX_Real_gfx11_gfx12<0x0fe>;
defm V_CMPX_CLASS_F64 : VOPCX_Real_gfx11_gfx12<0x0ff>;

let AssemblerPredicate = isGFX11Only in {
def : AMDGPUMnemonicAlias<"v_cmp_tru_i32", "v_cmp_t_i32">;
def : AMDGPUMnemonicAlias<"v_cmp_tru_u32", "v_cmp_t_u32">;
def : AMDGPUMnemonicAlias<"v_cmp_tru_i64", "v_cmp_t_i64">;
def : AMDGPUMnemonicAlias<"v_cmp_tru_u64", "v_cmp_t_u64">;
def : AMDGPUMnemonicAlias<"v_cmpx_tru_i32", "v_cmpx_t_i32">;
def : AMDGPUMnemonicAlias<"v_cmpx_tru_u32", "v_cmpx_t_u32">;
def : AMDGPUMnemonicAlias<"v_cmpx_tru_i64", "v_cmpx_t_i64">;
def : AMDGPUMnemonicAlias<"v_cmpx_tru_u64", "v_cmpx_t_u64">;
}

//===----------------------------------------------------------------------===//
// GFX10.
//===----------------------------------------------------------------------===//
Expand Down
14 changes: 14 additions & 0 deletions llvm/test/MC/AMDGPU/gfx11_asm_vopc_alias.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64 -show-encoding %s | FileCheck -check-prefix=GFX11 %s

v_cmp_tru_i32 vcc, v1, v2
// GFX11: v_cmp_t_i32_e32 vcc, v1, v2 ; encoding: [0x01,0x05,0x8e,0x7c]

v_cmp_tru_u32 vcc, v1, v2
// GFX11: v_cmp_t_u32_e32 vcc, v1, v2 ; encoding: [0x01,0x05,0x9e,0x7c]

v_cmp_tru_i64 vcc, v[1:2], v[2:3]
// GFX11: v_cmp_t_i64_e32 vcc, v[1:2], v[2:3] ; encoding: [0x01,0x05,0xae,0x7c]

v_cmp_tru_u64 vcc, v[1:2], v[2:3]
// GFX11: v_cmp_t_u64_e32 vcc, v[1:2], v[2:3] ; encoding: [0x01,0x05,0xbe,0x7c]
14 changes: 14 additions & 0 deletions llvm/test/MC/AMDGPU/gfx11_asm_vopcx_alias.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64 -show-encoding %s | FileCheck -check-prefix=GFX11 %s

v_cmpx_tru_i32 v1, v2
// GFX11: v_cmpx_t_i32_e32 v1, v2 ; encoding: [0x01,0x05,0x8e,0x7d]

v_cmpx_tru_u32 v1, v2
// GFX11: v_cmpx_t_u32_e32 v1, v2 ; encoding: [0x01,0x05,0x9e,0x7d]

v_cmpx_tru_i64 v[1:2], v[2:3]
// GFX11: v_cmpx_t_i64_e32 v[1:2], v[2:3] ; encoding: [0x01,0x05,0xae,0x7d]

v_cmpx_tru_u64 v[1:2], v[2:3]
// GFX11: v_cmpx_t_u64_e32 v[1:2], v[2:3] ; encoding: [0x01,0x05,0xbe,0x7d]
Loading