1 ; Test the MSA intrinsics that are encoded with the 3R instruction format.
2 ; There are lots of these so this covers those beginning with 'i'
4 ; RUN: llc -march=mips -mattr=+msa,+fp64,+mips32r2 < %s | FileCheck %s
5 ; RUN: llc -march=mipsel -mattr=+msa,+fp64,+mips32r2 < %s | FileCheck %s
7 @llvm_mips_ilvev_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16
8 @llvm_mips_ilvev_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16
9 @llvm_mips_ilvev_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16
11 define void @llvm_mips_ilvev_b_test() nounwind {
13 %0 = load <16 x i8>, ptr @llvm_mips_ilvev_b_ARG1
14 %1 = load <16 x i8>, ptr @llvm_mips_ilvev_b_ARG2
15 %2 = tail call <16 x i8> @llvm.mips.ilvev.b(<16 x i8> %0, <16 x i8> %1)
16 store <16 x i8> %2, ptr @llvm_mips_ilvev_b_RES
20 declare <16 x i8> @llvm.mips.ilvev.b(<16 x i8>, <16 x i8>) nounwind
22 ; CHECK: llvm_mips_ilvev_b_test:
27 ; CHECK: .size llvm_mips_ilvev_b_test
29 @llvm_mips_ilvev_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16
30 @llvm_mips_ilvev_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16
31 @llvm_mips_ilvev_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16
33 define void @llvm_mips_ilvev_h_test() nounwind {
35 %0 = load <8 x i16>, ptr @llvm_mips_ilvev_h_ARG1
36 %1 = load <8 x i16>, ptr @llvm_mips_ilvev_h_ARG2
37 %2 = tail call <8 x i16> @llvm.mips.ilvev.h(<8 x i16> %0, <8 x i16> %1)
38 store <8 x i16> %2, ptr @llvm_mips_ilvev_h_RES
42 declare <8 x i16> @llvm.mips.ilvev.h(<8 x i16>, <8 x i16>) nounwind
44 ; CHECK: llvm_mips_ilvev_h_test:
49 ; CHECK: .size llvm_mips_ilvev_h_test
51 @llvm_mips_ilvev_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
52 @llvm_mips_ilvev_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16
53 @llvm_mips_ilvev_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
55 define void @llvm_mips_ilvev_w_test() nounwind {
57 %0 = load <4 x i32>, ptr @llvm_mips_ilvev_w_ARG1
58 %1 = load <4 x i32>, ptr @llvm_mips_ilvev_w_ARG2
59 %2 = tail call <4 x i32> @llvm.mips.ilvev.w(<4 x i32> %0, <4 x i32> %1)
60 store <4 x i32> %2, ptr @llvm_mips_ilvev_w_RES
64 declare <4 x i32> @llvm.mips.ilvev.w(<4 x i32>, <4 x i32>) nounwind
66 ; CHECK: llvm_mips_ilvev_w_test:
71 ; CHECK: .size llvm_mips_ilvev_w_test
73 @llvm_mips_ilvev_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16
74 @llvm_mips_ilvev_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16
75 @llvm_mips_ilvev_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
77 define void @llvm_mips_ilvev_d_test() nounwind {
79 %0 = load <2 x i64>, ptr @llvm_mips_ilvev_d_ARG1
80 %1 = load <2 x i64>, ptr @llvm_mips_ilvev_d_ARG2
81 %2 = tail call <2 x i64> @llvm.mips.ilvev.d(<2 x i64> %0, <2 x i64> %1)
82 store <2 x i64> %2, ptr @llvm_mips_ilvev_d_RES
86 declare <2 x i64> @llvm.mips.ilvev.d(<2 x i64>, <2 x i64>) nounwind
88 ; CHECK: llvm_mips_ilvev_d_test:
93 ; CHECK: .size llvm_mips_ilvev_d_test
95 @llvm_mips_ilvl_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16
96 @llvm_mips_ilvl_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16
97 @llvm_mips_ilvl_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16
99 define void @llvm_mips_ilvl_b_test() nounwind {
101 %0 = load <16 x i8>, ptr @llvm_mips_ilvl_b_ARG1
102 %1 = load <16 x i8>, ptr @llvm_mips_ilvl_b_ARG2
103 %2 = tail call <16 x i8> @llvm.mips.ilvl.b(<16 x i8> %0, <16 x i8> %1)
104 store <16 x i8> %2, ptr @llvm_mips_ilvl_b_RES
108 declare <16 x i8> @llvm.mips.ilvl.b(<16 x i8>, <16 x i8>) nounwind
110 ; CHECK: llvm_mips_ilvl_b_test:
115 ; CHECK: .size llvm_mips_ilvl_b_test
117 @llvm_mips_ilvl_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16
118 @llvm_mips_ilvl_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16
119 @llvm_mips_ilvl_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16
121 define void @llvm_mips_ilvl_h_test() nounwind {
123 %0 = load <8 x i16>, ptr @llvm_mips_ilvl_h_ARG1
124 %1 = load <8 x i16>, ptr @llvm_mips_ilvl_h_ARG2
125 %2 = tail call <8 x i16> @llvm.mips.ilvl.h(<8 x i16> %0, <8 x i16> %1)
126 store <8 x i16> %2, ptr @llvm_mips_ilvl_h_RES
130 declare <8 x i16> @llvm.mips.ilvl.h(<8 x i16>, <8 x i16>) nounwind
132 ; CHECK: llvm_mips_ilvl_h_test:
137 ; CHECK: .size llvm_mips_ilvl_h_test
139 @llvm_mips_ilvl_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
140 @llvm_mips_ilvl_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16
141 @llvm_mips_ilvl_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
143 define void @llvm_mips_ilvl_w_test() nounwind {
145 %0 = load <4 x i32>, ptr @llvm_mips_ilvl_w_ARG1
146 %1 = load <4 x i32>, ptr @llvm_mips_ilvl_w_ARG2
147 %2 = tail call <4 x i32> @llvm.mips.ilvl.w(<4 x i32> %0, <4 x i32> %1)
148 store <4 x i32> %2, ptr @llvm_mips_ilvl_w_RES
152 declare <4 x i32> @llvm.mips.ilvl.w(<4 x i32>, <4 x i32>) nounwind
154 ; CHECK: llvm_mips_ilvl_w_test:
159 ; CHECK: .size llvm_mips_ilvl_w_test
161 @llvm_mips_ilvl_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16
162 @llvm_mips_ilvl_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16
163 @llvm_mips_ilvl_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
165 define void @llvm_mips_ilvl_d_test() nounwind {
167 %0 = load <2 x i64>, ptr @llvm_mips_ilvl_d_ARG1
168 %1 = load <2 x i64>, ptr @llvm_mips_ilvl_d_ARG2
169 %2 = tail call <2 x i64> @llvm.mips.ilvl.d(<2 x i64> %0, <2 x i64> %1)
170 store <2 x i64> %2, ptr @llvm_mips_ilvl_d_RES
174 declare <2 x i64> @llvm.mips.ilvl.d(<2 x i64>, <2 x i64>) nounwind
176 ; CHECK: llvm_mips_ilvl_d_test:
181 ; CHECK: .size llvm_mips_ilvl_d_test
183 @llvm_mips_ilvod_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16
184 @llvm_mips_ilvod_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16
185 @llvm_mips_ilvod_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16
187 define void @llvm_mips_ilvod_b_test() nounwind {
189 %0 = load <16 x i8>, ptr @llvm_mips_ilvod_b_ARG1
190 %1 = load <16 x i8>, ptr @llvm_mips_ilvod_b_ARG2
191 %2 = tail call <16 x i8> @llvm.mips.ilvod.b(<16 x i8> %0, <16 x i8> %1)
192 store <16 x i8> %2, ptr @llvm_mips_ilvod_b_RES
196 declare <16 x i8> @llvm.mips.ilvod.b(<16 x i8>, <16 x i8>) nounwind
198 ; CHECK: llvm_mips_ilvod_b_test:
203 ; CHECK: .size llvm_mips_ilvod_b_test
205 @llvm_mips_ilvod_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16
206 @llvm_mips_ilvod_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16
207 @llvm_mips_ilvod_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16
209 define void @llvm_mips_ilvod_h_test() nounwind {
211 %0 = load <8 x i16>, ptr @llvm_mips_ilvod_h_ARG1
212 %1 = load <8 x i16>, ptr @llvm_mips_ilvod_h_ARG2
213 %2 = tail call <8 x i16> @llvm.mips.ilvod.h(<8 x i16> %0, <8 x i16> %1)
214 store <8 x i16> %2, ptr @llvm_mips_ilvod_h_RES
218 declare <8 x i16> @llvm.mips.ilvod.h(<8 x i16>, <8 x i16>) nounwind
220 ; CHECK: llvm_mips_ilvod_h_test:
225 ; CHECK: .size llvm_mips_ilvod_h_test
227 @llvm_mips_ilvod_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
228 @llvm_mips_ilvod_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16
229 @llvm_mips_ilvod_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
231 define void @llvm_mips_ilvod_w_test() nounwind {
233 %0 = load <4 x i32>, ptr @llvm_mips_ilvod_w_ARG1
234 %1 = load <4 x i32>, ptr @llvm_mips_ilvod_w_ARG2
235 %2 = tail call <4 x i32> @llvm.mips.ilvod.w(<4 x i32> %0, <4 x i32> %1)
236 store <4 x i32> %2, ptr @llvm_mips_ilvod_w_RES
240 declare <4 x i32> @llvm.mips.ilvod.w(<4 x i32>, <4 x i32>) nounwind
242 ; CHECK: llvm_mips_ilvod_w_test:
247 ; CHECK: .size llvm_mips_ilvod_w_test
249 @llvm_mips_ilvod_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16
250 @llvm_mips_ilvod_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16
251 @llvm_mips_ilvod_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
253 define void @llvm_mips_ilvod_d_test() nounwind {
255 %0 = load <2 x i64>, ptr @llvm_mips_ilvod_d_ARG1
256 %1 = load <2 x i64>, ptr @llvm_mips_ilvod_d_ARG2
257 %2 = tail call <2 x i64> @llvm.mips.ilvod.d(<2 x i64> %0, <2 x i64> %1)
258 store <2 x i64> %2, ptr @llvm_mips_ilvod_d_RES
262 declare <2 x i64> @llvm.mips.ilvod.d(<2 x i64>, <2 x i64>) nounwind
264 ; CHECK: llvm_mips_ilvod_d_test:
269 ; CHECK: .size llvm_mips_ilvod_d_test
271 @llvm_mips_ilvr_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16
272 @llvm_mips_ilvr_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16
273 @llvm_mips_ilvr_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16
275 define void @llvm_mips_ilvr_b_test() nounwind {
277 %0 = load <16 x i8>, ptr @llvm_mips_ilvr_b_ARG1
278 %1 = load <16 x i8>, ptr @llvm_mips_ilvr_b_ARG2
279 %2 = tail call <16 x i8> @llvm.mips.ilvr.b(<16 x i8> %0, <16 x i8> %1)
280 store <16 x i8> %2, ptr @llvm_mips_ilvr_b_RES
284 declare <16 x i8> @llvm.mips.ilvr.b(<16 x i8>, <16 x i8>) nounwind
286 ; CHECK: llvm_mips_ilvr_b_test:
291 ; CHECK: .size llvm_mips_ilvr_b_test
293 @llvm_mips_ilvr_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16
294 @llvm_mips_ilvr_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16
295 @llvm_mips_ilvr_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16
297 define void @llvm_mips_ilvr_h_test() nounwind {
299 %0 = load <8 x i16>, ptr @llvm_mips_ilvr_h_ARG1
300 %1 = load <8 x i16>, ptr @llvm_mips_ilvr_h_ARG2
301 %2 = tail call <8 x i16> @llvm.mips.ilvr.h(<8 x i16> %0, <8 x i16> %1)
302 store <8 x i16> %2, ptr @llvm_mips_ilvr_h_RES
306 declare <8 x i16> @llvm.mips.ilvr.h(<8 x i16>, <8 x i16>) nounwind
308 ; CHECK: llvm_mips_ilvr_h_test:
313 ; CHECK: .size llvm_mips_ilvr_h_test
315 @llvm_mips_ilvr_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
316 @llvm_mips_ilvr_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16
317 @llvm_mips_ilvr_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
319 define void @llvm_mips_ilvr_w_test() nounwind {
321 %0 = load <4 x i32>, ptr @llvm_mips_ilvr_w_ARG1
322 %1 = load <4 x i32>, ptr @llvm_mips_ilvr_w_ARG2
323 %2 = tail call <4 x i32> @llvm.mips.ilvr.w(<4 x i32> %0, <4 x i32> %1)
324 store <4 x i32> %2, ptr @llvm_mips_ilvr_w_RES
328 declare <4 x i32> @llvm.mips.ilvr.w(<4 x i32>, <4 x i32>) nounwind
330 ; CHECK: llvm_mips_ilvr_w_test:
335 ; CHECK: .size llvm_mips_ilvr_w_test
337 @llvm_mips_ilvr_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16
338 @llvm_mips_ilvr_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16
339 @llvm_mips_ilvr_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
341 define void @llvm_mips_ilvr_d_test() nounwind {
343 %0 = load <2 x i64>, ptr @llvm_mips_ilvr_d_ARG1
344 %1 = load <2 x i64>, ptr @llvm_mips_ilvr_d_ARG2
345 %2 = tail call <2 x i64> @llvm.mips.ilvr.d(<2 x i64> %0, <2 x i64> %1)
346 store <2 x i64> %2, ptr @llvm_mips_ilvr_d_RES
350 declare <2 x i64> @llvm.mips.ilvr.d(<2 x i64>, <2 x i64>) nounwind
352 ; CHECK: llvm_mips_ilvr_d_test:
357 ; CHECK: .size llvm_mips_ilvr_d_test