1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -ppc-asm-full-reg-names \
3 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-unknown < %s | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -ppc-asm-full-reg-names \
5 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
7 ; Function Attrs: nounwind
8 define zeroext i8 @_Z6testcff(float %arg) {
9 ; CHECK-LABEL: _Z6testcff:
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: xscvdpsxws f0, f1
12 ; CHECK-NEXT: stfs f1, -4(r1)
13 ; CHECK-NEXT: mfvsrwz r3, f0
14 ; CHECK-NEXT: clrldi r3, r3, 32
17 %arg.addr = alloca float, align 4
18 store float %arg, float* %arg.addr, align 4
19 %0 = load float, float* %arg.addr, align 4
20 %conv = fptoui float %0 to i8
24 ; Function Attrs: nounwind
25 define float @_Z6testfcc(i8 zeroext %arg) {
26 ; CHECK-LABEL: _Z6testfcc:
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: mtfprwz f0, r3
29 ; CHECK-NEXT: stb r3, -1(r1)
30 ; CHECK-NEXT: xscvuxdsp f1, f0
33 %arg.addr = alloca i8, align 1
34 store i8 %arg, i8* %arg.addr, align 1
35 %0 = load i8, i8* %arg.addr, align 1
36 %conv = uitofp i8 %0 to float
40 ; Function Attrs: nounwind
41 define zeroext i8 @_Z6testcdd(double %arg) {
42 ; CHECK-LABEL: _Z6testcdd:
43 ; CHECK: # %bb.0: # %entry
44 ; CHECK-NEXT: xscvdpsxws f0, f1
45 ; CHECK-NEXT: stfd f1, -8(r1)
46 ; CHECK-NEXT: mfvsrwz r3, f0
47 ; CHECK-NEXT: clrldi r3, r3, 32
50 %arg.addr = alloca double, align 8
51 store double %arg, double* %arg.addr, align 8
52 %0 = load double, double* %arg.addr, align 8
53 %conv = fptoui double %0 to i8
57 ; Function Attrs: nounwind
58 define double @_Z6testdcc(i8 zeroext %arg) {
59 ; CHECK-LABEL: _Z6testdcc:
60 ; CHECK: # %bb.0: # %entry
61 ; CHECK-NEXT: mtfprwz f0, r3
62 ; CHECK-NEXT: stb r3, -1(r1)
63 ; CHECK-NEXT: xscvuxddp f1, f0
66 %arg.addr = alloca i8, align 1
67 store i8 %arg, i8* %arg.addr, align 1
68 %0 = load i8, i8* %arg.addr, align 1
69 %conv = uitofp i8 %0 to double
73 ; Function Attrs: nounwind
74 define zeroext i8 @_Z7testucff(float %arg) {
75 ; CHECK-LABEL: _Z7testucff:
76 ; CHECK: # %bb.0: # %entry
77 ; CHECK-NEXT: xscvdpsxws f0, f1
78 ; CHECK-NEXT: stfs f1, -4(r1)
79 ; CHECK-NEXT: mfvsrwz r3, f0
80 ; CHECK-NEXT: clrldi r3, r3, 32
83 %arg.addr = alloca float, align 4
84 store float %arg, float* %arg.addr, align 4
85 %0 = load float, float* %arg.addr, align 4
86 %conv = fptoui float %0 to i8
90 ; Function Attrs: nounwind
91 define float @_Z7testfuch(i8 zeroext %arg) {
92 ; CHECK-LABEL: _Z7testfuch:
93 ; CHECK: # %bb.0: # %entry
94 ; CHECK-NEXT: mtfprwz f0, r3
95 ; CHECK-NEXT: stb r3, -1(r1)
96 ; CHECK-NEXT: xscvuxdsp f1, f0
99 %arg.addr = alloca i8, align 1
100 store i8 %arg, i8* %arg.addr, align 1
101 %0 = load i8, i8* %arg.addr, align 1
102 %conv = uitofp i8 %0 to float
106 ; Function Attrs: nounwind
107 define zeroext i8 @_Z7testucdd(double %arg) {
108 ; CHECK-LABEL: _Z7testucdd:
109 ; CHECK: # %bb.0: # %entry
110 ; CHECK-NEXT: xscvdpsxws f0, f1
111 ; CHECK-NEXT: stfd f1, -8(r1)
112 ; CHECK-NEXT: mfvsrwz r3, f0
113 ; CHECK-NEXT: clrldi r3, r3, 32
116 %arg.addr = alloca double, align 8
117 store double %arg, double* %arg.addr, align 8
118 %0 = load double, double* %arg.addr, align 8
119 %conv = fptoui double %0 to i8
123 ; Function Attrs: nounwind
124 define double @_Z7testduch(i8 zeroext %arg) {
125 ; CHECK-LABEL: _Z7testduch:
126 ; CHECK: # %bb.0: # %entry
127 ; CHECK-NEXT: mtfprwz f0, r3
128 ; CHECK-NEXT: stb r3, -1(r1)
129 ; CHECK-NEXT: xscvuxddp f1, f0
132 %arg.addr = alloca i8, align 1
133 store i8 %arg, i8* %arg.addr, align 1
134 %0 = load i8, i8* %arg.addr, align 1
135 %conv = uitofp i8 %0 to double
139 ; Function Attrs: nounwind
140 define signext i16 @_Z6testsff(float %arg) {
141 ; CHECK-LABEL: _Z6testsff:
142 ; CHECK: # %bb.0: # %entry
143 ; CHECK-NEXT: xscvdpsxws f0, f1
144 ; CHECK-NEXT: stfs f1, -4(r1)
145 ; CHECK-NEXT: mffprwz r3, f0
146 ; CHECK-NEXT: extsw r3, r3
149 %arg.addr = alloca float, align 4
150 store float %arg, float* %arg.addr, align 4
151 %0 = load float, float* %arg.addr, align 4
152 %conv = fptosi float %0 to i16
156 ; Function Attrs: nounwind
157 define float @_Z6testfss(i16 signext %arg) {
158 ; CHECK-LABEL: _Z6testfss:
159 ; CHECK: # %bb.0: # %entry
160 ; CHECK-NEXT: mtfprwa f0, r3
161 ; CHECK-NEXT: sth r3, -2(r1)
162 ; CHECK-NEXT: xscvsxdsp f1, f0
165 %arg.addr = alloca i16, align 2
166 store i16 %arg, i16* %arg.addr, align 2
167 %0 = load i16, i16* %arg.addr, align 2
168 %conv = sitofp i16 %0 to float
172 ; Function Attrs: nounwind
173 define signext i16 @_Z6testsdd(double %arg) {
174 ; CHECK-LABEL: _Z6testsdd:
175 ; CHECK: # %bb.0: # %entry
176 ; CHECK-NEXT: xscvdpsxws f0, f1
177 ; CHECK-NEXT: stfd f1, -8(r1)
178 ; CHECK-NEXT: mffprwz r3, f0
179 ; CHECK-NEXT: extsw r3, r3
182 %arg.addr = alloca double, align 8
183 store double %arg, double* %arg.addr, align 8
184 %0 = load double, double* %arg.addr, align 8
185 %conv = fptosi double %0 to i16
189 ; Function Attrs: nounwind
190 define double @_Z6testdss(i16 signext %arg) {
191 ; CHECK-LABEL: _Z6testdss:
192 ; CHECK: # %bb.0: # %entry
193 ; CHECK-NEXT: mtfprwa f0, r3
194 ; CHECK-NEXT: sth r3, -2(r1)
195 ; CHECK-NEXT: xscvsxddp f1, f0
198 %arg.addr = alloca i16, align 2
199 store i16 %arg, i16* %arg.addr, align 2
200 %0 = load i16, i16* %arg.addr, align 2
201 %conv = sitofp i16 %0 to double
205 ; Function Attrs: nounwind
206 define zeroext i16 @_Z7testusff(float %arg) {
207 ; CHECK-LABEL: _Z7testusff:
208 ; CHECK: # %bb.0: # %entry
209 ; CHECK-NEXT: xscvdpsxws f0, f1
210 ; CHECK-NEXT: stfs f1, -4(r1)
211 ; CHECK-NEXT: mfvsrwz r3, f0
212 ; CHECK-NEXT: clrldi r3, r3, 32
215 %arg.addr = alloca float, align 4
216 store float %arg, float* %arg.addr, align 4
217 %0 = load float, float* %arg.addr, align 4
218 %conv = fptoui float %0 to i16
222 ; Function Attrs: nounwind
223 define float @_Z7testfust(i16 zeroext %arg) {
224 ; CHECK-LABEL: _Z7testfust:
225 ; CHECK: # %bb.0: # %entry
226 ; CHECK-NEXT: mtfprwz f0, r3
227 ; CHECK-NEXT: sth r3, -2(r1)
228 ; CHECK-NEXT: xscvuxdsp f1, f0
231 %arg.addr = alloca i16, align 2
232 store i16 %arg, i16* %arg.addr, align 2
233 %0 = load i16, i16* %arg.addr, align 2
234 %conv = uitofp i16 %0 to float
238 ; Function Attrs: nounwind
239 define zeroext i16 @_Z7testusdd(double %arg) {
240 ; CHECK-LABEL: _Z7testusdd:
241 ; CHECK: # %bb.0: # %entry
242 ; CHECK-NEXT: xscvdpsxws f0, f1
243 ; CHECK-NEXT: stfd f1, -8(r1)
244 ; CHECK-NEXT: mfvsrwz r3, f0
245 ; CHECK-NEXT: clrldi r3, r3, 32
248 %arg.addr = alloca double, align 8
249 store double %arg, double* %arg.addr, align 8
250 %0 = load double, double* %arg.addr, align 8
251 %conv = fptoui double %0 to i16
255 ; Function Attrs: nounwind
256 define double @_Z7testdust(i16 zeroext %arg) {
257 ; CHECK-LABEL: _Z7testdust:
258 ; CHECK: # %bb.0: # %entry
259 ; CHECK-NEXT: mtfprwz f0, r3
260 ; CHECK-NEXT: sth r3, -2(r1)
261 ; CHECK-NEXT: xscvuxddp f1, f0
264 %arg.addr = alloca i16, align 2
265 store i16 %arg, i16* %arg.addr, align 2
266 %0 = load i16, i16* %arg.addr, align 2
267 %conv = uitofp i16 %0 to double
271 ; Function Attrs: nounwind
272 define signext i32 @_Z6testiff(float %arg) {
273 ; CHECK-LABEL: _Z6testiff:
274 ; CHECK: # %bb.0: # %entry
275 ; CHECK-NEXT: xscvdpsxws f0, f1
276 ; CHECK-NEXT: stfs f1, -4(r1)
277 ; CHECK-NEXT: mffprwz r3, f0
278 ; CHECK-NEXT: extsw r3, r3
281 %arg.addr = alloca float, align 4
282 store float %arg, float* %arg.addr, align 4
283 %0 = load float, float* %arg.addr, align 4
284 %conv = fptosi float %0 to i32
288 ; Function Attrs: nounwind
289 define float @_Z6testfii(i32 signext %arg) {
290 ; CHECK-LABEL: _Z6testfii:
291 ; CHECK: # %bb.0: # %entry
292 ; CHECK-NEXT: mtfprwa f0, r3
293 ; CHECK-NEXT: stw r3, -4(r1)
294 ; CHECK-NEXT: xscvsxdsp f1, f0
297 %arg.addr = alloca i32, align 4
298 store i32 %arg, i32* %arg.addr, align 4
299 %0 = load i32, i32* %arg.addr, align 4
300 %conv = sitofp i32 %0 to float
304 ; Function Attrs: nounwind
305 define signext i32 @_Z6testidd(double %arg) {
306 ; CHECK-LABEL: _Z6testidd:
307 ; CHECK: # %bb.0: # %entry
308 ; CHECK-NEXT: xscvdpsxws f0, f1
309 ; CHECK-NEXT: stfd f1, -8(r1)
310 ; CHECK-NEXT: mffprwz r3, f0
311 ; CHECK-NEXT: extsw r3, r3
314 %arg.addr = alloca double, align 8
315 store double %arg, double* %arg.addr, align 8
316 %0 = load double, double* %arg.addr, align 8
317 %conv = fptosi double %0 to i32
321 ; Function Attrs: nounwind
322 define double @_Z6testdii(i32 signext %arg) {
323 ; CHECK-LABEL: _Z6testdii:
324 ; CHECK: # %bb.0: # %entry
325 ; CHECK-NEXT: mtfprwa f0, r3
326 ; CHECK-NEXT: stw r3, -4(r1)
327 ; CHECK-NEXT: xscvsxddp f1, f0
330 %arg.addr = alloca i32, align 4
331 store i32 %arg, i32* %arg.addr, align 4
332 %0 = load i32, i32* %arg.addr, align 4
333 %conv = sitofp i32 %0 to double
337 ; Function Attrs: nounwind
338 define zeroext i32 @_Z7testuiff(float %arg) {
339 ; CHECK-LABEL: _Z7testuiff:
340 ; CHECK: # %bb.0: # %entry
341 ; CHECK-NEXT: xscvdpuxws f0, f1
342 ; CHECK-NEXT: stfs f1, -4(r1)
343 ; CHECK-NEXT: mfvsrwz r3, f0
344 ; CHECK-NEXT: clrldi r3, r3, 32
347 %arg.addr = alloca float, align 4
348 store float %arg, float* %arg.addr, align 4
349 %0 = load float, float* %arg.addr, align 4
350 %conv = fptoui float %0 to i32
354 ; Function Attrs: nounwind
355 define float @_Z7testfuij(i32 zeroext %arg) {
356 ; CHECK-LABEL: _Z7testfuij:
357 ; CHECK: # %bb.0: # %entry
358 ; CHECK-NEXT: mtfprwz f0, r3
359 ; CHECK-NEXT: stw r3, -4(r1)
360 ; CHECK-NEXT: xscvuxdsp f1, f0
363 %arg.addr = alloca i32, align 4
364 store i32 %arg, i32* %arg.addr, align 4
365 %0 = load i32, i32* %arg.addr, align 4
366 %conv = uitofp i32 %0 to float
370 ; Function Attrs: nounwind
371 define zeroext i32 @_Z7testuidd(double %arg) {
372 ; CHECK-LABEL: _Z7testuidd:
373 ; CHECK: # %bb.0: # %entry
374 ; CHECK-NEXT: xscvdpuxws f0, f1
375 ; CHECK-NEXT: stfd f1, -8(r1)
376 ; CHECK-NEXT: mfvsrwz r3, f0
377 ; CHECK-NEXT: clrldi r3, r3, 32
380 %arg.addr = alloca double, align 8
381 store double %arg, double* %arg.addr, align 8
382 %0 = load double, double* %arg.addr, align 8
383 %conv = fptoui double %0 to i32
387 ; Function Attrs: nounwind
388 define double @_Z7testduij(i32 zeroext %arg) {
389 ; CHECK-LABEL: _Z7testduij:
390 ; CHECK: # %bb.0: # %entry
391 ; CHECK-NEXT: mtfprwz f0, r3
392 ; CHECK-NEXT: stw r3, -4(r1)
393 ; CHECK-NEXT: xscvuxddp f1, f0
396 %arg.addr = alloca i32, align 4
397 store i32 %arg, i32* %arg.addr, align 4
398 %0 = load i32, i32* %arg.addr, align 4
399 %conv = uitofp i32 %0 to double
403 ; Function Attrs: nounwind
404 define i64 @_Z7testllff(float %arg) {
405 ; CHECK-LABEL: _Z7testllff:
406 ; CHECK: # %bb.0: # %entry
407 ; CHECK-NEXT: xscvdpsxds f0, f1
408 ; CHECK-NEXT: stfs f1, -4(r1)
409 ; CHECK-NEXT: mffprd r3, f0
412 %arg.addr = alloca float, align 4
413 store float %arg, float* %arg.addr, align 4
414 %0 = load float, float* %arg.addr, align 4
415 %conv = fptosi float %0 to i64
419 ; Function Attrs: nounwind
420 define float @_Z7testfllx(i64 %arg) {
421 ; CHECK-LABEL: _Z7testfllx:
422 ; CHECK: # %bb.0: # %entry
423 ; CHECK-NEXT: mtfprd f0, r3
424 ; CHECK-NEXT: std r3, -8(r1)
425 ; CHECK-NEXT: xscvsxdsp f1, f0
428 %arg.addr = alloca i64, align 8
429 store i64 %arg, i64* %arg.addr, align 8
430 %0 = load i64, i64* %arg.addr, align 8
431 %conv = sitofp i64 %0 to float
435 ; Function Attrs: nounwind
436 define i64 @_Z7testlldd(double %arg) {
437 ; CHECK-LABEL: _Z7testlldd:
438 ; CHECK: # %bb.0: # %entry
439 ; CHECK-NEXT: xscvdpsxds f0, f1
440 ; CHECK-NEXT: stfd f1, -8(r1)
441 ; CHECK-NEXT: mffprd r3, f0
444 %arg.addr = alloca double, align 8
445 store double %arg, double* %arg.addr, align 8
446 %0 = load double, double* %arg.addr, align 8
447 %conv = fptosi double %0 to i64
451 ; Function Attrs: nounwind
452 define double @_Z7testdllx(i64 %arg) {
453 ; CHECK-LABEL: _Z7testdllx:
454 ; CHECK: # %bb.0: # %entry
455 ; CHECK-NEXT: mtfprd f0, r3
456 ; CHECK-NEXT: std r3, -8(r1)
457 ; CHECK-NEXT: xscvsxddp f1, f0
460 %arg.addr = alloca i64, align 8
461 store i64 %arg, i64* %arg.addr, align 8
462 %0 = load i64, i64* %arg.addr, align 8
463 %conv = sitofp i64 %0 to double
467 ; Function Attrs: nounwind
468 define i64 @_Z8testullff(float %arg) {
469 ; CHECK-LABEL: _Z8testullff:
470 ; CHECK: # %bb.0: # %entry
471 ; CHECK-NEXT: xscvdpuxds f0, f1
472 ; CHECK-NEXT: stfs f1, -4(r1)
473 ; CHECK-NEXT: mffprd r3, f0
476 %arg.addr = alloca float, align 4
477 store float %arg, float* %arg.addr, align 4
478 %0 = load float, float* %arg.addr, align 4
479 %conv = fptoui float %0 to i64
483 ; Function Attrs: nounwind
484 define float @_Z8testfully(i64 %arg) {
485 ; CHECK-LABEL: _Z8testfully:
486 ; CHECK: # %bb.0: # %entry
487 ; CHECK-NEXT: mtfprd f0, r3
488 ; CHECK-NEXT: std r3, -8(r1)
489 ; CHECK-NEXT: xscvuxdsp f1, f0
492 %arg.addr = alloca i64, align 8
493 store i64 %arg, i64* %arg.addr, align 8
494 %0 = load i64, i64* %arg.addr, align 8
495 %conv = uitofp i64 %0 to float
499 ; Function Attrs: nounwind
500 define i64 @_Z8testulldd(double %arg) {
501 ; CHECK-LABEL: _Z8testulldd:
502 ; CHECK: # %bb.0: # %entry
503 ; CHECK-NEXT: xscvdpuxds f0, f1
504 ; CHECK-NEXT: stfd f1, -8(r1)
505 ; CHECK-NEXT: mffprd r3, f0
508 %arg.addr = alloca double, align 8
509 store double %arg, double* %arg.addr, align 8
510 %0 = load double, double* %arg.addr, align 8
511 %conv = fptoui double %0 to i64
515 ; Function Attrs: nounwind
516 define double @_Z8testdully(i64 %arg) {
517 ; CHECK-LABEL: _Z8testdully:
518 ; CHECK: # %bb.0: # %entry
519 ; CHECK-NEXT: mtfprd f0, r3
520 ; CHECK-NEXT: std r3, -8(r1)
521 ; CHECK-NEXT: xscvuxddp f1, f0
524 %arg.addr = alloca i64, align 8
525 store i64 %arg, i64* %arg.addr, align 8
526 %0 = load i64, i64* %arg.addr, align 8
527 %conv = uitofp i64 %0 to double