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: stdu r1, -48(r1)
14 ; CHECK-NEXT: li r30, 0
15 ; CHECK-NEXT: li r3, 1
16 ; CHECK-NEXT: std r0, 64(r1)
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: bc 12, gt, .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, ptr 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, ptr 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: stdu r1, -48(r1)
87 ; CHECK-NEXT: li r30, 3
88 ; CHECK-NEXT: std r0, 64(r1)
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: bc 4, gt, .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, ptr 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: stw r12, 8(r1)
151 ; CHECK-NEXT: mflr r0
152 ; CHECK-NEXT: stdu r1, -48(r1)
153 ; CHECK-NEXT: std r0, 64(r1)
154 ; CHECK-NEXT: std r30, 32(r1) # 8-byte Folded Spill
155 ; CHECK-NEXT: # implicit-def: $x30
156 ; CHECK-NEXT: ld r3, 0(r3)
157 ; CHECK-NEXT: cmpdi r3, 0
158 ; CHECK-NEXT: crnot 4*cr2+lt, eq
159 ; CHECK-NEXT: b .LBB2_2
160 ; CHECK-NEXT: .p2align 4
161 ; CHECK-NEXT: .LBB2_1: # %bb10
163 ; CHECK-NEXT: addi r30, r30, -1
164 ; CHECK-NEXT: cmpldi r30, 0
165 ; CHECK-NEXT: bc 4, gt, .LBB2_5
166 ; CHECK-NEXT: .LBB2_2: # %bb2
168 ; CHECK-NEXT: bc 12, 4*cr5+lt, .LBB2_1
169 ; CHECK-NEXT: # %bb.3: # %bb4
171 ; CHECK-NEXT: lhz r3, 0(r3)
172 ; CHECK-NEXT: bl __gnu_h2f_ieee
174 ; CHECK-NEXT: bc 4, 4*cr2+lt, .LBB2_6
175 ; CHECK-NEXT: # %bb.4: # %bb8
177 ; CHECK-NEXT: bl __gnu_f2h_ieee
179 ; CHECK-NEXT: sth r3, 0(0)
180 ; CHECK-NEXT: b .LBB2_1
181 ; CHECK-NEXT: .LBB2_5: # %bb14
182 ; CHECK-NEXT: ld r30, 32(r1) # 8-byte Folded Reload
183 ; CHECK-NEXT: addi r1, r1, 48
184 ; CHECK-NEXT: ld r0, 16(r1)
185 ; CHECK-NEXT: lwz r12, 8(r1)
186 ; CHECK-NEXT: mtlr r0
187 ; CHECK-NEXT: mtocrf 32, r12
189 ; CHECK-NEXT: .LBB2_6: # %bb15
191 ; CHECK-P9-LABEL: func_48786:
192 ; CHECK-P9: # %bb.0: # %bb
193 ; CHECK-P9-NEXT: ld r3, 0(r3)
194 ; CHECK-P9-NEXT: cmpdi r3, 0
195 ; CHECK-P9-NEXT: mtctr r3
196 ; CHECK-P9-NEXT: li r3, 0
197 ; CHECK-P9-NEXT: crnot 4*cr5+lt, eq
198 ; CHECK-P9-NEXT: b .LBB2_2
199 ; CHECK-P9-NEXT: .p2align 5
200 ; CHECK-P9-NEXT: .LBB2_1: # %bb10
202 ; CHECK-P9-NEXT: bdzlr
203 ; CHECK-P9-NEXT: .LBB2_2: # %bb2
205 ; CHECK-P9-NEXT: bc 12, 4*cr5+lt, .LBB2_1
206 ; CHECK-P9-NEXT: # %bb.3: # %bb4
208 ; CHECK-P9-NEXT: lxsihzx f0, 0, r3
209 ; CHECK-P9-NEXT: xscvhpdp f0, f0
210 ; CHECK-P9-NEXT: bc 4, 4*cr5+lt, .LBB2_5
211 ; CHECK-P9-NEXT: # %bb.4: # %bb8
213 ; CHECK-P9-NEXT: xscvdphp f0, f0
214 ; CHECK-P9-NEXT: stxsihx f0, 0, r3
215 ; CHECK-P9-NEXT: b .LBB2_1
216 ; CHECK-P9-NEXT: .LBB2_5: # %bb15
218 %i = load i64, ptr addrspace(11) undef, align 8
219 %i1 = load i64, ptr addrspace(11) undef, align 8
222 bb2: ; preds = %bb12, %bb
223 %i3 = phi i64 [ undef, %bb ], [ %i13, %bb12 ]
224 br i1 undef, label %bb10, label %bb4
227 switch i32 undef, label %bb9 [
228 i32 1426063360, label %bb5
229 i32 1275068416, label %bb5
232 bb5: ; preds = %bb4, %bb4
233 %i6 = load half, ptr addrspace(13) undef, align 2
234 %i7 = icmp ult i64 0, %i1
235 br i1 %i7, label %bb8, label %bb15
238 store half %i6, ptr addrspace(13) null, align 2
244 bb10: ; preds = %bb8, %bb2
245 %i11 = icmp eq i64 %i3, 0
246 br i1 %i11, label %bb14, label %bb12
248 bb12: ; preds = %bb10
249 %i13 = add i64 %i3, 1
252 bb14: ; preds = %bb10
259 define void @func_48785(half %arg) #0 {
260 ; CHECK-LABEL: func_48785:
261 ; CHECK: # %bb.0: # %bb
262 ; CHECK-NEXT: mflr r0
263 ; CHECK-NEXT: std r29, -32(r1) # 8-byte Folded Spill
264 ; CHECK-NEXT: std r30, -24(r1) # 8-byte Folded Spill
265 ; CHECK-NEXT: stfd f31, -8(r1) # 8-byte Folded Spill
266 ; CHECK-NEXT: stdu r1, -64(r1)
267 ; CHECK-NEXT: fmr f31, f1
268 ; CHECK-NEXT: li r3, 1
269 ; CHECK-NEXT: li r29, 0
270 ; CHECK-NEXT: std r0, 80(r1)
271 ; CHECK-NEXT: rldic r30, r3, 62, 1
272 ; CHECK-NEXT: .p2align 5
273 ; CHECK-NEXT: .LBB3_1: # %bb1
275 ; CHECK-NEXT: fmr f1, f31
276 ; CHECK-NEXT: bl __gnu_f2h_ieee
278 ; CHECK-NEXT: addi r30, r30, -1
279 ; CHECK-NEXT: sth r3, 0(r29)
280 ; CHECK-NEXT: addi r29, r29, 24
281 ; CHECK-NEXT: cmpldi r30, 0
282 ; CHECK-NEXT: bc 12, gt, .LBB3_1
283 ; CHECK-NEXT: # %bb.2: # %bb5
285 ; CHECK-P9-LABEL: func_48785:
286 ; CHECK-P9: # %bb.0: # %bb
287 ; CHECK-P9-NEXT: li r3, 1
288 ; CHECK-P9-NEXT: rldic r3, r3, 62, 1
289 ; CHECK-P9-NEXT: mtctr r3
290 ; CHECK-P9-NEXT: li r3, 0
291 ; CHECK-P9-NEXT: .p2align 4
292 ; CHECK-P9-NEXT: .LBB3_1: # %bb1
294 ; CHECK-P9-NEXT: xscvdphp f0, f1
295 ; CHECK-P9-NEXT: stxsihx f0, 0, r3
296 ; CHECK-P9-NEXT: addi r3, r3, 24
297 ; CHECK-P9-NEXT: bdnz .LBB3_1
298 ; CHECK-P9-NEXT: # %bb.2: # %bb5
302 bb1: ; preds = %bb1, %bb
303 %i = phi i64 [ 0, %bb ], [ %i3, %bb1 ]
304 %i2 = getelementptr inbounds half, ptr addrspace(13) null, i64 %i
305 store half %arg, ptr addrspace(13) %i2, align 2
307 %i4 = icmp eq i64 %i3, 0
308 br i1 %i4, label %bb5, label %bb1
313 attributes #0 = { nounwind }