1 ; Test the MSA intrinsics that are encoded with the 3RF instruction format.
3 ; RUN: llc -march=mips -mattr=+msa,+fp64,+mips32r2 < %s | FileCheck %s
4 ; RUN: llc -march=mipsel -mattr=+msa,+fp64,+mips32r2 < %s | FileCheck %s
6 @llvm_mips_fadd_w_ARG1 = global <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, align 16
7 @llvm_mips_fadd_w_ARG2 = global <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, align 16
8 @llvm_mips_fadd_w_RES = global <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, align 16
10 define void @llvm_mips_fadd_w_test() nounwind {
12 %0 = load <4 x float>, ptr @llvm_mips_fadd_w_ARG1
13 %1 = load <4 x float>, ptr @llvm_mips_fadd_w_ARG2
14 %2 = tail call <4 x float> @llvm.mips.fadd.w(<4 x float> %0, <4 x float> %1)
15 store <4 x float> %2, ptr @llvm_mips_fadd_w_RES
19 declare <4 x float> @llvm.mips.fadd.w(<4 x float>, <4 x float>) nounwind
21 ; CHECK: llvm_mips_fadd_w_test:
26 ; CHECK: .size llvm_mips_fadd_w_test
28 @llvm_mips_fadd_d_ARG1 = global <2 x double> <double 0.000000e+00, double 1.000000e+00>, align 16
29 @llvm_mips_fadd_d_ARG2 = global <2 x double> <double 2.000000e+00, double 3.000000e+00>, align 16
30 @llvm_mips_fadd_d_RES = global <2 x double> <double 0.000000e+00, double 0.000000e+00>, align 16
32 define void @llvm_mips_fadd_d_test() nounwind {
34 %0 = load <2 x double>, ptr @llvm_mips_fadd_d_ARG1
35 %1 = load <2 x double>, ptr @llvm_mips_fadd_d_ARG2
36 %2 = tail call <2 x double> @llvm.mips.fadd.d(<2 x double> %0, <2 x double> %1)
37 store <2 x double> %2, ptr @llvm_mips_fadd_d_RES
41 declare <2 x double> @llvm.mips.fadd.d(<2 x double>, <2 x double>) nounwind
43 ; CHECK: llvm_mips_fadd_d_test:
48 ; CHECK: .size llvm_mips_fadd_d_test
50 define void @fadd_w_test() nounwind {
52 %0 = load <4 x float>, ptr @llvm_mips_fadd_w_ARG1
53 %1 = load <4 x float>, ptr @llvm_mips_fadd_w_ARG2
54 %2 = fadd <4 x float> %0, %1
55 store <4 x float> %2, ptr @llvm_mips_fadd_w_RES
64 ; CHECK: .size fadd_w_test
66 define void @fadd_d_test() nounwind {
68 %0 = load <2 x double>, ptr @llvm_mips_fadd_d_ARG1
69 %1 = load <2 x double>, ptr @llvm_mips_fadd_d_ARG2
70 %2 = fadd <2 x double> %0, %1
71 store <2 x double> %2, ptr @llvm_mips_fadd_d_RES
80 ; CHECK: .size fadd_d_test
82 @llvm_mips_fdiv_w_ARG1 = global <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, align 16
83 @llvm_mips_fdiv_w_ARG2 = global <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, align 16
84 @llvm_mips_fdiv_w_RES = global <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, align 16
86 define void @llvm_mips_fdiv_w_test() nounwind {
88 %0 = load <4 x float>, ptr @llvm_mips_fdiv_w_ARG1
89 %1 = load <4 x float>, ptr @llvm_mips_fdiv_w_ARG2
90 %2 = tail call <4 x float> @llvm.mips.fdiv.w(<4 x float> %0, <4 x float> %1)
91 store <4 x float> %2, ptr @llvm_mips_fdiv_w_RES
95 declare <4 x float> @llvm.mips.fdiv.w(<4 x float>, <4 x float>) nounwind
97 ; CHECK: llvm_mips_fdiv_w_test:
102 ; CHECK: .size llvm_mips_fdiv_w_test
104 @llvm_mips_fdiv_d_ARG1 = global <2 x double> <double 0.000000e+00, double 1.000000e+00>, align 16
105 @llvm_mips_fdiv_d_ARG2 = global <2 x double> <double 2.000000e+00, double 3.000000e+00>, align 16
106 @llvm_mips_fdiv_d_RES = global <2 x double> <double 0.000000e+00, double 0.000000e+00>, align 16
108 define void @llvm_mips_fdiv_d_test() nounwind {
110 %0 = load <2 x double>, ptr @llvm_mips_fdiv_d_ARG1
111 %1 = load <2 x double>, ptr @llvm_mips_fdiv_d_ARG2
112 %2 = tail call <2 x double> @llvm.mips.fdiv.d(<2 x double> %0, <2 x double> %1)
113 store <2 x double> %2, ptr @llvm_mips_fdiv_d_RES
117 declare <2 x double> @llvm.mips.fdiv.d(<2 x double>, <2 x double>) nounwind
119 ; CHECK: llvm_mips_fdiv_d_test:
124 ; CHECK: .size llvm_mips_fdiv_d_test
126 define void @fdiv_w_test() nounwind {
128 %0 = load <4 x float>, ptr @llvm_mips_fdiv_w_ARG1
129 %1 = load <4 x float>, ptr @llvm_mips_fdiv_w_ARG2
130 %2 = fdiv <4 x float> %0, %1
131 store <4 x float> %2, ptr @llvm_mips_fdiv_w_RES
135 ; CHECK: fdiv_w_test:
140 ; CHECK: .size fdiv_w_test
142 define void @fdiv_d_test() nounwind {
144 %0 = load <2 x double>, ptr @llvm_mips_fdiv_d_ARG1
145 %1 = load <2 x double>, ptr @llvm_mips_fdiv_d_ARG2
146 %2 = fdiv <2 x double> %0, %1
147 store <2 x double> %2, ptr @llvm_mips_fdiv_d_RES
151 ; CHECK: fdiv_d_test:
156 ; CHECK: .size fdiv_d_test
158 @llvm_mips_fmin_w_ARG1 = global <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, align 16
159 @llvm_mips_fmin_w_ARG2 = global <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, align 16
160 @llvm_mips_fmin_w_RES = global <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, align 16
162 define void @llvm_mips_fmin_w_test() nounwind {
164 %0 = load <4 x float>, ptr @llvm_mips_fmin_w_ARG1
165 %1 = load <4 x float>, ptr @llvm_mips_fmin_w_ARG2
166 %2 = tail call <4 x float> @llvm.mips.fmin.w(<4 x float> %0, <4 x float> %1)
167 store <4 x float> %2, ptr @llvm_mips_fmin_w_RES
171 declare <4 x float> @llvm.mips.fmin.w(<4 x float>, <4 x float>) nounwind
173 ; CHECK: llvm_mips_fmin_w_test:
178 ; CHECK: .size llvm_mips_fmin_w_test
180 @llvm_mips_fmin_d_ARG1 = global <2 x double> <double 0.000000e+00, double 1.000000e+00>, align 16
181 @llvm_mips_fmin_d_ARG2 = global <2 x double> <double 2.000000e+00, double 3.000000e+00>, align 16
182 @llvm_mips_fmin_d_RES = global <2 x double> <double 0.000000e+00, double 0.000000e+00>, align 16
184 define void @llvm_mips_fmin_d_test() nounwind {
186 %0 = load <2 x double>, ptr @llvm_mips_fmin_d_ARG1
187 %1 = load <2 x double>, ptr @llvm_mips_fmin_d_ARG2
188 %2 = tail call <2 x double> @llvm.mips.fmin.d(<2 x double> %0, <2 x double> %1)
189 store <2 x double> %2, ptr @llvm_mips_fmin_d_RES
193 declare <2 x double> @llvm.mips.fmin.d(<2 x double>, <2 x double>) nounwind
195 ; CHECK: llvm_mips_fmin_d_test:
200 ; CHECK: .size llvm_mips_fmin_d_test
202 @llvm_mips_fmin_a_w_ARG1 = global <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, align 16
203 @llvm_mips_fmin_a_w_ARG2 = global <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, align 16
204 @llvm_mips_fmin_a_w_RES = global <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, align 16
206 define void @llvm_mips_fmin_a_w_test() nounwind {
208 %0 = load <4 x float>, ptr @llvm_mips_fmin_a_w_ARG1
209 %1 = load <4 x float>, ptr @llvm_mips_fmin_a_w_ARG2
210 %2 = tail call <4 x float> @llvm.mips.fmin.a.w(<4 x float> %0, <4 x float> %1)
211 store <4 x float> %2, ptr @llvm_mips_fmin_a_w_RES
215 declare <4 x float> @llvm.mips.fmin.a.w(<4 x float>, <4 x float>) nounwind
217 ; CHECK: llvm_mips_fmin_a_w_test:
222 ; CHECK: .size llvm_mips_fmin_a_w_test
224 @llvm_mips_fmin_a_d_ARG1 = global <2 x double> <double 0.000000e+00, double 1.000000e+00>, align 16
225 @llvm_mips_fmin_a_d_ARG2 = global <2 x double> <double 2.000000e+00, double 3.000000e+00>, align 16
226 @llvm_mips_fmin_a_d_RES = global <2 x double> <double 0.000000e+00, double 0.000000e+00>, align 16
228 define void @llvm_mips_fmin_a_d_test() nounwind {
230 %0 = load <2 x double>, ptr @llvm_mips_fmin_a_d_ARG1
231 %1 = load <2 x double>, ptr @llvm_mips_fmin_a_d_ARG2
232 %2 = tail call <2 x double> @llvm.mips.fmin.a.d(<2 x double> %0, <2 x double> %1)
233 store <2 x double> %2, ptr @llvm_mips_fmin_a_d_RES
237 declare <2 x double> @llvm.mips.fmin.a.d(<2 x double>, <2 x double>) nounwind
239 ; CHECK: llvm_mips_fmin_a_d_test:
244 ; CHECK: .size llvm_mips_fmin_a_d_test
246 @llvm_mips_fmax_w_ARG1 = global <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, align 16
247 @llvm_mips_fmax_w_ARG2 = global <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, align 16
248 @llvm_mips_fmax_w_RES = global <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, align 16
250 define void @llvm_mips_fmax_w_test() nounwind {
252 %0 = load <4 x float>, ptr @llvm_mips_fmax_w_ARG1
253 %1 = load <4 x float>, ptr @llvm_mips_fmax_w_ARG2
254 %2 = tail call <4 x float> @llvm.mips.fmax.w(<4 x float> %0, <4 x float> %1)
255 store <4 x float> %2, ptr @llvm_mips_fmax_w_RES
259 declare <4 x float> @llvm.mips.fmax.w(<4 x float>, <4 x float>) nounwind
261 ; CHECK: llvm_mips_fmax_w_test:
266 ; CHECK: .size llvm_mips_fmax_w_test
268 @llvm_mips_fmax_d_ARG1 = global <2 x double> <double 0.000000e+00, double 1.000000e+00>, align 16
269 @llvm_mips_fmax_d_ARG2 = global <2 x double> <double 2.000000e+00, double 3.000000e+00>, align 16
270 @llvm_mips_fmax_d_RES = global <2 x double> <double 0.000000e+00, double 0.000000e+00>, align 16
272 define void @llvm_mips_fmax_d_test() nounwind {
274 %0 = load <2 x double>, ptr @llvm_mips_fmax_d_ARG1
275 %1 = load <2 x double>, ptr @llvm_mips_fmax_d_ARG2
276 %2 = tail call <2 x double> @llvm.mips.fmax.d(<2 x double> %0, <2 x double> %1)
277 store <2 x double> %2, ptr @llvm_mips_fmax_d_RES
281 declare <2 x double> @llvm.mips.fmax.d(<2 x double>, <2 x double>) nounwind
283 ; CHECK: llvm_mips_fmax_d_test:
288 ; CHECK: .size llvm_mips_fmax_d_test
290 @llvm_mips_fmax_a_w_ARG1 = global <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, align 16
291 @llvm_mips_fmax_a_w_ARG2 = global <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, align 16
292 @llvm_mips_fmax_a_w_RES = global <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, align 16
294 define void @llvm_mips_fmax_a_w_test() nounwind {
296 %0 = load <4 x float>, ptr @llvm_mips_fmax_a_w_ARG1
297 %1 = load <4 x float>, ptr @llvm_mips_fmax_a_w_ARG2
298 %2 = tail call <4 x float> @llvm.mips.fmax.a.w(<4 x float> %0, <4 x float> %1)
299 store <4 x float> %2, ptr @llvm_mips_fmax_a_w_RES
303 declare <4 x float> @llvm.mips.fmax.a.w(<4 x float>, <4 x float>) nounwind
305 ; CHECK: llvm_mips_fmax_a_w_test:
310 ; CHECK: .size llvm_mips_fmax_a_w_test
312 @llvm_mips_fmax_a_d_ARG1 = global <2 x double> <double 0.000000e+00, double 1.000000e+00>, align 16
313 @llvm_mips_fmax_a_d_ARG2 = global <2 x double> <double 2.000000e+00, double 3.000000e+00>, align 16
314 @llvm_mips_fmax_a_d_RES = global <2 x double> <double 0.000000e+00, double 0.000000e+00>, align 16
316 define void @llvm_mips_fmax_a_d_test() nounwind {
318 %0 = load <2 x double>, ptr @llvm_mips_fmax_a_d_ARG1
319 %1 = load <2 x double>, ptr @llvm_mips_fmax_a_d_ARG2
320 %2 = tail call <2 x double> @llvm.mips.fmax.a.d(<2 x double> %0, <2 x double> %1)
321 store <2 x double> %2, ptr @llvm_mips_fmax_a_d_RES
325 declare <2 x double> @llvm.mips.fmax.a.d(<2 x double>, <2 x double>) nounwind
327 ; CHECK: llvm_mips_fmax_a_d_test:
332 ; CHECK: .size llvm_mips_fmax_a_d_test
334 @llvm_mips_fmul_w_ARG1 = global <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, align 16
335 @llvm_mips_fmul_w_ARG2 = global <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, align 16
336 @llvm_mips_fmul_w_RES = global <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, align 16
338 define void @llvm_mips_fmul_w_test() nounwind {
340 %0 = load <4 x float>, ptr @llvm_mips_fmul_w_ARG1
341 %1 = load <4 x float>, ptr @llvm_mips_fmul_w_ARG2
342 %2 = tail call <4 x float> @llvm.mips.fmul.w(<4 x float> %0, <4 x float> %1)
343 store <4 x float> %2, ptr @llvm_mips_fmul_w_RES
347 declare <4 x float> @llvm.mips.fmul.w(<4 x float>, <4 x float>) nounwind
349 ; CHECK: llvm_mips_fmul_w_test:
354 ; CHECK: .size llvm_mips_fmul_w_test
356 @llvm_mips_fmul_d_ARG1 = global <2 x double> <double 0.000000e+00, double 1.000000e+00>, align 16
357 @llvm_mips_fmul_d_ARG2 = global <2 x double> <double 2.000000e+00, double 3.000000e+00>, align 16
358 @llvm_mips_fmul_d_RES = global <2 x double> <double 0.000000e+00, double 0.000000e+00>, align 16
360 define void @llvm_mips_fmul_d_test() nounwind {
362 %0 = load <2 x double>, ptr @llvm_mips_fmul_d_ARG1
363 %1 = load <2 x double>, ptr @llvm_mips_fmul_d_ARG2
364 %2 = tail call <2 x double> @llvm.mips.fmul.d(<2 x double> %0, <2 x double> %1)
365 store <2 x double> %2, ptr @llvm_mips_fmul_d_RES
369 declare <2 x double> @llvm.mips.fmul.d(<2 x double>, <2 x double>) nounwind
371 ; CHECK: llvm_mips_fmul_d_test:
376 ; CHECK: .size llvm_mips_fmul_d_test
378 define void @fmul_w_test() nounwind {
380 %0 = load <4 x float>, ptr @llvm_mips_fmul_w_ARG1
381 %1 = load <4 x float>, ptr @llvm_mips_fmul_w_ARG2
382 %2 = fmul <4 x float> %0, %1
383 store <4 x float> %2, ptr @llvm_mips_fmul_w_RES
387 ; CHECK: fmul_w_test:
392 ; CHECK: .size fmul_w_test
394 define void @fmul_d_test() nounwind {
396 %0 = load <2 x double>, ptr @llvm_mips_fmul_d_ARG1
397 %1 = load <2 x double>, ptr @llvm_mips_fmul_d_ARG2
398 %2 = fmul <2 x double> %0, %1
399 store <2 x double> %2, ptr @llvm_mips_fmul_d_RES
403 ; CHECK: fmul_d_test:
408 ; CHECK: .size fmul_d_test
410 @llvm_mips_fsub_w_ARG1 = global <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, align 16
411 @llvm_mips_fsub_w_ARG2 = global <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, align 16
412 @llvm_mips_fsub_w_RES = global <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, align 16
414 define void @llvm_mips_fsub_w_test() nounwind {
416 %0 = load <4 x float>, ptr @llvm_mips_fsub_w_ARG1
417 %1 = load <4 x float>, ptr @llvm_mips_fsub_w_ARG2
418 %2 = tail call <4 x float> @llvm.mips.fsub.w(<4 x float> %0, <4 x float> %1)
419 store <4 x float> %2, ptr @llvm_mips_fsub_w_RES
423 declare <4 x float> @llvm.mips.fsub.w(<4 x float>, <4 x float>) nounwind
425 ; CHECK: llvm_mips_fsub_w_test:
430 ; CHECK: .size llvm_mips_fsub_w_test
432 @llvm_mips_fsub_d_ARG1 = global <2 x double> <double 0.000000e+00, double 1.000000e+00>, align 16
433 @llvm_mips_fsub_d_ARG2 = global <2 x double> <double 2.000000e+00, double 3.000000e+00>, align 16
434 @llvm_mips_fsub_d_RES = global <2 x double> <double 0.000000e+00, double 0.000000e+00>, align 16
436 define void @llvm_mips_fsub_d_test() nounwind {
438 %0 = load <2 x double>, ptr @llvm_mips_fsub_d_ARG1
439 %1 = load <2 x double>, ptr @llvm_mips_fsub_d_ARG2
440 %2 = tail call <2 x double> @llvm.mips.fsub.d(<2 x double> %0, <2 x double> %1)
441 store <2 x double> %2, ptr @llvm_mips_fsub_d_RES
445 declare <2 x double> @llvm.mips.fsub.d(<2 x double>, <2 x double>) nounwind
447 ; CHECK: llvm_mips_fsub_d_test:
452 ; CHECK: .size llvm_mips_fsub_d_test
455 define void @fsub_w_test() nounwind {
457 %0 = load <4 x float>, ptr @llvm_mips_fsub_w_ARG1
458 %1 = load <4 x float>, ptr @llvm_mips_fsub_w_ARG2
459 %2 = fsub <4 x float> %0, %1
460 store <4 x float> %2, ptr @llvm_mips_fsub_w_RES
464 ; CHECK: fsub_w_test:
469 ; CHECK: .size fsub_w_test
471 define void @fsub_d_test() nounwind {
473 %0 = load <2 x double>, ptr @llvm_mips_fsub_d_ARG1
474 %1 = load <2 x double>, ptr @llvm_mips_fsub_d_ARG2
475 %2 = fsub <2 x double> %0, %1
476 store <2 x double> %2, ptr @llvm_mips_fsub_d_RES
480 ; CHECK: fsub_d_test:
485 ; CHECK: .size fsub_d_test