1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-SELDAG %s
3 ; RUN: llc -verify-machineinstrs -O0 < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-FASTISEL %s
5 target triple = "aarch64-unknown-linux-gnu"
11 define <16 x i8> @reverse_v16i8(<16 x i8> %a) #0 {
12 ; CHECK-LABEL: reverse_v16i8:
14 ; CHECK-NEXT: rev64 v0.16b, v0.16b
15 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
18 %res = call <16 x i8> @llvm.experimental.vector.reverse.v16i8(<16 x i8> %a)
22 define <8 x i16> @reverse_v8i16(<8 x i16> %a) #0 {
23 ; CHECK-LABEL: reverse_v8i16:
25 ; CHECK-NEXT: rev64 v0.8h, v0.8h
26 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
29 %res = call <8 x i16> @llvm.experimental.vector.reverse.v8i16(<8 x i16> %a)
33 define <4 x i32> @reverse_v4i32(<4 x i32> %a) #0 {
34 ; CHECK-LABEL: reverse_v4i32:
36 ; CHECK-NEXT: rev64 v0.4s, v0.4s
37 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
40 %res = call <4 x i32> @llvm.experimental.vector.reverse.v4i32(<4 x i32> %a)
44 define <2 x i64> @reverse_v2i64(<2 x i64> %a) #0 {
45 ; CHECK-LABEL: reverse_v2i64:
47 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
50 %res = call <2 x i64> @llvm.experimental.vector.reverse.v2i64(<2 x i64> %a)
54 define <8 x half> @reverse_v8f16(<8 x half> %a) #0 {
55 ; CHECK-LABEL: reverse_v8f16:
57 ; CHECK-NEXT: rev64 v0.8h, v0.8h
58 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
61 %res = call <8 x half> @llvm.experimental.vector.reverse.v8f16(<8 x half> %a)
65 define <4 x float> @reverse_v4f32(<4 x float> %a) #0 {
66 ; CHECK-LABEL: reverse_v4f32:
68 ; CHECK-NEXT: rev64 v0.4s, v0.4s
69 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
72 %res = call <4 x float> @llvm.experimental.vector.reverse.v4f32(<4 x float> %a)
76 define <2 x double> @reverse_v2f64(<2 x double> %a) #0 {
77 ; CHECK-LABEL: reverse_v2f64:
79 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #8
82 %res = call <2 x double> @llvm.experimental.vector.reverse.v2f64(<2 x double> %a)
86 ; Verify promote type legalisation works as expected.
87 define <2 x i8> @reverse_v2i8(<2 x i8> %a) #0 {
88 ; CHECK-LABEL: reverse_v2i8:
90 ; CHECK-NEXT: rev64 v0.2s, v0.2s
93 %res = call <2 x i8> @llvm.experimental.vector.reverse.v2i8(<2 x i8> %a)
97 ; Verify splitvec type legalisation works as expected.
98 define <8 x i32> @reverse_v8i32(<8 x i32> %a) #0 {
99 ; CHECK-SELDAG-LABEL: reverse_v8i32:
100 ; CHECK-SELDAG: // %bb.0:
101 ; CHECK-SELDAG-NEXT: rev64 v1.4s, v1.4s
102 ; CHECK-SELDAG-NEXT: rev64 v2.4s, v0.4s
103 ; CHECK-SELDAG-NEXT: ext v0.16b, v1.16b, v1.16b, #8
104 ; CHECK-SELDAG-NEXT: ext v1.16b, v2.16b, v2.16b, #8
105 ; CHECK-SELDAG-NEXT: ret
107 ; CHECK-FASTISEL-LABEL: reverse_v8i32:
108 ; CHECK-FASTISEL: // %bb.0:
109 ; CHECK-FASTISEL-NEXT: sub sp, sp, #16
110 ; CHECK-FASTISEL-NEXT: str q1, [sp] // 16-byte Folded Spill
111 ; CHECK-FASTISEL-NEXT: mov v1.16b, v0.16b
112 ; CHECK-FASTISEL-NEXT: ldr q0, [sp] // 16-byte Folded Reload
113 ; CHECK-FASTISEL-NEXT: rev64 v0.4s, v0.4s
114 ; CHECK-FASTISEL-NEXT: ext v0.16b, v0.16b, v0.16b, #8
115 ; CHECK-FASTISEL-NEXT: rev64 v1.4s, v1.4s
116 ; CHECK-FASTISEL-NEXT: ext v1.16b, v1.16b, v1.16b, #8
117 ; CHECK-FASTISEL-NEXT: add sp, sp, #16
118 ; CHECK-FASTISEL-NEXT: ret
120 %res = call <8 x i32> @llvm.experimental.vector.reverse.v8i32(<8 x i32> %a)
124 ; Verify splitvec type legalisation works as expected.
125 define <16 x float> @reverse_v16f32(<16 x float> %a) #0 {
126 ; CHECK-SELDAG-LABEL: reverse_v16f32:
127 ; CHECK-SELDAG: // %bb.0:
128 ; CHECK-SELDAG-NEXT: rev64 v3.4s, v3.4s
129 ; CHECK-SELDAG-NEXT: rev64 v2.4s, v2.4s
130 ; CHECK-SELDAG-NEXT: rev64 v4.4s, v1.4s
131 ; CHECK-SELDAG-NEXT: rev64 v5.4s, v0.4s
132 ; CHECK-SELDAG-NEXT: ext v0.16b, v3.16b, v3.16b, #8
133 ; CHECK-SELDAG-NEXT: ext v1.16b, v2.16b, v2.16b, #8
134 ; CHECK-SELDAG-NEXT: ext v2.16b, v4.16b, v4.16b, #8
135 ; CHECK-SELDAG-NEXT: ext v3.16b, v5.16b, v5.16b, #8
136 ; CHECK-SELDAG-NEXT: ret
138 ; CHECK-FASTISEL-LABEL: reverse_v16f32:
139 ; CHECK-FASTISEL: // %bb.0:
140 ; CHECK-FASTISEL-NEXT: sub sp, sp, #32
141 ; CHECK-FASTISEL-NEXT: str q3, [sp, #16] // 16-byte Folded Spill
142 ; CHECK-FASTISEL-NEXT: str q2, [sp] // 16-byte Folded Spill
143 ; CHECK-FASTISEL-NEXT: mov v2.16b, v1.16b
144 ; CHECK-FASTISEL-NEXT: ldr q1, [sp] // 16-byte Folded Reload
145 ; CHECK-FASTISEL-NEXT: mov v3.16b, v0.16b
146 ; CHECK-FASTISEL-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
147 ; CHECK-FASTISEL-NEXT: rev64 v0.4s, v0.4s
148 ; CHECK-FASTISEL-NEXT: ext v0.16b, v0.16b, v0.16b, #8
149 ; CHECK-FASTISEL-NEXT: rev64 v1.4s, v1.4s
150 ; CHECK-FASTISEL-NEXT: ext v1.16b, v1.16b, v1.16b, #8
151 ; CHECK-FASTISEL-NEXT: rev64 v2.4s, v2.4s
152 ; CHECK-FASTISEL-NEXT: ext v2.16b, v2.16b, v2.16b, #8
153 ; CHECK-FASTISEL-NEXT: rev64 v3.4s, v3.4s
154 ; CHECK-FASTISEL-NEXT: ext v3.16b, v3.16b, v3.16b, #8
155 ; CHECK-FASTISEL-NEXT: add sp, sp, #32
156 ; CHECK-FASTISEL-NEXT: ret
158 %res = call <16 x float> @llvm.experimental.vector.reverse.v16f32(<16 x float> %a)
159 ret <16 x float> %res
163 declare <2 x i8> @llvm.experimental.vector.reverse.v2i8(<2 x i8>)
164 declare <16 x i8> @llvm.experimental.vector.reverse.v16i8(<16 x i8>)
165 declare <8 x i16> @llvm.experimental.vector.reverse.v8i16(<8 x i16>)
166 declare <4 x i32> @llvm.experimental.vector.reverse.v4i32(<4 x i32>)
167 declare <8 x i32> @llvm.experimental.vector.reverse.v8i32(<8 x i32>)
168 declare <2 x i64> @llvm.experimental.vector.reverse.v2i64(<2 x i64>)
169 declare <8 x half> @llvm.experimental.vector.reverse.v8f16(<8 x half>)
170 declare <4 x float> @llvm.experimental.vector.reverse.v4f32(<4 x float>)
171 declare <16 x float> @llvm.experimental.vector.reverse.v16f32(<16 x float>)
172 declare <2 x double> @llvm.experimental.vector.reverse.v2f64(<2 x double>)
174 attributes #0 = { nounwind "target-features"="+neon" }