1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
4 declare <vscale x 1 x i8> @llvm.riscv.vmv.s.x.nxv1i8(<vscale x 1 x i8>, i8, i64);
6 define <vscale x 1 x i8> @intrinsic_vmv.s.x_x_nxv1i8(<vscale x 1 x i8> %0, i8 %1, i64 %2) nounwind {
7 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv1i8:
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
10 ; CHECK-NEXT: vmv.s.x v8, a0
13 %a = call <vscale x 1 x i8> @llvm.riscv.vmv.s.x.nxv1i8(<vscale x 1 x i8> %0, i8 %1, i64 %2)
14 ret <vscale x 1 x i8> %a
17 declare <vscale x 2 x i8> @llvm.riscv.vmv.s.x.nxv2i8(<vscale x 2 x i8>, i8, i64);
19 define <vscale x 2 x i8> @intrinsic_vmv.s.x_x_nxv2i8(<vscale x 2 x i8> %0, i8 %1, i64 %2) nounwind {
20 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv2i8:
21 ; CHECK: # %bb.0: # %entry
22 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
23 ; CHECK-NEXT: vmv.s.x v8, a0
26 %a = call <vscale x 2 x i8> @llvm.riscv.vmv.s.x.nxv2i8(<vscale x 2 x i8> %0, i8 %1, i64 %2)
27 ret <vscale x 2 x i8> %a
30 declare <vscale x 4 x i8> @llvm.riscv.vmv.s.x.nxv4i8(<vscale x 4 x i8>, i8, i64);
32 define <vscale x 4 x i8> @intrinsic_vmv.s.x_x_nxv4i8(<vscale x 4 x i8> %0, i8 %1, i64 %2) nounwind {
33 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv4i8:
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
36 ; CHECK-NEXT: vmv.s.x v8, a0
39 %a = call <vscale x 4 x i8> @llvm.riscv.vmv.s.x.nxv4i8(<vscale x 4 x i8> %0, i8 %1, i64 %2)
40 ret <vscale x 4 x i8> %a
43 declare <vscale x 8 x i8> @llvm.riscv.vmv.s.x.nxv8i8(<vscale x 8 x i8>, i8, i64);
45 define <vscale x 8 x i8> @intrinsic_vmv.s.x_x_nxv8i8(<vscale x 8 x i8> %0, i8 %1, i64 %2) nounwind {
46 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv8i8:
47 ; CHECK: # %bb.0: # %entry
48 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
49 ; CHECK-NEXT: vmv.s.x v8, a0
52 %a = call <vscale x 8 x i8> @llvm.riscv.vmv.s.x.nxv8i8(<vscale x 8 x i8> %0, i8 %1, i64 %2)
53 ret <vscale x 8 x i8> %a
56 declare <vscale x 16 x i8> @llvm.riscv.vmv.s.x.nxv16i8(<vscale x 16 x i8>, i8, i64);
58 define <vscale x 16 x i8> @intrinsic_vmv.s.x_x_nxv16i8(<vscale x 16 x i8> %0, i8 %1, i64 %2) nounwind {
59 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv16i8:
60 ; CHECK: # %bb.0: # %entry
61 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
62 ; CHECK-NEXT: vmv.s.x v8, a0
65 %a = call <vscale x 16 x i8> @llvm.riscv.vmv.s.x.nxv16i8(<vscale x 16 x i8> %0, i8 %1, i64 %2)
66 ret <vscale x 16 x i8> %a
69 declare <vscale x 32 x i8> @llvm.riscv.vmv.s.x.nxv32i8(<vscale x 32 x i8>, i8, i64);
71 define <vscale x 32 x i8> @intrinsic_vmv.s.x_x_nxv32i8(<vscale x 32 x i8> %0, i8 %1, i64 %2) nounwind {
72 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv32i8:
73 ; CHECK: # %bb.0: # %entry
74 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
75 ; CHECK-NEXT: vmv.s.x v8, a0
78 %a = call <vscale x 32 x i8> @llvm.riscv.vmv.s.x.nxv32i8(<vscale x 32 x i8> %0, i8 %1, i64 %2)
79 ret <vscale x 32 x i8> %a
82 declare <vscale x 64 x i8> @llvm.riscv.vmv.s.x.nxv64i8(<vscale x 64 x i8>, i8, i64);
84 define <vscale x 64 x i8> @intrinsic_vmv.s.x_x_nxv64i8(<vscale x 64 x i8> %0, i8 %1, i64 %2) nounwind {
85 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv64i8:
86 ; CHECK: # %bb.0: # %entry
87 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
88 ; CHECK-NEXT: vmv.s.x v8, a0
91 %a = call <vscale x 64 x i8> @llvm.riscv.vmv.s.x.nxv64i8(<vscale x 64 x i8> %0, i8 %1, i64 %2)
92 ret <vscale x 64 x i8> %a
95 declare <vscale x 1 x i16> @llvm.riscv.vmv.s.x.nxv1i16(<vscale x 1 x i16>, i16, i64);
97 define <vscale x 1 x i16> @intrinsic_vmv.s.x_x_nxv1i16(<vscale x 1 x i16> %0, i16 %1, i64 %2) nounwind {
98 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv1i16:
99 ; CHECK: # %bb.0: # %entry
100 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
101 ; CHECK-NEXT: vmv.s.x v8, a0
104 %a = call <vscale x 1 x i16> @llvm.riscv.vmv.s.x.nxv1i16(<vscale x 1 x i16> %0, i16 %1, i64 %2)
105 ret <vscale x 1 x i16> %a
108 declare <vscale x 2 x i16> @llvm.riscv.vmv.s.x.nxv2i16(<vscale x 2 x i16>, i16, i64);
110 define <vscale x 2 x i16> @intrinsic_vmv.s.x_x_nxv2i16(<vscale x 2 x i16> %0, i16 %1, i64 %2) nounwind {
111 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv2i16:
112 ; CHECK: # %bb.0: # %entry
113 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
114 ; CHECK-NEXT: vmv.s.x v8, a0
117 %a = call <vscale x 2 x i16> @llvm.riscv.vmv.s.x.nxv2i16(<vscale x 2 x i16> %0, i16 %1, i64 %2)
118 ret <vscale x 2 x i16> %a
121 declare <vscale x 4 x i16> @llvm.riscv.vmv.s.x.nxv4i16(<vscale x 4 x i16>, i16, i64);
123 define <vscale x 4 x i16> @intrinsic_vmv.s.x_x_nxv4i16(<vscale x 4 x i16> %0, i16 %1, i64 %2) nounwind {
124 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv4i16:
125 ; CHECK: # %bb.0: # %entry
126 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
127 ; CHECK-NEXT: vmv.s.x v8, a0
130 %a = call <vscale x 4 x i16> @llvm.riscv.vmv.s.x.nxv4i16(<vscale x 4 x i16> %0, i16 %1, i64 %2)
131 ret <vscale x 4 x i16> %a
134 declare <vscale x 8 x i16> @llvm.riscv.vmv.s.x.nxv8i16(<vscale x 8 x i16>, i16, i64);
136 define <vscale x 8 x i16> @intrinsic_vmv.s.x_x_nxv8i16(<vscale x 8 x i16> %0, i16 %1, i64 %2) nounwind {
137 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv8i16:
138 ; CHECK: # %bb.0: # %entry
139 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
140 ; CHECK-NEXT: vmv.s.x v8, a0
143 %a = call <vscale x 8 x i16> @llvm.riscv.vmv.s.x.nxv8i16(<vscale x 8 x i16> %0, i16 %1, i64 %2)
144 ret <vscale x 8 x i16> %a
147 declare <vscale x 16 x i16> @llvm.riscv.vmv.s.x.nxv16i16(<vscale x 16 x i16>, i16, i64);
149 define <vscale x 16 x i16> @intrinsic_vmv.s.x_x_nxv16i16(<vscale x 16 x i16> %0, i16 %1, i64 %2) nounwind {
150 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv16i16:
151 ; CHECK: # %bb.0: # %entry
152 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
153 ; CHECK-NEXT: vmv.s.x v8, a0
156 %a = call <vscale x 16 x i16> @llvm.riscv.vmv.s.x.nxv16i16(<vscale x 16 x i16> %0, i16 %1, i64 %2)
157 ret <vscale x 16 x i16> %a
160 declare <vscale x 32 x i16> @llvm.riscv.vmv.s.x.nxv32i16(<vscale x 32 x i16>, i16, i64);
162 define <vscale x 32 x i16> @intrinsic_vmv.s.x_x_nxv32i16(<vscale x 32 x i16> %0, i16 %1, i64 %2) nounwind {
163 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv32i16:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
166 ; CHECK-NEXT: vmv.s.x v8, a0
169 %a = call <vscale x 32 x i16> @llvm.riscv.vmv.s.x.nxv32i16(<vscale x 32 x i16> %0, i16 %1, i64 %2)
170 ret <vscale x 32 x i16> %a
173 declare <vscale x 1 x i32> @llvm.riscv.vmv.s.x.nxv1i32(<vscale x 1 x i32>, i32, i64);
175 define <vscale x 1 x i32> @intrinsic_vmv.s.x_x_nxv1i32(<vscale x 1 x i32> %0, i32 %1, i64 %2) nounwind {
176 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv1i32:
177 ; CHECK: # %bb.0: # %entry
178 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, tu, ma
179 ; CHECK-NEXT: vmv.s.x v8, a0
182 %a = call <vscale x 1 x i32> @llvm.riscv.vmv.s.x.nxv1i32(<vscale x 1 x i32> %0, i32 %1, i64 %2)
183 ret <vscale x 1 x i32> %a
186 declare <vscale x 2 x i32> @llvm.riscv.vmv.s.x.nxv2i32(<vscale x 2 x i32>, i32, i64);
188 define <vscale x 2 x i32> @intrinsic_vmv.s.x_x_nxv2i32(<vscale x 2 x i32> %0, i32 %1, i64 %2) nounwind {
189 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv2i32:
190 ; CHECK: # %bb.0: # %entry
191 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, tu, ma
192 ; CHECK-NEXT: vmv.s.x v8, a0
195 %a = call <vscale x 2 x i32> @llvm.riscv.vmv.s.x.nxv2i32(<vscale x 2 x i32> %0, i32 %1, i64 %2)
196 ret <vscale x 2 x i32> %a
199 declare <vscale x 4 x i32> @llvm.riscv.vmv.s.x.nxv4i32(<vscale x 4 x i32>, i32, i64);
201 define <vscale x 4 x i32> @intrinsic_vmv.s.x_x_nxv4i32(<vscale x 4 x i32> %0, i32 %1, i64 %2) nounwind {
202 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv4i32:
203 ; CHECK: # %bb.0: # %entry
204 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, tu, ma
205 ; CHECK-NEXT: vmv.s.x v8, a0
208 %a = call <vscale x 4 x i32> @llvm.riscv.vmv.s.x.nxv4i32(<vscale x 4 x i32> %0, i32 %1, i64 %2)
209 ret <vscale x 4 x i32> %a
212 declare <vscale x 8 x i32> @llvm.riscv.vmv.s.x.nxv8i32(<vscale x 8 x i32>, i32, i64);
214 define <vscale x 8 x i32> @intrinsic_vmv.s.x_x_nxv8i32(<vscale x 8 x i32> %0, i32 %1, i64 %2) nounwind {
215 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv8i32:
216 ; CHECK: # %bb.0: # %entry
217 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, tu, ma
218 ; CHECK-NEXT: vmv.s.x v8, a0
221 %a = call <vscale x 8 x i32> @llvm.riscv.vmv.s.x.nxv8i32(<vscale x 8 x i32> %0, i32 %1, i64 %2)
222 ret <vscale x 8 x i32> %a
225 declare <vscale x 16 x i32> @llvm.riscv.vmv.s.x.nxv16i32(<vscale x 16 x i32>, i32, i64);
227 define <vscale x 16 x i32> @intrinsic_vmv.s.x_x_nxv16i32(<vscale x 16 x i32> %0, i32 %1, i64 %2) nounwind {
228 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv16i32:
229 ; CHECK: # %bb.0: # %entry
230 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, tu, ma
231 ; CHECK-NEXT: vmv.s.x v8, a0
234 %a = call <vscale x 16 x i32> @llvm.riscv.vmv.s.x.nxv16i32(<vscale x 16 x i32> %0, i32 %1, i64 %2)
235 ret <vscale x 16 x i32> %a
238 declare <vscale x 1 x i64> @llvm.riscv.vmv.s.x.nxv1i64(<vscale x 1 x i64>, i64, i64);
240 define <vscale x 1 x i64> @intrinsic_vmv.s.x_x_nxv1i64(<vscale x 1 x i64> %0, i64 %1, i64 %2) nounwind {
241 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv1i64:
242 ; CHECK: # %bb.0: # %entry
243 ; CHECK-NEXT: vsetvli zero, a1, e64, m1, tu, ma
244 ; CHECK-NEXT: vmv.s.x v8, a0
247 %a = call <vscale x 1 x i64> @llvm.riscv.vmv.s.x.nxv1i64(<vscale x 1 x i64> %0, i64 %1, i64 %2)
248 ret <vscale x 1 x i64> %a
251 declare <vscale x 2 x i64> @llvm.riscv.vmv.s.x.nxv2i64(<vscale x 2 x i64>, i64, i64);
253 define <vscale x 2 x i64> @intrinsic_vmv.s.x_x_nxv2i64(<vscale x 2 x i64> %0, i64 %1, i64 %2) nounwind {
254 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv2i64:
255 ; CHECK: # %bb.0: # %entry
256 ; CHECK-NEXT: vsetvli zero, a1, e64, m1, tu, ma
257 ; CHECK-NEXT: vmv.s.x v8, a0
260 %a = call <vscale x 2 x i64> @llvm.riscv.vmv.s.x.nxv2i64(<vscale x 2 x i64> %0, i64 %1, i64 %2)
261 ret <vscale x 2 x i64> %a
264 declare <vscale x 4 x i64> @llvm.riscv.vmv.s.x.nxv4i64(<vscale x 4 x i64>, i64, i64);
266 define <vscale x 4 x i64> @intrinsic_vmv.s.x_x_nxv4i64(<vscale x 4 x i64> %0, i64 %1, i64 %2) nounwind {
267 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv4i64:
268 ; CHECK: # %bb.0: # %entry
269 ; CHECK-NEXT: vsetvli zero, a1, e64, m1, tu, ma
270 ; CHECK-NEXT: vmv.s.x v8, a0
273 %a = call <vscale x 4 x i64> @llvm.riscv.vmv.s.x.nxv4i64(<vscale x 4 x i64> %0, i64 %1, i64 %2)
274 ret <vscale x 4 x i64> %a
277 declare <vscale x 8 x i64> @llvm.riscv.vmv.s.x.nxv8i64(<vscale x 8 x i64>, i64, i64);
279 define <vscale x 8 x i64> @intrinsic_vmv.s.x_x_nxv8i64(<vscale x 8 x i64> %0, i64 %1, i64 %2) nounwind {
280 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv8i64:
281 ; CHECK: # %bb.0: # %entry
282 ; CHECK-NEXT: vsetvli zero, a1, e64, m1, tu, ma
283 ; CHECK-NEXT: vmv.s.x v8, a0
286 %a = call <vscale x 8 x i64> @llvm.riscv.vmv.s.x.nxv8i64(<vscale x 8 x i64> %0, i64 %1, i64 %2)
287 ret <vscale x 8 x i64> %a
290 ; We should not emit a tail agnostic vlse for a tail undisturbed vmv.s.x
291 define <vscale x 1 x i64> @intrinsic_vmv.s.x_x_nxv1i64_bug(<vscale x 1 x i64> %0, ptr %1) nounwind {
292 ; CHECK-LABEL: intrinsic_vmv.s.x_x_nxv1i64_bug:
293 ; CHECK: # %bb.0: # %entry
294 ; CHECK-NEXT: ld a0, 0(a0)
295 ; CHECK-NEXT: vsetivli zero, 1, e64, m1, tu, ma
296 ; CHECK-NEXT: vmv.s.x v8, a0
299 %a = load i64, ptr %1, align 8
300 %b = call <vscale x 1 x i64> @llvm.riscv.vmv.s.x.nxv1i64(<vscale x 1 x i64> %0, i64 %a, i64 1)
301 ret <vscale x 1 x i64> %b