1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux -mcpu=pwr8 -O0 < %s | \
3 ; RUN: FileCheck %s -check-prefix=P8
4 ; RUN: llc -mtriple=powerpc64le-unknown-linux -mcpu=pwr9 -O0 < %s | \
5 ; RUN: FileCheck %s -check-prefix=P9
7 define i32 @test_choice1(fp128 %a, fp128 %b) #0 {
8 ; P8-LABEL: test_choice1:
9 ; P8: # %bb.0: # %entry
11 ; P8-NEXT: stdu 1, -112(1)
12 ; P8-NEXT: std 0, 128(1)
15 ; P8-NEXT: # kill: def $r3 killed $r3 killed $x3
16 ; P8-NEXT: cmplwi 3, 0
17 ; P8-NEXT: bne 0, .LBB0_2
19 ; P8-NEXT: .LBB0_1: # %if.true
22 ; P8-NEXT: stw 3, 108(1) # 4-byte Folded Spill
24 ; P8-NEXT: .LBB0_2: # %if.false
27 ; P8-NEXT: stw 3, 108(1) # 4-byte Folded Spill
28 ; P8-NEXT: .LBB0_3: # %final
29 ; P8-NEXT: lwz 3, 108(1) # 4-byte Folded Reload
30 ; P8-NEXT: clrldi 3, 3, 32
31 ; P8-NEXT: addi 1, 1, 112
32 ; P8-NEXT: ld 0, 16(1)
36 ; P9-LABEL: test_choice1:
37 ; P9: # %bb.0: # %entry
39 ; P9-NEXT: stdu 1, -112(1)
40 ; P9-NEXT: std 0, 128(1)
41 ; P9-NEXT: xscmpuqp 0, 2, 3
42 ; P9-NEXT: bne 0, .LBB0_2
44 ; P9-NEXT: .LBB0_1: # %if.true
47 ; P9-NEXT: stw 3, 108(1) # 4-byte Folded Spill
49 ; P9-NEXT: .LBB0_2: # %if.false
52 ; P9-NEXT: stw 3, 108(1) # 4-byte Folded Spill
53 ; P9-NEXT: .LBB0_3: # %final
54 ; P9-NEXT: lwz 3, 108(1) # 4-byte Folded Reload
55 ; P9-NEXT: clrldi 3, 3, 32
56 ; P9-NEXT: addi 1, 1, 112
57 ; P9-NEXT: ld 0, 16(1)
61 %cmp = fcmp oeq fp128 %a, %b
62 br i1 %cmp, label %if.true, label %if.false
65 %res1 = call i32 @foo()
69 %res2 = call i32 @bar()
73 %result = phi i32 [%res1, %if.true], [%res2, %if.false]
77 define i32 @test_choice2(fp128 %a, fp128 %b) #0 {
78 ; P8-LABEL: test_choice2:
79 ; P8: # %bb.0: # %entry
81 ; P8-NEXT: stdu 1, -112(1)
82 ; P8-NEXT: std 0, 128(1)
85 ; P8-NEXT: # kill: def $r3 killed $r3 killed $x3
87 ; P8-NEXT: blt 0, .LBB1_2
89 ; P8-NEXT: .LBB1_1: # %if.true
92 ; P8-NEXT: stw 3, 108(1) # 4-byte Folded Spill
94 ; P8-NEXT: .LBB1_2: # %if.false
97 ; P8-NEXT: stw 3, 108(1) # 4-byte Folded Spill
98 ; P8-NEXT: .LBB1_3: # %final
99 ; P8-NEXT: lwz 3, 108(1) # 4-byte Folded Reload
100 ; P8-NEXT: clrldi 3, 3, 32
101 ; P8-NEXT: addi 1, 1, 112
102 ; P8-NEXT: ld 0, 16(1)
106 ; P9-LABEL: test_choice2:
107 ; P9: # %bb.0: # %entry
109 ; P9-NEXT: stdu 1, -112(1)
110 ; P9-NEXT: std 0, 128(1)
111 ; P9-NEXT: xscmpuqp 0, 2, 3
112 ; P9-NEXT: crmove 20, 3
113 ; P9-NEXT: crnot 21, 20
114 ; P9-NEXT: crmove 20, 1
115 ; P9-NEXT: crnot 20, 20
116 ; P9-NEXT: crand 20, 20, 21
117 ; P9-NEXT: crxor 21, 21, 21
118 ; P9-NEXT: crxor 20, 20, 21
119 ; P9-NEXT: bc 12, 20, .LBB1_2
121 ; P9-NEXT: .LBB1_1: # %if.true
124 ; P9-NEXT: stw 3, 108(1) # 4-byte Folded Spill
126 ; P9-NEXT: .LBB1_2: # %if.false
129 ; P9-NEXT: stw 3, 108(1) # 4-byte Folded Spill
130 ; P9-NEXT: .LBB1_3: # %final
131 ; P9-NEXT: lwz 3, 108(1) # 4-byte Folded Reload
132 ; P9-NEXT: clrldi 3, 3, 32
133 ; P9-NEXT: addi 1, 1, 112
134 ; P9-NEXT: ld 0, 16(1)
138 %cmp = fcmp ugt fp128 %a, %b
139 br i1 %cmp, label %if.true, label %if.false
142 %res1 = call i32 @foo()
146 %res2 = call i32 @bar()
150 %result = phi i32 [%res1, %if.true], [%res2, %if.false]
154 define i32 @test_choice3(fp128 %a, fp128 %b) #0 {
155 ; P8-LABEL: test_choice3:
156 ; P8: # %bb.0: # %entry
158 ; P8-NEXT: stdu 1, -112(1)
159 ; P8-NEXT: std 0, 128(1)
160 ; P8-NEXT: bl __ltkf2
162 ; P8-NEXT: # kill: def $r3 killed $r3 killed $x3
163 ; P8-NEXT: cmpwi 3, -1
164 ; P8-NEXT: bgt 0, .LBB2_2
166 ; P8-NEXT: .LBB2_1: # %if.true
169 ; P8-NEXT: stw 3, 108(1) # 4-byte Folded Spill
171 ; P8-NEXT: .LBB2_2: # %if.false
174 ; P8-NEXT: stw 3, 108(1) # 4-byte Folded Spill
175 ; P8-NEXT: .LBB2_3: # %final
176 ; P8-NEXT: lwz 3, 108(1) # 4-byte Folded Reload
177 ; P8-NEXT: clrldi 3, 3, 32
178 ; P8-NEXT: addi 1, 1, 112
179 ; P8-NEXT: ld 0, 16(1)
183 ; P9-LABEL: test_choice3:
184 ; P9: # %bb.0: # %entry
186 ; P9-NEXT: stdu 1, -112(1)
187 ; P9-NEXT: std 0, 128(1)
188 ; P9-NEXT: xscmpuqp 0, 2, 3
189 ; P9-NEXT: bge 0, .LBB2_2
191 ; P9-NEXT: .LBB2_1: # %if.true
194 ; P9-NEXT: stw 3, 108(1) # 4-byte Folded Spill
196 ; P9-NEXT: .LBB2_2: # %if.false
199 ; P9-NEXT: stw 3, 108(1) # 4-byte Folded Spill
200 ; P9-NEXT: .LBB2_3: # %final
201 ; P9-NEXT: lwz 3, 108(1) # 4-byte Folded Reload
202 ; P9-NEXT: clrldi 3, 3, 32
203 ; P9-NEXT: addi 1, 1, 112
204 ; P9-NEXT: ld 0, 16(1)
208 %cmp = fcmp olt fp128 %a, %b
209 br i1 %cmp, label %if.true, label %if.false
212 %res1 = call i32 @foo()
216 %res2 = call i32 @bar()
220 %result = phi i32 [%res1, %if.true], [%res2, %if.false]
224 define i32 @test_choice4(fp128 %a, fp128 %b) #0 {
225 ; P8-LABEL: test_choice4:
226 ; P8: # %bb.0: # %entry
228 ; P8-NEXT: stdu 1, -112(1)
229 ; P8-NEXT: std 0, 128(1)
230 ; P8-NEXT: bl __eqkf2
232 ; P8-NEXT: # kill: def $r3 killed $r3 killed $x3
233 ; P8-NEXT: cmplwi 3, 0
234 ; P8-NEXT: beq 0, .LBB3_2
236 ; P8-NEXT: .LBB3_1: # %if.true
239 ; P8-NEXT: stw 3, 108(1) # 4-byte Folded Spill
241 ; P8-NEXT: .LBB3_2: # %if.false
244 ; P8-NEXT: stw 3, 108(1) # 4-byte Folded Spill
245 ; P8-NEXT: .LBB3_3: # %final
246 ; P8-NEXT: lwz 3, 108(1) # 4-byte Folded Reload
247 ; P8-NEXT: clrldi 3, 3, 32
248 ; P8-NEXT: addi 1, 1, 112
249 ; P8-NEXT: ld 0, 16(1)
253 ; P9-LABEL: test_choice4:
254 ; P9: # %bb.0: # %entry
256 ; P9-NEXT: stdu 1, -112(1)
257 ; P9-NEXT: std 0, 128(1)
258 ; P9-NEXT: xscmpuqp 0, 2, 3
259 ; P9-NEXT: beq 0, .LBB3_2
261 ; P9-NEXT: .LBB3_1: # %if.true
264 ; P9-NEXT: stw 3, 108(1) # 4-byte Folded Spill
266 ; P9-NEXT: .LBB3_2: # %if.false
269 ; P9-NEXT: stw 3, 108(1) # 4-byte Folded Spill
270 ; P9-NEXT: .LBB3_3: # %final
271 ; P9-NEXT: lwz 3, 108(1) # 4-byte Folded Reload
272 ; P9-NEXT: clrldi 3, 3, 32
273 ; P9-NEXT: addi 1, 1, 112
274 ; P9-NEXT: ld 0, 16(1)
278 %cmp = fcmp une fp128 %a, %b
279 br i1 %cmp, label %if.true, label %if.false
282 %res1 = call i32 @foo()
286 %res2 = call i32 @bar()
290 %result = phi i32 [%res1, %if.true], [%res2, %if.false]
294 attributes #0 = { nounwind }