1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown -ppc-vsr-nums-as-vr \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown -ppc-vsr-nums-as-vr \
5 ; RUN: -verify-machineinstrs < %s | FileCheck -check-prefix=CHECK-PWR8 %s
7 ; ==========================================
8 ; Tests for store of fp_to_sint converstions
9 ; ==========================================
11 ; Function Attrs: norecurse nounwind
12 define void @qpConv2sdw(ptr nocapture readonly %a, ptr nocapture %b) {
13 ; CHECK-LABEL: qpConv2sdw:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: lxv 2, 0(3)
16 ; CHECK-NEXT: xscvqpsdz 2, 2
17 ; CHECK-NEXT: stxsd 2, 0(4)
20 ; CHECK-PWR8-LABEL: qpConv2sdw:
21 ; CHECK-PWR8: # %bb.0: # %entry
22 ; CHECK-PWR8-NEXT: mflr 0
23 ; CHECK-PWR8-NEXT: .cfi_def_cfa_offset 48
24 ; CHECK-PWR8-NEXT: .cfi_offset lr, 16
25 ; CHECK-PWR8-NEXT: .cfi_offset r30, -16
26 ; CHECK-PWR8-NEXT: std 30, -16(1) # 8-byte Folded Spill
27 ; CHECK-PWR8-NEXT: stdu 1, -48(1)
28 ; CHECK-PWR8-NEXT: std 0, 64(1)
29 ; CHECK-PWR8-NEXT: mr 30, 4
30 ; CHECK-PWR8-NEXT: lxvd2x 0, 0, 3
31 ; CHECK-PWR8-NEXT: xxswapd 2, 0
32 ; CHECK-PWR8-NEXT: bl __fixkfdi
33 ; CHECK-PWR8-NEXT: nop
34 ; CHECK-PWR8-NEXT: std 3, 0(30)
35 ; CHECK-PWR8-NEXT: addi 1, 1, 48
36 ; CHECK-PWR8-NEXT: ld 0, 16(1)
37 ; CHECK-PWR8-NEXT: ld 30, -16(1) # 8-byte Folded Reload
38 ; CHECK-PWR8-NEXT: mtlr 0
39 ; CHECK-PWR8-NEXT: blr
41 %0 = load fp128, ptr %a, align 16
42 %conv = fptosi fp128 %0 to i64
43 store i64 %conv, ptr %b, align 8
49 ; Function Attrs: norecurse nounwind
50 define void @qpConv2sw(ptr nocapture readonly %a, ptr nocapture %b) {
51 ; CHECK-LABEL: qpConv2sw:
52 ; CHECK: # %bb.0: # %entry
53 ; CHECK-NEXT: lxv 2, 0(3)
54 ; CHECK-NEXT: xscvqpswz 2, 2
55 ; CHECK-NEXT: stxsiwx 2, 0, 4
58 ; CHECK-PWR8-LABEL: qpConv2sw:
59 ; CHECK-PWR8: # %bb.0: # %entry
60 ; CHECK-PWR8-NEXT: mflr 0
61 ; CHECK-PWR8-NEXT: .cfi_def_cfa_offset 48
62 ; CHECK-PWR8-NEXT: .cfi_offset lr, 16
63 ; CHECK-PWR8-NEXT: .cfi_offset r30, -16
64 ; CHECK-PWR8-NEXT: std 30, -16(1) # 8-byte Folded Spill
65 ; CHECK-PWR8-NEXT: stdu 1, -48(1)
66 ; CHECK-PWR8-NEXT: std 0, 64(1)
67 ; CHECK-PWR8-NEXT: mr 30, 4
68 ; CHECK-PWR8-NEXT: lxvd2x 0, 0, 3
69 ; CHECK-PWR8-NEXT: xxswapd 2, 0
70 ; CHECK-PWR8-NEXT: bl __fixkfsi
71 ; CHECK-PWR8-NEXT: nop
72 ; CHECK-PWR8-NEXT: stw 3, 0(30)
73 ; CHECK-PWR8-NEXT: addi 1, 1, 48
74 ; CHECK-PWR8-NEXT: ld 0, 16(1)
75 ; CHECK-PWR8-NEXT: ld 30, -16(1) # 8-byte Folded Reload
76 ; CHECK-PWR8-NEXT: mtlr 0
77 ; CHECK-PWR8-NEXT: blr
79 %0 = load fp128, ptr %a, align 16
80 %conv = fptosi fp128 %0 to i32
81 store i32 %conv, ptr %b, align 4
87 ; Function Attrs: norecurse nounwind
88 define void @qpConv2udw(ptr nocapture readonly %a, ptr nocapture %b) {
89 ; CHECK-LABEL: qpConv2udw:
90 ; CHECK: # %bb.0: # %entry
91 ; CHECK-NEXT: lxv 2, 0(3)
92 ; CHECK-NEXT: xscvqpudz 2, 2
93 ; CHECK-NEXT: stxsd 2, 0(4)
96 ; CHECK-PWR8-LABEL: qpConv2udw:
97 ; CHECK-PWR8: # %bb.0: # %entry
98 ; CHECK-PWR8-NEXT: mflr 0
99 ; CHECK-PWR8-NEXT: .cfi_def_cfa_offset 48
100 ; CHECK-PWR8-NEXT: .cfi_offset lr, 16
101 ; CHECK-PWR8-NEXT: .cfi_offset r30, -16
102 ; CHECK-PWR8-NEXT: std 30, -16(1) # 8-byte Folded Spill
103 ; CHECK-PWR8-NEXT: stdu 1, -48(1)
104 ; CHECK-PWR8-NEXT: std 0, 64(1)
105 ; CHECK-PWR8-NEXT: mr 30, 4
106 ; CHECK-PWR8-NEXT: lxvd2x 0, 0, 3
107 ; CHECK-PWR8-NEXT: xxswapd 2, 0
108 ; CHECK-PWR8-NEXT: bl __fixunskfdi
109 ; CHECK-PWR8-NEXT: nop
110 ; CHECK-PWR8-NEXT: std 3, 0(30)
111 ; CHECK-PWR8-NEXT: addi 1, 1, 48
112 ; CHECK-PWR8-NEXT: ld 0, 16(1)
113 ; CHECK-PWR8-NEXT: ld 30, -16(1) # 8-byte Folded Reload
114 ; CHECK-PWR8-NEXT: mtlr 0
115 ; CHECK-PWR8-NEXT: blr
117 %0 = load fp128, ptr %a, align 16
118 %conv = fptoui fp128 %0 to i64
119 store i64 %conv, ptr %b, align 8
125 ; Function Attrs: norecurse nounwind
126 define void @qpConv2uw(ptr nocapture readonly %a, ptr nocapture %b) {
127 ; CHECK-LABEL: qpConv2uw:
128 ; CHECK: # %bb.0: # %entry
129 ; CHECK-NEXT: lxv 2, 0(3)
130 ; CHECK-NEXT: xscvqpuwz 2, 2
131 ; CHECK-NEXT: stxsiwx 2, 0, 4
134 ; CHECK-PWR8-LABEL: qpConv2uw:
135 ; CHECK-PWR8: # %bb.0: # %entry
136 ; CHECK-PWR8-NEXT: mflr 0
137 ; CHECK-PWR8-NEXT: .cfi_def_cfa_offset 48
138 ; CHECK-PWR8-NEXT: .cfi_offset lr, 16
139 ; CHECK-PWR8-NEXT: .cfi_offset r30, -16
140 ; CHECK-PWR8-NEXT: std 30, -16(1) # 8-byte Folded Spill
141 ; CHECK-PWR8-NEXT: stdu 1, -48(1)
142 ; CHECK-PWR8-NEXT: std 0, 64(1)
143 ; CHECK-PWR8-NEXT: mr 30, 4
144 ; CHECK-PWR8-NEXT: lxvd2x 0, 0, 3
145 ; CHECK-PWR8-NEXT: xxswapd 2, 0
146 ; CHECK-PWR8-NEXT: bl __fixunskfsi
147 ; CHECK-PWR8-NEXT: nop
148 ; CHECK-PWR8-NEXT: stw 3, 0(30)
149 ; CHECK-PWR8-NEXT: addi 1, 1, 48
150 ; CHECK-PWR8-NEXT: ld 0, 16(1)
151 ; CHECK-PWR8-NEXT: ld 30, -16(1) # 8-byte Folded Reload
152 ; CHECK-PWR8-NEXT: mtlr 0
153 ; CHECK-PWR8-NEXT: blr
155 %0 = load fp128, ptr %a, align 16
156 %conv = fptoui fp128 %0 to i32
157 store i32 %conv, ptr %b, align 4
163 ; Function Attrs: norecurse nounwind
164 define void @dpConv2sdw(ptr nocapture readonly %a, ptr nocapture %b) {
165 ; CHECK-LABEL: dpConv2sdw:
166 ; CHECK: # %bb.0: # %entry
167 ; CHECK-NEXT: lfd 0, 0(3)
168 ; CHECK-NEXT: xscvdpsxds 2, 0
169 ; CHECK-NEXT: stxsd 2, 0(4)
172 ; CHECK-PWR8-LABEL: dpConv2sdw:
173 ; CHECK-PWR8: # %bb.0: # %entry
174 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
175 ; CHECK-PWR8-NEXT: xscvdpsxds 0, 0
176 ; CHECK-PWR8-NEXT: stxsdx 0, 0, 4
177 ; CHECK-PWR8-NEXT: blr
179 %0 = load double, ptr %a, align 8
180 %conv = fptosi double %0 to i64
181 store i64 %conv, ptr %b, align 8
187 ; Function Attrs: norecurse nounwind
188 define void @dpConv2sw(ptr nocapture readonly %a, ptr nocapture %b) {
189 ; CHECK-LABEL: dpConv2sw:
190 ; CHECK: # %bb.0: # %entry
191 ; CHECK-NEXT: lfd 0, 0(3)
192 ; CHECK-NEXT: xscvdpsxws 0, 0
193 ; CHECK-NEXT: stfiwx 0, 0, 4
196 ; CHECK-PWR8-LABEL: dpConv2sw:
197 ; CHECK-PWR8: # %bb.0: # %entry
198 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
199 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
200 ; CHECK-PWR8-NEXT: stfiwx 0, 0, 4
201 ; CHECK-PWR8-NEXT: blr
203 %0 = load double, ptr %a, align 8
204 %conv = fptosi double %0 to i32
205 store i32 %conv, ptr %b, align 4
211 ; Function Attrs: norecurse nounwind
212 define void @dpConv2shw(ptr nocapture readonly %a, ptr nocapture %b) {
213 ; CHECK-LABEL: dpConv2shw:
214 ; CHECK: # %bb.0: # %entry
215 ; CHECK-NEXT: lfd 0, 0(3)
216 ; CHECK-NEXT: xscvdpsxws 0, 0
217 ; CHECK-NEXT: stxsihx 0, 0, 4
220 ; CHECK-PWR8-LABEL: dpConv2shw:
221 ; CHECK-PWR8: # %bb.0: # %entry
222 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
223 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
224 ; CHECK-PWR8-NEXT: mffprwz 3, 0
225 ; CHECK-PWR8-NEXT: sth 3, 0(4)
226 ; CHECK-PWR8-NEXT: blr
228 %0 = load double, ptr %a, align 8
229 %conv = fptosi double %0 to i16
230 store i16 %conv, ptr %b, align 2
236 ; Function Attrs: norecurse nounwind
237 define void @dpConv2sb(ptr nocapture readonly %a, ptr nocapture %b) {
238 ; CHECK-LABEL: dpConv2sb:
239 ; CHECK: # %bb.0: # %entry
240 ; CHECK-NEXT: lfd 0, 0(3)
241 ; CHECK-NEXT: xscvdpsxws 0, 0
242 ; CHECK-NEXT: stxsibx 0, 0, 4
245 ; CHECK-PWR8-LABEL: dpConv2sb:
246 ; CHECK-PWR8: # %bb.0: # %entry
247 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
248 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
249 ; CHECK-PWR8-NEXT: mffprwz 3, 0
250 ; CHECK-PWR8-NEXT: stb 3, 0(4)
251 ; CHECK-PWR8-NEXT: blr
253 %0 = load double, ptr %a, align 8
254 %conv = fptosi double %0 to i8
255 store i8 %conv, ptr %b, align 1
261 ; Function Attrs: norecurse nounwind
262 define void @spConv2sdw(ptr nocapture readonly %a, ptr nocapture %b) {
263 ; CHECK-LABEL: spConv2sdw:
264 ; CHECK: # %bb.0: # %entry
265 ; CHECK-NEXT: lfs 0, 0(3)
266 ; CHECK-NEXT: xscvdpsxds 2, 0
267 ; CHECK-NEXT: stxsd 2, 0(4)
270 ; CHECK-PWR8-LABEL: spConv2sdw:
271 ; CHECK-PWR8: # %bb.0: # %entry
272 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
273 ; CHECK-PWR8-NEXT: xscvdpsxds 0, 0
274 ; CHECK-PWR8-NEXT: stxsdx 0, 0, 4
275 ; CHECK-PWR8-NEXT: blr
277 %0 = load float, ptr %a, align 4
278 %conv = fptosi float %0 to i64
279 store i64 %conv, ptr %b, align 8
285 ; Function Attrs: norecurse nounwind
286 define void @spConv2sw(ptr nocapture readonly %a, ptr nocapture %b) {
287 ; CHECK-LABEL: spConv2sw:
288 ; CHECK: # %bb.0: # %entry
289 ; CHECK-NEXT: lfs 0, 0(3)
290 ; CHECK-NEXT: xscvdpsxws 0, 0
291 ; CHECK-NEXT: stfiwx 0, 0, 4
294 ; CHECK-PWR8-LABEL: spConv2sw:
295 ; CHECK-PWR8: # %bb.0: # %entry
296 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
297 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
298 ; CHECK-PWR8-NEXT: stfiwx 0, 0, 4
299 ; CHECK-PWR8-NEXT: blr
301 %0 = load float, ptr %a, align 4
302 %conv = fptosi float %0 to i32
303 store i32 %conv, ptr %b, align 4
309 ; Function Attrs: norecurse nounwind
310 define void @spConv2shw(ptr nocapture readonly %a, ptr nocapture %b) {
311 ; CHECK-LABEL: spConv2shw:
312 ; CHECK: # %bb.0: # %entry
313 ; CHECK-NEXT: lfs 0, 0(3)
314 ; CHECK-NEXT: xscvdpsxws 0, 0
315 ; CHECK-NEXT: stxsihx 0, 0, 4
318 ; CHECK-PWR8-LABEL: spConv2shw:
319 ; CHECK-PWR8: # %bb.0: # %entry
320 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
321 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
322 ; CHECK-PWR8-NEXT: mffprwz 3, 0
323 ; CHECK-PWR8-NEXT: sth 3, 0(4)
324 ; CHECK-PWR8-NEXT: blr
326 %0 = load float, ptr %a, align 4
327 %conv = fptosi float %0 to i16
328 store i16 %conv, ptr %b, align 2
334 ; Function Attrs: norecurse nounwind
335 define void @spConv2sb(ptr nocapture readonly %a, ptr nocapture %b) {
336 ; CHECK-LABEL: spConv2sb:
337 ; CHECK: # %bb.0: # %entry
338 ; CHECK-NEXT: lfs 0, 0(3)
339 ; CHECK-NEXT: xscvdpsxws 0, 0
340 ; CHECK-NEXT: stxsibx 0, 0, 4
343 ; CHECK-PWR8-LABEL: spConv2sb:
344 ; CHECK-PWR8: # %bb.0: # %entry
345 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
346 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
347 ; CHECK-PWR8-NEXT: mffprwz 3, 0
348 ; CHECK-PWR8-NEXT: stb 3, 0(4)
349 ; CHECK-PWR8-NEXT: blr
351 %0 = load float, ptr %a, align 4
352 %conv = fptosi float %0 to i8
353 store i8 %conv, ptr %b, align 1
359 ; Function Attrs: norecurse nounwind
360 define void @dpConv2sdw_x(ptr nocapture readonly %a, ptr nocapture %b,
361 ; CHECK-LABEL: dpConv2sdw_x:
362 ; CHECK: # %bb.0: # %entry
363 ; CHECK-NEXT: lfd 0, 0(3)
364 ; CHECK-NEXT: sldi 3, 5, 3
365 ; CHECK-NEXT: xscvdpsxds 0, 0
366 ; CHECK-NEXT: stxsdx 0, 4, 3
369 ; CHECK-PWR8-LABEL: dpConv2sdw_x:
370 ; CHECK-PWR8: # %bb.0: # %entry
371 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
372 ; CHECK-PWR8-NEXT: sldi 3, 5, 3
373 ; CHECK-PWR8-NEXT: xscvdpsxds 0, 0
374 ; CHECK-PWR8-NEXT: stxsdx 0, 4, 3
375 ; CHECK-PWR8-NEXT: blr
378 %0 = load double, ptr %a, align 8
379 %conv = fptosi double %0 to i64
380 %idxprom = sext i32 %idx to i64
381 %arrayidx = getelementptr inbounds i64, ptr %b, i64 %idxprom
382 store i64 %conv, ptr %arrayidx, align 8
388 ; Function Attrs: norecurse nounwind
389 define void @dpConv2sw_x(ptr nocapture readonly %a, ptr nocapture %b,
390 ; CHECK-LABEL: dpConv2sw_x:
391 ; CHECK: # %bb.0: # %entry
392 ; CHECK-NEXT: lfd 0, 0(3)
393 ; CHECK-NEXT: sldi 3, 5, 2
394 ; CHECK-NEXT: xscvdpsxws 0, 0
395 ; CHECK-NEXT: stfiwx 0, 4, 3
398 ; CHECK-PWR8-LABEL: dpConv2sw_x:
399 ; CHECK-PWR8: # %bb.0: # %entry
400 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
401 ; CHECK-PWR8-NEXT: sldi 3, 5, 2
402 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
403 ; CHECK-PWR8-NEXT: stfiwx 0, 4, 3
404 ; CHECK-PWR8-NEXT: blr
407 %0 = load double, ptr %a, align 8
408 %conv = fptosi double %0 to i32
409 %idxprom = sext i32 %idx to i64
410 %arrayidx = getelementptr inbounds i32, ptr %b, i64 %idxprom
411 store i32 %conv, ptr %arrayidx, align 4
417 ; Function Attrs: norecurse nounwind
418 define void @dpConv2shw_x(ptr nocapture readonly %a, ptr nocapture %b,
419 ; CHECK-LABEL: dpConv2shw_x:
420 ; CHECK: # %bb.0: # %entry
421 ; CHECK-NEXT: lfd 0, 0(3)
422 ; CHECK-NEXT: sldi 3, 5, 1
423 ; CHECK-NEXT: xscvdpsxws 0, 0
424 ; CHECK-NEXT: stxsihx 0, 4, 3
427 ; CHECK-PWR8-LABEL: dpConv2shw_x:
428 ; CHECK-PWR8: # %bb.0: # %entry
429 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
430 ; CHECK-PWR8-NEXT: sldi 5, 5, 1
431 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
432 ; CHECK-PWR8-NEXT: mffprwz 3, 0
433 ; CHECK-PWR8-NEXT: sthx 3, 4, 5
434 ; CHECK-PWR8-NEXT: blr
437 %0 = load double, ptr %a, align 8
438 %conv = fptosi double %0 to i16
439 %idxprom = sext i32 %idx to i64
440 %arrayidx = getelementptr inbounds i16, ptr %b, i64 %idxprom
441 store i16 %conv, ptr %arrayidx, align 2
447 ; Function Attrs: norecurse nounwind
448 define void @dpConv2sb_x(ptr nocapture readonly %a, ptr nocapture %b,
449 ; CHECK-LABEL: dpConv2sb_x:
450 ; CHECK: # %bb.0: # %entry
451 ; CHECK-NEXT: lfd 0, 0(3)
452 ; CHECK-NEXT: xscvdpsxws 0, 0
453 ; CHECK-NEXT: stxsibx 0, 4, 5
456 ; CHECK-PWR8-LABEL: dpConv2sb_x:
457 ; CHECK-PWR8: # %bb.0: # %entry
458 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
459 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
460 ; CHECK-PWR8-NEXT: mffprwz 3, 0
461 ; CHECK-PWR8-NEXT: stbx 3, 4, 5
462 ; CHECK-PWR8-NEXT: blr
465 %0 = load double, ptr %a, align 8
466 %conv = fptosi double %0 to i8
467 %idxprom = sext i32 %idx to i64
468 %arrayidx = getelementptr inbounds i8, ptr %b, i64 %idxprom
469 store i8 %conv, ptr %arrayidx, align 1
475 ; Function Attrs: norecurse nounwind
476 define void @spConv2sdw_x(ptr nocapture readonly %a, ptr nocapture %b,
477 ; CHECK-LABEL: spConv2sdw_x:
478 ; CHECK: # %bb.0: # %entry
479 ; CHECK-NEXT: lfs 0, 0(3)
480 ; CHECK-NEXT: xscvdpsxds 0, 0
481 ; CHECK-NEXT: sldi 5, 5, 3
482 ; CHECK-NEXT: stxsdx 0, 4, 5
485 ; CHECK-PWR8-LABEL: spConv2sdw_x:
486 ; CHECK-PWR8: # %bb.0: # %entry
487 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
488 ; CHECK-PWR8-NEXT: sldi 3, 5, 3
489 ; CHECK-PWR8-NEXT: xscvdpsxds 0, 0
490 ; CHECK-PWR8-NEXT: stxsdx 0, 4, 3
491 ; CHECK-PWR8-NEXT: blr
494 %0 = load float, ptr %a, align 4
495 %conv = fptosi float %0 to i64
496 %idxprom = sext i32 %idx to i64
497 %arrayidx = getelementptr inbounds i64, ptr %b, i64 %idxprom
498 store i64 %conv, ptr %arrayidx, align 8
504 ; Function Attrs: norecurse nounwind
505 define void @spConv2sw_x(ptr nocapture readonly %a, ptr nocapture %b,
506 ; CHECK-LABEL: spConv2sw_x:
507 ; CHECK: # %bb.0: # %entry
508 ; CHECK-NEXT: lfs 0, 0(3)
509 ; CHECK-NEXT: xscvdpsxws 0, 0
510 ; CHECK-NEXT: sldi 5, 5, 2
511 ; CHECK-NEXT: stfiwx 0, 4, 5
514 ; CHECK-PWR8-LABEL: spConv2sw_x:
515 ; CHECK-PWR8: # %bb.0: # %entry
516 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
517 ; CHECK-PWR8-NEXT: sldi 3, 5, 2
518 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
519 ; CHECK-PWR8-NEXT: stfiwx 0, 4, 3
520 ; CHECK-PWR8-NEXT: blr
523 %0 = load float, ptr %a, align 4
524 %conv = fptosi float %0 to i32
525 %idxprom = sext i32 %idx to i64
526 %arrayidx = getelementptr inbounds i32, ptr %b, i64 %idxprom
527 store i32 %conv, ptr %arrayidx, align 4
533 ; Function Attrs: norecurse nounwind
534 define void @spConv2shw_x(ptr nocapture readonly %a, ptr nocapture %b,
535 ; CHECK-LABEL: spConv2shw_x:
536 ; CHECK: # %bb.0: # %entry
537 ; CHECK-NEXT: lfs 0, 0(3)
538 ; CHECK-NEXT: xscvdpsxws 0, 0
539 ; CHECK-NEXT: sldi 5, 5, 1
540 ; CHECK-NEXT: stxsihx 0, 4, 5
543 ; CHECK-PWR8-LABEL: spConv2shw_x:
544 ; CHECK-PWR8: # %bb.0: # %entry
545 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
546 ; CHECK-PWR8-NEXT: sldi 5, 5, 1
547 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
548 ; CHECK-PWR8-NEXT: mffprwz 3, 0
549 ; CHECK-PWR8-NEXT: sthx 3, 4, 5
550 ; CHECK-PWR8-NEXT: blr
553 %0 = load float, ptr %a, align 4
554 %conv = fptosi float %0 to i16
555 %idxprom = sext i32 %idx to i64
556 %arrayidx = getelementptr inbounds i16, ptr %b, i64 %idxprom
557 store i16 %conv, ptr %arrayidx, align 2
563 ; Function Attrs: norecurse nounwind
564 define void @spConv2sb_x(ptr nocapture readonly %a, ptr nocapture %b,
565 ; CHECK-LABEL: spConv2sb_x:
566 ; CHECK: # %bb.0: # %entry
567 ; CHECK-NEXT: lfs 0, 0(3)
568 ; CHECK-NEXT: xscvdpsxws 0, 0
569 ; CHECK-NEXT: stxsibx 0, 4, 5
572 ; CHECK-PWR8-LABEL: spConv2sb_x:
573 ; CHECK-PWR8: # %bb.0: # %entry
574 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
575 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
576 ; CHECK-PWR8-NEXT: mffprwz 3, 0
577 ; CHECK-PWR8-NEXT: stbx 3, 4, 5
578 ; CHECK-PWR8-NEXT: blr
581 %0 = load float, ptr %a, align 4
582 %conv = fptosi float %0 to i8
583 %idxprom = sext i32 %idx to i64
584 %arrayidx = getelementptr inbounds i8, ptr %b, i64 %idxprom
585 store i8 %conv, ptr %arrayidx, align 1
591 ; ==========================================
592 ; Tests for store of fp_to_uint converstions
593 ; ==========================================
595 ; Function Attrs: norecurse nounwind
596 define void @dpConv2udw(ptr nocapture readonly %a, ptr nocapture %b) {
597 ; CHECK-LABEL: dpConv2udw:
598 ; CHECK: # %bb.0: # %entry
599 ; CHECK-NEXT: lfd 0, 0(3)
600 ; CHECK-NEXT: xscvdpuxds 2, 0
601 ; CHECK-NEXT: stxsd 2, 0(4)
604 ; CHECK-PWR8-LABEL: dpConv2udw:
605 ; CHECK-PWR8: # %bb.0: # %entry
606 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
607 ; CHECK-PWR8-NEXT: xscvdpuxds 0, 0
608 ; CHECK-PWR8-NEXT: stxsdx 0, 0, 4
609 ; CHECK-PWR8-NEXT: blr
611 %0 = load double, ptr %a, align 8
612 %conv = fptoui double %0 to i64
613 store i64 %conv, ptr %b, align 8
619 ; Function Attrs: norecurse nounwind
620 define void @dpConv2uw(ptr nocapture readonly %a, ptr nocapture %b) {
621 ; CHECK-LABEL: dpConv2uw:
622 ; CHECK: # %bb.0: # %entry
623 ; CHECK-NEXT: lfd 0, 0(3)
624 ; CHECK-NEXT: xscvdpuxws 0, 0
625 ; CHECK-NEXT: stfiwx 0, 0, 4
628 ; CHECK-PWR8-LABEL: dpConv2uw:
629 ; CHECK-PWR8: # %bb.0: # %entry
630 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
631 ; CHECK-PWR8-NEXT: xscvdpuxws 0, 0
632 ; CHECK-PWR8-NEXT: stfiwx 0, 0, 4
633 ; CHECK-PWR8-NEXT: blr
635 %0 = load double, ptr %a, align 8
636 %conv = fptoui double %0 to i32
637 store i32 %conv, ptr %b, align 4
643 ; Function Attrs: norecurse nounwind
644 define void @dpConv2uhw(ptr nocapture readonly %a, ptr nocapture %b) {
645 ; CHECK-LABEL: dpConv2uhw:
646 ; CHECK: # %bb.0: # %entry
647 ; CHECK-NEXT: lfd 0, 0(3)
648 ; CHECK-NEXT: xscvdpuxws 0, 0
649 ; CHECK-NEXT: stxsihx 0, 0, 4
652 ; CHECK-PWR8-LABEL: dpConv2uhw:
653 ; CHECK-PWR8: # %bb.0: # %entry
654 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
655 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
656 ; CHECK-PWR8-NEXT: mffprwz 3, 0
657 ; CHECK-PWR8-NEXT: sth 3, 0(4)
658 ; CHECK-PWR8-NEXT: blr
660 %0 = load double, ptr %a, align 8
661 %conv = fptoui double %0 to i16
662 store i16 %conv, ptr %b, align 2
668 ; Function Attrs: norecurse nounwind
669 define void @dpConv2ub(ptr nocapture readonly %a, ptr nocapture %b) {
670 ; CHECK-LABEL: dpConv2ub:
671 ; CHECK: # %bb.0: # %entry
672 ; CHECK-NEXT: lfd 0, 0(3)
673 ; CHECK-NEXT: xscvdpuxws 0, 0
674 ; CHECK-NEXT: stxsibx 0, 0, 4
677 ; CHECK-PWR8-LABEL: dpConv2ub:
678 ; CHECK-PWR8: # %bb.0: # %entry
679 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
680 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
681 ; CHECK-PWR8-NEXT: mffprwz 3, 0
682 ; CHECK-PWR8-NEXT: stb 3, 0(4)
683 ; CHECK-PWR8-NEXT: blr
685 %0 = load double, ptr %a, align 8
686 %conv = fptoui double %0 to i8
687 store i8 %conv, ptr %b, align 1
693 ; Function Attrs: norecurse nounwind
694 define void @spConv2udw(ptr nocapture readonly %a, ptr nocapture %b) {
695 ; CHECK-LABEL: spConv2udw:
696 ; CHECK: # %bb.0: # %entry
697 ; CHECK-NEXT: lfs 0, 0(3)
698 ; CHECK-NEXT: xscvdpuxds 2, 0
699 ; CHECK-NEXT: stxsd 2, 0(4)
702 ; CHECK-PWR8-LABEL: spConv2udw:
703 ; CHECK-PWR8: # %bb.0: # %entry
704 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
705 ; CHECK-PWR8-NEXT: xscvdpuxds 0, 0
706 ; CHECK-PWR8-NEXT: stxsdx 0, 0, 4
707 ; CHECK-PWR8-NEXT: blr
709 %0 = load float, ptr %a, align 4
710 %conv = fptoui float %0 to i64
711 store i64 %conv, ptr %b, align 8
717 ; Function Attrs: norecurse nounwind
718 define void @spConv2uw(ptr nocapture readonly %a, ptr nocapture %b) {
719 ; CHECK-LABEL: spConv2uw:
720 ; CHECK: # %bb.0: # %entry
721 ; CHECK-NEXT: lfs 0, 0(3)
722 ; CHECK-NEXT: xscvdpuxws 0, 0
723 ; CHECK-NEXT: stfiwx 0, 0, 4
726 ; CHECK-PWR8-LABEL: spConv2uw:
727 ; CHECK-PWR8: # %bb.0: # %entry
728 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
729 ; CHECK-PWR8-NEXT: xscvdpuxws 0, 0
730 ; CHECK-PWR8-NEXT: stfiwx 0, 0, 4
731 ; CHECK-PWR8-NEXT: blr
733 %0 = load float, ptr %a, align 4
734 %conv = fptoui float %0 to i32
735 store i32 %conv, ptr %b, align 4
741 ; Function Attrs: norecurse nounwind
742 define void @spConv2uhw(ptr nocapture readonly %a, ptr nocapture %b) {
743 ; CHECK-LABEL: spConv2uhw:
744 ; CHECK: # %bb.0: # %entry
745 ; CHECK-NEXT: lfs 0, 0(3)
746 ; CHECK-NEXT: xscvdpuxws 0, 0
747 ; CHECK-NEXT: stxsihx 0, 0, 4
750 ; CHECK-PWR8-LABEL: spConv2uhw:
751 ; CHECK-PWR8: # %bb.0: # %entry
752 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
753 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
754 ; CHECK-PWR8-NEXT: mffprwz 3, 0
755 ; CHECK-PWR8-NEXT: sth 3, 0(4)
756 ; CHECK-PWR8-NEXT: blr
758 %0 = load float, ptr %a, align 4
759 %conv = fptoui float %0 to i16
760 store i16 %conv, ptr %b, align 2
766 ; Function Attrs: norecurse nounwind
767 define void @spConv2ub(ptr nocapture readonly %a, ptr nocapture %b) {
768 ; CHECK-LABEL: spConv2ub:
769 ; CHECK: # %bb.0: # %entry
770 ; CHECK-NEXT: lfs 0, 0(3)
771 ; CHECK-NEXT: xscvdpuxws 0, 0
772 ; CHECK-NEXT: stxsibx 0, 0, 4
775 ; CHECK-PWR8-LABEL: spConv2ub:
776 ; CHECK-PWR8: # %bb.0: # %entry
777 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
778 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
779 ; CHECK-PWR8-NEXT: mffprwz 3, 0
780 ; CHECK-PWR8-NEXT: stb 3, 0(4)
781 ; CHECK-PWR8-NEXT: blr
783 %0 = load float, ptr %a, align 4
784 %conv = fptoui float %0 to i8
785 store i8 %conv, ptr %b, align 1
791 ; Function Attrs: norecurse nounwind
792 define void @dpConv2udw_x(ptr nocapture readonly %a, ptr nocapture %b,
793 ; CHECK-LABEL: dpConv2udw_x:
794 ; CHECK: # %bb.0: # %entry
795 ; CHECK-NEXT: lfd 0, 0(3)
796 ; CHECK-NEXT: sldi 3, 5, 3
797 ; CHECK-NEXT: xscvdpuxds 0, 0
798 ; CHECK-NEXT: stxsdx 0, 4, 3
801 ; CHECK-PWR8-LABEL: dpConv2udw_x:
802 ; CHECK-PWR8: # %bb.0: # %entry
803 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
804 ; CHECK-PWR8-NEXT: sldi 3, 5, 3
805 ; CHECK-PWR8-NEXT: xscvdpuxds 0, 0
806 ; CHECK-PWR8-NEXT: stxsdx 0, 4, 3
807 ; CHECK-PWR8-NEXT: blr
810 %0 = load double, ptr %a, align 8
811 %conv = fptoui double %0 to i64
812 %idxprom = zext i32 %idx to i64
813 %arrayidx = getelementptr inbounds i64, ptr %b, i64 %idxprom
814 store i64 %conv, ptr %arrayidx, align 8
820 ; Function Attrs: norecurse nounwind
821 define void @dpConv2uw_x(ptr nocapture readonly %a, ptr nocapture %b,
822 ; CHECK-LABEL: dpConv2uw_x:
823 ; CHECK: # %bb.0: # %entry
824 ; CHECK-NEXT: lfd 0, 0(3)
825 ; CHECK-NEXT: sldi 3, 5, 2
826 ; CHECK-NEXT: xscvdpuxws 0, 0
827 ; CHECK-NEXT: stfiwx 0, 4, 3
830 ; CHECK-PWR8-LABEL: dpConv2uw_x:
831 ; CHECK-PWR8: # %bb.0: # %entry
832 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
833 ; CHECK-PWR8-NEXT: sldi 3, 5, 2
834 ; CHECK-PWR8-NEXT: xscvdpuxws 0, 0
835 ; CHECK-PWR8-NEXT: stfiwx 0, 4, 3
836 ; CHECK-PWR8-NEXT: blr
839 %0 = load double, ptr %a, align 8
840 %conv = fptoui double %0 to i32
841 %idxprom = zext i32 %idx to i64
842 %arrayidx = getelementptr inbounds i32, ptr %b, i64 %idxprom
843 store i32 %conv, ptr %arrayidx, align 4
849 ; Function Attrs: norecurse nounwind
850 define void @dpConv2uhw_x(ptr nocapture readonly %a, ptr nocapture %b,
851 ; CHECK-LABEL: dpConv2uhw_x:
852 ; CHECK: # %bb.0: # %entry
853 ; CHECK-NEXT: lfd 0, 0(3)
854 ; CHECK-NEXT: sldi 3, 5, 1
855 ; CHECK-NEXT: xscvdpuxws 0, 0
856 ; CHECK-NEXT: stxsihx 0, 4, 3
859 ; CHECK-PWR8-LABEL: dpConv2uhw_x:
860 ; CHECK-PWR8: # %bb.0: # %entry
861 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
862 ; CHECK-PWR8-NEXT: sldi 5, 5, 1
863 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
864 ; CHECK-PWR8-NEXT: mffprwz 3, 0
865 ; CHECK-PWR8-NEXT: sthx 3, 4, 5
866 ; CHECK-PWR8-NEXT: blr
869 %0 = load double, ptr %a, align 8
870 %conv = fptoui double %0 to i16
871 %idxprom = zext i32 %idx to i64
872 %arrayidx = getelementptr inbounds i16, ptr %b, i64 %idxprom
873 store i16 %conv, ptr %arrayidx, align 2
879 ; Function Attrs: norecurse nounwind
880 define void @dpConv2ub_x(ptr nocapture readonly %a, ptr nocapture %b,
881 ; CHECK-LABEL: dpConv2ub_x:
882 ; CHECK: # %bb.0: # %entry
883 ; CHECK-NEXT: lfd 0, 0(3)
884 ; CHECK-NEXT: xscvdpuxws 0, 0
885 ; CHECK-NEXT: stxsibx 0, 4, 5
888 ; CHECK-PWR8-LABEL: dpConv2ub_x:
889 ; CHECK-PWR8: # %bb.0: # %entry
890 ; CHECK-PWR8-NEXT: lfd 0, 0(3)
891 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
892 ; CHECK-PWR8-NEXT: mffprwz 3, 0
893 ; CHECK-PWR8-NEXT: stbx 3, 4, 5
894 ; CHECK-PWR8-NEXT: blr
897 %0 = load double, ptr %a, align 8
898 %conv = fptoui double %0 to i8
899 %idxprom = zext i32 %idx to i64
900 %arrayidx = getelementptr inbounds i8, ptr %b, i64 %idxprom
901 store i8 %conv, ptr %arrayidx, align 1
907 ; Function Attrs: norecurse nounwind
908 define void @spConv2udw_x(ptr nocapture readonly %a, ptr nocapture %b,
909 ; CHECK-LABEL: spConv2udw_x:
910 ; CHECK: # %bb.0: # %entry
911 ; CHECK-NEXT: lfs 0, 0(3)
912 ; CHECK-NEXT: xscvdpuxds 0, 0
913 ; CHECK-NEXT: sldi 5, 5, 3
914 ; CHECK-NEXT: stxsdx 0, 4, 5
917 ; CHECK-PWR8-LABEL: spConv2udw_x:
918 ; CHECK-PWR8: # %bb.0: # %entry
919 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
920 ; CHECK-PWR8-NEXT: sldi 3, 5, 3
921 ; CHECK-PWR8-NEXT: xscvdpuxds 0, 0
922 ; CHECK-PWR8-NEXT: stxsdx 0, 4, 3
923 ; CHECK-PWR8-NEXT: blr
926 %0 = load float, ptr %a, align 4
927 %conv = fptoui float %0 to i64
928 %idxprom = zext i32 %idx to i64
929 %arrayidx = getelementptr inbounds i64, ptr %b, i64 %idxprom
930 store i64 %conv, ptr %arrayidx, align 8
936 ; Function Attrs: norecurse nounwind
937 define void @spConv2uw_x(ptr nocapture readonly %a, ptr nocapture %b,
938 ; CHECK-LABEL: spConv2uw_x:
939 ; CHECK: # %bb.0: # %entry
940 ; CHECK-NEXT: lfs 0, 0(3)
941 ; CHECK-NEXT: xscvdpuxws 0, 0
942 ; CHECK-NEXT: sldi 5, 5, 2
943 ; CHECK-NEXT: stfiwx 0, 4, 5
946 ; CHECK-PWR8-LABEL: spConv2uw_x:
947 ; CHECK-PWR8: # %bb.0: # %entry
948 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
949 ; CHECK-PWR8-NEXT: sldi 3, 5, 2
950 ; CHECK-PWR8-NEXT: xscvdpuxws 0, 0
951 ; CHECK-PWR8-NEXT: stfiwx 0, 4, 3
952 ; CHECK-PWR8-NEXT: blr
955 %0 = load float, ptr %a, align 4
956 %conv = fptoui float %0 to i32
957 %idxprom = zext i32 %idx to i64
958 %arrayidx = getelementptr inbounds i32, ptr %b, i64 %idxprom
959 store i32 %conv, ptr %arrayidx, align 4
965 ; Function Attrs: norecurse nounwind
966 define void @spConv2uhw_x(ptr nocapture readonly %a, ptr nocapture %b,
967 ; CHECK-LABEL: spConv2uhw_x:
968 ; CHECK: # %bb.0: # %entry
969 ; CHECK-NEXT: lfs 0, 0(3)
970 ; CHECK-NEXT: xscvdpuxws 0, 0
971 ; CHECK-NEXT: sldi 5, 5, 1
972 ; CHECK-NEXT: stxsihx 0, 4, 5
975 ; CHECK-PWR8-LABEL: spConv2uhw_x:
976 ; CHECK-PWR8: # %bb.0: # %entry
977 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
978 ; CHECK-PWR8-NEXT: sldi 5, 5, 1
979 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
980 ; CHECK-PWR8-NEXT: mffprwz 3, 0
981 ; CHECK-PWR8-NEXT: sthx 3, 4, 5
982 ; CHECK-PWR8-NEXT: blr
985 %0 = load float, ptr %a, align 4
986 %conv = fptoui float %0 to i16
987 %idxprom = zext i32 %idx to i64
988 %arrayidx = getelementptr inbounds i16, ptr %b, i64 %idxprom
989 store i16 %conv, ptr %arrayidx, align 2
995 ; Function Attrs: norecurse nounwind
996 define void @spConv2ub_x(ptr nocapture readonly %a, ptr nocapture %b,
997 ; CHECK-LABEL: spConv2ub_x:
998 ; CHECK: # %bb.0: # %entry
999 ; CHECK-NEXT: lfs 0, 0(3)
1000 ; CHECK-NEXT: xscvdpuxws 0, 0
1001 ; CHECK-NEXT: stxsibx 0, 4, 5
1004 ; CHECK-PWR8-LABEL: spConv2ub_x:
1005 ; CHECK-PWR8: # %bb.0: # %entry
1006 ; CHECK-PWR8-NEXT: lfs 0, 0(3)
1007 ; CHECK-PWR8-NEXT: xscvdpsxws 0, 0
1008 ; CHECK-PWR8-NEXT: mffprwz 3, 0
1009 ; CHECK-PWR8-NEXT: stbx 3, 4, 5
1010 ; CHECK-PWR8-NEXT: blr
1013 %0 = load float, ptr %a, align 4
1014 %conv = fptoui float %0 to i8
1015 %idxprom = zext i32 %idx to i64
1016 %arrayidx = getelementptr inbounds i8, ptr %b, i64 %idxprom
1017 store i8 %conv, ptr %arrayidx, align 1