1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3
4--- |
5  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6
7  define void @fptrunc_s16_s32_fpr() { ret void }
8  define void @fptrunc_s16_s64_fpr() { ret void }
9  define void @fptrunc_s32_s64_fpr() { ret void }
10
11  define void @fpext_s32_s16_fpr() { ret void }
12  define void @fpext_s64_s16_fpr() { ret void }
13  define void @fpext_s64_s32_fpr() { ret void }
14
15  define void @sitofp_s32_s32_fpr() { ret void }
16  define void @sitofp_s32_s64_fpr() { ret void }
17  define void @sitofp_s64_s32_fpr() { ret void }
18  define void @sitofp_s64_s64_fpr() { ret void }
19
20  define void @uitofp_s32_s32_fpr() { ret void }
21  define void @uitofp_s32_s64_fpr() { ret void }
22  define void @uitofp_s64_s32_fpr() { ret void }
23  define void @uitofp_s64_s64_fpr() { ret void }
24
25  define void @fptosi_s32_s32_gpr() { ret void }
26  define void @fptosi_s32_s64_gpr() { ret void }
27  define void @fptosi_s64_s32_gpr() { ret void }
28  define void @fptosi_s64_s64_gpr() { ret void }
29
30  define void @fptoui_s32_s32_gpr() { ret void }
31  define void @fptoui_s32_s64_gpr() { ret void }
32  define void @fptoui_s64_s32_gpr() { ret void }
33  define void @fptoui_s64_s64_gpr() { ret void }
34...
35
36---
37name:            fptrunc_s16_s32_fpr
38legalized:       true
39regBankSelected: true
40
41registers:
42  - { id: 0, class: fpr }
43  - { id: 1, class: fpr }
44
45body:             |
46  bb.0:
47    liveins: $s0
48
49    ; CHECK-LABEL: name: fptrunc_s16_s32_fpr
50    ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
51    ; CHECK: [[FCVTHSr:%[0-9]+]]:fpr16 = FCVTHSr [[COPY]]
52    ; CHECK: $h0 = COPY [[FCVTHSr]]
53    %0(s32) = COPY $s0
54    %1(s16) = G_FPTRUNC %0
55    $h0 = COPY %1(s16)
56...
57
58---
59name:            fptrunc_s16_s64_fpr
60legalized:       true
61regBankSelected: true
62
63registers:
64  - { id: 0, class: fpr }
65  - { id: 1, class: fpr }
66
67body:             |
68  bb.0:
69    liveins: $d0
70
71    ; CHECK-LABEL: name: fptrunc_s16_s64_fpr
72    ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
73    ; CHECK: [[FCVTHDr:%[0-9]+]]:fpr16 = FCVTHDr [[COPY]]
74    ; CHECK: $h0 = COPY [[FCVTHDr]]
75    %0(s64) = COPY $d0
76    %1(s16) = G_FPTRUNC %0
77    $h0 = COPY %1(s16)
78...
79
80---
81name:            fptrunc_s32_s64_fpr
82legalized:       true
83regBankSelected: true
84
85registers:
86  - { id: 0, class: fpr }
87  - { id: 1, class: fpr }
88
89body:             |
90  bb.0:
91    liveins: $d0
92
93    ; CHECK-LABEL: name: fptrunc_s32_s64_fpr
94    ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
95    ; CHECK: [[FCVTSDr:%[0-9]+]]:fpr32 = FCVTSDr [[COPY]]
96    ; CHECK: $s0 = COPY [[FCVTSDr]]
97    %0(s64) = COPY $d0
98    %1(s32) = G_FPTRUNC %0
99    $s0 = COPY %1(s32)
100...
101
102---
103name:            fpext_s32_s16_fpr
104legalized:       true
105regBankSelected: true
106
107registers:
108  - { id: 0, class: fpr }
109  - { id: 1, class: fpr }
110
111body:             |
112  bb.0:
113    liveins: $h0
114
115    ; CHECK-LABEL: name: fpext_s32_s16_fpr
116    ; CHECK: [[COPY:%[0-9]+]]:fpr16 = COPY $h0
117    ; CHECK: [[FCVTSHr:%[0-9]+]]:fpr32 = FCVTSHr [[COPY]]
118    ; CHECK: $s0 = COPY [[FCVTSHr]]
119    %0(s16) = COPY $h0
120    %1(s32) = G_FPEXT %0
121    $s0 = COPY %1(s32)
122...
123
124---
125name:            fpext_s64_s16_fpr
126legalized:       true
127regBankSelected: true
128
129registers:
130  - { id: 0, class: fpr }
131  - { id: 1, class: fpr }
132
133body:             |
134  bb.0:
135    liveins: $h0
136
137    ; CHECK-LABEL: name: fpext_s64_s16_fpr
138    ; CHECK: [[COPY:%[0-9]+]]:fpr16 = COPY $h0
139    ; CHECK: [[FCVTDHr:%[0-9]+]]:fpr64 = FCVTDHr [[COPY]]
140    ; CHECK: $d0 = COPY [[FCVTDHr]]
141    %0(s16) = COPY $h0
142    %1(s64) = G_FPEXT %0
143    $d0 = COPY %1(s64)
144...
145
146---
147name:            fpext_s64_s32_fpr
148legalized:       true
149regBankSelected: true
150
151registers:
152  - { id: 0, class: fpr }
153  - { id: 1, class: fpr }
154
155body:             |
156  bb.0:
157    liveins: $d0
158
159    ; CHECK-LABEL: name: fpext_s64_s32_fpr
160    ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
161    ; CHECK: [[FCVTDSr:%[0-9]+]]:fpr64 = FCVTDSr [[COPY]]
162    ; CHECK: $d0 = COPY [[FCVTDSr]]
163    %0(s32) = COPY $s0
164    %1(s64) = G_FPEXT %0
165    $d0 = COPY %1(s64)
166...
167
168---
169name:            sitofp_s32_s32_fpr
170legalized:       true
171regBankSelected: true
172
173registers:
174  - { id: 0, class: gpr }
175  - { id: 1, class: fpr }
176
177body:             |
178  bb.0:
179    liveins: $w0
180
181    ; CHECK-LABEL: name: sitofp_s32_s32_fpr
182    ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
183    ; CHECK: [[SCVTFUWSri:%[0-9]+]]:fpr32 = SCVTFUWSri [[COPY]]
184    ; CHECK: $s0 = COPY [[SCVTFUWSri]]
185    %0(s32) = COPY $w0
186    %1(s32) = G_SITOFP %0
187    $s0 = COPY %1(s32)
188...
189
190---
191name:            sitofp_s32_s64_fpr
192legalized:       true
193regBankSelected: true
194
195registers:
196  - { id: 0, class: gpr }
197  - { id: 1, class: fpr }
198
199body:             |
200  bb.0:
201    liveins: $x0
202
203    ; CHECK-LABEL: name: sitofp_s32_s64_fpr
204    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
205    ; CHECK: [[SCVTFUXSri:%[0-9]+]]:fpr32 = SCVTFUXSri [[COPY]]
206    ; CHECK: $s0 = COPY [[SCVTFUXSri]]
207    %0(s64) = COPY $x0
208    %1(s32) = G_SITOFP %0
209    $s0 = COPY %1(s32)
210...
211
212---
213name:            sitofp_s64_s32_fpr
214legalized:       true
215regBankSelected: true
216
217registers:
218  - { id: 0, class: gpr }
219  - { id: 1, class: fpr }
220
221body:             |
222  bb.0:
223    liveins: $w0
224
225    ; CHECK-LABEL: name: sitofp_s64_s32_fpr
226    ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
227    ; CHECK: [[SCVTFUWDri:%[0-9]+]]:fpr64 = SCVTFUWDri [[COPY]]
228    ; CHECK: $d0 = COPY [[SCVTFUWDri]]
229    %0(s32) = COPY $w0
230    %1(s64) = G_SITOFP %0
231    $d0 = COPY %1(s64)
232...
233
234---
235name:            sitofp_s64_s64_fpr
236legalized:       true
237regBankSelected: true
238
239registers:
240  - { id: 0, class: gpr }
241  - { id: 1, class: fpr }
242
243body:             |
244  bb.0:
245    liveins: $x0
246
247    ; CHECK-LABEL: name: sitofp_s64_s64_fpr
248    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
249    ; CHECK: [[SCVTFUXDri:%[0-9]+]]:fpr64 = SCVTFUXDri [[COPY]]
250    ; CHECK: $d0 = COPY [[SCVTFUXDri]]
251    %0(s64) = COPY $x0
252    %1(s64) = G_SITOFP %0
253    $d0 = COPY %1(s64)
254...
255
256---
257name:            uitofp_s32_s32_fpr
258legalized:       true
259regBankSelected: true
260
261registers:
262  - { id: 0, class: gpr }
263  - { id: 1, class: fpr }
264
265body:             |
266  bb.0:
267    liveins: $w0
268
269    ; CHECK-LABEL: name: uitofp_s32_s32_fpr
270    ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
271    ; CHECK: [[UCVTFUWSri:%[0-9]+]]:fpr32 = UCVTFUWSri [[COPY]]
272    ; CHECK: $s0 = COPY [[UCVTFUWSri]]
273    %0(s32) = COPY $w0
274    %1(s32) = G_UITOFP %0
275    $s0 = COPY %1(s32)
276...
277
278---
279name:            uitofp_s32_s64_fpr
280legalized:       true
281regBankSelected: true
282
283registers:
284  - { id: 0, class: gpr }
285  - { id: 1, class: fpr }
286
287body:             |
288  bb.0:
289    liveins: $x0
290
291    ; CHECK-LABEL: name: uitofp_s32_s64_fpr
292    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
293    ; CHECK: [[UCVTFUXSri:%[0-9]+]]:fpr32 = UCVTFUXSri [[COPY]]
294    ; CHECK: $s0 = COPY [[UCVTFUXSri]]
295    %0(s64) = COPY $x0
296    %1(s32) = G_UITOFP %0
297    $s0 = COPY %1(s32)
298...
299
300---
301name:            uitofp_s64_s32_fpr
302legalized:       true
303regBankSelected: true
304
305registers:
306  - { id: 0, class: gpr }
307  - { id: 1, class: fpr }
308
309body:             |
310  bb.0:
311    liveins: $w0
312
313    ; CHECK-LABEL: name: uitofp_s64_s32_fpr
314    ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
315    ; CHECK: [[UCVTFUWDri:%[0-9]+]]:fpr64 = UCVTFUWDri [[COPY]]
316    ; CHECK: $d0 = COPY [[UCVTFUWDri]]
317    %0(s32) = COPY $w0
318    %1(s64) = G_UITOFP %0
319    $d0 = COPY %1(s64)
320...
321
322---
323name:            uitofp_s64_s64_fpr
324legalized:       true
325regBankSelected: true
326
327registers:
328  - { id: 0, class: gpr }
329  - { id: 1, class: fpr }
330
331body:             |
332  bb.0:
333    liveins: $x0
334
335    ; CHECK-LABEL: name: uitofp_s64_s64_fpr
336    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
337    ; CHECK: [[UCVTFUXDri:%[0-9]+]]:fpr64 = UCVTFUXDri [[COPY]]
338    ; CHECK: $d0 = COPY [[UCVTFUXDri]]
339    %0(s64) = COPY $x0
340    %1(s64) = G_UITOFP %0
341    $d0 = COPY %1(s64)
342...
343
344---
345name:            fptosi_s32_s32_gpr
346legalized:       true
347regBankSelected: true
348
349registers:
350  - { id: 0, class: fpr }
351  - { id: 1, class: gpr }
352
353body:             |
354  bb.0:
355    liveins: $s0
356
357    ; CHECK-LABEL: name: fptosi_s32_s32_gpr
358    ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
359    ; CHECK: [[FCVTZSUWSr:%[0-9]+]]:gpr32 = FCVTZSUWSr [[COPY]]
360    ; CHECK: $w0 = COPY [[FCVTZSUWSr]]
361    %0(s32) = COPY $s0
362    %1(s32) = G_FPTOSI %0
363    $w0 = COPY %1(s32)
364...
365
366---
367name:            fptosi_s32_s64_gpr
368legalized:       true
369regBankSelected: true
370
371registers:
372  - { id: 0, class: fpr }
373  - { id: 1, class: gpr }
374
375body:             |
376  bb.0:
377    liveins: $d0
378
379    ; CHECK-LABEL: name: fptosi_s32_s64_gpr
380    ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
381    ; CHECK: [[FCVTZSUWDr:%[0-9]+]]:gpr32 = FCVTZSUWDr [[COPY]]
382    ; CHECK: $w0 = COPY [[FCVTZSUWDr]]
383    %0(s64) = COPY $d0
384    %1(s32) = G_FPTOSI %0
385    $w0 = COPY %1(s32)
386...
387
388---
389name:            fptosi_s64_s32_gpr
390legalized:       true
391regBankSelected: true
392
393registers:
394  - { id: 0, class: fpr }
395  - { id: 1, class: gpr }
396
397body:             |
398  bb.0:
399    liveins: $s0
400
401    ; CHECK-LABEL: name: fptosi_s64_s32_gpr
402    ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
403    ; CHECK: [[FCVTZSUXSr:%[0-9]+]]:gpr64 = FCVTZSUXSr [[COPY]]
404    ; CHECK: $x0 = COPY [[FCVTZSUXSr]]
405    %0(s32) = COPY $s0
406    %1(s64) = G_FPTOSI %0
407    $x0 = COPY %1(s64)
408...
409
410---
411name:            fptosi_s64_s64_gpr
412legalized:       true
413regBankSelected: true
414
415registers:
416  - { id: 0, class: fpr }
417  - { id: 1, class: gpr }
418
419body:             |
420  bb.0:
421    liveins: $d0
422
423    ; CHECK-LABEL: name: fptosi_s64_s64_gpr
424    ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
425    ; CHECK: [[FCVTZSUXDr:%[0-9]+]]:gpr64 = FCVTZSUXDr [[COPY]]
426    ; CHECK: $x0 = COPY [[FCVTZSUXDr]]
427    %0(s64) = COPY $d0
428    %1(s64) = G_FPTOSI %0
429    $x0 = COPY %1(s64)
430...
431
432---
433name:            fptoui_s32_s32_gpr
434legalized:       true
435regBankSelected: true
436
437registers:
438  - { id: 0, class: fpr }
439  - { id: 1, class: gpr }
440
441body:             |
442  bb.0:
443    liveins: $s0
444
445    ; CHECK-LABEL: name: fptoui_s32_s32_gpr
446    ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
447    ; CHECK: [[FCVTZUUWSr:%[0-9]+]]:gpr32 = FCVTZUUWSr [[COPY]]
448    ; CHECK: $w0 = COPY [[FCVTZUUWSr]]
449    %0(s32) = COPY $s0
450    %1(s32) = G_FPTOUI %0
451    $w0 = COPY %1(s32)
452...
453
454---
455name:            fptoui_s32_s64_gpr
456legalized:       true
457regBankSelected: true
458
459registers:
460  - { id: 0, class: fpr }
461  - { id: 1, class: gpr }
462
463body:             |
464  bb.0:
465    liveins: $d0
466
467    ; CHECK-LABEL: name: fptoui_s32_s64_gpr
468    ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
469    ; CHECK: [[FCVTZUUWDr:%[0-9]+]]:gpr32 = FCVTZUUWDr [[COPY]]
470    ; CHECK: $w0 = COPY [[FCVTZUUWDr]]
471    %0(s64) = COPY $d0
472    %1(s32) = G_FPTOUI %0
473    $w0 = COPY %1(s32)
474...
475
476---
477name:            fptoui_s64_s32_gpr
478legalized:       true
479regBankSelected: true
480
481registers:
482  - { id: 0, class: fpr }
483  - { id: 1, class: gpr }
484
485body:             |
486  bb.0:
487    liveins: $s0
488
489    ; CHECK-LABEL: name: fptoui_s64_s32_gpr
490    ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
491    ; CHECK: [[FCVTZUUXSr:%[0-9]+]]:gpr64 = FCVTZUUXSr [[COPY]]
492    ; CHECK: $x0 = COPY [[FCVTZUUXSr]]
493    %0(s32) = COPY $s0
494    %1(s64) = G_FPTOUI %0
495    $x0 = COPY %1(s64)
496...
497
498---
499name:            fptoui_s64_s64_gpr
500legalized:       true
501regBankSelected: true
502
503registers:
504  - { id: 0, class: fpr }
505  - { id: 1, class: gpr }
506
507body:             |
508  bb.0:
509    liveins: $d0
510
511    ; CHECK-LABEL: name: fptoui_s64_s64_gpr
512    ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
513    ; CHECK: [[FCVTZUUXDr:%[0-9]+]]:gpr64 = FCVTZUUXDr [[COPY]]
514    ; CHECK: $x0 = COPY [[FCVTZUUXDr]]
515    %0(s64) = COPY $d0
516    %1(s64) = G_FPTOUI %0
517    $x0 = COPY %1(s64)
518...
519