1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -verify-machineinstrs -mtriple aarch64--- \
3 # RUN: -run-pass=legalizer -mattr=+fullfp16 -global-isel %s -o - \
9 tracksRegLiveness: true
13 ; CHECK-LABEL: name: test_v4f16.exp2
15 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
16 ; CHECK: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16), [[UV2:%[0-9]+]]:_(s16), [[UV3:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
17 ; CHECK: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[UV]](s16)
18 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
19 ; CHECK: $s0 = COPY [[FPEXT]](s32)
20 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
21 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s0
22 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
23 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY1]](s32)
24 ; CHECK: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[UV1]](s16)
25 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
26 ; CHECK: $s0 = COPY [[FPEXT1]](s32)
27 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
28 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $s0
29 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
30 ; CHECK: [[FPTRUNC1:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY2]](s32)
31 ; CHECK: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[UV2]](s16)
32 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
33 ; CHECK: $s0 = COPY [[FPEXT2]](s32)
34 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
35 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY $s0
36 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
37 ; CHECK: [[FPTRUNC2:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY3]](s32)
38 ; CHECK: [[FPEXT3:%[0-9]+]]:_(s32) = G_FPEXT [[UV3]](s16)
39 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
40 ; CHECK: $s0 = COPY [[FPEXT3]](s32)
41 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
42 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY $s0
43 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
44 ; CHECK: [[FPTRUNC3:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY4]](s32)
45 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[FPTRUNC]](s16), [[FPTRUNC1]](s16), [[FPTRUNC2]](s16), [[FPTRUNC3]](s16)
46 ; CHECK: $d0 = COPY [[BUILD_VECTOR]](<4 x s16>)
47 ; CHECK: RET_ReallyLR implicit $d0
48 %0:_(<4 x s16>) = COPY $d0
49 %1:_(<4 x s16>) = G_FEXP2 %0
50 $d0 = COPY %1(<4 x s16>)
51 RET_ReallyLR implicit $d0
57 tracksRegLiveness: true
61 ; CHECK-LABEL: name: test_v8f16.exp2
63 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
64 ; CHECK: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16), [[UV2:%[0-9]+]]:_(s16), [[UV3:%[0-9]+]]:_(s16), [[UV4:%[0-9]+]]:_(s16), [[UV5:%[0-9]+]]:_(s16), [[UV6:%[0-9]+]]:_(s16), [[UV7:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[COPY]](<8 x s16>)
65 ; CHECK: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[UV]](s16)
66 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
67 ; CHECK: $s0 = COPY [[FPEXT]](s32)
68 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
69 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s0
70 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
71 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY1]](s32)
72 ; CHECK: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[UV1]](s16)
73 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
74 ; CHECK: $s0 = COPY [[FPEXT1]](s32)
75 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
76 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $s0
77 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
78 ; CHECK: [[FPTRUNC1:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY2]](s32)
79 ; CHECK: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[UV2]](s16)
80 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
81 ; CHECK: $s0 = COPY [[FPEXT2]](s32)
82 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
83 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY $s0
84 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
85 ; CHECK: [[FPTRUNC2:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY3]](s32)
86 ; CHECK: [[FPEXT3:%[0-9]+]]:_(s32) = G_FPEXT [[UV3]](s16)
87 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
88 ; CHECK: $s0 = COPY [[FPEXT3]](s32)
89 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
90 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY $s0
91 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
92 ; CHECK: [[FPTRUNC3:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY4]](s32)
93 ; CHECK: [[FPEXT4:%[0-9]+]]:_(s32) = G_FPEXT [[UV4]](s16)
94 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
95 ; CHECK: $s0 = COPY [[FPEXT4]](s32)
96 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
97 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY $s0
98 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
99 ; CHECK: [[FPTRUNC4:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY5]](s32)
100 ; CHECK: [[FPEXT5:%[0-9]+]]:_(s32) = G_FPEXT [[UV5]](s16)
101 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
102 ; CHECK: $s0 = COPY [[FPEXT5]](s32)
103 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
104 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY $s0
105 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
106 ; CHECK: [[FPTRUNC5:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY6]](s32)
107 ; CHECK: [[FPEXT6:%[0-9]+]]:_(s32) = G_FPEXT [[UV6]](s16)
108 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
109 ; CHECK: $s0 = COPY [[FPEXT6]](s32)
110 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
111 ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY $s0
112 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
113 ; CHECK: [[FPTRUNC6:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY7]](s32)
114 ; CHECK: [[FPEXT7:%[0-9]+]]:_(s32) = G_FPEXT [[UV7]](s16)
115 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
116 ; CHECK: $s0 = COPY [[FPEXT7]](s32)
117 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
118 ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY $s0
119 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
120 ; CHECK: [[FPTRUNC7:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY8]](s32)
121 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s16>) = G_BUILD_VECTOR [[FPTRUNC]](s16), [[FPTRUNC1]](s16), [[FPTRUNC2]](s16), [[FPTRUNC3]](s16), [[FPTRUNC4]](s16), [[FPTRUNC5]](s16), [[FPTRUNC6]](s16), [[FPTRUNC7]](s16)
122 ; CHECK: $q0 = COPY [[BUILD_VECTOR]](<8 x s16>)
123 ; CHECK: RET_ReallyLR implicit $q0
124 %0:_(<8 x s16>) = COPY $q0
125 %1:_(<8 x s16>) = G_FEXP2 %0
126 $q0 = COPY %1(<8 x s16>)
127 RET_ReallyLR implicit $q0
131 name: test_v2f32.exp2
133 tracksRegLiveness: true
137 ; CHECK-LABEL: name: test_v2f32.exp2
138 ; CHECK: liveins: $d0
139 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
140 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
141 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
142 ; CHECK: $s0 = COPY [[UV]](s32)
143 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
144 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s0
145 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
146 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
147 ; CHECK: $s0 = COPY [[UV1]](s32)
148 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
149 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $s0
150 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
151 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[COPY1]](s32), [[COPY2]](s32)
152 ; CHECK: $d0 = COPY [[BUILD_VECTOR]](<2 x s32>)
153 ; CHECK: RET_ReallyLR implicit $d0
154 %0:_(<2 x s32>) = COPY $d0
155 %1:_(<2 x s32>) = G_FEXP2 %0
156 $d0 = COPY %1(<2 x s32>)
157 RET_ReallyLR implicit $d0
161 name: test_v4f32.exp2
163 tracksRegLiveness: true
167 ; CHECK-LABEL: name: test_v4f32.exp2
168 ; CHECK: liveins: $q0
169 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
170 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
171 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
172 ; CHECK: $s0 = COPY [[UV]](s32)
173 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
174 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s0
175 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
176 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
177 ; CHECK: $s0 = COPY [[UV1]](s32)
178 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
179 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $s0
180 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
181 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
182 ; CHECK: $s0 = COPY [[UV2]](s32)
183 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
184 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY $s0
185 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
186 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
187 ; CHECK: $s0 = COPY [[UV3]](s32)
188 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
189 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY $s0
190 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
191 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32), [[COPY4]](s32)
192 ; CHECK: $q0 = COPY [[BUILD_VECTOR]](<4 x s32>)
193 ; CHECK: RET_ReallyLR implicit $q0
194 %0:_(<4 x s32>) = COPY $q0
195 %1:_(<4 x s32>) = G_FEXP2 %0
196 $q0 = COPY %1(<4 x s32>)
197 RET_ReallyLR implicit $q0
201 name: test_v2f64.exp2
203 tracksRegLiveness: true
207 ; CHECK-LABEL: name: test_v2f64.exp2
208 ; CHECK: liveins: $q0
209 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
210 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
211 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
212 ; CHECK: $d0 = COPY [[UV]](s64)
213 ; CHECK: BL &exp2, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $d0, implicit-def $d0
214 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $d0
215 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
216 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
217 ; CHECK: $d0 = COPY [[UV1]](s64)
218 ; CHECK: BL &exp2, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $d0, implicit-def $d0
219 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $d0
220 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
221 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY1]](s64), [[COPY2]](s64)
222 ; CHECK: $q0 = COPY [[BUILD_VECTOR]](<2 x s64>)
223 ; CHECK: RET_ReallyLR implicit $q0
224 %0:_(<2 x s64>) = COPY $q0
225 %1:_(<2 x s64>) = G_FEXP2 %0
226 $q0 = COPY %1(<2 x s64>)
227 RET_ReallyLR implicit $q0
233 tracksRegLiveness: true
237 ; CHECK-LABEL: name: test_exp2_half
238 ; CHECK: liveins: $h0
239 ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
240 ; CHECK: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[COPY]](s16)
241 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
242 ; CHECK: $s0 = COPY [[FPEXT]](s32)
243 ; CHECK: BL &exp2f, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit-def $s0
244 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s0
245 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
246 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY1]](s32)
247 ; CHECK: $h0 = COPY [[FPTRUNC]](s16)
248 ; CHECK: RET_ReallyLR implicit $h0
250 %1:_(s16) = G_FEXP2 %0
252 RET_ReallyLR implicit $h0