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 'd'
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_div_s_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_div_s_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_div_s_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_div_s_b_test() nounwind {
13 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_div_s_b_ARG1
14 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_div_s_b_ARG2
15 %2 = tail call <16 x i8> @llvm.mips.div.s.b(<16 x i8> %0, <16 x i8> %1)
16 store <16 x i8> %2, <16 x i8>* @llvm_mips_div_s_b_RES
20 declare <16 x i8> @llvm.mips.div.s.b(<16 x i8>, <16 x i8>) nounwind
22 ; CHECK: llvm_mips_div_s_b_test:
27 ; CHECK: .size llvm_mips_div_s_b_test
29 @llvm_mips_div_s_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_div_s_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_div_s_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_div_s_h_test() nounwind {
35 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_div_s_h_ARG1
36 %1 = load <8 x i16>, <8 x i16>* @llvm_mips_div_s_h_ARG2
37 %2 = tail call <8 x i16> @llvm.mips.div.s.h(<8 x i16> %0, <8 x i16> %1)
38 store <8 x i16> %2, <8 x i16>* @llvm_mips_div_s_h_RES
42 declare <8 x i16> @llvm.mips.div.s.h(<8 x i16>, <8 x i16>) nounwind
44 ; CHECK: llvm_mips_div_s_h_test:
49 ; CHECK: .size llvm_mips_div_s_h_test
51 @llvm_mips_div_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
52 @llvm_mips_div_s_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16
53 @llvm_mips_div_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
55 define void @llvm_mips_div_s_w_test() nounwind {
57 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_div_s_w_ARG1
58 %1 = load <4 x i32>, <4 x i32>* @llvm_mips_div_s_w_ARG2
59 %2 = tail call <4 x i32> @llvm.mips.div.s.w(<4 x i32> %0, <4 x i32> %1)
60 store <4 x i32> %2, <4 x i32>* @llvm_mips_div_s_w_RES
64 declare <4 x i32> @llvm.mips.div.s.w(<4 x i32>, <4 x i32>) nounwind
66 ; CHECK: llvm_mips_div_s_w_test:
71 ; CHECK: .size llvm_mips_div_s_w_test
73 @llvm_mips_div_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16
74 @llvm_mips_div_s_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16
75 @llvm_mips_div_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
77 define void @llvm_mips_div_s_d_test() nounwind {
79 %0 = load <2 x i64>, <2 x i64>* @llvm_mips_div_s_d_ARG1
80 %1 = load <2 x i64>, <2 x i64>* @llvm_mips_div_s_d_ARG2
81 %2 = tail call <2 x i64> @llvm.mips.div.s.d(<2 x i64> %0, <2 x i64> %1)
82 store <2 x i64> %2, <2 x i64>* @llvm_mips_div_s_d_RES
86 declare <2 x i64> @llvm.mips.div.s.d(<2 x i64>, <2 x i64>) nounwind
88 ; CHECK: llvm_mips_div_s_d_test:
93 ; CHECK: .size llvm_mips_div_s_d_test
96 define void @div_s_b_test() nounwind {
98 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_div_s_b_ARG1
99 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_div_s_b_ARG2
100 %2 = sdiv <16 x i8> %0, %1
101 store <16 x i8> %2, <16 x i8>* @llvm_mips_div_s_b_RES
105 ; CHECK: div_s_b_test:
110 ; CHECK: .size div_s_b_test
112 define void @div_s_h_test() nounwind {
114 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_div_s_h_ARG1
115 %1 = load <8 x i16>, <8 x i16>* @llvm_mips_div_s_h_ARG2
116 %2 = sdiv <8 x i16> %0, %1
117 store <8 x i16> %2, <8 x i16>* @llvm_mips_div_s_h_RES
121 ; CHECK: div_s_h_test:
126 ; CHECK: .size div_s_h_test
128 define void @div_s_w_test() nounwind {
130 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_div_s_w_ARG1
131 %1 = load <4 x i32>, <4 x i32>* @llvm_mips_div_s_w_ARG2
132 %2 = sdiv <4 x i32> %0, %1
133 store <4 x i32> %2, <4 x i32>* @llvm_mips_div_s_w_RES
137 ; CHECK: div_s_w_test:
142 ; CHECK: .size div_s_w_test
144 define void @div_s_d_test() nounwind {
146 %0 = load <2 x i64>, <2 x i64>* @llvm_mips_div_s_d_ARG1
147 %1 = load <2 x i64>, <2 x i64>* @llvm_mips_div_s_d_ARG2
148 %2 = sdiv <2 x i64> %0, %1
149 store <2 x i64> %2, <2 x i64>* @llvm_mips_div_s_d_RES
153 ; CHECK: div_s_d_test:
158 ; CHECK: .size div_s_d_test
160 @llvm_mips_div_u_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
161 @llvm_mips_div_u_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
162 @llvm_mips_div_u_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
164 define void @llvm_mips_div_u_b_test() nounwind {
166 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_div_u_b_ARG1
167 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_div_u_b_ARG2
168 %2 = tail call <16 x i8> @llvm.mips.div.u.b(<16 x i8> %0, <16 x i8> %1)
169 store <16 x i8> %2, <16 x i8>* @llvm_mips_div_u_b_RES
173 declare <16 x i8> @llvm.mips.div.u.b(<16 x i8>, <16 x i8>) nounwind
175 ; CHECK: llvm_mips_div_u_b_test:
180 ; CHECK: .size llvm_mips_div_u_b_test
182 @llvm_mips_div_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16
183 @llvm_mips_div_u_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16
184 @llvm_mips_div_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16
186 define void @llvm_mips_div_u_h_test() nounwind {
188 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_div_u_h_ARG1
189 %1 = load <8 x i16>, <8 x i16>* @llvm_mips_div_u_h_ARG2
190 %2 = tail call <8 x i16> @llvm.mips.div.u.h(<8 x i16> %0, <8 x i16> %1)
191 store <8 x i16> %2, <8 x i16>* @llvm_mips_div_u_h_RES
195 declare <8 x i16> @llvm.mips.div.u.h(<8 x i16>, <8 x i16>) nounwind
197 ; CHECK: llvm_mips_div_u_h_test:
202 ; CHECK: .size llvm_mips_div_u_h_test
204 @llvm_mips_div_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
205 @llvm_mips_div_u_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16
206 @llvm_mips_div_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
208 define void @llvm_mips_div_u_w_test() nounwind {
210 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_div_u_w_ARG1
211 %1 = load <4 x i32>, <4 x i32>* @llvm_mips_div_u_w_ARG2
212 %2 = tail call <4 x i32> @llvm.mips.div.u.w(<4 x i32> %0, <4 x i32> %1)
213 store <4 x i32> %2, <4 x i32>* @llvm_mips_div_u_w_RES
217 declare <4 x i32> @llvm.mips.div.u.w(<4 x i32>, <4 x i32>) nounwind
219 ; CHECK: llvm_mips_div_u_w_test:
224 ; CHECK: .size llvm_mips_div_u_w_test
226 @llvm_mips_div_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16
227 @llvm_mips_div_u_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16
228 @llvm_mips_div_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
230 define void @llvm_mips_div_u_d_test() nounwind {
232 %0 = load <2 x i64>, <2 x i64>* @llvm_mips_div_u_d_ARG1
233 %1 = load <2 x i64>, <2 x i64>* @llvm_mips_div_u_d_ARG2
234 %2 = tail call <2 x i64> @llvm.mips.div.u.d(<2 x i64> %0, <2 x i64> %1)
235 store <2 x i64> %2, <2 x i64>* @llvm_mips_div_u_d_RES
239 declare <2 x i64> @llvm.mips.div.u.d(<2 x i64>, <2 x i64>) nounwind
241 ; CHECK: llvm_mips_div_u_d_test:
246 ; CHECK: .size llvm_mips_div_u_d_test
249 define void @div_u_b_test() nounwind {
251 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_div_u_b_ARG1
252 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_div_u_b_ARG2
253 %2 = udiv <16 x i8> %0, %1
254 store <16 x i8> %2, <16 x i8>* @llvm_mips_div_u_b_RES
258 ; CHECK: div_u_b_test:
263 ; CHECK: .size div_u_b_test
265 define void @div_u_h_test() nounwind {
267 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_div_u_h_ARG1
268 %1 = load <8 x i16>, <8 x i16>* @llvm_mips_div_u_h_ARG2
269 %2 = udiv <8 x i16> %0, %1
270 store <8 x i16> %2, <8 x i16>* @llvm_mips_div_u_h_RES
274 ; CHECK: div_u_h_test:
279 ; CHECK: .size div_u_h_test
281 define void @div_u_w_test() nounwind {
283 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_div_u_w_ARG1
284 %1 = load <4 x i32>, <4 x i32>* @llvm_mips_div_u_w_ARG2
285 %2 = udiv <4 x i32> %0, %1
286 store <4 x i32> %2, <4 x i32>* @llvm_mips_div_u_w_RES
290 ; CHECK: div_u_w_test:
295 ; CHECK: .size div_u_w_test
297 define void @div_u_d_test() nounwind {
299 %0 = load <2 x i64>, <2 x i64>* @llvm_mips_div_u_d_ARG1
300 %1 = load <2 x i64>, <2 x i64>* @llvm_mips_div_u_d_ARG2
301 %2 = udiv <2 x i64> %0, %1
302 store <2 x i64> %2, <2 x i64>* @llvm_mips_div_u_d_RES
306 ; CHECK: div_u_d_test:
311 ; CHECK: .size div_u_d_test
313 @llvm_mips_dotp_s_h_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3,
314 i8 4, i8 5, i8 6, i8 7,
315 i8 8, i8 9, i8 10, i8 11,
316 i8 12, i8 13, i8 14, i8 15>,
318 @llvm_mips_dotp_s_h_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19,
319 i8 20, i8 21, i8 22, i8 23,
320 i8 24, i8 25, i8 26, i8 27,
321 i8 28, i8 29, i8 30, i8 31>,
323 @llvm_mips_dotp_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0,
324 i16 0, i16 0, i16 0, i16 0>,
327 define void @llvm_mips_dotp_s_h_test() nounwind {
329 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_dotp_s_h_ARG1
330 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_dotp_s_h_ARG2
331 %2 = tail call <8 x i16> @llvm.mips.dotp.s.h(<16 x i8> %0, <16 x i8> %1)
332 store <8 x i16> %2, <8 x i16>* @llvm_mips_dotp_s_h_RES
336 declare <8 x i16> @llvm.mips.dotp.s.h(<16 x i8>, <16 x i8>) nounwind
338 ; CHECK: llvm_mips_dotp_s_h_test:
343 ; CHECK: .size llvm_mips_dotp_s_h_test
345 @llvm_mips_dotp_s_w_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3,
346 i16 4, i16 5, i16 6, i16 7>,
348 @llvm_mips_dotp_s_w_ARG2 = global <8 x i16> <i16 4, i16 5, i16 6, i16 7,
349 i16 8, i16 9, i16 10, i16 11>,
351 @llvm_mips_dotp_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>,
354 define void @llvm_mips_dotp_s_w_test() nounwind {
356 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_dotp_s_w_ARG1
357 %1 = load <8 x i16>, <8 x i16>* @llvm_mips_dotp_s_w_ARG2
358 %2 = tail call <4 x i32> @llvm.mips.dotp.s.w(<8 x i16> %0, <8 x i16> %1)
359 store <4 x i32> %2, <4 x i32>* @llvm_mips_dotp_s_w_RES
363 declare <4 x i32> @llvm.mips.dotp.s.w(<8 x i16>, <8 x i16>) nounwind
365 ; CHECK: llvm_mips_dotp_s_w_test:
370 ; CHECK: .size llvm_mips_dotp_s_w_test
372 @llvm_mips_dotp_s_d_ARG1 = global <4 x i32> <i32 0, i32 1, i32 0, i32 1>,
374 @llvm_mips_dotp_s_d_ARG2 = global <4 x i32> <i32 2, i32 3, i32 2, i32 3>,
376 @llvm_mips_dotp_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
378 define void @llvm_mips_dotp_s_d_test() nounwind {
380 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_dotp_s_d_ARG1
381 %1 = load <4 x i32>, <4 x i32>* @llvm_mips_dotp_s_d_ARG2
382 %2 = tail call <2 x i64> @llvm.mips.dotp.s.d(<4 x i32> %0, <4 x i32> %1)
383 store <2 x i64> %2, <2 x i64>* @llvm_mips_dotp_s_d_RES
387 declare <2 x i64> @llvm.mips.dotp.s.d(<4 x i32>, <4 x i32>) nounwind
389 ; CHECK: llvm_mips_dotp_s_d_test:
394 ; CHECK: .size llvm_mips_dotp_s_d_test
396 @llvm_mips_dotp_u_h_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3,
397 i8 4, i8 5, i8 6, i8 7,
398 i8 8, i8 9, i8 10, i8 11,
399 i8 12, i8 13, i8 14, i8 15>,
401 @llvm_mips_dotp_u_h_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19,
402 i8 20, i8 21, i8 22, i8 23,
403 i8 24, i8 25, i8 26, i8 27,
404 i8 28, i8 29, i8 30, i8 31>,
406 @llvm_mips_dotp_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0,
407 i16 0, i16 0, i16 0, i16 0>,
410 define void @llvm_mips_dotp_u_h_test() nounwind {
412 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_dotp_u_h_ARG1
413 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_dotp_u_h_ARG2
414 %2 = tail call <8 x i16> @llvm.mips.dotp.u.h(<16 x i8> %0, <16 x i8> %1)
415 store <8 x i16> %2, <8 x i16>* @llvm_mips_dotp_u_h_RES
419 declare <8 x i16> @llvm.mips.dotp.u.h(<16 x i8>, <16 x i8>) nounwind
421 ; CHECK: llvm_mips_dotp_u_h_test:
426 ; CHECK: .size llvm_mips_dotp_u_h_test
428 @llvm_mips_dotp_u_w_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3,
429 i16 4, i16 5, i16 6, i16 7>,
431 @llvm_mips_dotp_u_w_ARG2 = global <8 x i16> <i16 4, i16 5, i16 6, i16 7,
432 i16 8, i16 9, i16 10, i16 11>,
434 @llvm_mips_dotp_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>,
437 define void @llvm_mips_dotp_u_w_test() nounwind {
439 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_dotp_u_w_ARG1
440 %1 = load <8 x i16>, <8 x i16>* @llvm_mips_dotp_u_w_ARG2
441 %2 = tail call <4 x i32> @llvm.mips.dotp.u.w(<8 x i16> %0, <8 x i16> %1)
442 store <4 x i32> %2, <4 x i32>* @llvm_mips_dotp_u_w_RES
446 declare <4 x i32> @llvm.mips.dotp.u.w(<8 x i16>, <8 x i16>) nounwind
448 ; CHECK: llvm_mips_dotp_u_w_test:
453 ; CHECK: .size llvm_mips_dotp_u_w_test
455 @llvm_mips_dotp_u_d_ARG1 = global <4 x i32> <i32 0, i32 1, i32 0, i32 1>,
457 @llvm_mips_dotp_u_d_ARG2 = global <4 x i32> <i32 2, i32 3, i32 2, i32 3>,
459 @llvm_mips_dotp_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
461 define void @llvm_mips_dotp_u_d_test() nounwind {
463 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_dotp_u_d_ARG1
464 %1 = load <4 x i32>, <4 x i32>* @llvm_mips_dotp_u_d_ARG2
465 %2 = tail call <2 x i64> @llvm.mips.dotp.u.d(<4 x i32> %0, <4 x i32> %1)
466 store <2 x i64> %2, <2 x i64>* @llvm_mips_dotp_u_d_RES
470 declare <2 x i64> @llvm.mips.dotp.u.d(<4 x i32>, <4 x i32>) nounwind
472 ; CHECK: llvm_mips_dotp_u_d_test:
477 ; CHECK: .size llvm_mips_dotp_u_d_test