1 ; Test the MSA intrinsics that are encoded with the ELM instruction format and
2 ; are either shifts or slides.
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_sldi_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_sldi_b_ARG2 = 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
9 @llvm_mips_sldi_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_sldi_b_test() nounwind {
13 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_sldi_b_ARG1
14 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_sldi_b_ARG2
15 %2 = tail call <16 x i8> @llvm.mips.sldi.b(<16 x i8> %0, <16 x i8> %1, i32 1)
16 store <16 x i8> %2, <16 x i8>* @llvm_mips_sldi_b_RES
20 declare <16 x i8> @llvm.mips.sldi.b(<16 x i8>, <16 x i8>, i32) nounwind
22 ; CHECK: llvm_mips_sldi_b_test:
26 ; CHECK: .size llvm_mips_sldi_b_test
28 @llvm_mips_sldi_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16
29 @llvm_mips_sldi_h_ARG2 = 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_sldi_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16
32 define void @llvm_mips_sldi_h_test() nounwind {
34 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_sldi_h_ARG1
35 %1 = load <8 x i16>, <8 x i16>* @llvm_mips_sldi_h_ARG2
36 %2 = tail call <8 x i16> @llvm.mips.sldi.h(<8 x i16> %0, <8 x i16> %1, i32 1)
37 store <8 x i16> %2, <8 x i16>* @llvm_mips_sldi_h_RES
41 declare <8 x i16> @llvm.mips.sldi.h(<8 x i16>, <8 x i16>, i32) nounwind
43 ; CHECK: llvm_mips_sldi_h_test:
47 ; CHECK: .size llvm_mips_sldi_h_test
49 @llvm_mips_sldi_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
50 @llvm_mips_sldi_w_ARG2 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
51 @llvm_mips_sldi_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
53 define void @llvm_mips_sldi_w_test() nounwind {
55 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_sldi_w_ARG1
56 %1 = load <4 x i32>, <4 x i32>* @llvm_mips_sldi_w_ARG2
57 %2 = tail call <4 x i32> @llvm.mips.sldi.w(<4 x i32> %0, <4 x i32> %1, i32 1)
58 store <4 x i32> %2, <4 x i32>* @llvm_mips_sldi_w_RES
62 declare <4 x i32> @llvm.mips.sldi.w(<4 x i32>, <4 x i32>, i32) nounwind
64 ; CHECK: llvm_mips_sldi_w_test:
68 ; CHECK: .size llvm_mips_sldi_w_test
70 @llvm_mips_sldi_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16
71 @llvm_mips_sldi_d_ARG2 = global <2 x i64> <i64 0, i64 1>, align 16
72 @llvm_mips_sldi_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
74 define void @llvm_mips_sldi_d_test() nounwind {
76 %0 = load <2 x i64>, <2 x i64>* @llvm_mips_sldi_d_ARG1
77 %1 = load <2 x i64>, <2 x i64>* @llvm_mips_sldi_d_ARG2
78 %2 = tail call <2 x i64> @llvm.mips.sldi.d(<2 x i64> %0, <2 x i64> %1, i32 1)
79 store <2 x i64> %2, <2 x i64>* @llvm_mips_sldi_d_RES
83 declare <2 x i64> @llvm.mips.sldi.d(<2 x i64>, <2 x i64>, i32) nounwind
85 ; CHECK: llvm_mips_sldi_d_test:
89 ; CHECK: .size llvm_mips_sldi_d_test
91 @llvm_mips_splati_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
92 @llvm_mips_splati_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
94 define void @llvm_mips_splati_b_test() nounwind {
96 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_splati_b_ARG1
97 %1 = tail call <16 x i8> @llvm.mips.splati.b(<16 x i8> %0, i32 1)
98 store <16 x i8> %1, <16 x i8>* @llvm_mips_splati_b_RES
102 declare <16 x i8> @llvm.mips.splati.b(<16 x i8>, i32) nounwind
104 ; CHECK: llvm_mips_splati_b_test:
108 ; CHECK: .size llvm_mips_splati_b_test
110 @llvm_mips_splati_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16
111 @llvm_mips_splati_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16
113 define void @llvm_mips_splati_h_test() nounwind {
115 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_splati_h_ARG1
116 %1 = tail call <8 x i16> @llvm.mips.splati.h(<8 x i16> %0, i32 1)
117 store <8 x i16> %1, <8 x i16>* @llvm_mips_splati_h_RES
121 declare <8 x i16> @llvm.mips.splati.h(<8 x i16>, i32) nounwind
123 ; CHECK: llvm_mips_splati_h_test:
127 ; CHECK: .size llvm_mips_splati_h_test
129 @llvm_mips_splati_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
130 @llvm_mips_splati_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
132 define void @llvm_mips_splati_w_test() nounwind {
134 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_splati_w_ARG1
135 %1 = tail call <4 x i32> @llvm.mips.splati.w(<4 x i32> %0, i32 1)
136 store <4 x i32> %1, <4 x i32>* @llvm_mips_splati_w_RES
140 declare <4 x i32> @llvm.mips.splati.w(<4 x i32>, i32) nounwind
142 ; CHECK: llvm_mips_splati_w_test:
146 ; CHECK: .size llvm_mips_splati_w_test
148 @llvm_mips_splati_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16
149 @llvm_mips_splati_d_RES = global <2 x i64> <i64 0, i64 0>, align 16
151 define void @llvm_mips_splati_d_test() nounwind {
153 %0 = load <2 x i64>, <2 x i64>* @llvm_mips_splati_d_ARG1
154 %1 = tail call <2 x i64> @llvm.mips.splati.d(<2 x i64> %0, i32 1)
155 store <2 x i64> %1, <2 x i64>* @llvm_mips_splati_d_RES
159 declare <2 x i64> @llvm.mips.splati.d(<2 x i64>, i32) nounwind
161 ; CHECK: llvm_mips_splati_d_test:
165 ; CHECK: .size llvm_mips_splati_d_test