1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc -mtriple=aarch64 -global-isel -global-isel-abort=2 -verify-machineinstrs %s -o - 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 define i8 @xtn_i16_to_i8(i16 %a) {
6 ; CHECK-LABEL: xtn_i16_to_i8:
7 ; CHECK: // %bb.0: // %entry
10 %arg1 = trunc i16 %a to i8
14 define i8 @xtn_i32_to_i8(i32 %a) {
15 ; CHECK-LABEL: xtn_i32_to_i8:
16 ; CHECK: // %bb.0: // %entry
19 %arg1 = trunc i32 %a to i8
23 define i8 @xtn_i64_to_i8(i64 %a) {
24 ; CHECK-LABEL: xtn_i64_to_i8:
25 ; CHECK: // %bb.0: // %entry
26 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
29 %arg1 = trunc i64 %a to i8
33 define i8 @xtn_i128_to_i8(i128 %a) {
34 ; CHECK-LABEL: xtn_i128_to_i8:
35 ; CHECK: // %bb.0: // %entry
36 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
39 %arg1 = trunc i128 %a to i8
43 define i16 @xtn_i32_to_i16(i32 %a) {
44 ; CHECK-LABEL: xtn_i32_to_i16:
45 ; CHECK: // %bb.0: // %entry
48 %arg1 = trunc i32 %a to i16
52 define i16 @xtn_i64_to_i16(i64 %a) {
53 ; CHECK-LABEL: xtn_i64_to_i16:
54 ; CHECK: // %bb.0: // %entry
55 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
58 %arg1 = trunc i64 %a to i16
62 define i16 @xtn_i128_to_i16(i128 %a) {
63 ; CHECK-LABEL: xtn_i128_to_i16:
64 ; CHECK: // %bb.0: // %entry
65 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
68 %arg1 = trunc i128 %a to i16
72 define i32 @xtn_i64_to_i32(i64 %a) {
73 ; CHECK-LABEL: xtn_i64_to_i32:
74 ; CHECK: // %bb.0: // %entry
75 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
78 %arg1 = trunc i64 %a to i32
82 define i32 @xtn_i128_to_i32(i128 %a) {
83 ; CHECK-LABEL: xtn_i128_to_i32:
84 ; CHECK: // %bb.0: // %entry
85 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
88 %arg1 = trunc i128 %a to i32
92 define i64 @xtn_i128_to_i64(i128 %a) {
93 ; CHECK-LABEL: xtn_i128_to_i64:
94 ; CHECK: // %bb.0: // %entry
97 %arg1 = trunc i128 %a to i64
101 define <2 x i8> @xtn_v2i16_v2i8(<2 x i16> %a) {
102 ; CHECK-LABEL: xtn_v2i16_v2i8:
103 ; CHECK: // %bb.0: // %entry
106 %arg1 = trunc <2 x i16> %a to <2 x i8>
110 define <2 x i8> @xtn_v2i32_v2i8(<2 x i32> %a) {
111 ; CHECK-LABEL: xtn_v2i32_v2i8:
112 ; CHECK: // %bb.0: // %entry
115 %arg1 = trunc <2 x i32> %a to <2 x i8>
119 define <2 x i8> @xtn_v2i64_v2i8(<2 x i64> %a) {
120 ; CHECK-LABEL: xtn_v2i64_v2i8:
121 ; CHECK: // %bb.0: // %entry
122 ; CHECK-NEXT: xtn v0.2s, v0.2d
125 %arg1 = trunc <2 x i64> %a to <2 x i8>
129 define <2 x i8> @xtn_v2i128_v2i8(<2 x i128> %a) {
130 ; CHECK-SD-LABEL: xtn_v2i128_v2i8:
131 ; CHECK-SD: // %bb.0: // %entry
132 ; CHECK-SD-NEXT: fmov s0, w0
133 ; CHECK-SD-NEXT: mov v0.s[1], w2
134 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
137 ; CHECK-GI-LABEL: xtn_v2i128_v2i8:
138 ; CHECK-GI: // %bb.0: // %entry
139 ; CHECK-GI-NEXT: mov v0.s[0], w0
140 ; CHECK-GI-NEXT: mov v0.s[1], w2
141 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
144 %arg1 = trunc <2 x i128> %a to <2 x i8>
148 define <2 x i16> @xtn_v2i32_v2i16(<2 x i32> %a) {
149 ; CHECK-LABEL: xtn_v2i32_v2i16:
150 ; CHECK: // %bb.0: // %entry
153 %arg1 = trunc <2 x i32> %a to <2 x i16>
157 define <2 x i16> @xtn_v2i64_v2i16(<2 x i64> %a) {
158 ; CHECK-LABEL: xtn_v2i64_v2i16:
159 ; CHECK: // %bb.0: // %entry
160 ; CHECK-NEXT: xtn v0.2s, v0.2d
163 %arg1 = trunc <2 x i64> %a to <2 x i16>
167 define <2 x i16> @xtn_v2i128_v2i16(<2 x i128> %a) {
168 ; CHECK-SD-LABEL: xtn_v2i128_v2i16:
169 ; CHECK-SD: // %bb.0: // %entry
170 ; CHECK-SD-NEXT: fmov s0, w0
171 ; CHECK-SD-NEXT: mov v0.s[1], w2
172 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
175 ; CHECK-GI-LABEL: xtn_v2i128_v2i16:
176 ; CHECK-GI: // %bb.0: // %entry
177 ; CHECK-GI-NEXT: mov v0.s[0], w0
178 ; CHECK-GI-NEXT: mov v0.s[1], w2
179 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
182 %arg1 = trunc <2 x i128> %a to <2 x i16>
186 define <2 x i32> @xtn_v2i64_v2i32(<2 x i64> %a) {
187 ; CHECK-LABEL: xtn_v2i64_v2i32:
188 ; CHECK: // %bb.0: // %entry
189 ; CHECK-NEXT: xtn v0.2s, v0.2d
192 %arg1 = trunc <2 x i64> %a to <2 x i32>
196 define <2 x i32> @xtn_v2i128_v2i32(<2 x i128> %a) {
197 ; CHECK-SD-LABEL: xtn_v2i128_v2i32:
198 ; CHECK-SD: // %bb.0: // %entry
199 ; CHECK-SD-NEXT: fmov s0, w0
200 ; CHECK-SD-NEXT: mov v0.s[1], w2
201 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
204 ; CHECK-GI-LABEL: xtn_v2i128_v2i32:
205 ; CHECK-GI: // %bb.0: // %entry
206 ; CHECK-GI-NEXT: mov v0.s[0], w0
207 ; CHECK-GI-NEXT: mov v0.s[1], w2
208 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
211 %arg1 = trunc <2 x i128> %a to <2 x i32>
215 define <2 x i64> @xtn_v2i128_v2i64(<2 x i128> %a) {
216 ; CHECK-SD-LABEL: xtn_v2i128_v2i64:
217 ; CHECK-SD: // %bb.0: // %entry
218 ; CHECK-SD-NEXT: fmov d0, x0
219 ; CHECK-SD-NEXT: mov v0.d[1], x2
222 ; CHECK-GI-LABEL: xtn_v2i128_v2i64:
223 ; CHECK-GI: // %bb.0: // %entry
224 ; CHECK-GI-NEXT: mov v0.d[0], x0
225 ; CHECK-GI-NEXT: mov v0.d[1], x2
228 %arg1 = trunc <2 x i128> %a to <2 x i64>
232 define <3 x i8> @xtn_v3i16_v3i8(<3 x i16> %a) {
233 ; CHECK-LABEL: xtn_v3i16_v3i8:
234 ; CHECK: // %bb.0: // %entry
235 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
236 ; CHECK-NEXT: umov w0, v0.h[0]
237 ; CHECK-NEXT: umov w1, v0.h[1]
238 ; CHECK-NEXT: umov w2, v0.h[2]
241 %arg1 = trunc <3 x i16> %a to <3 x i8>
245 define <3 x i8> @xtn_v3i32_v3i8(<3 x i32> %a) {
246 ; CHECK-SD-LABEL: xtn_v3i32_v3i8:
247 ; CHECK-SD: // %bb.0: // %entry
248 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
249 ; CHECK-SD-NEXT: umov w0, v0.h[0]
250 ; CHECK-SD-NEXT: umov w1, v0.h[1]
251 ; CHECK-SD-NEXT: umov w2, v0.h[2]
254 ; CHECK-GI-LABEL: xtn_v3i32_v3i8:
255 ; CHECK-GI: // %bb.0: // %entry
256 ; CHECK-GI-NEXT: mov s1, v0.s[1]
257 ; CHECK-GI-NEXT: mov s2, v0.s[2]
258 ; CHECK-GI-NEXT: fmov w0, s0
259 ; CHECK-GI-NEXT: fmov w1, s1
260 ; CHECK-GI-NEXT: fmov w2, s2
263 %arg1 = trunc <3 x i32> %a to <3 x i8>
267 define <3 x i8> @xtn_v3i64_v3i8(<3 x i64> %a) {
268 ; CHECK-SD-LABEL: xtn_v3i64_v3i8:
269 ; CHECK-SD: // %bb.0: // %entry
270 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
271 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
272 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
273 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
274 ; CHECK-SD-NEXT: xtn v1.2s, v2.2d
275 ; CHECK-SD-NEXT: xtn v0.2s, v0.2d
276 ; CHECK-SD-NEXT: fmov w2, s1
277 ; CHECK-SD-NEXT: mov w1, v0.s[1]
278 ; CHECK-SD-NEXT: fmov w0, s0
281 ; CHECK-GI-LABEL: xtn_v3i64_v3i8:
282 ; CHECK-GI: // %bb.0: // %entry
283 ; CHECK-GI-NEXT: fmov x0, d0
284 ; CHECK-GI-NEXT: fmov x1, d1
285 ; CHECK-GI-NEXT: fmov x2, d2
286 ; CHECK-GI-NEXT: // kill: def $w0 killed $w0 killed $x0
287 ; CHECK-GI-NEXT: // kill: def $w1 killed $w1 killed $x1
288 ; CHECK-GI-NEXT: // kill: def $w2 killed $w2 killed $x2
291 %arg1 = trunc <3 x i64> %a to <3 x i8>
295 define <3 x i16> @xtn_v3i32_v3i16(<3 x i32> %a) {
296 ; CHECK-LABEL: xtn_v3i32_v3i16:
297 ; CHECK: // %bb.0: // %entry
298 ; CHECK-NEXT: xtn v0.4h, v0.4s
301 %arg1 = trunc <3 x i32> %a to <3 x i16>
305 define <3 x i16> @xtn_v3i64_v3i16(<3 x i64> %a) {
306 ; CHECK-SD-LABEL: xtn_v3i64_v3i16:
307 ; CHECK-SD: // %bb.0: // %entry
308 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
309 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
310 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
311 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
312 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v2.4s
313 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
316 ; CHECK-GI-LABEL: xtn_v3i64_v3i16:
317 ; CHECK-GI: // %bb.0: // %entry
318 ; CHECK-GI-NEXT: fmov x8, d0
319 ; CHECK-GI-NEXT: fmov x9, d1
320 ; CHECK-GI-NEXT: fmov s0, w8
321 ; CHECK-GI-NEXT: fmov x8, d2
322 ; CHECK-GI-NEXT: mov v0.h[1], w9
323 ; CHECK-GI-NEXT: mov v0.h[2], w8
324 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
327 %arg1 = trunc <3 x i64> %a to <3 x i16>
331 define <3 x i32> @xtn_v3i64_v3i32(<3 x i64> %a) {
332 ; CHECK-SD-LABEL: xtn_v3i64_v3i32:
333 ; CHECK-SD: // %bb.0: // %entry
334 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
335 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
336 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
337 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
338 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v2.4s
341 ; CHECK-GI-LABEL: xtn_v3i64_v3i32:
342 ; CHECK-GI: // %bb.0: // %entry
343 ; CHECK-GI-NEXT: fmov x8, d0
344 ; CHECK-GI-NEXT: mov v0.s[0], w8
345 ; CHECK-GI-NEXT: fmov x8, d1
346 ; CHECK-GI-NEXT: mov v0.s[1], w8
347 ; CHECK-GI-NEXT: fmov x8, d2
348 ; CHECK-GI-NEXT: mov v0.s[2], w8
351 %arg1 = trunc <3 x i64> %a to <3 x i32>
355 define <4 x i8> @xtn_v4i16_v4i8(<4 x i16> %a) {
356 ; CHECK-LABEL: xtn_v4i16_v4i8:
357 ; CHECK: // %bb.0: // %entry
360 %arg1 = trunc <4 x i16> %a to <4 x i8>
364 define <4 x i8> @xtn_v4i32_v4i8(<4 x i32> %a) {
365 ; CHECK-LABEL: xtn_v4i32_v4i8:
366 ; CHECK: // %bb.0: // %entry
367 ; CHECK-NEXT: xtn v0.4h, v0.4s
370 %arg1 = trunc <4 x i32> %a to <4 x i8>
374 define <4 x i8> @xtn_v4i64_v4i8(<4 x i64> %a) {
375 ; CHECK-LABEL: xtn_v4i64_v4i8:
376 ; CHECK: // %bb.0: // %entry
377 ; CHECK-NEXT: uzp1 v0.4s, v0.4s, v1.4s
378 ; CHECK-NEXT: xtn v0.4h, v0.4s
381 %arg1 = trunc <4 x i64> %a to <4 x i8>
385 define <4 x i16> @xtn_v4i32_v4i16(<4 x i32> %a) {
386 ; CHECK-LABEL: xtn_v4i32_v4i16:
387 ; CHECK: // %bb.0: // %entry
388 ; CHECK-NEXT: xtn v0.4h, v0.4s
391 %arg1 = trunc <4 x i32> %a to <4 x i16>
395 define <4 x i16> @xtn_v4i64_v4i16(<4 x i64> %a) {
396 ; CHECK-LABEL: xtn_v4i64_v4i16:
397 ; CHECK: // %bb.0: // %entry
398 ; CHECK-NEXT: uzp1 v0.4s, v0.4s, v1.4s
399 ; CHECK-NEXT: xtn v0.4h, v0.4s
402 %arg1 = trunc <4 x i64> %a to <4 x i16>
406 define <4 x i32> @xtn_v4i64_v4i32(<4 x i64> %a) {
407 ; CHECK-LABEL: xtn_v4i64_v4i32:
408 ; CHECK: // %bb.0: // %entry
409 ; CHECK-NEXT: uzp1 v0.4s, v0.4s, v1.4s
412 %arg1 = trunc <4 x i64> %a to <4 x i32>
416 define <8 x i8> @xtn_v8i16_v8i8(<8 x i16> %a) {
417 ; CHECK-LABEL: xtn_v8i16_v8i8:
418 ; CHECK: // %bb.0: // %entry
419 ; CHECK-NEXT: xtn v0.8b, v0.8h
422 %arg1 = trunc <8 x i16> %a to <8 x i8>
426 define <8 x i8> @xtn_v8i32_v8i8(<8 x i32> %a) {
427 ; CHECK-LABEL: xtn_v8i32_v8i8:
428 ; CHECK: // %bb.0: // %entry
429 ; CHECK-NEXT: uzp1 v0.8h, v0.8h, v1.8h
430 ; CHECK-NEXT: xtn v0.8b, v0.8h
433 %arg1 = trunc <8 x i32> %a to <8 x i8>
437 define <8 x i16> @xtn_v8i32_v8i16(<8 x i32> %a) {
438 ; CHECK-LABEL: xtn_v8i32_v8i16:
439 ; CHECK: // %bb.0: // %entry
440 ; CHECK-NEXT: uzp1 v0.8h, v0.8h, v1.8h
443 %arg1 = trunc <8 x i32> %a to <8 x i16>
447 define <16 x i8> @xtn_v16i16_v16i8(<16 x i16> %a) {
448 ; CHECK-LABEL: xtn_v16i16_v16i8:
449 ; CHECK: // %bb.0: // %entry
450 ; CHECK-NEXT: uzp1 v0.16b, v0.16b, v1.16b
453 %arg1 = trunc <16 x i16> %a to <16 x i8>