1 ; Test the MSA intrinsics that are encoded with the I8 instruction format.
3 ; RUN: llc -march=mips -mattr=+msa,+fp64,+mips32r2 -relocation-model=pic < %s | FileCheck %s
4 ; RUN: llc -march=mipsel -mattr=+msa,+fp64,+mips32r2 -relocation-model=pic < %s | FileCheck %s
6 @llvm_mips_andi_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
7 @llvm_mips_andi_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
9 define void @llvm_mips_andi_b_test() nounwind {
11 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_andi_b_ARG1
12 %1 = tail call <16 x i8> @llvm.mips.andi.b(<16 x i8> %0, i32 25)
13 store <16 x i8> %1, <16 x i8>* @llvm_mips_andi_b_RES
17 declare <16 x i8> @llvm.mips.andi.b(<16 x i8>, i32) nounwind
19 ; CHECK: llvm_mips_andi_b_test:
23 ; CHECK: .size llvm_mips_andi_b_test
25 @llvm_mips_bmnzi_b_ARG1 = 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
26 @llvm_mips_bmnzi_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
27 @llvm_mips_bmnzi_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
29 define void @llvm_mips_bmnzi_b_test() nounwind {
31 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_bmnzi_b_ARG1
32 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_bmnzi_b_ARG2
33 %2 = tail call <16 x i8> @llvm.mips.bmnzi.b(<16 x i8> %0, <16 x i8> %1, i32 25)
34 store <16 x i8> %2, <16 x i8>* @llvm_mips_bmnzi_b_RES
38 declare <16 x i8> @llvm.mips.bmnzi.b(<16 x i8>, <16 x i8>, i32) nounwind
40 ; CHECK: llvm_mips_bmnzi_b_test:
41 ; CHECK-DAG: lw [[R1:\$[0-9]+]], %got(llvm_mips_bmnzi_b_ARG1)(
42 ; CHECK-DAG: lw [[R2:\$[0-9]+]], %got(llvm_mips_bmnzi_b_ARG2)(
43 ; CHECK-DAG: ld.b [[R3:\$w[0-9]+]], 0([[R1]])
44 ; CHECK-DAG: ld.b [[R4:\$w[0-9]+]], 0([[R2]])
45 ; CHECK-DAG: bmnzi.b [[R3]], [[R4]], 25
46 ; CHECK-DAG: st.b [[R3]], 0(
47 ; CHECK: .size llvm_mips_bmnzi_b_test
49 @llvm_mips_bmzi_b_ARG1 = 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
50 @llvm_mips_bmzi_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
51 @llvm_mips_bmzi_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
53 define void @llvm_mips_bmzi_b_test() nounwind {
55 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_bmzi_b_ARG1
56 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_bmzi_b_ARG2
57 %2 = tail call <16 x i8> @llvm.mips.bmzi.b(<16 x i8> %0, <16 x i8> %1, i32 25)
58 store <16 x i8> %2, <16 x i8>* @llvm_mips_bmzi_b_RES
62 declare <16 x i8> @llvm.mips.bmzi.b(<16 x i8>, <16 x i8>, i32) nounwind
64 ; CHECK: llvm_mips_bmzi_b_test:
65 ; CHECK-DAG: lw [[R1:\$[0-9]+]], %got(llvm_mips_bmzi_b_ARG1)(
66 ; CHECK-DAG: lw [[R2:\$[0-9]+]], %got(llvm_mips_bmzi_b_ARG2)(
67 ; CHECK-DAG: ld.b [[R3:\$w[0-9]+]], 0([[R1]])
68 ; CHECK-DAG: ld.b [[R4:\$w[0-9]+]], 0([[R2]])
69 ; bmnzi.b is the same as bmzi.b with ws and wd_in swapped
70 ; CHECK-DAG: bmnzi.b [[R4]], [[R3]], 25
71 ; CHECK-DAG: st.b [[R4]], 0(
72 ; CHECK: .size llvm_mips_bmzi_b_test
74 @llvm_mips_bseli_b_ARG1 = 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
75 @llvm_mips_bseli_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
76 @llvm_mips_bseli_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
78 define void @llvm_mips_bseli_b_test() nounwind {
80 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_bseli_b_ARG1
81 %1 = load <16 x i8>, <16 x i8>* @llvm_mips_bseli_b_ARG2
82 %2 = tail call <16 x i8> @llvm.mips.bseli.b(<16 x i8> %0, <16 x i8> %1, i32 25)
83 store <16 x i8> %2, <16 x i8>* @llvm_mips_bseli_b_RES
87 declare <16 x i8> @llvm.mips.bseli.b(<16 x i8>, <16 x i8>, i32) nounwind
89 ; CHECK: llvm_mips_bseli_b_test:
90 ; CHECK-DAG: lw [[R1:\$[0-9]+]], %got(llvm_mips_bseli_b_ARG1)(
91 ; CHECK-DAG: lw [[R2:\$[0-9]+]], %got(llvm_mips_bseli_b_ARG2)(
92 ; CHECK-DAG: ld.b [[R3:\$w[0-9]+]], 0([[R1]])
93 ; CHECK-DAG: ld.b [[R4:\$w[0-9]+]], 0([[R2]])
94 ; CHECK-DAG: bseli.b [[R3]], [[R4]], 25
95 ; CHECK-DAG: st.b [[R3]], 0(
96 ; CHECK: .size llvm_mips_bseli_b_test
98 @llvm_mips_nori_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
99 @llvm_mips_nori_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
101 define void @llvm_mips_nori_b_test() nounwind {
103 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_nori_b_ARG1
104 %1 = tail call <16 x i8> @llvm.mips.nori.b(<16 x i8> %0, i32 25)
105 store <16 x i8> %1, <16 x i8>* @llvm_mips_nori_b_RES
109 declare <16 x i8> @llvm.mips.nori.b(<16 x i8>, i32) nounwind
111 ; CHECK: llvm_mips_nori_b_test:
115 ; CHECK: .size llvm_mips_nori_b_test
117 @llvm_mips_ori_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
118 @llvm_mips_ori_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
120 define void @llvm_mips_ori_b_test() nounwind {
122 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_ori_b_ARG1
123 %1 = tail call <16 x i8> @llvm.mips.ori.b(<16 x i8> %0, i32 25)
124 store <16 x i8> %1, <16 x i8>* @llvm_mips_ori_b_RES
128 declare <16 x i8> @llvm.mips.ori.b(<16 x i8>, i32) nounwind
130 ; CHECK: llvm_mips_ori_b_test:
134 ; CHECK: .size llvm_mips_ori_b_test
136 @llvm_mips_shf_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
137 @llvm_mips_shf_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
139 define void @llvm_mips_shf_b_test() nounwind {
141 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_shf_b_ARG1
142 %1 = tail call <16 x i8> @llvm.mips.shf.b(<16 x i8> %0, i32 25)
143 store <16 x i8> %1, <16 x i8>* @llvm_mips_shf_b_RES
147 declare <16 x i8> @llvm.mips.shf.b(<16 x i8>, i32) nounwind
149 ; CHECK: llvm_mips_shf_b_test:
153 ; CHECK: .size llvm_mips_shf_b_test
155 @llvm_mips_shf_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16
156 @llvm_mips_shf_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16
158 define void @llvm_mips_shf_h_test() nounwind {
160 %0 = load <8 x i16>, <8 x i16>* @llvm_mips_shf_h_ARG1
161 %1 = tail call <8 x i16> @llvm.mips.shf.h(<8 x i16> %0, i32 25)
162 store <8 x i16> %1, <8 x i16>* @llvm_mips_shf_h_RES
166 declare <8 x i16> @llvm.mips.shf.h(<8 x i16>, i32) nounwind
168 ; CHECK: llvm_mips_shf_h_test:
172 ; CHECK: .size llvm_mips_shf_h_test
174 @llvm_mips_shf_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16
175 @llvm_mips_shf_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16
177 define void @llvm_mips_shf_w_test() nounwind {
179 %0 = load <4 x i32>, <4 x i32>* @llvm_mips_shf_w_ARG1
180 %1 = tail call <4 x i32> @llvm.mips.shf.w(<4 x i32> %0, i32 25)
181 store <4 x i32> %1, <4 x i32>* @llvm_mips_shf_w_RES
185 declare <4 x i32> @llvm.mips.shf.w(<4 x i32>, i32) nounwind
187 ; CHECK: llvm_mips_shf_w_test:
191 ; CHECK: .size llvm_mips_shf_w_test
193 @llvm_mips_xori_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
194 @llvm_mips_xori_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
196 define void @llvm_mips_xori_b_test() nounwind {
198 %0 = load <16 x i8>, <16 x i8>* @llvm_mips_xori_b_ARG1
199 %1 = tail call <16 x i8> @llvm.mips.xori.b(<16 x i8> %0, i32 25)
200 store <16 x i8> %1, <16 x i8>* @llvm_mips_xori_b_RES
204 declare <16 x i8> @llvm.mips.xori.b(<16 x i8>, i32) nounwind
206 ; CHECK: llvm_mips_xori_b_test:
210 ; CHECK: .size llvm_mips_xori_b_test