1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
2 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
3 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
5 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
6 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
8 @glob = common local_unnamed_addr global i8 0, align 1
10 ; Function Attrs: norecurse nounwind readnone
11 define signext i32 @test_igeuc(i8 zeroext %a, i8 zeroext %b) {
13 %cmp = icmp uge i8 %a, %b
14 %conv2 = zext i1 %cmp to i32
16 ; CHECK-LABEL: test_igeuc:
17 ; CHECK: sub [[REG1:r[0-9]+]], r3, r4
18 ; CHECK-NEXT: not [[REG2:r[0-9]+]], [[REG1]]
19 ; CHECK-NEXT: rldicl r3, [[REG2]], 1, 63
23 ; Function Attrs: norecurse nounwind readnone
24 define signext i32 @test_igeuc_sext(i8 zeroext %a, i8 zeroext %b) {
26 %cmp = icmp uge i8 %a, %b
27 %sub = sext i1 %cmp to i32
29 ; CHECK-LABEL: @test_igeuc_sext
30 ; CHECK: sub [[REG1:r[0-9]+]], r3, r4
31 ; CHECK-NEXT: rldicl [[REG2:r[0-9]+]], [[REG1]], 1, 63
32 ; CHECK-NEXT: addi [[REG3:r[0-9]+]], [[REG2]], -1
37 ; Function Attrs: norecurse nounwind readnone
38 define signext i32 @test_igeuc_z(i8 zeroext %a) {
40 %cmp = icmp uge i8 %a, 0
41 %conv2 = zext i1 %cmp to i32
43 ; CHECK-LABEL: @test_igeuc_z
48 ; Function Attrs: norecurse nounwind readnone
49 define signext i32 @test_igeuc_sext_z(i8 zeroext %a) {
51 %cmp = icmp uge i8 %a, 0
52 %conv2 = sext i1 %cmp to i32
54 ; CHECK-LABEL: @test_igeuc_sext_z
59 ; Function Attrs: norecurse nounwind
60 define void @test_igeuc_store(i8 zeroext %a, i8 zeroext %b) {
62 %cmp = icmp uge i8 %a, %b
63 %conv3 = zext i1 %cmp to i8
64 store i8 %conv3, i8* @glob
66 ; CHECK_LABEL: test_igeuc_store:
67 ; CHECK: sub [[REG1:r[0-9]+]], r3, r4
68 ; CHECK: not [[REG2:r[0-9]+]], [[REG1]]
69 ; CHECK: rldicl r3, [[REG2]], 1, 63
73 ; Function Attrs: norecurse nounwind
74 define void @test_igeuc_sext_store(i8 zeroext %a, i8 zeroext %b) {
76 %cmp = icmp uge i8 %a, %b
77 %conv3 = sext i1 %cmp to i8
78 store i8 %conv3, i8* @glob
80 ; CHECK-TBD-LABEL: @test_igeuc_sext_store
81 ; CHECK-TBD: subf [[REG1:r[0-9]+]], r3, r4
82 ; CHECK-TBD: rldicl [[REG2:r[0-9]+]], [[REG1]], 1, 63
83 ; CHECK-TBD: addi [[REG3:r[0-9]+]], [[REG2]], -1
84 ; CHECK-TBD: stb [[REG3]]
88 ; Function Attrs : norecurse nounwind
89 define void @test_igeuc_z_store(i8 zeroext %a) {
91 %cmp = icmp uge i8 %a, 0
92 %conv3 = zext i1 %cmp to i8
93 store i8 %conv3, i8* @glob
95 ; CHECK-LABEL: @test_igeuc_z_store
96 ; CHECK: li [[REG1:r[0-9]+]], 1
101 ; Function Attrs: norecurse nounwind
102 define void @test_igeuc_sext_z_store(i8 zeroext %a) {
104 %cmp = icmp uge i8 %a, 0
105 %conv3 = sext i1 %cmp to i8
106 store i8 %conv3, i8* @glob
108 ; CHECK-LABEL: @test_igeuc_sext_z_store
109 ; CHECK: li [[REG1:r[0-9]+]], -1
110 ; CHECK: stb [[REG1]]