diff --git a/llvm/lib/Target/AMDGPU/VOPCInstructions.td b/llvm/lib/Target/AMDGPU/VOPCInstructions.td --- a/llvm/lib/Target/AMDGPU/VOPCInstructions.td +++ b/llvm/lib/Target/AMDGPU/VOPCInstructions.td @@ -1024,6 +1024,20 @@ defm : ICMP_Pattern ; defm : ICMP_Pattern ; +let OtherPredicates = [HasTrue16BitInsts] in { +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +defm : ICMP_Pattern ; +} // End OtherPredicates = [HasTrue16BitInsts] + +let OtherPredicates = [NotHasTrue16BitInsts] in { defm : ICMP_Pattern ; defm : ICMP_Pattern ; defm : ICMP_Pattern ; @@ -1034,6 +1048,7 @@ defm : ICMP_Pattern ; defm : ICMP_Pattern ; defm : ICMP_Pattern ; +} // End OtherPredicates = [NotHasTrue16BitInsts] multiclass FCMP_Pattern { let WaveSizePredicate = isWave64 in @@ -1067,14 +1082,6 @@ defm : FCMP_Pattern ; defm : FCMP_Pattern ; -defm : FCMP_Pattern ; -defm : FCMP_Pattern ; -defm : FCMP_Pattern ; -defm : FCMP_Pattern ; -defm : FCMP_Pattern ; -defm : FCMP_Pattern ; - - defm : FCMP_Pattern ; defm : FCMP_Pattern ; defm : FCMP_Pattern ; @@ -1089,12 +1096,37 @@ defm : FCMP_Pattern ; defm : FCMP_Pattern ; +let OtherPredicates = [HasTrue16BitInsts] in { +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; + +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +} // End OtherPredicates = [HasTrue16BitInsts] + +let OtherPredicates = [NotHasTrue16BitInsts] in { +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; +defm : FCMP_Pattern ; + defm : FCMP_Pattern ; defm : FCMP_Pattern ; defm : FCMP_Pattern ; defm : FCMP_Pattern ; defm : FCMP_Pattern ; defm : FCMP_Pattern ; +} // End OtherPredicates = [NotHasTrue16BitInsts] //===----------------------------------------------------------------------===// // DPP Encodings diff --git a/llvm/test/CodeGen/AMDGPU/v_cmp_gfx11.ll b/llvm/test/CodeGen/AMDGPU/v_cmp_gfx11.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/AMDGPU/v_cmp_gfx11.ll @@ -0,0 +1,26 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK %s + +define amdgpu_kernel void @test() { +; CHECK-LABEL: test: +; CHECK: ; %bb.0: ; %entry +; CHECK-NEXT: v_cmp_eq_u16_e64 s0, 0, 0 +; CHECK-NEXT: v_mov_b32_e32 v1, 0 +; CHECK-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1) +; CHECK-NEXT: s_cmp_eq_u32 s0, 0 +; CHECK-NEXT: s_cselect_b32 s0, -1, 0 +; CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, s0 +; CHECK-NEXT: ds_store_b32 v1, v0 +; CHECK-NEXT: s_endpgm +entry: + %0 = tail call i64 @llvm.amdgcn.icmp.i64.i16(i16 0, i16 0, i32 32) + %cmp0 = icmp eq i64 %0, 0 + %add0 = zext i1 %cmp0 to i32 + store i32 %add0, ptr addrspace(3) null, align 2147483648 + ret void +} + +; Function Attrs: convergent nounwind readnone willreturn +declare i64 @llvm.amdgcn.icmp.i64.i16(i16, i16, i32 immarg) #0 + +attributes #0 = { convergent nounwind readnone willreturn }