| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
| |
| ; RUN: llc -mtriple=ppc64le-unknown-unknown -mcpu=pwr8 %s -o - | FileCheck %s |
| ; RUN: llc -mtriple=powerpc-ibm-aix7.2.0.0 -mcpu=pwr8 %s -o - | FileCheck --check-prefix=AIX32 %s |
| ; RUN: llc -mtriple=powerpc64-ibm-aix7.2.0.0 -mcpu=pwr8 %s -o - | FileCheck --check-prefix=AIX64 %s |
| |
| ; RUN: llc -mtriple=ppc64le-unknown-unknown -mcpu=pwr9 %s -o - | FileCheck --check-prefix=CHECK-PWR9 %s |
| ; RUN: llc -mtriple=powerpc-ibm-aix7.2.0.0 -mcpu=pwr9 %s -o - | FileCheck --check-prefix=AIX32-PWR9 %s |
| ; RUN: llc -mtriple=powerpc64-ibm-aix7.2.0.0 -mcpu=pwr9 %s -o - | FileCheck --check-prefix=AIX64-PWR9 %s |
| |
| |
| define i8 @scmp_8_8(i8 signext %x, i8 signext %y) nounwind { |
| ; CHECK-LABEL: scmp_8_8: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: cmpw 7, 3, 4 |
| ; CHECK-NEXT: mfocrf 3, 1 |
| ; CHECK-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; CHECK-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; CHECK-NEXT: sub 3, 4, 3 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: scmp_8_8: |
| ; AIX32: # %bb.0: |
| ; AIX32-NEXT: cmpw 7, 3, 4 |
| ; AIX32-NEXT: mfocrf 3, 1 |
| ; AIX32-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX32-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX32-NEXT: sub 3, 4, 3 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: scmp_8_8: |
| ; AIX64: # %bb.0: |
| ; AIX64-NEXT: cmpw 7, 3, 4 |
| ; AIX64-NEXT: mfocrf 3, 1 |
| ; AIX64-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX64-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX64-NEXT: sub 3, 4, 3 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: scmp_8_8: |
| ; CHECK-PWR9: # %bb.0: |
| ; CHECK-PWR9-NEXT: cmpw 3, 4 |
| ; CHECK-PWR9-NEXT: setb 3, 0 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: scmp_8_8: |
| ; AIX32-PWR9: # %bb.0: |
| ; AIX32-PWR9-NEXT: cmpw 3, 4 |
| ; AIX32-PWR9-NEXT: li 3, 0 |
| ; AIX32-PWR9-NEXT: li 4, 1 |
| ; AIX32-PWR9-NEXT: iselgt 3, 4, 3 |
| ; AIX32-PWR9-NEXT: li 4, -1 |
| ; AIX32-PWR9-NEXT: isellt 3, 4, 3 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: scmp_8_8: |
| ; AIX64-PWR9: # %bb.0: |
| ; AIX64-PWR9-NEXT: cmpw 3, 4 |
| ; AIX64-PWR9-NEXT: setb 3, 0 |
| ; AIX64-PWR9-NEXT: blr |
| %1 = call i8 @llvm.scmp(i8 %x, i8 %y) |
| ret i8 %1 |
| } |
| |
| define i8 @scmp_8_16(i16 signext %x, i16 signext %y) nounwind { |
| ; CHECK-LABEL: scmp_8_16: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: cmpw 7, 3, 4 |
| ; CHECK-NEXT: mfocrf 3, 1 |
| ; CHECK-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; CHECK-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; CHECK-NEXT: sub 3, 4, 3 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: scmp_8_16: |
| ; AIX32: # %bb.0: |
| ; AIX32-NEXT: cmpw 7, 3, 4 |
| ; AIX32-NEXT: mfocrf 3, 1 |
| ; AIX32-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX32-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX32-NEXT: sub 3, 4, 3 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: scmp_8_16: |
| ; AIX64: # %bb.0: |
| ; AIX64-NEXT: cmpw 7, 3, 4 |
| ; AIX64-NEXT: mfocrf 3, 1 |
| ; AIX64-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX64-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX64-NEXT: sub 3, 4, 3 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: scmp_8_16: |
| ; CHECK-PWR9: # %bb.0: |
| ; CHECK-PWR9-NEXT: cmpw 3, 4 |
| ; CHECK-PWR9-NEXT: setb 3, 0 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: scmp_8_16: |
| ; AIX32-PWR9: # %bb.0: |
| ; AIX32-PWR9-NEXT: cmpw 3, 4 |
| ; AIX32-PWR9-NEXT: li 3, 0 |
| ; AIX32-PWR9-NEXT: li 4, 1 |
| ; AIX32-PWR9-NEXT: iselgt 3, 4, 3 |
| ; AIX32-PWR9-NEXT: li 4, -1 |
| ; AIX32-PWR9-NEXT: isellt 3, 4, 3 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: scmp_8_16: |
| ; AIX64-PWR9: # %bb.0: |
| ; AIX64-PWR9-NEXT: cmpw 3, 4 |
| ; AIX64-PWR9-NEXT: setb 3, 0 |
| ; AIX64-PWR9-NEXT: blr |
| %1 = call i8 @llvm.scmp(i16 %x, i16 %y) |
| ret i8 %1 |
| } |
| |
| define i8 @scmp_8_32(i32 %x, i32 %y) nounwind { |
| ; CHECK-LABEL: scmp_8_32: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: cmpw 7, 3, 4 |
| ; CHECK-NEXT: mfocrf 3, 1 |
| ; CHECK-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; CHECK-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; CHECK-NEXT: sub 3, 4, 3 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: scmp_8_32: |
| ; AIX32: # %bb.0: |
| ; AIX32-NEXT: cmpw 7, 3, 4 |
| ; AIX32-NEXT: mfocrf 3, 1 |
| ; AIX32-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX32-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX32-NEXT: sub 3, 4, 3 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: scmp_8_32: |
| ; AIX64: # %bb.0: |
| ; AIX64-NEXT: cmpw 7, 3, 4 |
| ; AIX64-NEXT: mfocrf 3, 1 |
| ; AIX64-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX64-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX64-NEXT: sub 3, 4, 3 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: scmp_8_32: |
| ; CHECK-PWR9: # %bb.0: |
| ; CHECK-PWR9-NEXT: cmpw 3, 4 |
| ; CHECK-PWR9-NEXT: setb 3, 0 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: scmp_8_32: |
| ; AIX32-PWR9: # %bb.0: |
| ; AIX32-PWR9-NEXT: cmpw 3, 4 |
| ; AIX32-PWR9-NEXT: li 3, 0 |
| ; AIX32-PWR9-NEXT: li 4, 1 |
| ; AIX32-PWR9-NEXT: iselgt 3, 4, 3 |
| ; AIX32-PWR9-NEXT: li 4, -1 |
| ; AIX32-PWR9-NEXT: isellt 3, 4, 3 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: scmp_8_32: |
| ; AIX64-PWR9: # %bb.0: |
| ; AIX64-PWR9-NEXT: cmpw 3, 4 |
| ; AIX64-PWR9-NEXT: setb 3, 0 |
| ; AIX64-PWR9-NEXT: blr |
| %1 = call i8 @llvm.scmp(i32 %x, i32 %y) |
| ret i8 %1 |
| } |
| |
| define i8 @scmp_8_64(i64 %x, i64 %y) nounwind { |
| ; CHECK-LABEL: scmp_8_64: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: cmpd 7, 3, 4 |
| ; CHECK-NEXT: mfocrf 3, 1 |
| ; CHECK-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; CHECK-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; CHECK-NEXT: sub 3, 4, 3 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: scmp_8_64: |
| ; AIX32: # %bb.0: |
| ; AIX32-NEXT: cmplw 3, 5 |
| ; AIX32-NEXT: cmpw 1, 3, 5 |
| ; AIX32-NEXT: li 3, 1 |
| ; AIX32-NEXT: cmplw 5, 4, 6 |
| ; AIX32-NEXT: li 4, -1 |
| ; AIX32-NEXT: crandc 22, 5, 2 |
| ; AIX32-NEXT: crand 21, 2, 21 |
| ; AIX32-NEXT: crand 20, 2, 20 |
| ; AIX32-NEXT: crnor 21, 21, 22 |
| ; AIX32-NEXT: isel 3, 0, 3, 21 |
| ; AIX32-NEXT: crandc 21, 4, 2 |
| ; AIX32-NEXT: cror 20, 20, 21 |
| ; AIX32-NEXT: isel 3, 4, 3, 20 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: scmp_8_64: |
| ; AIX64: # %bb.0: |
| ; AIX64-NEXT: cmpd 7, 3, 4 |
| ; AIX64-NEXT: mfocrf 3, 1 |
| ; AIX64-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX64-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX64-NEXT: sub 3, 4, 3 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: scmp_8_64: |
| ; CHECK-PWR9: # %bb.0: |
| ; CHECK-PWR9-NEXT: cmpd 3, 4 |
| ; CHECK-PWR9-NEXT: setb 3, 0 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: scmp_8_64: |
| ; AIX32-PWR9: # %bb.0: |
| ; AIX32-PWR9-NEXT: cmplw 3, 5 |
| ; AIX32-PWR9-NEXT: cmpw 1, 3, 5 |
| ; AIX32-PWR9-NEXT: cmplw 6, 4, 6 |
| ; AIX32-PWR9-NEXT: li 3, 1 |
| ; AIX32-PWR9-NEXT: li 4, -1 |
| ; AIX32-PWR9-NEXT: crandc 20, 5, 2 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 25 |
| ; AIX32-PWR9-NEXT: crnor 20, 21, 20 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 24 |
| ; AIX32-PWR9-NEXT: isel 3, 0, 3, 20 |
| ; AIX32-PWR9-NEXT: crandc 20, 4, 2 |
| ; AIX32-PWR9-NEXT: cror 20, 21, 20 |
| ; AIX32-PWR9-NEXT: isel 3, 4, 3, 20 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: scmp_8_64: |
| ; AIX64-PWR9: # %bb.0: |
| ; AIX64-PWR9-NEXT: cmpd 3, 4 |
| ; AIX64-PWR9-NEXT: setb 3, 0 |
| ; AIX64-PWR9-NEXT: blr |
| %1 = call i8 @llvm.scmp(i64 %x, i64 %y) |
| ret i8 %1 |
| } |
| |
| define i8 @scmp_8_128(i128 %x, i128 %y) nounwind { |
| ; CHECK-LABEL: scmp_8_128: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: cmpld 4, 6 |
| ; CHECK-NEXT: cmpd 1, 4, 6 |
| ; CHECK-NEXT: li 4, -1 |
| ; CHECK-NEXT: cmpld 5, 3, 5 |
| ; CHECK-NEXT: li 3, 1 |
| ; CHECK-NEXT: crandc 22, 5, 2 |
| ; CHECK-NEXT: crand 21, 2, 21 |
| ; CHECK-NEXT: crand 20, 2, 20 |
| ; CHECK-NEXT: crnor 21, 21, 22 |
| ; CHECK-NEXT: isel 3, 0, 3, 21 |
| ; CHECK-NEXT: crandc 21, 4, 2 |
| ; CHECK-NEXT: cror 20, 20, 21 |
| ; CHECK-NEXT: isel 3, 4, 3, 20 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: scmp_8_128: |
| ; AIX32: # %bb.0: |
| ; AIX32-NEXT: cmplw 3, 7 |
| ; AIX32-NEXT: cmpw 1, 3, 7 |
| ; AIX32-NEXT: mfcr 12 |
| ; AIX32-NEXT: stw 12, 4(1) |
| ; AIX32-NEXT: cmplw 6, 4, 8 |
| ; AIX32-NEXT: xor 3, 3, 7 |
| ; AIX32-NEXT: crandc 20, 5, 2 |
| ; AIX32-NEXT: xor 4, 4, 8 |
| ; AIX32-NEXT: crand 21, 2, 25 |
| ; AIX32-NEXT: or 3, 4, 3 |
| ; AIX32-NEXT: cmplw 7, 5, 9 |
| ; AIX32-NEXT: cmplw 2, 6, 10 |
| ; AIX32-NEXT: li 4, -1 |
| ; AIX32-NEXT: lwz 12, 4(1) |
| ; AIX32-NEXT: cror 25, 21, 20 |
| ; AIX32-NEXT: cmplwi 5, 3, 0 |
| ; AIX32-NEXT: crandc 21, 29, 30 |
| ; AIX32-NEXT: crand 23, 30, 9 |
| ; AIX32-NEXT: cror 21, 23, 21 |
| ; AIX32-NEXT: li 3, 1 |
| ; AIX32-NEXT: crand 23, 30, 8 |
| ; AIX32-NEXT: mtocrf 32, 12 |
| ; AIX32-NEXT: crandc 20, 25, 22 |
| ; AIX32-NEXT: crand 21, 22, 21 |
| ; AIX32-NEXT: crnor 20, 21, 20 |
| ; AIX32-NEXT: crand 21, 2, 24 |
| ; AIX32-NEXT: isel 3, 0, 3, 20 |
| ; AIX32-NEXT: crandc 20, 4, 2 |
| ; AIX32-NEXT: cror 20, 21, 20 |
| ; AIX32-NEXT: crandc 21, 28, 30 |
| ; AIX32-NEXT: cror 21, 23, 21 |
| ; AIX32-NEXT: crandc 20, 20, 22 |
| ; AIX32-NEXT: crand 21, 22, 21 |
| ; AIX32-NEXT: cror 20, 21, 20 |
| ; AIX32-NEXT: isel 3, 4, 3, 20 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: scmp_8_128: |
| ; AIX64: # %bb.0: |
| ; AIX64-NEXT: cmpld 3, 5 |
| ; AIX64-NEXT: cmpd 1, 3, 5 |
| ; AIX64-NEXT: li 3, 1 |
| ; AIX64-NEXT: cmpld 5, 4, 6 |
| ; AIX64-NEXT: li 4, -1 |
| ; AIX64-NEXT: crandc 22, 5, 2 |
| ; AIX64-NEXT: crand 21, 2, 21 |
| ; AIX64-NEXT: crand 20, 2, 20 |
| ; AIX64-NEXT: crnor 21, 21, 22 |
| ; AIX64-NEXT: isel 3, 0, 3, 21 |
| ; AIX64-NEXT: crandc 21, 4, 2 |
| ; AIX64-NEXT: cror 20, 20, 21 |
| ; AIX64-NEXT: isel 3, 4, 3, 20 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: scmp_8_128: |
| ; CHECK-PWR9: # %bb.0: |
| ; CHECK-PWR9-NEXT: cmpld 4, 6 |
| ; CHECK-PWR9-NEXT: cmpd 1, 4, 6 |
| ; CHECK-PWR9-NEXT: cmpld 6, 3, 5 |
| ; CHECK-PWR9-NEXT: li 3, 1 |
| ; CHECK-PWR9-NEXT: li 4, -1 |
| ; CHECK-PWR9-NEXT: crandc 20, 5, 2 |
| ; CHECK-PWR9-NEXT: crand 21, 2, 25 |
| ; CHECK-PWR9-NEXT: crnor 20, 21, 20 |
| ; CHECK-PWR9-NEXT: crand 21, 2, 24 |
| ; CHECK-PWR9-NEXT: isel 3, 0, 3, 20 |
| ; CHECK-PWR9-NEXT: crandc 20, 4, 2 |
| ; CHECK-PWR9-NEXT: cror 20, 21, 20 |
| ; CHECK-PWR9-NEXT: isel 3, 4, 3, 20 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: scmp_8_128: |
| ; AIX32-PWR9: # %bb.0: |
| ; AIX32-PWR9-NEXT: cmplw 3, 7 |
| ; AIX32-PWR9-NEXT: cmpw 1, 3, 7 |
| ; AIX32-PWR9-NEXT: cmplw 6, 4, 8 |
| ; AIX32-PWR9-NEXT: xor 3, 3, 7 |
| ; AIX32-PWR9-NEXT: xor 4, 4, 8 |
| ; AIX32-PWR9-NEXT: cmplw 7, 5, 9 |
| ; AIX32-PWR9-NEXT: crandc 20, 5, 2 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 25 |
| ; AIX32-PWR9-NEXT: mfcr 12 |
| ; AIX32-PWR9-NEXT: or 3, 4, 3 |
| ; AIX32-PWR9-NEXT: cmplw 2, 6, 10 |
| ; AIX32-PWR9-NEXT: li 4, -1 |
| ; AIX32-PWR9-NEXT: cror 25, 21, 20 |
| ; AIX32-PWR9-NEXT: cmplwi 5, 3, 0 |
| ; AIX32-PWR9-NEXT: crandc 21, 29, 30 |
| ; AIX32-PWR9-NEXT: li 3, 1 |
| ; AIX32-PWR9-NEXT: crand 23, 30, 9 |
| ; AIX32-PWR9-NEXT: cror 21, 23, 21 |
| ; AIX32-PWR9-NEXT: crandc 20, 25, 22 |
| ; AIX32-PWR9-NEXT: crand 23, 30, 8 |
| ; AIX32-PWR9-NEXT: stw 12, 4(1) |
| ; AIX32-PWR9-NEXT: lwz 12, 4(1) |
| ; AIX32-PWR9-NEXT: crand 21, 22, 21 |
| ; AIX32-PWR9-NEXT: crnor 20, 21, 20 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 24 |
| ; AIX32-PWR9-NEXT: mtocrf 32, 12 |
| ; AIX32-PWR9-NEXT: isel 3, 0, 3, 20 |
| ; AIX32-PWR9-NEXT: crandc 20, 4, 2 |
| ; AIX32-PWR9-NEXT: cror 20, 21, 20 |
| ; AIX32-PWR9-NEXT: crandc 21, 28, 30 |
| ; AIX32-PWR9-NEXT: cror 21, 23, 21 |
| ; AIX32-PWR9-NEXT: crandc 20, 20, 22 |
| ; AIX32-PWR9-NEXT: crand 21, 22, 21 |
| ; AIX32-PWR9-NEXT: cror 20, 21, 20 |
| ; AIX32-PWR9-NEXT: isel 3, 4, 3, 20 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: scmp_8_128: |
| ; AIX64-PWR9: # %bb.0: |
| ; AIX64-PWR9-NEXT: cmpld 3, 5 |
| ; AIX64-PWR9-NEXT: cmpd 1, 3, 5 |
| ; AIX64-PWR9-NEXT: cmpld 6, 4, 6 |
| ; AIX64-PWR9-NEXT: li 3, 1 |
| ; AIX64-PWR9-NEXT: li 4, -1 |
| ; AIX64-PWR9-NEXT: crandc 20, 5, 2 |
| ; AIX64-PWR9-NEXT: crand 21, 2, 25 |
| ; AIX64-PWR9-NEXT: crnor 20, 21, 20 |
| ; AIX64-PWR9-NEXT: crand 21, 2, 24 |
| ; AIX64-PWR9-NEXT: isel 3, 0, 3, 20 |
| ; AIX64-PWR9-NEXT: crandc 20, 4, 2 |
| ; AIX64-PWR9-NEXT: cror 20, 21, 20 |
| ; AIX64-PWR9-NEXT: isel 3, 4, 3, 20 |
| ; AIX64-PWR9-NEXT: blr |
| %1 = call i8 @llvm.scmp(i128 %x, i128 %y) |
| ret i8 %1 |
| } |
| |
| define i32 @scmp_32_32(i32 %x, i32 %y) nounwind { |
| ; CHECK-LABEL: scmp_32_32: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: cmpw 7, 3, 4 |
| ; CHECK-NEXT: mfocrf 3, 1 |
| ; CHECK-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; CHECK-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; CHECK-NEXT: sub 3, 4, 3 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: scmp_32_32: |
| ; AIX32: # %bb.0: |
| ; AIX32-NEXT: cmpw 7, 3, 4 |
| ; AIX32-NEXT: mfocrf 3, 1 |
| ; AIX32-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX32-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX32-NEXT: sub 3, 4, 3 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: scmp_32_32: |
| ; AIX64: # %bb.0: |
| ; AIX64-NEXT: cmpw 7, 3, 4 |
| ; AIX64-NEXT: mfocrf 3, 1 |
| ; AIX64-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX64-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX64-NEXT: sub 3, 4, 3 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: scmp_32_32: |
| ; CHECK-PWR9: # %bb.0: |
| ; CHECK-PWR9-NEXT: cmpw 3, 4 |
| ; CHECK-PWR9-NEXT: setb 3, 0 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: scmp_32_32: |
| ; AIX32-PWR9: # %bb.0: |
| ; AIX32-PWR9-NEXT: cmpw 3, 4 |
| ; AIX32-PWR9-NEXT: li 3, 0 |
| ; AIX32-PWR9-NEXT: li 4, 1 |
| ; AIX32-PWR9-NEXT: iselgt 3, 4, 3 |
| ; AIX32-PWR9-NEXT: li 4, -1 |
| ; AIX32-PWR9-NEXT: isellt 3, 4, 3 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: scmp_32_32: |
| ; AIX64-PWR9: # %bb.0: |
| ; AIX64-PWR9-NEXT: cmpw 3, 4 |
| ; AIX64-PWR9-NEXT: setb 3, 0 |
| ; AIX64-PWR9-NEXT: blr |
| %1 = call i32 @llvm.scmp(i32 %x, i32 %y) |
| ret i32 %1 |
| } |
| |
| define i32 @scmp_32_64(i64 %x, i64 %y) nounwind { |
| ; CHECK-LABEL: scmp_32_64: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: cmpd 7, 3, 4 |
| ; CHECK-NEXT: mfocrf 3, 1 |
| ; CHECK-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; CHECK-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; CHECK-NEXT: sub 3, 4, 3 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: scmp_32_64: |
| ; AIX32: # %bb.0: |
| ; AIX32-NEXT: cmplw 3, 5 |
| ; AIX32-NEXT: cmpw 1, 3, 5 |
| ; AIX32-NEXT: li 3, 1 |
| ; AIX32-NEXT: cmplw 5, 4, 6 |
| ; AIX32-NEXT: li 4, -1 |
| ; AIX32-NEXT: crandc 22, 5, 2 |
| ; AIX32-NEXT: crand 21, 2, 21 |
| ; AIX32-NEXT: crand 20, 2, 20 |
| ; AIX32-NEXT: crnor 21, 21, 22 |
| ; AIX32-NEXT: isel 3, 0, 3, 21 |
| ; AIX32-NEXT: crandc 21, 4, 2 |
| ; AIX32-NEXT: cror 20, 20, 21 |
| ; AIX32-NEXT: isel 3, 4, 3, 20 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: scmp_32_64: |
| ; AIX64: # %bb.0: |
| ; AIX64-NEXT: cmpd 7, 3, 4 |
| ; AIX64-NEXT: mfocrf 3, 1 |
| ; AIX64-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX64-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX64-NEXT: sub 3, 4, 3 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: scmp_32_64: |
| ; CHECK-PWR9: # %bb.0: |
| ; CHECK-PWR9-NEXT: cmpd 3, 4 |
| ; CHECK-PWR9-NEXT: setb 3, 0 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: scmp_32_64: |
| ; AIX32-PWR9: # %bb.0: |
| ; AIX32-PWR9-NEXT: cmplw 3, 5 |
| ; AIX32-PWR9-NEXT: cmpw 1, 3, 5 |
| ; AIX32-PWR9-NEXT: cmplw 6, 4, 6 |
| ; AIX32-PWR9-NEXT: li 3, 1 |
| ; AIX32-PWR9-NEXT: li 4, -1 |
| ; AIX32-PWR9-NEXT: crandc 20, 5, 2 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 25 |
| ; AIX32-PWR9-NEXT: crnor 20, 21, 20 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 24 |
| ; AIX32-PWR9-NEXT: isel 3, 0, 3, 20 |
| ; AIX32-PWR9-NEXT: crandc 20, 4, 2 |
| ; AIX32-PWR9-NEXT: cror 20, 21, 20 |
| ; AIX32-PWR9-NEXT: isel 3, 4, 3, 20 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: scmp_32_64: |
| ; AIX64-PWR9: # %bb.0: |
| ; AIX64-PWR9-NEXT: cmpd 3, 4 |
| ; AIX64-PWR9-NEXT: setb 3, 0 |
| ; AIX64-PWR9-NEXT: blr |
| %1 = call i32 @llvm.scmp(i64 %x, i64 %y) |
| ret i32 %1 |
| } |
| |
| define i64 @scmp_64_64(i64 %x, i64 %y) nounwind { |
| ; CHECK-LABEL: scmp_64_64: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: cmpd 7, 3, 4 |
| ; CHECK-NEXT: mfocrf 3, 1 |
| ; CHECK-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; CHECK-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; CHECK-NEXT: sub 3, 4, 3 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: scmp_64_64: |
| ; AIX32: # %bb.0: |
| ; AIX32-NEXT: cmplw 3, 5 |
| ; AIX32-NEXT: cmpw 1, 3, 5 |
| ; AIX32-NEXT: li 3, 1 |
| ; AIX32-NEXT: li 5, 0 |
| ; AIX32-NEXT: cmplw 6, 4, 6 |
| ; AIX32-NEXT: li 6, -1 |
| ; AIX32-NEXT: crandc 20, 5, 2 |
| ; AIX32-NEXT: crand 21, 2, 25 |
| ; AIX32-NEXT: crnor 20, 21, 20 |
| ; AIX32-NEXT: crand 21, 2, 24 |
| ; AIX32-NEXT: isel 3, 0, 3, 20 |
| ; AIX32-NEXT: crandc 20, 4, 2 |
| ; AIX32-NEXT: cror 20, 21, 20 |
| ; AIX32-NEXT: isel 4, 6, 3, 20 |
| ; AIX32-NEXT: isel 3, 6, 5, 20 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: scmp_64_64: |
| ; AIX64: # %bb.0: |
| ; AIX64-NEXT: cmpd 7, 3, 4 |
| ; AIX64-NEXT: mfocrf 3, 1 |
| ; AIX64-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX64-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX64-NEXT: sub 3, 4, 3 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: scmp_64_64: |
| ; CHECK-PWR9: # %bb.0: |
| ; CHECK-PWR9-NEXT: cmpd 3, 4 |
| ; CHECK-PWR9-NEXT: setb 3, 0 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: scmp_64_64: |
| ; AIX32-PWR9: # %bb.0: |
| ; AIX32-PWR9-NEXT: cmplw 3, 5 |
| ; AIX32-PWR9-NEXT: cmpw 1, 3, 5 |
| ; AIX32-PWR9-NEXT: cmplw 6, 4, 6 |
| ; AIX32-PWR9-NEXT: li 3, 1 |
| ; AIX32-PWR9-NEXT: li 5, 0 |
| ; AIX32-PWR9-NEXT: li 6, -1 |
| ; AIX32-PWR9-NEXT: crandc 20, 5, 2 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 25 |
| ; AIX32-PWR9-NEXT: crnor 20, 21, 20 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 24 |
| ; AIX32-PWR9-NEXT: isel 3, 0, 3, 20 |
| ; AIX32-PWR9-NEXT: crandc 20, 4, 2 |
| ; AIX32-PWR9-NEXT: cror 20, 21, 20 |
| ; AIX32-PWR9-NEXT: isel 4, 6, 3, 20 |
| ; AIX32-PWR9-NEXT: isel 3, 6, 5, 20 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: scmp_64_64: |
| ; AIX64-PWR9: # %bb.0: |
| ; AIX64-PWR9-NEXT: cmpd 3, 4 |
| ; AIX64-PWR9-NEXT: setb 3, 0 |
| ; AIX64-PWR9-NEXT: blr |
| %1 = call i64 @llvm.scmp(i64 %x, i64 %y) |
| ret i64 %1 |
| } |
| |
| define noundef signext range(i32 -1, 2) i32 @test_scmp(i64 noundef %a, i64 noundef %b) { |
| ; CHECK-LABEL: test_scmp: |
| ; CHECK: # %bb.0: # %entry |
| ; CHECK-NEXT: cmpd 7, 3, 4 |
| ; CHECK-NEXT: mfocrf 3, 1 |
| ; CHECK-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; CHECK-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; CHECK-NEXT: sub 3, 4, 3 |
| ; CHECK-NEXT: blr |
| ; |
| ; AIX32-LABEL: test_scmp: |
| ; AIX32: # %bb.0: # %entry |
| ; AIX32-NEXT: cmplw 3, 5 |
| ; AIX32-NEXT: cmpw 1, 3, 5 |
| ; AIX32-NEXT: li 3, 1 |
| ; AIX32-NEXT: cmplw 5, 4, 6 |
| ; AIX32-NEXT: li 4, -1 |
| ; AIX32-NEXT: crandc 22, 5, 2 |
| ; AIX32-NEXT: crand 21, 2, 21 |
| ; AIX32-NEXT: crand 20, 2, 20 |
| ; AIX32-NEXT: crnor 21, 21, 22 |
| ; AIX32-NEXT: isel 3, 0, 3, 21 |
| ; AIX32-NEXT: crandc 21, 4, 2 |
| ; AIX32-NEXT: cror 20, 20, 21 |
| ; AIX32-NEXT: isel 3, 4, 3, 20 |
| ; AIX32-NEXT: blr |
| ; |
| ; AIX64-LABEL: test_scmp: |
| ; AIX64: # %bb.0: # %entry |
| ; AIX64-NEXT: cmpd 7, 3, 4 |
| ; AIX64-NEXT: mfocrf 3, 1 |
| ; AIX64-NEXT: rlwinm 4, 3, 30, 31, 31 |
| ; AIX64-NEXT: rlwinm 3, 3, 29, 31, 31 |
| ; AIX64-NEXT: sub 3, 4, 3 |
| ; AIX64-NEXT: blr |
| ; |
| ; CHECK-PWR9-LABEL: test_scmp: |
| ; CHECK-PWR9: # %bb.0: # %entry |
| ; CHECK-PWR9-NEXT: cmpd 3, 4 |
| ; CHECK-PWR9-NEXT: setb 3, 0 |
| ; CHECK-PWR9-NEXT: blr |
| ; |
| ; AIX32-PWR9-LABEL: test_scmp: |
| ; AIX32-PWR9: # %bb.0: # %entry |
| ; AIX32-PWR9-NEXT: cmplw 3, 5 |
| ; AIX32-PWR9-NEXT: cmpw 1, 3, 5 |
| ; AIX32-PWR9-NEXT: cmplw 6, 4, 6 |
| ; AIX32-PWR9-NEXT: li 3, 1 |
| ; AIX32-PWR9-NEXT: li 4, -1 |
| ; AIX32-PWR9-NEXT: crandc 20, 5, 2 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 25 |
| ; AIX32-PWR9-NEXT: crnor 20, 21, 20 |
| ; AIX32-PWR9-NEXT: crand 21, 2, 24 |
| ; AIX32-PWR9-NEXT: isel 3, 0, 3, 20 |
| ; AIX32-PWR9-NEXT: crandc 20, 4, 2 |
| ; AIX32-PWR9-NEXT: cror 20, 21, 20 |
| ; AIX32-PWR9-NEXT: isel 3, 4, 3, 20 |
| ; AIX32-PWR9-NEXT: blr |
| ; |
| ; AIX64-PWR9-LABEL: test_scmp: |
| ; AIX64-PWR9: # %bb.0: # %entry |
| ; AIX64-PWR9-NEXT: cmpd 3, 4 |
| ; AIX64-PWR9-NEXT: setb 3, 0 |
| ; AIX64-PWR9-NEXT: blr |
| entry: |
| %cond2 = tail call i32 @llvm.scmp.i32.i64(i64 %a, i64 %b) |
| ret i32 %cond2 |
| } |