1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
3 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
4 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl \
5 ; RUN: --check-prefixes=CHECK,BE
6 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
7 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
8 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl \
9 ; RUN: --check-prefixes=CHECK,LE
11 @glob = common local_unnamed_addr global i8 0, align 1
13 ; Function Attrs: norecurse nounwind readnone
14 define signext i32 @test_igeuc(i8 zeroext %a, i8 zeroext %b) {
15 ; CHECK-LABEL: test_igeuc:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: sub r3, r3, r4
18 ; CHECK-NEXT: not r3, r3
19 ; CHECK-NEXT: rldicl r3, r3, 1, 63
22 %cmp = icmp uge i8 %a, %b
23 %conv2 = zext i1 %cmp to i32
27 ; Function Attrs: norecurse nounwind readnone
28 define signext i32 @test_igeuc_sext(i8 zeroext %a, i8 zeroext %b) {
29 ; CHECK-LABEL: test_igeuc_sext:
30 ; CHECK: # %bb.0: # %entry
31 ; CHECK-NEXT: sub r3, r3, r4
32 ; CHECK-NEXT: rldicl r3, r3, 1, 63
33 ; CHECK-NEXT: addi r3, r3, -1
36 %cmp = icmp uge i8 %a, %b
37 %sub = sext i1 %cmp to i32
42 ; Function Attrs: norecurse nounwind readnone
43 define signext i32 @test_igeuc_z(i8 zeroext %a) {
44 ; CHECK-LABEL: test_igeuc_z:
45 ; CHECK: # %bb.0: # %entry
46 ; CHECK-NEXT: li r3, 1
49 %cmp = icmp uge i8 %a, 0
50 %conv2 = zext i1 %cmp to i32
54 ; Function Attrs: norecurse nounwind readnone
55 define signext i32 @test_igeuc_sext_z(i8 zeroext %a) {
56 ; CHECK-LABEL: test_igeuc_sext_z:
57 ; CHECK: # %bb.0: # %entry
58 ; CHECK-NEXT: li r3, -1
61 %cmp = icmp uge i8 %a, 0
62 %conv2 = sext i1 %cmp to i32
66 ; Function Attrs: norecurse nounwind
67 define void @test_igeuc_store(i8 zeroext %a, i8 zeroext %b) {
68 ; BE-LABEL: test_igeuc_store:
69 ; BE: # %bb.0: # %entry
70 ; BE-NEXT: addis r5, r2, .LC0@toc@ha
71 ; BE-NEXT: sub r3, r3, r4
72 ; BE-NEXT: ld r4, .LC0@toc@l(r5)
74 ; BE-NEXT: rldicl r3, r3, 1, 63
75 ; BE-NEXT: stb r3, 0(r4)
78 ; LE-LABEL: test_igeuc_store:
79 ; LE: # %bb.0: # %entry
80 ; LE-NEXT: sub r3, r3, r4
81 ; LE-NEXT: addis r5, r2, glob@toc@ha
83 ; LE-NEXT: rldicl r3, r3, 1, 63
84 ; LE-NEXT: stb r3, glob@toc@l(r5)
87 %cmp = icmp uge i8 %a, %b
88 %conv3 = zext i1 %cmp to i8
89 store i8 %conv3, i8* @glob
91 ; CHECK_LABEL: test_igeuc_store:
94 ; Function Attrs: norecurse nounwind
95 define void @test_igeuc_sext_store(i8 zeroext %a, i8 zeroext %b) {
96 ; BE-LABEL: test_igeuc_sext_store:
97 ; BE: # %bb.0: # %entry
98 ; BE-NEXT: addis r5, r2, .LC0@toc@ha
99 ; BE-NEXT: sub r3, r3, r4
100 ; BE-NEXT: ld r4, .LC0@toc@l(r5)
101 ; BE-NEXT: rldicl r3, r3, 1, 63
102 ; BE-NEXT: addi r3, r3, -1
103 ; BE-NEXT: stb r3, 0(r4)
106 ; LE-LABEL: test_igeuc_sext_store:
107 ; LE: # %bb.0: # %entry
108 ; LE-NEXT: sub r3, r3, r4
109 ; LE-NEXT: addis r5, r2, glob@toc@ha
110 ; LE-NEXT: rldicl r3, r3, 1, 63
111 ; LE-NEXT: addi r3, r3, -1
112 ; LE-NEXT: stb r3, glob@toc@l(r5)
115 %cmp = icmp uge i8 %a, %b
116 %conv3 = sext i1 %cmp to i8
117 store i8 %conv3, i8* @glob
119 ; CHECK-TBD-LABEL: @test_igeuc_sext_store
120 ; CHECK-TBD: subf [[REG1:r[0-9]+]], r3, r4
121 ; CHECK-TBD: rldicl [[REG2:r[0-9]+]], [[REG1]], 1, 63
122 ; CHECK-TBD: addi [[REG3:r[0-9]+]], [[REG2]], -1
123 ; CHECK-TBD: stb [[REG3]]
127 ; Function Attrs : norecurse nounwind
128 define void @test_igeuc_z_store(i8 zeroext %a) {
129 ; BE-LABEL: test_igeuc_z_store:
130 ; BE: # %bb.0: # %entry
131 ; BE-NEXT: addis r3, r2, .LC0@toc@ha
133 ; BE-NEXT: ld r3, .LC0@toc@l(r3)
134 ; BE-NEXT: stb r4, 0(r3)
137 ; LE-LABEL: test_igeuc_z_store:
138 ; LE: # %bb.0: # %entry
139 ; LE-NEXT: addis r3, r2, glob@toc@ha
141 ; LE-NEXT: stb r4, glob@toc@l(r3)
144 %cmp = icmp uge i8 %a, 0
145 %conv3 = zext i1 %cmp to i8
146 store i8 %conv3, i8* @glob
150 ; Function Attrs: norecurse nounwind
151 define void @test_igeuc_sext_z_store(i8 zeroext %a) {
152 ; BE-LABEL: test_igeuc_sext_z_store:
153 ; BE: # %bb.0: # %entry
154 ; BE-NEXT: addis r3, r2, .LC0@toc@ha
156 ; BE-NEXT: ld r3, .LC0@toc@l(r3)
157 ; BE-NEXT: stb r4, 0(r3)
160 ; LE-LABEL: test_igeuc_sext_z_store:
161 ; LE: # %bb.0: # %entry
162 ; LE-NEXT: addis r3, r2, glob@toc@ha
164 ; LE-NEXT: stb r4, glob@toc@l(r3)
167 %cmp = icmp uge i8 %a, 0
168 %conv3 = sext i1 %cmp to i8
169 store i8 %conv3, i8* @glob