diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -906,6 +906,7 @@ setOperationAction(ISD::SRL, MVT::v1i128, Expand); setOperationAction(ISD::SRA, MVT::v1i128, Expand); + setOperationAction(ISD::SETCC, MVT::v1i128, Expand); setOperationAction(ISD::SETCC, MVT::v2i64, Legal); } else { diff --git a/llvm/test/CodeGen/PowerPC/setcc-vector.ll b/llvm/test/CodeGen/PowerPC/setcc-vector.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/setcc-vector.ll @@ -0,0 +1,52 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown \ +; RUN: -ppc-asm-full-reg-names < %s | FileCheck -check-prefixes=CHECK-PWR9 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown \ +; RUN: -ppc-asm-full-reg-names < %s | FileCheck -check-prefixes=CHECK-PWR8 %s +; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple=powerpc64-unknown-unknown \ +; RUN: -ppc-asm-full-reg-names < %s | FileCheck -check-prefixes=CHECK-PWR7 %s + +define <2 x i1> @setcc_v1i128([1 x i128] %a) { +; CHECK-PWR9-LABEL: setcc_v1i128: +; CHECK-PWR9: # %bb.0: # %entry +; CHECK-PWR9-NEXT: cmpldi r3, 35708 +; CHECK-PWR9-NEXT: cmpdi cr1, r4, 0 +; CHECK-PWR9-NEXT: li r3, -1 +; CHECK-PWR9-NEXT: crnand 4*cr5+lt, 4*cr1+eq, lt +; CHECK-PWR9-NEXT: isel r3, 0, r3, 4*cr5+lt +; CHECK-PWR9-NEXT: mtvsrdd vs34, 0, r3 +; CHECK-PWR9-NEXT: blr +; +; CHECK-PWR8-LABEL: setcc_v1i128: +; CHECK-PWR8: # %bb.0: # %entry +; CHECK-PWR8-NEXT: cmpldi r3, 35708 +; CHECK-PWR8-NEXT: cmpdi cr1, r4, 0 +; CHECK-PWR8-NEXT: li r3, -1 +; CHECK-PWR8-NEXT: li r4, 0 +; CHECK-PWR8-NEXT: crnand 4*cr5+lt, 4*cr1+eq, lt +; CHECK-PWR8-NEXT: mtfprd f1, r4 +; CHECK-PWR8-NEXT: isel r3, 0, r3, 4*cr5+lt +; CHECK-PWR8-NEXT: mtfprd f0, r3 +; CHECK-PWR8-NEXT: xxmrghd vs34, vs1, vs0 +; CHECK-PWR8-NEXT: blr +; +; CHECK-PWR7-LABEL: setcc_v1i128: +; CHECK-PWR7: # %bb.0: # %entry +; CHECK-PWR7-NEXT: cmpldi r3, 35708 +; CHECK-PWR7-NEXT: cmpdi cr1, r4, 0 +; CHECK-PWR7-NEXT: li r3, 0 +; CHECK-PWR7-NEXT: li r4, -1 +; CHECK-PWR7-NEXT: crnand 4*cr5+lt, 4*cr1+eq, lt +; CHECK-PWR7-NEXT: std r3, -8(r1) +; CHECK-PWR7-NEXT: isel r3, 0, r4, 4*cr5+lt +; CHECK-PWR7-NEXT: std r3, -16(r1) +; CHECK-PWR7-NEXT: addi r3, r1, -16 +; CHECK-PWR7-NEXT: lxvd2x vs0, 0, r3 +; CHECK-PWR7-NEXT: xxswapd vs34, vs0 +; CHECK-PWR7-NEXT: blr +entry: + %b = extractvalue [1 x i128] %a, 0 + %0 = insertelement <2 x i128> undef, i128 %b, i32 0 + %1 = icmp ult <2 x i128> %0, + ret <2 x i1> %1 +}