1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
3 # RUN:llc %s -verify-machineinstrs -mtriple=aarch64-unknown-unknown -run-pass=legalizer -mattr=-fullfp16 -o - | FileCheck %s --check-prefix=NO-FP16
4 # RUN:llc %s -verify-machineinstrs -mtriple=aarch64-unknown-unknown -run-pass=legalizer -mattr=+fullfp16 -o - | FileCheck %s --check-prefix=FP16
8 name: test_f16.roundeven
10 tracksRegLiveness: true
11 machineFunctionInfo: {}
16 ; NO-FP16-LABEL: name: test_f16.roundeven
17 ; NO-FP16: liveins: $h0
18 ; NO-FP16-NEXT: {{ $}}
19 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
20 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[COPY]](s16)
21 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(s32) = G_INTRINSIC_ROUNDEVEN [[FPEXT]]
22 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[INTRINSIC_ROUNDEVEN]](s32)
23 ; NO-FP16-NEXT: $h0 = COPY [[FPTRUNC]](s16)
24 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
26 ; FP16-LABEL: name: test_f16.roundeven
29 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
30 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(s16) = G_INTRINSIC_ROUNDEVEN [[COPY]]
31 ; FP16-NEXT: $h0 = COPY [[INTRINSIC_ROUNDEVEN]](s16)
32 ; FP16-NEXT: RET_ReallyLR implicit $h0
34 %1:_(s16) = G_INTRINSIC_ROUNDEVEN %0
36 RET_ReallyLR implicit $h0
40 name: test_f32.roundeven
42 tracksRegLiveness: true
43 machineFunctionInfo: {}
48 ; NO-FP16-LABEL: name: test_f32.roundeven
49 ; NO-FP16: liveins: $s0
50 ; NO-FP16-NEXT: {{ $}}
51 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
52 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(s32) = G_INTRINSIC_ROUNDEVEN [[COPY]]
53 ; NO-FP16-NEXT: $s0 = COPY [[INTRINSIC_ROUNDEVEN]](s32)
54 ; NO-FP16-NEXT: RET_ReallyLR implicit $s0
56 ; FP16-LABEL: name: test_f32.roundeven
59 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
60 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(s32) = G_INTRINSIC_ROUNDEVEN [[COPY]]
61 ; FP16-NEXT: $s0 = COPY [[INTRINSIC_ROUNDEVEN]](s32)
62 ; FP16-NEXT: RET_ReallyLR implicit $s0
64 %1:_(s32) = G_INTRINSIC_ROUNDEVEN %0
66 RET_ReallyLR implicit $s0
70 name: test_f64.roundeven
72 tracksRegLiveness: true
73 machineFunctionInfo: {}
78 ; NO-FP16-LABEL: name: test_f64.roundeven
79 ; NO-FP16: liveins: $d0
80 ; NO-FP16-NEXT: {{ $}}
81 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
82 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(s64) = G_INTRINSIC_ROUNDEVEN [[COPY]]
83 ; NO-FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUNDEVEN]](s64)
84 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
86 ; FP16-LABEL: name: test_f64.roundeven
89 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
90 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(s64) = G_INTRINSIC_ROUNDEVEN [[COPY]]
91 ; FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUNDEVEN]](s64)
92 ; FP16-NEXT: RET_ReallyLR implicit $d0
94 %1:_(s64) = G_INTRINSIC_ROUNDEVEN %0
96 RET_ReallyLR implicit $d0
100 name: test_v8f16.roundeven
102 tracksRegLiveness: true
103 machineFunctionInfo: {}
108 ; NO-FP16-LABEL: name: test_v8f16.roundeven
109 ; NO-FP16: liveins: $q0
110 ; NO-FP16-NEXT: {{ $}}
111 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
112 ; NO-FP16-NEXT: [[UV:%[0-9]+]]:_(<4 x s16>), [[UV1:%[0-9]+]]:_(<4 x s16>) = G_UNMERGE_VALUES [[COPY]](<8 x s16>)
113 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[UV]](<4 x s16>)
114 ; NO-FP16-NEXT: [[FPEXT1:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[UV1]](<4 x s16>)
115 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUNDEVEN [[FPEXT]]
116 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN1:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUNDEVEN [[FPEXT1]]
117 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[INTRINSIC_ROUNDEVEN]](<4 x s32>)
118 ; NO-FP16-NEXT: [[FPTRUNC1:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[INTRINSIC_ROUNDEVEN1]](<4 x s32>)
119 ; NO-FP16-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[FPTRUNC]](<4 x s16>), [[FPTRUNC1]](<4 x s16>)
120 ; NO-FP16-NEXT: $q0 = COPY [[CONCAT_VECTORS]](<8 x s16>)
121 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
123 ; FP16-LABEL: name: test_v8f16.roundeven
126 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
127 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<8 x s16>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
128 ; FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUNDEVEN]](<8 x s16>)
129 ; FP16-NEXT: RET_ReallyLR implicit $q0
130 %0:_(<8 x s16>) = COPY $q0
131 %1:_(<8 x s16>) = G_INTRINSIC_ROUNDEVEN %0
132 $q0 = COPY %1(<8 x s16>)
133 RET_ReallyLR implicit $q0
137 name: test_v4f16.roundeven
139 tracksRegLiveness: true
141 - { id: 0, class: _ }
142 - { id: 1, class: _ }
143 machineFunctionInfo: {}
148 ; NO-FP16-LABEL: name: test_v4f16.roundeven
149 ; NO-FP16: liveins: $d0
150 ; NO-FP16-NEXT: {{ $}}
151 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
152 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[COPY]](<4 x s16>)
153 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUNDEVEN [[FPEXT]]
154 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[INTRINSIC_ROUNDEVEN]](<4 x s32>)
155 ; NO-FP16-NEXT: $d0 = COPY [[FPTRUNC]](<4 x s16>)
156 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
158 ; FP16-LABEL: name: test_v4f16.roundeven
161 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
162 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<4 x s16>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
163 ; FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUNDEVEN]](<4 x s16>)
164 ; FP16-NEXT: RET_ReallyLR implicit $d0
165 %0:_(<4 x s16>) = COPY $d0
166 %1:_(<4 x s16>) = G_INTRINSIC_ROUNDEVEN %0
167 $d0 = COPY %1(<4 x s16>)
168 RET_ReallyLR implicit $d0
172 name: test_v2f32.roundeven
174 tracksRegLiveness: true
176 - { id: 0, class: _ }
177 - { id: 1, class: _ }
178 machineFunctionInfo: {}
183 ; NO-FP16-LABEL: name: test_v2f32.roundeven
184 ; NO-FP16: liveins: $d0
185 ; NO-FP16-NEXT: {{ $}}
186 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
187 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<2 x s32>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
188 ; NO-FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUNDEVEN]](<2 x s32>)
189 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
191 ; FP16-LABEL: name: test_v2f32.roundeven
194 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
195 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<2 x s32>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
196 ; FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUNDEVEN]](<2 x s32>)
197 ; FP16-NEXT: RET_ReallyLR implicit $d0
198 %0:_(<2 x s32>) = COPY $d0
199 %1:_(<2 x s32>) = G_INTRINSIC_ROUNDEVEN %0
200 $d0 = COPY %1(<2 x s32>)
201 RET_ReallyLR implicit $d0
205 name: test_v4f32.roundeven
207 tracksRegLiveness: true
209 - { id: 0, class: _ }
210 - { id: 1, class: _ }
211 machineFunctionInfo: {}
216 ; NO-FP16-LABEL: name: test_v4f32.roundeven
217 ; NO-FP16: liveins: $q0
218 ; NO-FP16-NEXT: {{ $}}
219 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
220 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
221 ; NO-FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUNDEVEN]](<4 x s32>)
222 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
224 ; FP16-LABEL: name: test_v4f32.roundeven
227 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
228 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
229 ; FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUNDEVEN]](<4 x s32>)
230 ; FP16-NEXT: RET_ReallyLR implicit $q0
231 %0:_(<4 x s32>) = COPY $q0
232 %1:_(<4 x s32>) = G_INTRINSIC_ROUNDEVEN %0
233 $q0 = COPY %1(<4 x s32>)
234 RET_ReallyLR implicit $q0
238 name: test_v2f64.roundeven
240 tracksRegLiveness: true
242 - { id: 0, class: _ }
243 - { id: 1, class: _ }
244 machineFunctionInfo: {}
249 ; NO-FP16-LABEL: name: test_v2f64.roundeven
250 ; NO-FP16: liveins: $q0
251 ; NO-FP16-NEXT: {{ $}}
252 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
253 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<2 x s64>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
254 ; NO-FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUNDEVEN]](<2 x s64>)
255 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
257 ; FP16-LABEL: name: test_v2f64.roundeven
260 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
261 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<2 x s64>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
262 ; FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUNDEVEN]](<2 x s64>)
263 ; FP16-NEXT: RET_ReallyLR implicit $q0
264 %0:_(<2 x s64>) = COPY $q0
265 %1:_(<2 x s64>) = G_INTRINSIC_ROUNDEVEN %0
266 $q0 = COPY %1(<2 x s64>)
267 RET_ReallyLR implicit $q0
271 name: test_v4f64.roundeven
273 tracksRegLiveness: true
278 ; NO-FP16-LABEL: name: test_v4f64.roundeven
279 ; NO-FP16: liveins: $q0, $q1
280 ; NO-FP16-NEXT: {{ $}}
281 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
282 ; NO-FP16-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
283 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<2 x s64>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
284 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN1:%[0-9]+]]:_(<2 x s64>) = G_INTRINSIC_ROUNDEVEN [[COPY1]]
285 ; NO-FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUNDEVEN]](<2 x s64>)
286 ; NO-FP16-NEXT: $q1 = COPY [[INTRINSIC_ROUNDEVEN1]](<2 x s64>)
287 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
289 ; FP16-LABEL: name: test_v4f64.roundeven
290 ; FP16: liveins: $q0, $q1
292 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
293 ; FP16-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
294 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<2 x s64>) = G_INTRINSIC_ROUNDEVEN [[COPY]]
295 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN1:%[0-9]+]]:_(<2 x s64>) = G_INTRINSIC_ROUNDEVEN [[COPY1]]
296 ; FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUNDEVEN]](<2 x s64>)
297 ; FP16-NEXT: $q1 = COPY [[INTRINSIC_ROUNDEVEN1]](<2 x s64>)
298 ; FP16-NEXT: RET_ReallyLR implicit $q0
299 %0:_(<2 x s64>) = COPY $q0
300 %1:_(<2 x s64>) = COPY $q1
301 %2:_(<4 x s64>) = G_CONCAT_VECTORS %0, %1
302 %3:_(<4 x s64>) = G_INTRINSIC_ROUNDEVEN %2
303 %4:_(<2 x s64>), %5:_(<2 x s64>) = G_UNMERGE_VALUES %3
304 $q0 = COPY %4(<2 x s64>)
305 $q1 = COPY %5(<2 x s64>)
306 RET_ReallyLR implicit $q0
310 name: test_v2f16.roundeven
312 tracksRegLiveness: true
317 ; NO-FP16-LABEL: name: test_v2f16.roundeven
318 ; NO-FP16: liveins: $s0, $s1
319 ; NO-FP16-NEXT: {{ $}}
320 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
321 ; NO-FP16-NEXT: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[COPY]](<2 x s16>)
322 ; NO-FP16-NEXT: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
323 ; NO-FP16-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[UV]](s16), [[UV1]](s16), [[DEF]](s16), [[DEF]](s16)
324 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[BUILD_VECTOR]](<4 x s16>)
325 ; NO-FP16-NEXT: [[UV2:%[0-9]+]]:_(<2 x s32>), [[UV3:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[FPEXT]](<4 x s32>)
326 ; NO-FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<2 x s32>) = G_INTRINSIC_ROUNDEVEN [[UV2]]
327 ; NO-FP16-NEXT: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[INTRINSIC_ROUNDEVEN]](<2 x s32>)
328 ; NO-FP16-NEXT: [[DEF1:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
329 ; NO-FP16-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[UV4]](s32), [[UV5]](s32), [[DEF1]](s32), [[DEF1]](s32)
330 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[BUILD_VECTOR1]](<4 x s32>)
331 ; NO-FP16-NEXT: [[UV6:%[0-9]+]]:_(<2 x s16>), [[UV7:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[FPTRUNC]](<4 x s16>)
332 ; NO-FP16-NEXT: $s0 = COPY [[UV6]](<2 x s16>)
333 ; NO-FP16-NEXT: RET_ReallyLR implicit $s0
335 ; FP16-LABEL: name: test_v2f16.roundeven
336 ; FP16: liveins: $s0, $s1
338 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
339 ; FP16-NEXT: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[COPY]](<2 x s16>)
340 ; FP16-NEXT: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
341 ; FP16-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[UV]](s16), [[UV1]](s16), [[DEF]](s16), [[DEF]](s16)
342 ; FP16-NEXT: [[INTRINSIC_ROUNDEVEN:%[0-9]+]]:_(<4 x s16>) = G_INTRINSIC_ROUNDEVEN [[BUILD_VECTOR]]
343 ; FP16-NEXT: [[UV2:%[0-9]+]]:_(<2 x s16>), [[UV3:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[INTRINSIC_ROUNDEVEN]](<4 x s16>)
344 ; FP16-NEXT: $s0 = COPY [[UV2]](<2 x s16>)
345 ; FP16-NEXT: RET_ReallyLR implicit $s0
346 %0:_(<2 x s16>) = COPY $s0
347 %1:_(<2 x s16>) = G_INTRINSIC_ROUNDEVEN %0
348 $s0 = COPY %1(<2 x s16>)
349 RET_ReallyLR implicit $s0