1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=riscv32 -mattr=+m,+v,+zfh,+zvfh | FileCheck %s
3 ; RUN: llc < %s -mtriple=riscv64 -mattr=+m,+v,+zfh,+zvfh | FileCheck %s
7 define {<vscale x 16 x i1>, <vscale x 16 x i1>} @vector_deinterleave_nxv16i1_nxv32i1(<vscale x 32 x i1> %vec) {
8 ; CHECK-LABEL: vector_deinterleave_nxv16i1_nxv32i1:
10 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
11 ; CHECK-NEXT: vmv.v.i v10, 0
12 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
13 ; CHECK-NEXT: csrr a0, vlenb
14 ; CHECK-NEXT: srli a0, a0, 2
15 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
16 ; CHECK-NEXT: vslidedown.vx v0, v0, a0
17 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
18 ; CHECK-NEXT: vmerge.vim v10, v10, 1, v0
19 ; CHECK-NEXT: vnsrl.wi v12, v8, 0
20 ; CHECK-NEXT: vmsne.vi v0, v12, 0
21 ; CHECK-NEXT: vnsrl.wi v12, v8, 8
22 ; CHECK-NEXT: vmsne.vi v8, v12, 0
24 %retval = call {<vscale x 16 x i1>, <vscale x 16 x i1>} @llvm.experimental.vector.deinterleave2.nxv32i1(<vscale x 32 x i1> %vec)
25 ret {<vscale x 16 x i1>, <vscale x 16 x i1>} %retval
28 define {<vscale x 16 x i8>, <vscale x 16 x i8>} @vector_deinterleave_nxv16i8_nxv32i8(<vscale x 32 x i8> %vec) {
29 ; CHECK-LABEL: vector_deinterleave_nxv16i8_nxv32i8:
31 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
32 ; CHECK-NEXT: vnsrl.wi v12, v8, 0
33 ; CHECK-NEXT: vnsrl.wi v14, v8, 8
34 ; CHECK-NEXT: vmv.v.v v8, v12
35 ; CHECK-NEXT: vmv.v.v v10, v14
37 %retval = call {<vscale x 16 x i8>, <vscale x 16 x i8>} @llvm.experimental.vector.deinterleave2.nxv32i8(<vscale x 32 x i8> %vec)
38 ret {<vscale x 16 x i8>, <vscale x 16 x i8>} %retval
41 define {<vscale x 8 x i16>, <vscale x 8 x i16>} @vector_deinterleave_nxv8i16_nxv16i16(<vscale x 16 x i16> %vec) {
42 ; CHECK-LABEL: vector_deinterleave_nxv8i16_nxv16i16:
44 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
45 ; CHECK-NEXT: vnsrl.wi v12, v8, 0
46 ; CHECK-NEXT: vnsrl.wi v14, v8, 16
47 ; CHECK-NEXT: vmv.v.v v8, v12
48 ; CHECK-NEXT: vmv.v.v v10, v14
50 %retval = call {<vscale x 8 x i16>, <vscale x 8 x i16>} @llvm.experimental.vector.deinterleave2.nxv16i16(<vscale x 16 x i16> %vec)
51 ret {<vscale x 8 x i16>, <vscale x 8 x i16>} %retval
54 define {<vscale x 4 x i32>, <vscale x 4 x i32>} @vector_deinterleave_nxv4i32_nxvv8i32(<vscale x 8 x i32> %vec) {
55 ; CHECK-LABEL: vector_deinterleave_nxv4i32_nxvv8i32:
57 ; CHECK-NEXT: li a0, 32
58 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
59 ; CHECK-NEXT: vnsrl.wx v12, v8, a0
60 ; CHECK-NEXT: vnsrl.wi v14, v8, 0
61 ; CHECK-NEXT: vmv.v.v v8, v14
62 ; CHECK-NEXT: vmv.v.v v10, v12
64 %retval = call {<vscale x 4 x i32>, <vscale x 4 x i32>} @llvm.experimental.vector.deinterleave2.nxv8i32(<vscale x 8 x i32> %vec)
65 ret {<vscale x 4 x i32>, <vscale x 4 x i32>} %retval
68 define {<vscale x 2 x i64>, <vscale x 2 x i64>} @vector_deinterleave_nxv2i64_nxv4i64(<vscale x 4 x i64> %vec) {
69 ; CHECK-LABEL: vector_deinterleave_nxv2i64_nxv4i64:
71 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
72 ; CHECK-NEXT: vid.v v12
73 ; CHECK-NEXT: vadd.vv v16, v12, v12
74 ; CHECK-NEXT: vrgather.vv v12, v8, v16
75 ; CHECK-NEXT: vadd.vi v16, v16, 1
76 ; CHECK-NEXT: vrgather.vv v20, v8, v16
77 ; CHECK-NEXT: vmv2r.v v8, v12
78 ; CHECK-NEXT: vmv2r.v v10, v20
80 %retval = call {<vscale x 2 x i64>, <vscale x 2 x i64>} @llvm.experimental.vector.deinterleave2.nxv4i64(<vscale x 4 x i64> %vec)
81 ret {<vscale x 2 x i64>, <vscale x 2 x i64>} %retval
84 declare {<vscale x 16 x i1>, <vscale x 16 x i1>} @llvm.experimental.vector.deinterleave2.nxv32i1(<vscale x 32 x i1>)
85 declare {<vscale x 16 x i8>, <vscale x 16 x i8>} @llvm.experimental.vector.deinterleave2.nxv32i8(<vscale x 32 x i8>)
86 declare {<vscale x 8 x i16>, <vscale x 8 x i16>} @llvm.experimental.vector.deinterleave2.nxv16i16(<vscale x 16 x i16>)
87 declare {<vscale x 4 x i32>, <vscale x 4 x i32>} @llvm.experimental.vector.deinterleave2.nxv8i32(<vscale x 8 x i32>)
88 declare {<vscale x 2 x i64>, <vscale x 2 x i64>} @llvm.experimental.vector.deinterleave2.nxv4i64(<vscale x 4 x i64>)
90 define {<vscale x 64 x i1>, <vscale x 64 x i1>} @vector_deinterleave_nxv64i1_nxv128i1(<vscale x 128 x i1> %vec) {
91 ; CHECK-LABEL: vector_deinterleave_nxv64i1_nxv128i1:
93 ; CHECK-NEXT: vmv1r.v v28, v8
94 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
95 ; CHECK-NEXT: vmv.v.i v8, 0
96 ; CHECK-NEXT: vmerge.vim v16, v8, 1, v0
97 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
98 ; CHECK-NEXT: vnsrl.wi v24, v16, 0
99 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
100 ; CHECK-NEXT: vmv1r.v v0, v28
101 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
102 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
103 ; CHECK-NEXT: vnsrl.wi v28, v8, 0
104 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
105 ; CHECK-NEXT: vmsne.vi v0, v24, 0
106 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
107 ; CHECK-NEXT: vnsrl.wi v24, v16, 8
108 ; CHECK-NEXT: vnsrl.wi v28, v8, 8
109 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
110 ; CHECK-NEXT: vmsne.vi v8, v24, 0
112 %retval = call {<vscale x 64 x i1>, <vscale x 64 x i1>} @llvm.experimental.vector.deinterleave2.nxv128i1(<vscale x 128 x i1> %vec)
113 ret {<vscale x 64 x i1>, <vscale x 64 x i1>} %retval
116 define {<vscale x 64 x i8>, <vscale x 64 x i8>} @vector_deinterleave_nxv64i8_nxv128i8(<vscale x 128 x i8> %vec) {
117 ; CHECK-LABEL: vector_deinterleave_nxv64i8_nxv128i8:
119 ; CHECK-NEXT: vmv8r.v v24, v8
120 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
121 ; CHECK-NEXT: vnsrl.wi v8, v24, 0
122 ; CHECK-NEXT: vnsrl.wi v12, v16, 0
123 ; CHECK-NEXT: vnsrl.wi v0, v24, 8
124 ; CHECK-NEXT: vnsrl.wi v4, v16, 8
125 ; CHECK-NEXT: vmv8r.v v16, v0
127 %retval = call {<vscale x 64 x i8>, <vscale x 64 x i8>} @llvm.experimental.vector.deinterleave2.nxv128i8(<vscale x 128 x i8> %vec)
128 ret {<vscale x 64 x i8>, <vscale x 64 x i8>} %retval
131 define {<vscale x 32 x i16>, <vscale x 32 x i16>} @vector_deinterleave_nxv32i16_nxv64i16(<vscale x 64 x i16> %vec) {
132 ; CHECK-LABEL: vector_deinterleave_nxv32i16_nxv64i16:
134 ; CHECK-NEXT: vmv8r.v v24, v8
135 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
136 ; CHECK-NEXT: vnsrl.wi v8, v24, 0
137 ; CHECK-NEXT: vnsrl.wi v12, v16, 0
138 ; CHECK-NEXT: vnsrl.wi v0, v24, 16
139 ; CHECK-NEXT: vnsrl.wi v4, v16, 16
140 ; CHECK-NEXT: vmv8r.v v16, v0
142 %retval = call {<vscale x 32 x i16>, <vscale x 32 x i16>} @llvm.experimental.vector.deinterleave2.nxv64i16(<vscale x 64 x i16> %vec)
143 ret {<vscale x 32 x i16>, <vscale x 32 x i16>} %retval
146 define {<vscale x 16 x i32>, <vscale x 16 x i32>} @vector_deinterleave_nxv16i32_nxvv32i32(<vscale x 32 x i32> %vec) {
147 ; CHECK-LABEL: vector_deinterleave_nxv16i32_nxvv32i32:
149 ; CHECK-NEXT: vmv8r.v v24, v16
150 ; CHECK-NEXT: li a0, 32
151 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
152 ; CHECK-NEXT: vnsrl.wx v20, v24, a0
153 ; CHECK-NEXT: vnsrl.wx v16, v8, a0
154 ; CHECK-NEXT: vnsrl.wi v0, v8, 0
155 ; CHECK-NEXT: vnsrl.wi v4, v24, 0
156 ; CHECK-NEXT: vmv8r.v v8, v0
158 %retval = call {<vscale x 16 x i32>, <vscale x 16 x i32>} @llvm.experimental.vector.deinterleave2.nxv32i32(<vscale x 32 x i32> %vec)
159 ret {<vscale x 16 x i32>, <vscale x 16 x i32>} %retval
162 define {<vscale x 8 x i64>, <vscale x 8 x i64>} @vector_deinterleave_nxv8i64_nxv16i64(<vscale x 16 x i64> %vec) {
163 ; CHECK-LABEL: vector_deinterleave_nxv8i64_nxv16i64:
165 ; CHECK-NEXT: addi sp, sp, -16
166 ; CHECK-NEXT: .cfi_def_cfa_offset 16
167 ; CHECK-NEXT: csrr a0, vlenb
168 ; CHECK-NEXT: slli a0, a0, 5
169 ; CHECK-NEXT: sub sp, sp, a0
170 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x20, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 32 * vlenb
171 ; CHECK-NEXT: csrr a0, vlenb
172 ; CHECK-NEXT: li a1, 24
173 ; CHECK-NEXT: mul a0, a0, a1
174 ; CHECK-NEXT: add a0, sp, a0
175 ; CHECK-NEXT: addi a0, a0, 16
176 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
177 ; CHECK-NEXT: vmv8r.v v24, v8
178 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
179 ; CHECK-NEXT: vid.v v8
180 ; CHECK-NEXT: vadd.vv v0, v8, v8
181 ; CHECK-NEXT: vrgather.vv v8, v24, v0
182 ; CHECK-NEXT: csrr a0, vlenb
183 ; CHECK-NEXT: slli a0, a0, 3
184 ; CHECK-NEXT: add a0, sp, a0
185 ; CHECK-NEXT: addi a0, a0, 16
186 ; CHECK-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
187 ; CHECK-NEXT: csrr a0, vlenb
188 ; CHECK-NEXT: li a1, 24
189 ; CHECK-NEXT: mul a0, a0, a1
190 ; CHECK-NEXT: add a0, sp, a0
191 ; CHECK-NEXT: addi a0, a0, 16
192 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
193 ; CHECK-NEXT: vrgather.vv v16, v8, v0
194 ; CHECK-NEXT: csrr a0, vlenb
195 ; CHECK-NEXT: slli a0, a0, 4
196 ; CHECK-NEXT: add a0, sp, a0
197 ; CHECK-NEXT: addi a0, a0, 16
198 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
199 ; CHECK-NEXT: vadd.vi v8, v0, 1
200 ; CHECK-NEXT: vrgather.vv v0, v24, v8
201 ; CHECK-NEXT: csrr a0, vlenb
202 ; CHECK-NEXT: li a1, 24
203 ; CHECK-NEXT: mul a0, a0, a1
204 ; CHECK-NEXT: add a0, sp, a0
205 ; CHECK-NEXT: addi a0, a0, 16
206 ; CHECK-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
207 ; CHECK-NEXT: vrgather.vv v16, v24, v8
208 ; CHECK-NEXT: addi a0, sp, 16
209 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
210 ; CHECK-NEXT: csrr a0, vlenb
211 ; CHECK-NEXT: slli a0, a0, 4
212 ; CHECK-NEXT: add a0, sp, a0
213 ; CHECK-NEXT: addi a0, a0, 16
214 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
215 ; CHECK-NEXT: csrr a0, vlenb
216 ; CHECK-NEXT: slli a0, a0, 3
217 ; CHECK-NEXT: add a0, sp, a0
218 ; CHECK-NEXT: addi a0, a0, 16
219 ; CHECK-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
220 ; CHECK-NEXT: vmv4r.v v20, v8
221 ; CHECK-NEXT: addi a0, sp, 16
222 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
223 ; CHECK-NEXT: vmv4r.v v4, v8
224 ; CHECK-NEXT: vmv8r.v v8, v16
225 ; CHECK-NEXT: vmv8r.v v16, v0
226 ; CHECK-NEXT: csrr a0, vlenb
227 ; CHECK-NEXT: slli a0, a0, 5
228 ; CHECK-NEXT: add sp, sp, a0
229 ; CHECK-NEXT: addi sp, sp, 16
231 %retval = call {<vscale x 8 x i64>, <vscale x 8 x i64>} @llvm.experimental.vector.deinterleave2.nxv16i64(<vscale x 16 x i64> %vec)
232 ret {<vscale x 8 x i64>, <vscale x 8 x i64>} %retval
235 declare {<vscale x 64 x i1>, <vscale x 64 x i1>} @llvm.experimental.vector.deinterleave2.nxv128i1(<vscale x 128 x i1>)
236 declare {<vscale x 64 x i8>, <vscale x 64 x i8>} @llvm.experimental.vector.deinterleave2.nxv128i8(<vscale x 128 x i8>)
237 declare {<vscale x 32 x i16>, <vscale x 32 x i16>} @llvm.experimental.vector.deinterleave2.nxv64i16(<vscale x 64 x i16>)
238 declare {<vscale x 16 x i32>, <vscale x 16 x i32>} @llvm.experimental.vector.deinterleave2.nxv32i32(<vscale x 32 x i32>)
239 declare {<vscale x 8 x i64>, <vscale x 8 x i64>} @llvm.experimental.vector.deinterleave2.nxv16i64(<vscale x 16 x i64>)
243 define {<vscale x 2 x half>, <vscale x 2 x half>} @vector_deinterleave_nxv2f16_nxv4f16(<vscale x 4 x half> %vec) {
244 ; CHECK-LABEL: vector_deinterleave_nxv2f16_nxv4f16:
246 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
247 ; CHECK-NEXT: vnsrl.wi v10, v8, 0
248 ; CHECK-NEXT: vnsrl.wi v9, v8, 16
249 ; CHECK-NEXT: vmv1r.v v8, v10
251 %retval = call {<vscale x 2 x half>, <vscale x 2 x half>} @llvm.experimental.vector.deinterleave2.nxv4f16(<vscale x 4 x half> %vec)
252 ret {<vscale x 2 x half>, <vscale x 2 x half>} %retval
255 define {<vscale x 4 x half>, <vscale x 4 x half>} @vector_deinterleave_nxv4f16_nxv8f16(<vscale x 8 x half> %vec) {
256 ; CHECK-LABEL: vector_deinterleave_nxv4f16_nxv8f16:
258 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
259 ; CHECK-NEXT: vnsrl.wi v10, v8, 0
260 ; CHECK-NEXT: vnsrl.wi v11, v8, 16
261 ; CHECK-NEXT: vmv.v.v v8, v10
262 ; CHECK-NEXT: vmv.v.v v9, v11
264 %retval = call {<vscale x 4 x half>, <vscale x 4 x half>} @llvm.experimental.vector.deinterleave2.nxv8f16(<vscale x 8 x half> %vec)
265 ret {<vscale x 4 x half>, <vscale x 4 x half>} %retval
268 define {<vscale x 2 x float>, <vscale x 2 x float>} @vector_deinterleave_nxv2f32_nxv4f32(<vscale x 4 x float> %vec) {
269 ; CHECK-LABEL: vector_deinterleave_nxv2f32_nxv4f32:
271 ; CHECK-NEXT: li a0, 32
272 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
273 ; CHECK-NEXT: vnsrl.wx v10, v8, a0
274 ; CHECK-NEXT: vnsrl.wi v11, v8, 0
275 ; CHECK-NEXT: vmv.v.v v8, v11
276 ; CHECK-NEXT: vmv.v.v v9, v10
278 %retval = call {<vscale x 2 x float>, <vscale x 2 x float>} @llvm.experimental.vector.deinterleave2.nxv4f32(<vscale x 4 x float> %vec)
279 ret {<vscale x 2 x float>, <vscale x 2 x float>} %retval
282 define {<vscale x 8 x half>, <vscale x 8 x half>} @vector_deinterleave_nxv8f16_nxv16f16(<vscale x 16 x half> %vec) {
283 ; CHECK-LABEL: vector_deinterleave_nxv8f16_nxv16f16:
285 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
286 ; CHECK-NEXT: vnsrl.wi v12, v8, 0
287 ; CHECK-NEXT: vnsrl.wi v14, v8, 16
288 ; CHECK-NEXT: vmv.v.v v8, v12
289 ; CHECK-NEXT: vmv.v.v v10, v14
291 %retval = call {<vscale x 8 x half>, <vscale x 8 x half>} @llvm.experimental.vector.deinterleave2.nxv16f16(<vscale x 16 x half> %vec)
292 ret {<vscale x 8 x half>, <vscale x 8 x half>} %retval
295 define {<vscale x 4 x float>, <vscale x 4 x float>} @vector_deinterleave_nxv4f32_nxv8f32(<vscale x 8 x float> %vec) {
296 ; CHECK-LABEL: vector_deinterleave_nxv4f32_nxv8f32:
298 ; CHECK-NEXT: li a0, 32
299 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
300 ; CHECK-NEXT: vnsrl.wx v12, v8, a0
301 ; CHECK-NEXT: vnsrl.wi v14, v8, 0
302 ; CHECK-NEXT: vmv.v.v v8, v14
303 ; CHECK-NEXT: vmv.v.v v10, v12
305 %retval = call {<vscale x 4 x float>, <vscale x 4 x float>} @llvm.experimental.vector.deinterleave2.nxv8f32(<vscale x 8 x float> %vec)
306 ret {<vscale x 4 x float>, <vscale x 4 x float>} %retval
309 define {<vscale x 2 x double>, <vscale x 2 x double>} @vector_deinterleave_nxv2f64_nxv4f64(<vscale x 4 x double> %vec) {
310 ; CHECK-LABEL: vector_deinterleave_nxv2f64_nxv4f64:
312 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
313 ; CHECK-NEXT: vid.v v12
314 ; CHECK-NEXT: vadd.vv v16, v12, v12
315 ; CHECK-NEXT: vrgather.vv v12, v8, v16
316 ; CHECK-NEXT: vadd.vi v16, v16, 1
317 ; CHECK-NEXT: vrgather.vv v20, v8, v16
318 ; CHECK-NEXT: vmv2r.v v8, v12
319 ; CHECK-NEXT: vmv2r.v v10, v20
321 %retval = call {<vscale x 2 x double>, <vscale x 2 x double>} @llvm.experimental.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %vec)
322 ret {<vscale x 2 x double>, <vscale x 2 x double>} %retval
325 declare {<vscale x 2 x half>,<vscale x 2 x half>} @llvm.experimental.vector.deinterleave2.nxv4f16(<vscale x 4 x half>)
326 declare {<vscale x 4 x half>, <vscale x 4 x half>} @llvm.experimental.vector.deinterleave2.nxv8f16(<vscale x 8 x half>)
327 declare {<vscale x 2 x float>, <vscale x 2 x float>} @llvm.experimental.vector.deinterleave2.nxv4f32(<vscale x 4 x float>)
328 declare {<vscale x 8 x half>, <vscale x 8 x half>} @llvm.experimental.vector.deinterleave2.nxv16f16(<vscale x 16 x half>)
329 declare {<vscale x 4 x float>, <vscale x 4 x float>} @llvm.experimental.vector.deinterleave2.nxv8f32(<vscale x 8 x float>)
330 declare {<vscale x 2 x double>, <vscale x 2 x double>} @llvm.experimental.vector.deinterleave2.nxv4f64(<vscale x 4 x double>)
332 define {<vscale x 32 x half>, <vscale x 32 x half>} @vector_deinterleave_nxv32f16_nxv64f16(<vscale x 64 x half> %vec) {
333 ; CHECK-LABEL: vector_deinterleave_nxv32f16_nxv64f16:
335 ; CHECK-NEXT: vmv8r.v v24, v8
336 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
337 ; CHECK-NEXT: vnsrl.wi v8, v24, 0
338 ; CHECK-NEXT: vnsrl.wi v12, v16, 0
339 ; CHECK-NEXT: vnsrl.wi v0, v24, 16
340 ; CHECK-NEXT: vnsrl.wi v4, v16, 16
341 ; CHECK-NEXT: vmv8r.v v16, v0
343 %retval = call {<vscale x 32 x half>, <vscale x 32 x half>} @llvm.experimental.vector.deinterleave2.nxv64f16(<vscale x 64 x half> %vec)
344 ret {<vscale x 32 x half>, <vscale x 32 x half>} %retval
347 define {<vscale x 16 x float>, <vscale x 16 x float>} @vector_deinterleave_nxv16f32_nxv32f32(<vscale x 32 x float> %vec) {
348 ; CHECK-LABEL: vector_deinterleave_nxv16f32_nxv32f32:
350 ; CHECK-NEXT: vmv8r.v v24, v16
351 ; CHECK-NEXT: li a0, 32
352 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
353 ; CHECK-NEXT: vnsrl.wx v20, v24, a0
354 ; CHECK-NEXT: vnsrl.wx v16, v8, a0
355 ; CHECK-NEXT: vnsrl.wi v0, v8, 0
356 ; CHECK-NEXT: vnsrl.wi v4, v24, 0
357 ; CHECK-NEXT: vmv8r.v v8, v0
359 %retval = call {<vscale x 16 x float>, <vscale x 16 x float>} @llvm.experimental.vector.deinterleave2.nxv32f32(<vscale x 32 x float> %vec)
360 ret {<vscale x 16 x float>, <vscale x 16 x float>} %retval
363 define {<vscale x 8 x double>, <vscale x 8 x double>} @vector_deinterleave_nxv8f64_nxv16f64(<vscale x 16 x double> %vec) {
364 ; CHECK-LABEL: vector_deinterleave_nxv8f64_nxv16f64:
366 ; CHECK-NEXT: addi sp, sp, -16
367 ; CHECK-NEXT: .cfi_def_cfa_offset 16
368 ; CHECK-NEXT: csrr a0, vlenb
369 ; CHECK-NEXT: slli a0, a0, 5
370 ; CHECK-NEXT: sub sp, sp, a0
371 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x20, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 32 * vlenb
372 ; CHECK-NEXT: csrr a0, vlenb
373 ; CHECK-NEXT: li a1, 24
374 ; CHECK-NEXT: mul a0, a0, a1
375 ; CHECK-NEXT: add a0, sp, a0
376 ; CHECK-NEXT: addi a0, a0, 16
377 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
378 ; CHECK-NEXT: vmv8r.v v24, v8
379 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
380 ; CHECK-NEXT: vid.v v8
381 ; CHECK-NEXT: vadd.vv v0, v8, v8
382 ; CHECK-NEXT: vrgather.vv v8, v24, v0
383 ; CHECK-NEXT: csrr a0, vlenb
384 ; CHECK-NEXT: slli a0, a0, 3
385 ; CHECK-NEXT: add a0, sp, a0
386 ; CHECK-NEXT: addi a0, a0, 16
387 ; CHECK-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
388 ; CHECK-NEXT: csrr a0, vlenb
389 ; CHECK-NEXT: li a1, 24
390 ; CHECK-NEXT: mul a0, a0, a1
391 ; CHECK-NEXT: add a0, sp, a0
392 ; CHECK-NEXT: addi a0, a0, 16
393 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
394 ; CHECK-NEXT: vrgather.vv v16, v8, v0
395 ; CHECK-NEXT: csrr a0, vlenb
396 ; CHECK-NEXT: slli a0, a0, 4
397 ; CHECK-NEXT: add a0, sp, a0
398 ; CHECK-NEXT: addi a0, a0, 16
399 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
400 ; CHECK-NEXT: vadd.vi v8, v0, 1
401 ; CHECK-NEXT: vrgather.vv v0, v24, v8
402 ; CHECK-NEXT: csrr a0, vlenb
403 ; CHECK-NEXT: li a1, 24
404 ; CHECK-NEXT: mul a0, a0, a1
405 ; CHECK-NEXT: add a0, sp, a0
406 ; CHECK-NEXT: addi a0, a0, 16
407 ; CHECK-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
408 ; CHECK-NEXT: vrgather.vv v16, v24, v8
409 ; CHECK-NEXT: addi a0, sp, 16
410 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
411 ; CHECK-NEXT: csrr a0, vlenb
412 ; CHECK-NEXT: slli a0, a0, 4
413 ; CHECK-NEXT: add a0, sp, a0
414 ; CHECK-NEXT: addi a0, a0, 16
415 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
416 ; CHECK-NEXT: csrr a0, vlenb
417 ; CHECK-NEXT: slli a0, a0, 3
418 ; CHECK-NEXT: add a0, sp, a0
419 ; CHECK-NEXT: addi a0, a0, 16
420 ; CHECK-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
421 ; CHECK-NEXT: vmv4r.v v20, v8
422 ; CHECK-NEXT: addi a0, sp, 16
423 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
424 ; CHECK-NEXT: vmv4r.v v4, v8
425 ; CHECK-NEXT: vmv8r.v v8, v16
426 ; CHECK-NEXT: vmv8r.v v16, v0
427 ; CHECK-NEXT: csrr a0, vlenb
428 ; CHECK-NEXT: slli a0, a0, 5
429 ; CHECK-NEXT: add sp, sp, a0
430 ; CHECK-NEXT: addi sp, sp, 16
432 %retval = call {<vscale x 8 x double>, <vscale x 8 x double>} @llvm.experimental.vector.deinterleave2.nxv16f64(<vscale x 16 x double> %vec)
433 ret {<vscale x 8 x double>, <vscale x 8 x double>} %retval
436 declare {<vscale x 32 x half>, <vscale x 32 x half>} @llvm.experimental.vector.deinterleave2.nxv64f16(<vscale x 64 x half>)
437 declare {<vscale x 16 x float>, <vscale x 16 x float>} @llvm.experimental.vector.deinterleave2.nxv32f32(<vscale x 32 x float>)
438 declare {<vscale x 8 x double>, <vscale x 8 x double>} @llvm.experimental.vector.deinterleave2.nxv16f64(<vscale x 16 x double>)