blob: 2b9d51924d300662a3e5b8b823dfc8bc4132bfc4 [file] [log] [blame]
Inna Palantff3f07a2019-07-11 16:15:26 -07001# 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
Chih-Hung Hsieh43f06942019-12-19 15:01:08 -08007 define i8 @const_s8() { ret i8 42 }
8 define i16 @const_s16() { ret i16 42 }
Inna Palantff3f07a2019-07-11 16:15:26 -07009 define i32 @const_s32() { ret i32 42 }
10 define i64 @const_s64() { ret i64 1234567890123 }
11
12 define i32 @fconst_s32() { ret i32 42 }
13 define i64 @fconst_s64() { ret i64 1234567890123 }
14 define float @fconst_s32_0() { ret float 0.0 }
15 define double @fconst_s64_0() { ret double 0.0 }
16...
17
18---
Chih-Hung Hsieh43f06942019-12-19 15:01:08 -080019name: const_s8
20legalized: true
21regBankSelected: true
22body: |
23 bb.0:
24 ; CHECK-LABEL: name: const_s8
25 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42
26 ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY [[MOVi32imm]]
27 ; CHECK: $w0 = COPY [[COPY]]
28 %0:gpr(s8) = G_CONSTANT i8 42
29 %1:gpr(s32) = G_ANYEXT %0(s8)
30 $w0 = COPY %1(s32)
31...
32
33---
34name: const_s16
35legalized: true
36regBankSelected: true
37body: |
38 bb.0:
39 ; CHECK-LABEL: name: const_s16
40 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42
41 ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY [[MOVi32imm]]
42 ; CHECK: $w0 = COPY [[COPY]]
43 %0:gpr(s16) = G_CONSTANT i16 42
44 %1:gpr(s32) = G_ANYEXT %0(s16)
45 $w0 = COPY %1(s32)
46...
47
48---
Inna Palantff3f07a2019-07-11 16:15:26 -070049name: const_s32
50legalized: true
51regBankSelected: true
52registers:
53 - { id: 0, class: gpr }
54
55body: |
56 bb.0:
57 ; CHECK-LABEL: name: const_s32
58 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42
59 ; CHECK: $w0 = COPY [[MOVi32imm]]
60 %0(s32) = G_CONSTANT i32 42
61 $w0 = COPY %0(s32)
62...
63
64---
65name: const_s64
66legalized: true
67regBankSelected: true
68registers:
69 - { id: 0, class: gpr }
70
71body: |
72 bb.0:
73 ; CHECK-LABEL: name: const_s64
74 ; CHECK: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm 1234567890123
75 ; CHECK: $x0 = COPY [[MOVi64imm]]
76 %0(s64) = G_CONSTANT i64 1234567890123
77 $x0 = COPY %0(s64)
78...
79
80---
81name: fconst_s32
82legalized: true
83regBankSelected: true
84registers:
85 - { id: 0, class: fpr }
86
87body: |
88 bb.0:
89 ; CHECK-LABEL: name: fconst_s32
Chih-Hung Hsieh43f06942019-12-19 15:01:08 -080090 ; CHECK: [[FMOVSi:%[0-9]+]]:fpr32 = FMOVSi 12
91 ; CHECK: $s0 = COPY [[FMOVSi]]
Inna Palantff3f07a2019-07-11 16:15:26 -070092 %0(s32) = G_FCONSTANT float 3.5
93 $s0 = COPY %0(s32)
94...
95
96---
97name: fconst_s64
98legalized: true
99regBankSelected: true
100registers:
101 - { id: 0, class: fpr }
102
103body: |
104 bb.0:
105 ; CHECK-LABEL: name: fconst_s64
Chih-Hung Hsieh43f06942019-12-19 15:01:08 -0800106 ; CHECK: [[FMOVDi:%[0-9]+]]:fpr64 = FMOVDi 112
107 ; CHECK: $d0 = COPY [[FMOVDi]]
Inna Palantff3f07a2019-07-11 16:15:26 -0700108 %0(s64) = G_FCONSTANT double 1.0
109 $d0 = COPY %0(s64)
110...
111
112---
113name: fconst_s32_0
114legalized: true
115regBankSelected: true
116registers:
117 - { id: 0, class: fpr }
118
119body: |
120 bb.0:
121 ; CHECK-LABEL: name: fconst_s32_0
122 ; CHECK: [[FMOVS0_:%[0-9]+]]:fpr32 = FMOVS0
123 ; CHECK: $s0 = COPY [[FMOVS0_]]
124 %0(s32) = G_FCONSTANT float 0.0
125 $s0 = COPY %0(s32)
126...
127
128---
129name: fconst_s64_0
130legalized: true
131regBankSelected: true
132registers:
133 - { id: 0, class: fpr }
134
135body: |
136 bb.0:
137 ; CHECK-LABEL: name: fconst_s64_0
138 ; CHECK: [[FMOVD0_:%[0-9]+]]:fpr64 = FMOVD0
139 ; CHECK: $x0 = COPY [[FMOVD0_]]
140 %0(s64) = G_FCONSTANT double 0.0
141 $x0 = COPY %0(s64)
142...