1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
3 ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
4 ; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
5 ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \
6 ; RUN: -check-prefix=CHECK-P9
8 define void @julia__typed_vcat_20() #0 {
9 ; CHECK-LABEL: julia__typed_vcat_20:
10 ; CHECK: # %bb.0: # %bb
12 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
13 ; CHECK-NEXT: std r0, 16(r1)
14 ; CHECK-NEXT: stdu r1, -48(r1)
15 ; CHECK-NEXT: li r3, 1
16 ; CHECK-NEXT: li r30, 0
17 ; CHECK-NEXT: .p2align 4
18 ; CHECK-NEXT: .LBB0_1: # %bb3
20 ; CHECK-NEXT: addi r3, r3, -1
21 ; CHECK-NEXT: mtfprd f0, r3
22 ; CHECK-NEXT: xscvsxdsp f1, f0
23 ; CHECK-NEXT: bl __gnu_f2h_ieee
25 ; CHECK-NEXT: clrldi r3, r3, 48
26 ; CHECK-NEXT: bl __gnu_h2f_ieee
28 ; CHECK-NEXT: addi r30, r30, -1
29 ; CHECK-NEXT: li r3, 0
30 ; CHECK-NEXT: cmpldi r30, 0
31 ; CHECK-NEXT: bne+ cr0, .LBB0_1
32 ; CHECK-NEXT: # %bb.2: # %bb11
33 ; CHECK-NEXT: bl __gnu_f2h_ieee
35 ; CHECK-NEXT: sth r3, 0(r3)
37 ; CHECK-P9-LABEL: julia__typed_vcat_20:
38 ; CHECK-P9: # %bb.0: # %bb
39 ; CHECK-P9-NEXT: li r3, 0
40 ; CHECK-P9-NEXT: mtctr r3
41 ; CHECK-P9-NEXT: li r3, 1
42 ; CHECK-P9-NEXT: .p2align 4
43 ; CHECK-P9-NEXT: .LBB0_1: # %bb3
45 ; CHECK-P9-NEXT: addi r3, r3, -1
46 ; CHECK-P9-NEXT: mtfprd f0, r3
47 ; CHECK-P9-NEXT: xscvsxdsp f0, f0
48 ; CHECK-P9-NEXT: xscvdphp f0, f0
49 ; CHECK-P9-NEXT: mffprwz r3, f0
50 ; CHECK-P9-NEXT: clrlwi r3, r3, 16
51 ; CHECK-P9-NEXT: mtfprwz f0, r3
52 ; CHECK-P9-NEXT: li r3, 0
53 ; CHECK-P9-NEXT: xscvhpdp f0, f0
54 ; CHECK-P9-NEXT: bdnz .LBB0_1
55 ; CHECK-P9-NEXT: # %bb.2: # %bb11
56 ; CHECK-P9-NEXT: xscvdphp f0, f0
57 ; CHECK-P9-NEXT: stxsihx f0, 0, r3
59 %i = load i64, i64 addrspace(11)* null, align 8
60 %i1 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 %i, i64 0)
61 %i2 = extractvalue { i64, i1 } %i1, 0
64 bb3: ; preds = %bb3, %bb
65 %i4 = phi i64 [ %i10, %bb3 ], [ 1, %bb ]
66 %i5 = phi i64 [ 0, %bb3 ], [ 1, %bb ]
67 %i6 = add nsw i64 %i5, -1
69 %i8 = sitofp i64 %i7 to half
70 store half %i8, half addrspace(13)* undef, align 2
71 %i9 = icmp eq i64 %i4, 0
73 br i1 %i9, label %bb11, label %bb3
79 declare { i64, i1 } @llvm.ssub.with.overflow.i64(i64, i64) #0
81 define void @julia__hypot_17() #0 {
82 ; CHECK-LABEL: julia__hypot_17:
83 ; CHECK: # %bb.0: # %bb
85 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
86 ; CHECK-NEXT: std r0, 16(r1)
87 ; CHECK-NEXT: stdu r1, -48(r1)
88 ; CHECK-NEXT: li r30, 3
89 ; CHECK-NEXT: .p2align 5
90 ; CHECK-NEXT: .LBB1_1: # %bb1
92 ; CHECK-NEXT: addi r30, r30, -1
93 ; CHECK-NEXT: cmpldi r30, 0
94 ; CHECK-NEXT: beq cr0, .LBB1_3
95 ; CHECK-NEXT: # %bb.2: # %bb3
97 ; CHECK-NEXT: lhz r3, 0(0)
98 ; CHECK-NEXT: bl __gnu_h2f_ieee
100 ; CHECK-NEXT: fcmpu cr0, f1, f1
101 ; CHECK-NEXT: bun cr0, .LBB1_1
102 ; CHECK-NEXT: .LBB1_3: # %bb9
103 ; CHECK-NEXT: addi r1, r1, 48
104 ; CHECK-NEXT: ld r0, 16(r1)
105 ; CHECK-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
106 ; CHECK-NEXT: mtlr r0
109 ; CHECK-P9-LABEL: julia__hypot_17:
110 ; CHECK-P9: # %bb.0: # %bb
111 ; CHECK-P9-NEXT: li r3, 3
112 ; CHECK-P9-NEXT: mtctr r3
113 ; CHECK-P9-NEXT: li r3, 0
114 ; CHECK-P9-NEXT: .p2align 5
115 ; CHECK-P9-NEXT: .LBB1_1: # %bb1
117 ; CHECK-P9-NEXT: bdzlr
118 ; CHECK-P9-NEXT: # %bb.2: # %bb3
120 ; CHECK-P9-NEXT: lxsihzx f0, 0, r3
121 ; CHECK-P9-NEXT: xscvhpdp f0, f0
122 ; CHECK-P9-NEXT: fcmpu cr0, f0, f0
123 ; CHECK-P9-NEXT: bun cr0, .LBB1_1
124 ; CHECK-P9-NEXT: # %bb.3: # %bb9
129 bb1: ; preds = %bb3, %bb
130 %i = phi i64 [ %i4, %bb3 ], [ 2, %bb ]
131 %i2 = icmp eq i64 %i, 4
132 br i1 %i2, label %bb9, label %bb3
135 %i4 = add nuw nsw i64 %i, 1
136 %i5 = load half, half* null, align 2
137 %i6 = fpext half %i5 to float
138 %i7 = fcmp uno float %i6, 0.000000e+00
139 %i8 = or i1 %i7, false
140 br i1 %i8, label %bb1, label %bb9
142 bb9: ; preds = %bb3, %bb1
146 define void @func_48786() #0 {
147 ; CHECK-LABEL: func_48786:
148 ; CHECK: # %bb.0: # %bb
149 ; CHECK-NEXT: mfocrf r12, 32
150 ; CHECK-NEXT: mflr r0
151 ; CHECK-NEXT: std r0, 16(r1)
152 ; CHECK-NEXT: stw r12, 8(r1)
153 ; CHECK-NEXT: stdu r1, -48(r1)
154 ; CHECK-NEXT: ld r3, 0(r3)
155 ; CHECK-NEXT: std r30, 32(r1) # 8-byte Folded Spill
156 ; CHECK-NEXT: # implicit-def: $x30
157 ; CHECK-NEXT: cmpdi r3, 0
158 ; CHECK-NEXT: crnot 4*cr2+lt, eq
159 ; CHECK-NEXT: bc 12, 4*cr5+lt, .LBB2_3
160 ; CHECK-NEXT: .p2align 4
161 ; CHECK-NEXT: .LBB2_1: # %bb4
162 ; CHECK-NEXT: lhz r3, 0(r3)
163 ; CHECK-NEXT: bl __gnu_h2f_ieee
165 ; CHECK-NEXT: bc 4, 4*cr2+lt, .LBB2_6
166 ; CHECK-NEXT: # %bb.2: # %bb8
167 ; CHECK-NEXT: bl __gnu_f2h_ieee
169 ; CHECK-NEXT: sth r3, 0(0)
170 ; CHECK-NEXT: .LBB2_3: # %bb10
172 ; CHECK-NEXT: cmpldi r30, 0
173 ; CHECK-NEXT: beq cr0, .LBB2_5
174 ; CHECK-NEXT: # %bb.4: # %bb12
176 ; CHECK-NEXT: addi r30, r30, 1
177 ; CHECK-NEXT: bc 4, 4*cr5+lt, .LBB2_1
178 ; CHECK-NEXT: b .LBB2_3
179 ; CHECK-NEXT: .LBB2_5: # %bb14
180 ; CHECK-NEXT: ld r30, 32(r1) # 8-byte Folded Reload
181 ; CHECK-NEXT: addi r1, r1, 48
182 ; CHECK-NEXT: ld r0, 16(r1)
183 ; CHECK-NEXT: lwz r12, 8(r1)
184 ; CHECK-NEXT: mtocrf 32, r12
185 ; CHECK-NEXT: mtlr r0
187 ; CHECK-NEXT: .LBB2_6: # %bb15
189 ; CHECK-P9-LABEL: func_48786:
190 ; CHECK-P9: # %bb.0: # %bb
191 ; CHECK-P9-NEXT: ld r3, 0(r3)
192 ; CHECK-P9-NEXT: cmpdi r3, 0
193 ; CHECK-P9-NEXT: mtctr r3
194 ; CHECK-P9-NEXT: li r3, 0
195 ; CHECK-P9-NEXT: crnot 4*cr5+lt, eq
196 ; CHECK-P9-NEXT: b .LBB2_2
197 ; CHECK-P9-NEXT: .p2align 5
198 ; CHECK-P9-NEXT: .LBB2_1: # %bb10
200 ; CHECK-P9-NEXT: bdzlr
201 ; CHECK-P9-NEXT: .LBB2_2: # %bb2
203 ; CHECK-P9-NEXT: bc 12, 4*cr5+lt, .LBB2_1
204 ; CHECK-P9-NEXT: # %bb.3: # %bb4
206 ; CHECK-P9-NEXT: lxsihzx f0, 0, r3
207 ; CHECK-P9-NEXT: xscvhpdp f0, f0
208 ; CHECK-P9-NEXT: bc 4, 4*cr5+lt, .LBB2_5
209 ; CHECK-P9-NEXT: # %bb.4: # %bb8
211 ; CHECK-P9-NEXT: xscvdphp f0, f0
212 ; CHECK-P9-NEXT: stxsihx f0, 0, r3
213 ; CHECK-P9-NEXT: b .LBB2_1
214 ; CHECK-P9-NEXT: .LBB2_5: # %bb15
216 %i = load i64, i64 addrspace(11)* undef, align 8
217 %i1 = load i64, i64 addrspace(11)* undef, align 8
220 bb2: ; preds = %bb12, %bb
221 %i3 = phi i64 [ undef, %bb ], [ %i13, %bb12 ]
222 br i1 undef, label %bb10, label %bb4
225 switch i32 undef, label %bb9 [
226 i32 1426063360, label %bb5
227 i32 1275068416, label %bb5
230 bb5: ; preds = %bb4, %bb4
231 %i6 = load half, half addrspace(13)* undef, align 2
232 %i7 = icmp ult i64 0, %i1
233 br i1 %i7, label %bb8, label %bb15
236 store half %i6, half addrspace(13)* null, align 2
242 bb10: ; preds = %bb8, %bb2
243 %i11 = icmp eq i64 %i3, 0
244 br i1 %i11, label %bb14, label %bb12
246 bb12: ; preds = %bb10
247 %i13 = add i64 %i3, 1
250 bb14: ; preds = %bb10
257 define void @func_48785(half %arg) #0 {
258 ; CHECK-LABEL: func_48785:
259 ; CHECK: # %bb.0: # %bb
260 ; CHECK-NEXT: mflr r0
261 ; CHECK-NEXT: std r29, -32(r1) # 8-byte Folded Spill
262 ; CHECK-NEXT: std r30, -24(r1) # 8-byte Folded Spill
263 ; CHECK-NEXT: stfd f31, -8(r1) # 8-byte Folded Spill
264 ; CHECK-NEXT: std r0, 16(r1)
265 ; CHECK-NEXT: stdu r1, -64(r1)
266 ; CHECK-NEXT: fmr f31, f1
267 ; CHECK-NEXT: li r30, 0
268 ; CHECK-NEXT: li r29, 0
269 ; CHECK-NEXT: .p2align 5
270 ; CHECK-NEXT: .LBB3_1: # %bb1
272 ; CHECK-NEXT: fmr f1, f31
273 ; CHECK-NEXT: bl __gnu_f2h_ieee
275 ; CHECK-NEXT: addi r29, r29, -12
276 ; CHECK-NEXT: sth r3, 0(r30)
277 ; CHECK-NEXT: addi r30, r30, 24
278 ; CHECK-NEXT: cmpldi r29, 0
279 ; CHECK-NEXT: bne+ cr0, .LBB3_1
280 ; CHECK-NEXT: # %bb.2: # %bb5
282 ; CHECK-P9-LABEL: func_48785:
283 ; CHECK-P9: # %bb.0: # %bb
284 ; CHECK-P9-NEXT: li r3, 1
285 ; CHECK-P9-NEXT: rldic r3, r3, 62, 1
286 ; CHECK-P9-NEXT: mtctr r3
287 ; CHECK-P9-NEXT: li r3, 0
288 ; CHECK-P9-NEXT: .p2align 4
289 ; CHECK-P9-NEXT: .LBB3_1: # %bb1
291 ; CHECK-P9-NEXT: xscvdphp f0, f1
292 ; CHECK-P9-NEXT: stxsihx f0, 0, r3
293 ; CHECK-P9-NEXT: addi r3, r3, 24
294 ; CHECK-P9-NEXT: bdnz .LBB3_1
295 ; CHECK-P9-NEXT: # %bb.2: # %bb5
299 bb1: ; preds = %bb1, %bb
300 %i = phi i64 [ 0, %bb ], [ %i3, %bb1 ]
301 %i2 = getelementptr inbounds half, half addrspace(13)* null, i64 %i
302 store half %arg, half addrspace(13)* %i2, align 2
304 %i4 = icmp eq i64 %i3, 0
305 br i1 %i4, label %bb5, label %bb1
310 attributes #0 = { nounwind }