1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
7 ; VECTOR_SPLICE (index)
10 define <16 x i8> @splice_v16i8_idx(<16 x i8> %a, <16 x i8> %b) #0 {
11 ; CHECK-LABEL: splice_v16i8_idx:
13 ; CHECK-NEXT: ext v0.16b, v0.16b, v1.16b, #1
15 %res = call <16 x i8> @llvm.vector.splice.v16i8(<16 x i8> %a, <16 x i8> %b, i32 1)
19 define <2 x double> @splice_v2f64_idx(<2 x double> %a, <2 x double> %b) #0 {
20 ; CHECK-LABEL: splice_v2f64_idx:
22 ; CHECK-NEXT: ext v0.16b, v0.16b, v1.16b, #8
24 %res = call <2 x double> @llvm.vector.splice.v2f64(<2 x double> %a, <2 x double> %b, i32 1)
28 ; Verify promote type legalisation works as expected.
29 define <2 x i8> @splice_v2i8_idx(<2 x i8> %a, <2 x i8> %b) #0 {
30 ; CHECK-LABEL: splice_v2i8_idx:
32 ; CHECK-NEXT: ext v0.8b, v0.8b, v1.8b, #4
34 %res = call <2 x i8> @llvm.vector.splice.v2i8(<2 x i8> %a, <2 x i8> %b, i32 1)
38 ; Verify splitvec type legalisation works as expected.
39 define <8 x i32> @splice_v8i32_idx(<8 x i32> %a, <8 x i32> %b) #0 {
40 ; CHECK-LABEL: splice_v8i32_idx:
42 ; CHECK-NEXT: ext v0.16b, v1.16b, v2.16b, #4
43 ; CHECK-NEXT: ext v1.16b, v2.16b, v3.16b, #4
45 %res = call <8 x i32> @llvm.vector.splice.v8i32(<8 x i32> %a, <8 x i32> %b, i32 5)
49 ; Verify splitvec type legalisation works as expected.
50 define <16 x float> @splice_v16f32_idx(<16 x float> %a, <16 x float> %b) #0 {
51 ; CHECK-LABEL: splice_v16f32_idx:
53 ; CHECK-NEXT: ext v6.16b, v3.16b, v4.16b, #12
54 ; CHECK-NEXT: ext v0.16b, v1.16b, v2.16b, #12
55 ; CHECK-NEXT: ext v1.16b, v2.16b, v3.16b, #12
56 ; CHECK-NEXT: ext v3.16b, v4.16b, v5.16b, #12
57 ; CHECK-NEXT: mov v2.16b, v6.16b
59 %res = call <16 x float> @llvm.vector.splice.v16f32(<16 x float> %a, <16 x float> %b, i32 7)
64 ; VECTOR_SPLICE (trailing elements)
67 define <16 x i8> @splice_v16i8(<16 x i8> %a, <16 x i8> %b) #0 {
68 ; CHECK-LABEL: splice_v16i8:
70 ; CHECK-NEXT: ext v0.16b, v0.16b, v1.16b, #1
72 %res = call <16 x i8> @llvm.vector.splice.v16i8(<16 x i8> %a, <16 x i8> %b, i32 -15)
76 define <2 x double> @splice_v2f64(<2 x double> %a, <2 x double> %b) #0 {
77 ; CHECK-LABEL: splice_v2f64:
79 ; CHECK-NEXT: ext v0.16b, v0.16b, v1.16b, #8
81 %res = call <2 x double> @llvm.vector.splice.v2f64(<2 x double> %a, <2 x double> %b, i32 -1)
85 ; Verify promote type legalisation works as expected.
86 define <2 x i8> @splice_v2i8(<2 x i8> %a, <2 x i8> %b) #0 {
87 ; CHECK-LABEL: splice_v2i8:
89 ; CHECK-NEXT: ext v0.8b, v0.8b, v1.8b, #4
91 %res = call <2 x i8> @llvm.vector.splice.v2i8(<2 x i8> %a, <2 x i8> %b, i32 -1)
95 ; Verify splitvec type legalisation works as expected.
96 define <8 x i32> @splice_v8i32(<8 x i32> %a, <8 x i32> %b) #0 {
97 ; CHECK-LABEL: splice_v8i32:
99 ; CHECK-NEXT: ext v0.16b, v1.16b, v2.16b, #4
100 ; CHECK-NEXT: ext v1.16b, v2.16b, v3.16b, #4
102 %res = call <8 x i32> @llvm.vector.splice.v8i32(<8 x i32> %a, <8 x i32> %b, i32 -3)
106 ; Verify splitvec type legalisation works as expected.
107 define <16 x float> @splice_v16f32(<16 x float> %a, <16 x float> %b) #0 {
108 ; CHECK-LABEL: splice_v16f32:
110 ; CHECK-NEXT: ext v6.16b, v3.16b, v4.16b, #12
111 ; CHECK-NEXT: ext v0.16b, v1.16b, v2.16b, #12
112 ; CHECK-NEXT: ext v1.16b, v2.16b, v3.16b, #12
113 ; CHECK-NEXT: ext v3.16b, v4.16b, v5.16b, #12
114 ; CHECK-NEXT: mov v2.16b, v6.16b
116 %res = call <16 x float> @llvm.vector.splice.v16f32(<16 x float> %a, <16 x float> %b, i32 -9)
117 ret <16 x float> %res
120 declare <2 x i8> @llvm.vector.splice.v2i8(<2 x i8>, <2 x i8>, i32)
121 declare <16 x i8> @llvm.vector.splice.v16i8(<16 x i8>, <16 x i8>, i32)
122 declare <8 x i32> @llvm.vector.splice.v8i32(<8 x i32>, <8 x i32>, i32)
123 declare <16 x float> @llvm.vector.splice.v16f32(<16 x float>, <16 x float>, i32)
124 declare <2 x double> @llvm.vector.splice.v2f64(<2 x double>, <2 x double>, i32)
126 attributes #0 = { nounwind "target-features"="+neon" }