Skip to main content

core/stdarch/crates/core_arch/src/mips/
msa.rs

1//! MIPS SIMD Architecture intrinsics
2//!
3//! The reference is [MIPS Architecture for Programmers Volume IV-j: The
4//! MIPS32 SIMD Architecture Module Revision 1.12][msa_ref].
5//!
6//! [msa_ref]: http://cdn2.imgtec.com/documentation/MD00866-2B-MSA32-AFP-01.12.pdf
7
8#[cfg(test)]
9use stdarch_test::assert_instr;
10
11use crate::mem;
12
13types! {
14    #![unstable(feature = "stdarch_mips", issue = "111198")]
15
16    /// MIPS-specific 128-bit wide vector of 16 packed `i8`.
17    pub struct v16i8(16 x i8);
18
19    /// MIPS-specific 128-bit wide vector of 8 packed `i16`.
20    pub struct v8i16(8 x i16);
21
22    /// MIPS-specific 128-bit wide vector of 4 packed `i32`.
23    pub struct v4i32(4 x i32);
24
25    /// MIPS-specific 128-bit wide vector of 2 packed `i64`.
26    pub struct v2i64(2 x i64);
27
28    /// MIPS-specific 128-bit wide vector of 16 packed `u8`.
29    pub struct v16u8(16 x u8);
30
31    /// MIPS-specific 128-bit wide vector of 8 packed `u16`.
32    pub struct v8u16(8 x u16);
33
34    /// MIPS-specific 128-bit wide vector of 4 packed `u32`.
35    pub struct v4u32(4 x u32);
36
37    /// MIPS-specific 128-bit wide vector of 2 packed `u64`.
38    pub struct v2u64(2 x u64);
39
40    // / MIPS-specific 128-bit wide vector of 4 packed `f32`.
41    pub struct v4f32(4 x f32);
42
43    /// MIPS-specific 128-bit wide vector of 2 packed `f64`.
44    pub struct v2f64(2 x f64);
45}
46
47#[allow(improper_ctypes)]
48unsafe extern "llvm-intrinsic" {
49    #[link_name = "llvm.mips.add.a.b"]
50    fn msa_add_a_b(a: v16i8, b: v16i8) -> v16i8;
51    #[link_name = "llvm.mips.add.a.h"]
52    fn msa_add_a_h(a: v8i16, b: v8i16) -> v8i16;
53    #[link_name = "llvm.mips.add.a.w"]
54    fn msa_add_a_w(a: v4i32, b: v4i32) -> v4i32;
55    #[link_name = "llvm.mips.add.a.d"]
56    fn msa_add_a_d(a: v2i64, b: v2i64) -> v2i64;
57    #[link_name = "llvm.mips.adds.a.b"]
58    fn msa_adds_a_b(a: v16i8, b: v16i8) -> v16i8;
59    #[link_name = "llvm.mips.adds.a.h"]
60    fn msa_adds_a_h(a: v8i16, b: v8i16) -> v8i16;
61    #[link_name = "llvm.mips.adds.a.w"]
62    fn msa_adds_a_w(a: v4i32, b: v4i32) -> v4i32;
63    #[link_name = "llvm.mips.adds.a.d"]
64    fn msa_adds_a_d(a: v2i64, b: v2i64) -> v2i64;
65    #[link_name = "llvm.mips.adds.s.b"]
66    fn msa_adds_s_b(a: v16i8, b: v16i8) -> v16i8;
67    #[link_name = "llvm.mips.adds.s.h"]
68    fn msa_adds_s_h(a: v8i16, b: v8i16) -> v8i16;
69    #[link_name = "llvm.mips.adds.s.w"]
70    fn msa_adds_s_w(a: v4i32, b: v4i32) -> v4i32;
71    #[link_name = "llvm.mips.adds.s.d"]
72    fn msa_adds_s_d(a: v2i64, b: v2i64) -> v2i64;
73    #[link_name = "llvm.mips.adds.u.b"]
74    fn msa_adds_u_b(a: v16u8, b: v16u8) -> v16u8;
75    #[link_name = "llvm.mips.adds.u.h"]
76    fn msa_adds_u_h(a: v8u16, b: v8u16) -> v8u16;
77    #[link_name = "llvm.mips.adds.u.w"]
78    fn msa_adds_u_w(a: v4u32, b: v4u32) -> v4u32;
79    #[link_name = "llvm.mips.adds.u.d"]
80    fn msa_adds_u_d(a: v2u64, b: v2u64) -> v2u64;
81    #[link_name = "llvm.mips.addv.b"]
82    fn msa_addv_b(a: v16i8, b: v16i8) -> v16i8;
83    #[link_name = "llvm.mips.addv.h"]
84    fn msa_addv_h(a: v8i16, b: v8i16) -> v8i16;
85    #[link_name = "llvm.mips.addv.w"]
86    fn msa_addv_w(a: v4i32, b: v4i32) -> v4i32;
87    #[link_name = "llvm.mips.addv.d"]
88    fn msa_addv_d(a: v2i64, b: v2i64) -> v2i64;
89    #[link_name = "llvm.mips.addvi.b"]
90    fn msa_addvi_b(a: v16i8, b: i32) -> v16i8;
91    #[link_name = "llvm.mips.addvi.h"]
92    fn msa_addvi_h(a: v8i16, b: i32) -> v8i16;
93    #[link_name = "llvm.mips.addvi.w"]
94    fn msa_addvi_w(a: v4i32, b: i32) -> v4i32;
95    #[link_name = "llvm.mips.addvi.d"]
96    fn msa_addvi_d(a: v2i64, b: i32) -> v2i64;
97    #[link_name = "llvm.mips.and.v"]
98    fn msa_and_v(a: v16u8, b: v16u8) -> v16u8;
99    #[link_name = "llvm.mips.andi.b"]
100    fn msa_andi_b(a: v16u8, b: i32) -> v16u8;
101    #[link_name = "llvm.mips.asub.s.b"]
102    fn msa_asub_s_b(a: v16i8, b: v16i8) -> v16i8;
103    #[link_name = "llvm.mips.asub.s.h"]
104    fn msa_asub_s_h(a: v8i16, b: v8i16) -> v8i16;
105    #[link_name = "llvm.mips.asub.s.w"]
106    fn msa_asub_s_w(a: v4i32, b: v4i32) -> v4i32;
107    #[link_name = "llvm.mips.asub.s.d"]
108    fn msa_asub_s_d(a: v2i64, b: v2i64) -> v2i64;
109    #[link_name = "llvm.mips.asub.u.b"]
110    fn msa_asub_u_b(a: v16u8, b: v16u8) -> v16u8;
111    #[link_name = "llvm.mips.asub.u.h"]
112    fn msa_asub_u_h(a: v8u16, b: v8u16) -> v8u16;
113    #[link_name = "llvm.mips.asub.u.w"]
114    fn msa_asub_u_w(a: v4u32, b: v4u32) -> v4u32;
115    #[link_name = "llvm.mips.asub.u.d"]
116    fn msa_asub_u_d(a: v2u64, b: v2u64) -> v2u64;
117    #[link_name = "llvm.mips.ave.s.b"]
118    fn msa_ave_s_b(a: v16i8, b: v16i8) -> v16i8;
119    #[link_name = "llvm.mips.ave.s.h"]
120    fn msa_ave_s_h(a: v8i16, b: v8i16) -> v8i16;
121    #[link_name = "llvm.mips.ave.s.w"]
122    fn msa_ave_s_w(a: v4i32, b: v4i32) -> v4i32;
123    #[link_name = "llvm.mips.ave.s.d"]
124    fn msa_ave_s_d(a: v2i64, b: v2i64) -> v2i64;
125    #[link_name = "llvm.mips.ave.u.b"]
126    fn msa_ave_u_b(a: v16u8, b: v16u8) -> v16u8;
127    #[link_name = "llvm.mips.ave.u.h"]
128    fn msa_ave_u_h(a: v8u16, b: v8u16) -> v8u16;
129    #[link_name = "llvm.mips.ave.u.w"]
130    fn msa_ave_u_w(a: v4u32, b: v4u32) -> v4u32;
131    #[link_name = "llvm.mips.ave.u.d"]
132    fn msa_ave_u_d(a: v2u64, b: v2u64) -> v2u64;
133    #[link_name = "llvm.mips.aver.s.b"]
134    fn msa_aver_s_b(a: v16i8, b: v16i8) -> v16i8;
135    #[link_name = "llvm.mips.aver.s.h"]
136    fn msa_aver_s_h(a: v8i16, b: v8i16) -> v8i16;
137    #[link_name = "llvm.mips.aver.s.w"]
138    fn msa_aver_s_w(a: v4i32, b: v4i32) -> v4i32;
139    #[link_name = "llvm.mips.aver.s.d"]
140    fn msa_aver_s_d(a: v2i64, b: v2i64) -> v2i64;
141    #[link_name = "llvm.mips.aver.u.b"]
142    fn msa_aver_u_b(a: v16u8, b: v16u8) -> v16u8;
143    #[link_name = "llvm.mips.aver.u.h"]
144    fn msa_aver_u_h(a: v8u16, b: v8u16) -> v8u16;
145    #[link_name = "llvm.mips.aver.u.w"]
146    fn msa_aver_u_w(a: v4u32, b: v4u32) -> v4u32;
147    #[link_name = "llvm.mips.aver.u.d"]
148    fn msa_aver_u_d(a: v2u64, b: v2u64) -> v2u64;
149    #[link_name = "llvm.mips.bclr.b"]
150    fn msa_bclr_b(a: v16u8, b: v16u8) -> v16u8;
151    #[link_name = "llvm.mips.bclr.h"]
152    fn msa_bclr_h(a: v8u16, b: v8u16) -> v8u16;
153    #[link_name = "llvm.mips.bclr.w"]
154    fn msa_bclr_w(a: v4u32, b: v4u32) -> v4u32;
155    #[link_name = "llvm.mips.bclr.d"]
156    fn msa_bclr_d(a: v2u64, b: v2u64) -> v2u64;
157    #[link_name = "llvm.mips.bclri.b"]
158    fn msa_bclri_b(a: v16u8, b: i32) -> v16u8;
159    #[link_name = "llvm.mips.bclri.h"]
160    fn msa_bclri_h(a: v8u16, b: i32) -> v8u16;
161    #[link_name = "llvm.mips.bclri.w"]
162    fn msa_bclri_w(a: v4u32, b: i32) -> v4u32;
163    #[link_name = "llvm.mips.bclri.d"]
164    fn msa_bclri_d(a: v2u64, b: i32) -> v2u64;
165    #[link_name = "llvm.mips.binsl.b"]
166    fn msa_binsl_b(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
167    #[link_name = "llvm.mips.binsl.h"]
168    fn msa_binsl_h(a: v8u16, b: v8u16, c: v8u16) -> v8u16;
169    #[link_name = "llvm.mips.binsl.w"]
170    fn msa_binsl_w(a: v4u32, b: v4u32, c: v4u32) -> v4u32;
171    #[link_name = "llvm.mips.binsl.d"]
172    fn msa_binsl_d(a: v2u64, b: v2u64, c: v2u64) -> v2u64;
173    #[link_name = "llvm.mips.binsli.b"]
174    fn msa_binsli_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
175    #[link_name = "llvm.mips.binsli.h"]
176    fn msa_binsli_h(a: v8u16, b: v8u16, c: i32) -> v8u16;
177    #[link_name = "llvm.mips.binsli.w"]
178    fn msa_binsli_w(a: v4u32, b: v4u32, c: i32) -> v4u32;
179    #[link_name = "llvm.mips.binsli.d"]
180    fn msa_binsli_d(a: v2u64, b: v2u64, c: i32) -> v2u64;
181    #[link_name = "llvm.mips.binsr.b"]
182    fn msa_binsr_b(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
183    #[link_name = "llvm.mips.binsr.h"]
184    fn msa_binsr_h(a: v8u16, b: v8u16, c: v8u16) -> v8u16;
185    #[link_name = "llvm.mips.binsr.w"]
186    fn msa_binsr_w(a: v4u32, b: v4u32, c: v4u32) -> v4u32;
187    #[link_name = "llvm.mips.binsr.d"]
188    fn msa_binsr_d(a: v2u64, b: v2u64, c: v2u64) -> v2u64;
189    #[link_name = "llvm.mips.binsri.b"]
190    fn msa_binsri_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
191    #[link_name = "llvm.mips.binsri.h"]
192    fn msa_binsri_h(a: v8u16, b: v8u16, c: i32) -> v8u16;
193    #[link_name = "llvm.mips.binsri.w"]
194    fn msa_binsri_w(a: v4u32, b: v4u32, c: i32) -> v4u32;
195    #[link_name = "llvm.mips.binsri.d"]
196    fn msa_binsri_d(a: v2u64, b: v2u64, c: i32) -> v2u64;
197    #[link_name = "llvm.mips.bmnz.v"]
198    fn msa_bmnz_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
199    #[link_name = "llvm.mips.bmnzi.b"]
200    fn msa_bmnzi_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
201    #[link_name = "llvm.mips.bmz.v"]
202    fn msa_bmz_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
203    #[link_name = "llvm.mips.bmzi.b"]
204    fn msa_bmzi_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
205    #[link_name = "llvm.mips.bneg.b"]
206    fn msa_bneg_b(a: v16u8, b: v16u8) -> v16u8;
207    #[link_name = "llvm.mips.bneg.h"]
208    fn msa_bneg_h(a: v8u16, b: v8u16) -> v8u16;
209    #[link_name = "llvm.mips.bneg.w"]
210    fn msa_bneg_w(a: v4u32, b: v4u32) -> v4u32;
211    #[link_name = "llvm.mips.bneg.d"]
212    fn msa_bneg_d(a: v2u64, b: v2u64) -> v2u64;
213    #[link_name = "llvm.mips.bnegi.b"]
214    fn msa_bnegi_b(a: v16u8, b: i32) -> v16u8;
215    #[link_name = "llvm.mips.bnegi.h"]
216    fn msa_bnegi_h(a: v8u16, b: i32) -> v8u16;
217    #[link_name = "llvm.mips.bnegi.w"]
218    fn msa_bnegi_w(a: v4u32, b: i32) -> v4u32;
219    #[link_name = "llvm.mips.bnegi.d"]
220    fn msa_bnegi_d(a: v2u64, b: i32) -> v2u64;
221    #[link_name = "llvm.mips.bnz.b"]
222    fn msa_bnz_b(a: v16u8) -> i32;
223    #[link_name = "llvm.mips.bnz.h"]
224    fn msa_bnz_h(a: v8u16) -> i32;
225    #[link_name = "llvm.mips.bnz.w"]
226    fn msa_bnz_w(a: v4u32) -> i32;
227    #[link_name = "llvm.mips.bnz.d"]
228    fn msa_bnz_d(a: v2u64) -> i32;
229    #[link_name = "llvm.mips.bnz.v"]
230    fn msa_bnz_v(a: v16u8) -> i32;
231    #[link_name = "llvm.mips.bsel.v"]
232    fn msa_bsel_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8;
233    #[link_name = "llvm.mips.bseli.b"]
234    fn msa_bseli_b(a: v16u8, b: v16u8, c: i32) -> v16u8;
235    #[link_name = "llvm.mips.bset.b"]
236    fn msa_bset_b(a: v16u8, b: v16u8) -> v16u8;
237    #[link_name = "llvm.mips.bset.h"]
238    fn msa_bset_h(a: v8u16, b: v8u16) -> v8u16;
239    #[link_name = "llvm.mips.bset.w"]
240    fn msa_bset_w(a: v4u32, b: v4u32) -> v4u32;
241    #[link_name = "llvm.mips.bset.d"]
242    fn msa_bset_d(a: v2u64, b: v2u64) -> v2u64;
243    #[link_name = "llvm.mips.bseti.b"]
244    fn msa_bseti_b(a: v16u8, b: i32) -> v16u8;
245    #[link_name = "llvm.mips.bseti.h"]
246    fn msa_bseti_h(a: v8u16, b: i32) -> v8u16;
247    #[link_name = "llvm.mips.bseti.w"]
248    fn msa_bseti_w(a: v4u32, b: i32) -> v4u32;
249    #[link_name = "llvm.mips.bseti.d"]
250    fn msa_bseti_d(a: v2u64, b: i32) -> v2u64;
251    #[link_name = "llvm.mips.bz.b"]
252    fn msa_bz_b(a: v16u8) -> i32;
253    #[link_name = "llvm.mips.bz.h"]
254    fn msa_bz_h(a: v8u16) -> i32;
255    #[link_name = "llvm.mips.bz.w"]
256    fn msa_bz_w(a: v4u32) -> i32;
257    #[link_name = "llvm.mips.bz.d"]
258    fn msa_bz_d(a: v2u64) -> i32;
259    #[link_name = "llvm.mips.bz.v"]
260    fn msa_bz_v(a: v16u8) -> i32;
261    #[link_name = "llvm.mips.ceq.b"]
262    fn msa_ceq_b(a: v16i8, b: v16i8) -> v16i8;
263    #[link_name = "llvm.mips.ceq.h"]
264    fn msa_ceq_h(a: v8i16, b: v8i16) -> v8i16;
265    #[link_name = "llvm.mips.ceq.w"]
266    fn msa_ceq_w(a: v4i32, b: v4i32) -> v4i32;
267    #[link_name = "llvm.mips.ceq.d"]
268    fn msa_ceq_d(a: v2i64, b: v2i64) -> v2i64;
269    #[link_name = "llvm.mips.ceqi.b"]
270    fn msa_ceqi_b(a: v16i8, b: i32) -> v16i8;
271    #[link_name = "llvm.mips.ceqi.h"]
272    fn msa_ceqi_h(a: v8i16, b: i32) -> v8i16;
273    #[link_name = "llvm.mips.ceqi.w"]
274    fn msa_ceqi_w(a: v4i32, b: i32) -> v4i32;
275    #[link_name = "llvm.mips.ceqi.d"]
276    fn msa_ceqi_d(a: v2i64, b: i32) -> v2i64;
277    #[link_name = "llvm.mips.cfcmsa"]
278    fn msa_cfcmsa(a: i32) -> i32;
279    #[link_name = "llvm.mips.cle.s.b"]
280    fn msa_cle_s_b(a: v16i8, b: v16i8) -> v16i8;
281    #[link_name = "llvm.mips.cle.s.h"]
282    fn msa_cle_s_h(a: v8i16, b: v8i16) -> v8i16;
283    #[link_name = "llvm.mips.cle.s.w"]
284    fn msa_cle_s_w(a: v4i32, b: v4i32) -> v4i32;
285    #[link_name = "llvm.mips.cle.s.d"]
286    fn msa_cle_s_d(a: v2i64, b: v2i64) -> v2i64;
287    #[link_name = "llvm.mips.cle.u.b"]
288    fn msa_cle_u_b(a: v16u8, b: v16u8) -> v16i8;
289    #[link_name = "llvm.mips.cle.u.h"]
290    fn msa_cle_u_h(a: v8u16, b: v8u16) -> v8i16;
291    #[link_name = "llvm.mips.cle.u.w"]
292    fn msa_cle_u_w(a: v4u32, b: v4u32) -> v4i32;
293    #[link_name = "llvm.mips.cle.u.d"]
294    fn msa_cle_u_d(a: v2u64, b: v2u64) -> v2i64;
295    #[link_name = "llvm.mips.clei.s.b"]
296    fn msa_clei_s_b(a: v16i8, b: i32) -> v16i8;
297    #[link_name = "llvm.mips.clei.s.h"]
298    fn msa_clei_s_h(a: v8i16, b: i32) -> v8i16;
299    #[link_name = "llvm.mips.clei.s.w"]
300    fn msa_clei_s_w(a: v4i32, b: i32) -> v4i32;
301    #[link_name = "llvm.mips.clei.s.d"]
302    fn msa_clei_s_d(a: v2i64, b: i32) -> v2i64;
303    #[link_name = "llvm.mips.clei.u.b"]
304    fn msa_clei_u_b(a: v16u8, b: i32) -> v16i8;
305    #[link_name = "llvm.mips.clei.u.h"]
306    fn msa_clei_u_h(a: v8u16, b: i32) -> v8i16;
307    #[link_name = "llvm.mips.clei.u.w"]
308    fn msa_clei_u_w(a: v4u32, b: i32) -> v4i32;
309    #[link_name = "llvm.mips.clei.u.d"]
310    fn msa_clei_u_d(a: v2u64, b: i32) -> v2i64;
311    #[link_name = "llvm.mips.clt.s.b"]
312    fn msa_clt_s_b(a: v16i8, b: v16i8) -> v16i8;
313    #[link_name = "llvm.mips.clt.s.h"]
314    fn msa_clt_s_h(a: v8i16, b: v8i16) -> v8i16;
315    #[link_name = "llvm.mips.clt.s.w"]
316    fn msa_clt_s_w(a: v4i32, b: v4i32) -> v4i32;
317    #[link_name = "llvm.mips.clt.s.d"]
318    fn msa_clt_s_d(a: v2i64, b: v2i64) -> v2i64;
319    #[link_name = "llvm.mips.clt.u.b"]
320    fn msa_clt_u_b(a: v16u8, b: v16u8) -> v16i8;
321    #[link_name = "llvm.mips.clt.u.h"]
322    fn msa_clt_u_h(a: v8u16, b: v8u16) -> v8i16;
323    #[link_name = "llvm.mips.clt.u.w"]
324    fn msa_clt_u_w(a: v4u32, b: v4u32) -> v4i32;
325    #[link_name = "llvm.mips.clt.u.d"]
326    fn msa_clt_u_d(a: v2u64, b: v2u64) -> v2i64;
327    #[link_name = "llvm.mips.clti.s.b"]
328    fn msa_clti_s_b(a: v16i8, b: i32) -> v16i8;
329    #[link_name = "llvm.mips.clti.s.h"]
330    fn msa_clti_s_h(a: v8i16, b: i32) -> v8i16;
331    #[link_name = "llvm.mips.clti.s.w"]
332    fn msa_clti_s_w(a: v4i32, b: i32) -> v4i32;
333    #[link_name = "llvm.mips.clti.s.d"]
334    fn msa_clti_s_d(a: v2i64, b: i32) -> v2i64;
335    #[link_name = "llvm.mips.clti.u.b"]
336    fn msa_clti_u_b(a: v16u8, b: i32) -> v16i8;
337    #[link_name = "llvm.mips.clti.u.h"]
338    fn msa_clti_u_h(a: v8u16, b: i32) -> v8i16;
339    #[link_name = "llvm.mips.clti.u.w"]
340    fn msa_clti_u_w(a: v4u32, b: i32) -> v4i32;
341    #[link_name = "llvm.mips.clti.u.d"]
342    fn msa_clti_u_d(a: v2u64, b: i32) -> v2i64;
343    #[link_name = "llvm.mips.copy.s.b"]
344    fn msa_copy_s_b(a: v16i8, b: i32) -> i32;
345    #[link_name = "llvm.mips.copy.s.h"]
346    fn msa_copy_s_h(a: v8i16, b: i32) -> i32;
347    #[link_name = "llvm.mips.copy.s.w"]
348    fn msa_copy_s_w(a: v4i32, b: i32) -> i32;
349    #[link_name = "llvm.mips.copy.s.d"]
350    fn msa_copy_s_d(a: v2i64, b: i32) -> i64;
351    #[link_name = "llvm.mips.copy.u.b"]
352    fn msa_copy_u_b(a: v16i8, b: i32) -> u32;
353    #[link_name = "llvm.mips.copy.u.h"]
354    fn msa_copy_u_h(a: v8i16, b: i32) -> u32;
355    #[link_name = "llvm.mips.copy.u.w"]
356    fn msa_copy_u_w(a: v4i32, b: i32) -> u32;
357    #[link_name = "llvm.mips.copy.u.d"]
358    fn msa_copy_u_d(a: v2i64, b: i32) -> u64;
359    #[link_name = "llvm.mips.ctcmsa"]
360    fn msa_ctcmsa(imm5: i32, a: i32) -> ();
361    #[link_name = "llvm.mips.div.s.b"]
362    fn msa_div_s_b(a: v16i8, b: v16i8) -> v16i8;
363    #[link_name = "llvm.mips.div.s.h"]
364    fn msa_div_s_h(a: v8i16, b: v8i16) -> v8i16;
365    #[link_name = "llvm.mips.div.s.w"]
366    fn msa_div_s_w(a: v4i32, b: v4i32) -> v4i32;
367    #[link_name = "llvm.mips.div.s.d"]
368    fn msa_div_s_d(a: v2i64, b: v2i64) -> v2i64;
369    #[link_name = "llvm.mips.div.u.b"]
370    fn msa_div_u_b(a: v16u8, b: v16u8) -> v16u8;
371    #[link_name = "llvm.mips.div.u.h"]
372    fn msa_div_u_h(a: v8u16, b: v8u16) -> v8u16;
373    #[link_name = "llvm.mips.div.u.w"]
374    fn msa_div_u_w(a: v4u32, b: v4u32) -> v4u32;
375    #[link_name = "llvm.mips.div.u.d"]
376    fn msa_div_u_d(a: v2u64, b: v2u64) -> v2u64;
377    #[link_name = "llvm.mips.dotp.s.h"]
378    fn msa_dotp_s_h(a: v16i8, b: v16i8) -> v8i16;
379    #[link_name = "llvm.mips.dotp.s.w"]
380    fn msa_dotp_s_w(a: v8i16, b: v8i16) -> v4i32;
381    #[link_name = "llvm.mips.dotp.s.d"]
382    fn msa_dotp_s_d(a: v4i32, b: v4i32) -> v2i64;
383    #[link_name = "llvm.mips.dotp.u.h"]
384    fn msa_dotp_u_h(a: v16u8, b: v16u8) -> v8u16;
385    #[link_name = "llvm.mips.dotp.u.w"]
386    fn msa_dotp_u_w(a: v8u16, b: v8u16) -> v4u32;
387    #[link_name = "llvm.mips.dotp.u.d"]
388    fn msa_dotp_u_d(a: v4u32, b: v4u32) -> v2u64;
389    #[link_name = "llvm.mips.dpadd.s.h"]
390    fn msa_dpadd_s_h(a: v8i16, b: v16i8, c: v16i8) -> v8i16;
391    #[link_name = "llvm.mips.dpadd.s.w"]
392    fn msa_dpadd_s_w(a: v4i32, b: v8i16, c: v8i16) -> v4i32;
393    #[link_name = "llvm.mips.dpadd.s.d"]
394    fn msa_dpadd_s_d(a: v2i64, b: v4i32, c: v4i32) -> v2i64;
395    #[link_name = "llvm.mips.dpadd.u.h"]
396    fn msa_dpadd_u_h(a: v8u16, b: v16u8, c: v16u8) -> v8u16;
397    #[link_name = "llvm.mips.dpadd.u.w"]
398    fn msa_dpadd_u_w(a: v4u32, b: v8u16, c: v8u16) -> v4u32;
399    #[link_name = "llvm.mips.dpadd.u.d"]
400    fn msa_dpadd_u_d(a: v2u64, b: v4u32, c: v4u32) -> v2u64;
401    #[link_name = "llvm.mips.dpsub.s.h"]
402    fn msa_dpsub_s_h(a: v8i16, b: v16i8, c: v16i8) -> v8i16;
403    #[link_name = "llvm.mips.dpsub.s.w"]
404    fn msa_dpsub_s_w(a: v4i32, b: v8i16, c: v8i16) -> v4i32;
405    #[link_name = "llvm.mips.dpsub.s.d"]
406    fn msa_dpsub_s_d(a: v2i64, b: v4i32, c: v4i32) -> v2i64;
407    #[link_name = "llvm.mips.dpsub.u.h"]
408    fn msa_dpsub_u_h(a: v8i16, b: v16u8, c: v16u8) -> v8i16;
409    #[link_name = "llvm.mips.dpsub.u.w"]
410    fn msa_dpsub_u_w(a: v4i32, b: v8u16, c: v8u16) -> v4i32;
411    #[link_name = "llvm.mips.dpsub.u.d"]
412    fn msa_dpsub_u_d(a: v2i64, b: v4u32, c: v4u32) -> v2i64;
413    #[link_name = "llvm.mips.fadd.w"]
414    fn msa_fadd_w(a: v4f32, b: v4f32) -> v4f32;
415    #[link_name = "llvm.mips.fadd.d"]
416    fn msa_fadd_d(a: v2f64, b: v2f64) -> v2f64;
417    #[link_name = "llvm.mips.fcaf.w"]
418    fn msa_fcaf_w(a: v4f32, b: v4f32) -> v4i32;
419    #[link_name = "llvm.mips.fcaf.d"]
420    fn msa_fcaf_d(a: v2f64, b: v2f64) -> v2i64;
421    #[link_name = "llvm.mips.fceq.w"]
422    fn msa_fceq_w(a: v4f32, b: v4f32) -> v4i32;
423    #[link_name = "llvm.mips.fceq.d"]
424    fn msa_fceq_d(a: v2f64, b: v2f64) -> v2i64;
425    #[link_name = "llvm.mips.fclass.w"]
426    fn msa_fclass_w(a: v4f32) -> v4i32;
427    #[link_name = "llvm.mips.fclass.d"]
428    fn msa_fclass_d(a: v2f64) -> v2i64;
429    #[link_name = "llvm.mips.fcle.w"]
430    fn msa_fcle_w(a: v4f32, b: v4f32) -> v4i32;
431    #[link_name = "llvm.mips.fcle.d"]
432    fn msa_fcle_d(a: v2f64, b: v2f64) -> v2i64;
433    #[link_name = "llvm.mips.fclt.w"]
434    fn msa_fclt_w(a: v4f32, b: v4f32) -> v4i32;
435    #[link_name = "llvm.mips.fclt.d"]
436    fn msa_fclt_d(a: v2f64, b: v2f64) -> v2i64;
437    #[link_name = "llvm.mips.fcne.w"]
438    fn msa_fcne_w(a: v4f32, b: v4f32) -> v4i32;
439    #[link_name = "llvm.mips.fcne.d"]
440    fn msa_fcne_d(a: v2f64, b: v2f64) -> v2i64;
441    #[link_name = "llvm.mips.fcor.w"]
442    fn msa_fcor_w(a: v4f32, b: v4f32) -> v4i32;
443    #[link_name = "llvm.mips.fcor.d"]
444    fn msa_fcor_d(a: v2f64, b: v2f64) -> v2i64;
445    #[link_name = "llvm.mips.fcueq.w"]
446    fn msa_fcueq_w(a: v4f32, b: v4f32) -> v4i32;
447    #[link_name = "llvm.mips.fcueq.d"]
448    fn msa_fcueq_d(a: v2f64, b: v2f64) -> v2i64;
449    #[link_name = "llvm.mips.fcule.w"]
450    fn msa_fcule_w(a: v4f32, b: v4f32) -> v4i32;
451    #[link_name = "llvm.mips.fcule.d"]
452    fn msa_fcule_d(a: v2f64, b: v2f64) -> v2i64;
453    #[link_name = "llvm.mips.fcult.w"]
454    fn msa_fcult_w(a: v4f32, b: v4f32) -> v4i32;
455    #[link_name = "llvm.mips.fcult.d"]
456    fn msa_fcult_d(a: v2f64, b: v2f64) -> v2i64;
457    #[link_name = "llvm.mips.fcun.w"]
458    fn msa_fcun_w(a: v4f32, b: v4f32) -> v4i32;
459    #[link_name = "llvm.mips.fcun.d"]
460    fn msa_fcun_d(a: v2f64, b: v2f64) -> v2i64;
461    #[link_name = "llvm.mips.fcune.w"]
462    fn msa_fcune_w(a: v4f32, b: v4f32) -> v4i32;
463    #[link_name = "llvm.mips.fcune.d"]
464    fn msa_fcune_d(a: v2f64, b: v2f64) -> v2i64;
465    #[link_name = "llvm.mips.fdiv.w"]
466    fn msa_fdiv_w(a: v4f32, b: v4f32) -> v4f32;
467    #[link_name = "llvm.mips.fdiv.d"]
468    fn msa_fdiv_d(a: v2f64, b: v2f64) -> v2f64;
469    // FIXME: 16-bit floats
470    // #[link_name = "llvm.mips.fexdo.h"]
471    // fn msa_fexdo_h(a: v4f32, b: v4f32) -> f16x8;
472    #[link_name = "llvm.mips.fexdo.w"]
473    fn msa_fexdo_w(a: v2f64, b: v2f64) -> v4f32;
474    #[link_name = "llvm.mips.fexp2.w"]
475    fn msa_fexp2_w(a: v4f32, b: v4i32) -> v4f32;
476    #[link_name = "llvm.mips.fexp2.d"]
477    fn msa_fexp2_d(a: v2f64, b: v2i64) -> v2f64;
478    // FIXME: 16-bit floats
479    // #[link_name = "llvm.mips.fexupl.w"]
480    // fn msa_fexupl_w(a: f16x8) -> v4f32;
481    #[link_name = "llvm.mips.fexupl.d"]
482    fn msa_fexupl_d(a: v4f32) -> v2f64;
483    // FIXME: 16-bit floats
484    // #[link_name = "llvm.mips.fexupr.w"]
485    // fn msa_fexupr_w(a: f16x8) -> v4f32;
486    #[link_name = "llvm.mips.fexupr.d"]
487    fn msa_fexupr_d(a: v4f32) -> v2f64;
488    #[link_name = "llvm.mips.ffint.s.w"]
489    fn msa_ffint_s_w(a: v4i32) -> v4f32;
490    #[link_name = "llvm.mips.ffint.s.d"]
491    fn msa_ffint_s_d(a: v2i64) -> v2f64;
492    #[link_name = "llvm.mips.ffint.u.w"]
493    fn msa_ffint_u_w(a: v4u32) -> v4f32;
494    #[link_name = "llvm.mips.ffint.u.d"]
495    fn msa_ffint_u_d(a: v2u64) -> v2f64;
496    #[link_name = "llvm.mips.ffql.w"]
497    fn msa_ffql_w(a: v8i16) -> v4f32;
498    #[link_name = "llvm.mips.ffql.d"]
499    fn msa_ffql_d(a: v4i32) -> v2f64;
500    #[link_name = "llvm.mips.ffqr.w"]
501    fn msa_ffqr_w(a: v8i16) -> v4f32;
502    #[link_name = "llvm.mips.ffqr.d"]
503    fn msa_ffqr_d(a: v4i32) -> v2f64;
504    #[link_name = "llvm.mips.fill.b"]
505    fn msa_fill_b(a: i32) -> v16i8;
506    #[link_name = "llvm.mips.fill.h"]
507    fn msa_fill_h(a: i32) -> v8i16;
508    #[link_name = "llvm.mips.fill.w"]
509    fn msa_fill_w(a: i32) -> v4i32;
510    #[link_name = "llvm.mips.fill.d"]
511    fn msa_fill_d(a: i64) -> v2i64;
512    #[link_name = "llvm.mips.flog2.w"]
513    fn msa_flog2_w(a: v4f32) -> v4f32;
514    #[link_name = "llvm.mips.flog2.d"]
515    fn msa_flog2_d(a: v2f64) -> v2f64;
516    #[link_name = "llvm.mips.fmadd.w"]
517    fn msa_fmadd_w(a: v4f32, b: v4f32, c: v4f32) -> v4f32;
518    #[link_name = "llvm.mips.fmadd.d"]
519    fn msa_fmadd_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64;
520    #[link_name = "llvm.mips.fmax.w"]
521    fn msa_fmax_w(a: v4f32, b: v4f32) -> v4f32;
522    #[link_name = "llvm.mips.fmax.d"]
523    fn msa_fmax_d(a: v2f64, b: v2f64) -> v2f64;
524    #[link_name = "llvm.mips.fmax.a.w"]
525    fn msa_fmax_a_w(a: v4f32, b: v4f32) -> v4f32;
526    #[link_name = "llvm.mips.fmax.a.d"]
527    fn msa_fmax_a_d(a: v2f64, b: v2f64) -> v2f64;
528    #[link_name = "llvm.mips.fmin.w"]
529    fn msa_fmin_w(a: v4f32, b: v4f32) -> v4f32;
530    #[link_name = "llvm.mips.fmin.d"]
531    fn msa_fmin_d(a: v2f64, b: v2f64) -> v2f64;
532    #[link_name = "llvm.mips.fmin.a.w"]
533    fn msa_fmin_a_w(a: v4f32, b: v4f32) -> v4f32;
534    #[link_name = "llvm.mips.fmin.a.d"]
535    fn msa_fmin_a_d(a: v2f64, b: v2f64) -> v2f64;
536    #[link_name = "llvm.mips.fmsub.w"]
537    fn msa_fmsub_w(a: v4f32, b: v4f32, c: v4f32) -> v4f32;
538    #[link_name = "llvm.mips.fmsub.d"]
539    fn msa_fmsub_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64;
540    #[link_name = "llvm.mips.fmul.w"]
541    fn msa_fmul_w(a: v4f32, b: v4f32) -> v4f32;
542    #[link_name = "llvm.mips.fmul.d"]
543    fn msa_fmul_d(a: v2f64, b: v2f64) -> v2f64;
544    #[link_name = "llvm.mips.frint.w"]
545    fn msa_frint_w(a: v4f32) -> v4f32;
546    #[link_name = "llvm.mips.frint.d"]
547    fn msa_frint_d(a: v2f64) -> v2f64;
548    #[link_name = "llvm.mips.frcp.w"]
549    fn msa_frcp_w(a: v4f32) -> v4f32;
550    #[link_name = "llvm.mips.frcp.d"]
551    fn msa_frcp_d(a: v2f64) -> v2f64;
552    #[link_name = "llvm.mips.frsqrt.w"]
553    fn msa_frsqrt_w(a: v4f32) -> v4f32;
554    #[link_name = "llvm.mips.frsqrt.d"]
555    fn msa_frsqrt_d(a: v2f64) -> v2f64;
556    #[link_name = "llvm.mips.fsaf.w"]
557    fn msa_fsaf_w(a: v4f32, b: v4f32) -> v4i32;
558    #[link_name = "llvm.mips.fsaf.d"]
559    fn msa_fsaf_d(a: v2f64, b: v2f64) -> v2i64;
560    #[link_name = "llvm.mips.fseq.w"]
561    fn msa_fseq_w(a: v4f32, b: v4f32) -> v4i32;
562    #[link_name = "llvm.mips.fseq.d"]
563    fn msa_fseq_d(a: v2f64, b: v2f64) -> v2i64;
564    #[link_name = "llvm.mips.fsle.w"]
565    fn msa_fsle_w(a: v4f32, b: v4f32) -> v4i32;
566    #[link_name = "llvm.mips.fsle.d"]
567    fn msa_fsle_d(a: v2f64, b: v2f64) -> v2i64;
568    #[link_name = "llvm.mips.fslt.w"]
569    fn msa_fslt_w(a: v4f32, b: v4f32) -> v4i32;
570    #[link_name = "llvm.mips.fslt.d"]
571    fn msa_fslt_d(a: v2f64, b: v2f64) -> v2i64;
572    #[link_name = "llvm.mips.fsne.w"]
573    fn msa_fsne_w(a: v4f32, b: v4f32) -> v4i32;
574    #[link_name = "llvm.mips.fsne.d"]
575    fn msa_fsne_d(a: v2f64, b: v2f64) -> v2i64;
576    #[link_name = "llvm.mips.fsor.w"]
577    fn msa_fsor_w(a: v4f32, b: v4f32) -> v4i32;
578    #[link_name = "llvm.mips.fsor.d"]
579    fn msa_fsor_d(a: v2f64, b: v2f64) -> v2i64;
580    #[link_name = "llvm.mips.fsqrt.w"]
581    fn msa_fsqrt_w(a: v4f32) -> v4f32;
582    #[link_name = "llvm.mips.fsqrt.d"]
583    fn msa_fsqrt_d(a: v2f64) -> v2f64;
584    #[link_name = "llvm.mips.fsub.w"]
585    fn msa_fsub_w(a: v4f32, b: v4f32) -> v4f32;
586    #[link_name = "llvm.mips.fsub.d"]
587    fn msa_fsub_d(a: v2f64, b: v2f64) -> v2f64;
588    #[link_name = "llvm.mips.fsueq.w"]
589    fn msa_fsueq_w(a: v4f32, b: v4f32) -> v4i32;
590    #[link_name = "llvm.mips.fsueq.d"]
591    fn msa_fsueq_d(a: v2f64, b: v2f64) -> v2i64;
592    #[link_name = "llvm.mips.fsule.w"]
593    fn msa_fsule_w(a: v4f32, b: v4f32) -> v4i32;
594    #[link_name = "llvm.mips.fsule.d"]
595    fn msa_fsule_d(a: v2f64, b: v2f64) -> v2i64;
596    #[link_name = "llvm.mips.fsult.w"]
597    fn msa_fsult_w(a: v4f32, b: v4f32) -> v4i32;
598    #[link_name = "llvm.mips.fsult.d"]
599    fn msa_fsult_d(a: v2f64, b: v2f64) -> v2i64;
600    #[link_name = "llvm.mips.fsun.w"]
601    fn msa_fsun_w(a: v4f32, b: v4f32) -> v4i32;
602    #[link_name = "llvm.mips.fsun.d"]
603    fn msa_fsun_d(a: v2f64, b: v2f64) -> v2i64;
604    #[link_name = "llvm.mips.fsune.w"]
605    fn msa_fsune_w(a: v4f32, b: v4f32) -> v4i32;
606    #[link_name = "llvm.mips.fsune.d"]
607    fn msa_fsune_d(a: v2f64, b: v2f64) -> v2i64;
608    #[link_name = "llvm.mips.ftint.s.w"]
609    fn msa_ftint_s_w(a: v4f32) -> v4i32;
610    #[link_name = "llvm.mips.ftint.s.d"]
611    fn msa_ftint_s_d(a: v2f64) -> v2i64;
612    #[link_name = "llvm.mips.ftint.u.w"]
613    fn msa_ftint_u_w(a: v4f32) -> v4u32;
614    #[link_name = "llvm.mips.ftint.u.d"]
615    fn msa_ftint_u_d(a: v2f64) -> v2u64;
616    #[link_name = "llvm.mips.ftq.h"]
617    fn msa_ftq_h(a: v4f32, b: v4f32) -> v8i16;
618    #[link_name = "llvm.mips.ftq.w"]
619    fn msa_ftq_w(a: v2f64, b: v2f64) -> v4i32;
620    #[link_name = "llvm.mips.ftrunc.s.w"]
621    fn msa_ftrunc_s_w(a: v4f32) -> v4i32;
622    #[link_name = "llvm.mips.ftrunc.s.d"]
623    fn msa_ftrunc_s_d(a: v2f64) -> v2i64;
624    #[link_name = "llvm.mips.ftrunc.u.w"]
625    fn msa_ftrunc_u_w(a: v4f32) -> v4u32;
626    #[link_name = "llvm.mips.ftrunc.u.d"]
627    fn msa_ftrunc_u_d(a: v2f64) -> v2u64;
628    #[link_name = "llvm.mips.hadd.s.h"]
629    fn msa_hadd_s_h(a: v16i8, b: v16i8) -> v8i16;
630    #[link_name = "llvm.mips.hadd.s.w"]
631    fn msa_hadd_s_w(a: v8i16, b: v8i16) -> v4i32;
632    #[link_name = "llvm.mips.hadd.s.d"]
633    fn msa_hadd_s_d(a: v4i32, b: v4i32) -> v2i64;
634    #[link_name = "llvm.mips.hadd.u.h"]
635    fn msa_hadd_u_h(a: v16u8, b: v16u8) -> v8u16;
636    #[link_name = "llvm.mips.hadd.u.w"]
637    fn msa_hadd_u_w(a: v8u16, b: v8u16) -> v4u32;
638    #[link_name = "llvm.mips.hadd.u.d"]
639    fn msa_hadd_u_d(a: v4u32, b: v4u32) -> v2u64;
640    #[link_name = "llvm.mips.hsub.s.h"]
641    fn msa_hsub_s_h(a: v16i8, b: v16i8) -> v8i16;
642    #[link_name = "llvm.mips.hsub.s.w"]
643    fn msa_hsub_s_w(a: v8i16, b: v8i16) -> v4i32;
644    #[link_name = "llvm.mips.hsub.s.d"]
645    fn msa_hsub_s_d(a: v4i32, b: v4i32) -> v2i64;
646    #[link_name = "llvm.mips.hsub.u.h"]
647    fn msa_hsub_u_h(a: v16u8, b: v16u8) -> v8i16;
648    #[link_name = "llvm.mips.hsub.u.w"]
649    fn msa_hsub_u_w(a: v8u16, b: v8u16) -> v4i32;
650    #[link_name = "llvm.mips.hsub.u.d"]
651    fn msa_hsub_u_d(a: v4u32, b: v4u32) -> v2i64;
652    #[link_name = "llvm.mips.ilvev.b"]
653    fn msa_ilvev_b(a: v16i8, b: v16i8) -> v16i8;
654    #[link_name = "llvm.mips.ilvev.h"]
655    fn msa_ilvev_h(a: v8i16, b: v8i16) -> v8i16;
656    #[link_name = "llvm.mips.ilvev.w"]
657    fn msa_ilvev_w(a: v4i32, b: v4i32) -> v4i32;
658    #[link_name = "llvm.mips.ilvev.d"]
659    fn msa_ilvev_d(a: v2i64, b: v2i64) -> v2i64;
660    #[link_name = "llvm.mips.ilvl.b"]
661    fn msa_ilvl_b(a: v16i8, b: v16i8) -> v16i8;
662    #[link_name = "llvm.mips.ilvl.h"]
663    fn msa_ilvl_h(a: v8i16, b: v8i16) -> v8i16;
664    #[link_name = "llvm.mips.ilvl.w"]
665    fn msa_ilvl_w(a: v4i32, b: v4i32) -> v4i32;
666    #[link_name = "llvm.mips.ilvl.d"]
667    fn msa_ilvl_d(a: v2i64, b: v2i64) -> v2i64;
668    #[link_name = "llvm.mips.ilvod.b"]
669    fn msa_ilvod_b(a: v16i8, b: v16i8) -> v16i8;
670    #[link_name = "llvm.mips.ilvod.h"]
671    fn msa_ilvod_h(a: v8i16, b: v8i16) -> v8i16;
672    #[link_name = "llvm.mips.ilvod.w"]
673    fn msa_ilvod_w(a: v4i32, b: v4i32) -> v4i32;
674    #[link_name = "llvm.mips.ilvod.d"]
675    fn msa_ilvod_d(a: v2i64, b: v2i64) -> v2i64;
676    #[link_name = "llvm.mips.ilvr.b"]
677    fn msa_ilvr_b(a: v16i8, b: v16i8) -> v16i8;
678    #[link_name = "llvm.mips.ilvr.h"]
679    fn msa_ilvr_h(a: v8i16, b: v8i16) -> v8i16;
680    #[link_name = "llvm.mips.ilvr.w"]
681    fn msa_ilvr_w(a: v4i32, b: v4i32) -> v4i32;
682    #[link_name = "llvm.mips.ilvr.d"]
683    fn msa_ilvr_d(a: v2i64, b: v2i64) -> v2i64;
684    #[link_name = "llvm.mips.insert.b"]
685    fn msa_insert_b(a: v16i8, b: i32, c: i32) -> v16i8;
686    #[link_name = "llvm.mips.insert.h"]
687    fn msa_insert_h(a: v8i16, b: i32, c: i32) -> v8i16;
688    #[link_name = "llvm.mips.insert.w"]
689    fn msa_insert_w(a: v4i32, b: i32, c: i32) -> v4i32;
690    #[link_name = "llvm.mips.insert.d"]
691    fn msa_insert_d(a: v2i64, b: i32, c: i64) -> v2i64;
692    #[link_name = "llvm.mips.insve.b"]
693    fn msa_insve_b(a: v16i8, b: i32, c: v16i8) -> v16i8;
694    #[link_name = "llvm.mips.insve.h"]
695    fn msa_insve_h(a: v8i16, b: i32, c: v8i16) -> v8i16;
696    #[link_name = "llvm.mips.insve.w"]
697    fn msa_insve_w(a: v4i32, b: i32, c: v4i32) -> v4i32;
698    #[link_name = "llvm.mips.insve.d"]
699    fn msa_insve_d(a: v2i64, b: i32, c: v2i64) -> v2i64;
700    #[link_name = "llvm.mips.ld.b"]
701    fn msa_ld_b(mem_addr: *mut u8, b: i32) -> v16i8;
702    #[link_name = "llvm.mips.ld.h"]
703    fn msa_ld_h(mem_addr: *mut u8, b: i32) -> v8i16;
704    #[link_name = "llvm.mips.ld.w"]
705    fn msa_ld_w(mem_addr: *mut u8, b: i32) -> v4i32;
706    #[link_name = "llvm.mips.ld.d"]
707    fn msa_ld_d(mem_addr: *mut u8, b: i32) -> v2i64;
708    #[link_name = "llvm.mips.ldi.b"]
709    fn msa_ldi_b(a: i32) -> v16i8;
710    #[link_name = "llvm.mips.ldi.h"]
711    fn msa_ldi_h(a: i32) -> v8i16;
712    #[link_name = "llvm.mips.ldi.w"]
713    fn msa_ldi_w(a: i32) -> v4i32;
714    #[link_name = "llvm.mips.ldi.d"]
715    fn msa_ldi_d(a: i32) -> v2i64;
716    #[link_name = "llvm.mips.madd.q.h"]
717    fn msa_madd_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
718    #[link_name = "llvm.mips.madd.q.w"]
719    fn msa_madd_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
720    #[link_name = "llvm.mips.maddr.q.h"]
721    fn msa_maddr_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
722    #[link_name = "llvm.mips.maddr.q.w"]
723    fn msa_maddr_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
724    #[link_name = "llvm.mips.maddv.b"]
725    fn msa_maddv_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8;
726    #[link_name = "llvm.mips.maddv.h"]
727    fn msa_maddv_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
728    #[link_name = "llvm.mips.maddv.w"]
729    fn msa_maddv_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
730    #[link_name = "llvm.mips.maddv.d"]
731    fn msa_maddv_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64;
732    #[link_name = "llvm.mips.max.a.b"]
733    fn msa_max_a_b(a: v16i8, b: v16i8) -> v16i8;
734    #[link_name = "llvm.mips.max.a.h"]
735    fn msa_max_a_h(a: v8i16, b: v8i16) -> v8i16;
736    #[link_name = "llvm.mips.max.a.w"]
737    fn msa_max_a_w(a: v4i32, b: v4i32) -> v4i32;
738    #[link_name = "llvm.mips.max.a.d"]
739    fn msa_max_a_d(a: v2i64, b: v2i64) -> v2i64;
740    #[link_name = "llvm.mips.max.s.b"]
741    fn msa_max_s_b(a: v16i8, b: v16i8) -> v16i8;
742    #[link_name = "llvm.mips.max.s.h"]
743    fn msa_max_s_h(a: v8i16, b: v8i16) -> v8i16;
744    #[link_name = "llvm.mips.max.s.w"]
745    fn msa_max_s_w(a: v4i32, b: v4i32) -> v4i32;
746    #[link_name = "llvm.mips.max.s.d"]
747    fn msa_max_s_d(a: v2i64, b: v2i64) -> v2i64;
748    #[link_name = "llvm.mips.max.u.b"]
749    fn msa_max_u_b(a: v16u8, b: v16u8) -> v16u8;
750    #[link_name = "llvm.mips.max.u.h"]
751    fn msa_max_u_h(a: v8u16, b: v8u16) -> v8u16;
752    #[link_name = "llvm.mips.max.u.w"]
753    fn msa_max_u_w(a: v4u32, b: v4u32) -> v4u32;
754    #[link_name = "llvm.mips.max.u.d"]
755    fn msa_max_u_d(a: v2u64, b: v2u64) -> v2u64;
756    #[link_name = "llvm.mips.maxi.s.b"]
757    fn msa_maxi_s_b(a: v16i8, b: i32) -> v16i8;
758    #[link_name = "llvm.mips.maxi.s.h"]
759    fn msa_maxi_s_h(a: v8i16, b: i32) -> v8i16;
760    #[link_name = "llvm.mips.maxi.s.w"]
761    fn msa_maxi_s_w(a: v4i32, b: i32) -> v4i32;
762    #[link_name = "llvm.mips.maxi.s.d"]
763    fn msa_maxi_s_d(a: v2i64, b: i32) -> v2i64;
764    #[link_name = "llvm.mips.maxi.u.b"]
765    fn msa_maxi_u_b(a: v16u8, b: i32) -> v16u8;
766    #[link_name = "llvm.mips.maxi.u.h"]
767    fn msa_maxi_u_h(a: v8u16, b: i32) -> v8u16;
768    #[link_name = "llvm.mips.maxi.u.w"]
769    fn msa_maxi_u_w(a: v4u32, b: i32) -> v4u32;
770    #[link_name = "llvm.mips.maxi.u.d"]
771    fn msa_maxi_u_d(a: v2u64, b: i32) -> v2u64;
772    #[link_name = "llvm.mips.min.a.b"]
773    fn msa_min_a_b(a: v16i8, b: v16i8) -> v16i8;
774    #[link_name = "llvm.mips.min.a.h"]
775    fn msa_min_a_h(a: v8i16, b: v8i16) -> v8i16;
776    #[link_name = "llvm.mips.min.a.w"]
777    fn msa_min_a_w(a: v4i32, b: v4i32) -> v4i32;
778    #[link_name = "llvm.mips.min.a.d"]
779    fn msa_min_a_d(a: v2i64, b: v2i64) -> v2i64;
780    #[link_name = "llvm.mips.min.s.b"]
781    fn msa_min_s_b(a: v16i8, b: v16i8) -> v16i8;
782    #[link_name = "llvm.mips.min.s.h"]
783    fn msa_min_s_h(a: v8i16, b: v8i16) -> v8i16;
784    #[link_name = "llvm.mips.min.s.w"]
785    fn msa_min_s_w(a: v4i32, b: v4i32) -> v4i32;
786    #[link_name = "llvm.mips.min.s.d"]
787    fn msa_min_s_d(a: v2i64, b: v2i64) -> v2i64;
788    #[link_name = "llvm.mips.min.u.b"]
789    fn msa_min_u_b(a: v16u8, b: v16u8) -> v16u8;
790    #[link_name = "llvm.mips.min.u.h"]
791    fn msa_min_u_h(a: v8u16, b: v8u16) -> v8u16;
792    #[link_name = "llvm.mips.min.u.w"]
793    fn msa_min_u_w(a: v4u32, b: v4u32) -> v4u32;
794    #[link_name = "llvm.mips.min.u.d"]
795    fn msa_min_u_d(a: v2u64, b: v2u64) -> v2u64;
796    #[link_name = "llvm.mips.mini.s.b"]
797    fn msa_mini_s_b(a: v16i8, b: i32) -> v16i8;
798    #[link_name = "llvm.mips.mini.s.h"]
799    fn msa_mini_s_h(a: v8i16, b: i32) -> v8i16;
800    #[link_name = "llvm.mips.mini.s.w"]
801    fn msa_mini_s_w(a: v4i32, b: i32) -> v4i32;
802    #[link_name = "llvm.mips.mini.s.d"]
803    fn msa_mini_s_d(a: v2i64, b: i32) -> v2i64;
804    #[link_name = "llvm.mips.mini.u.b"]
805    fn msa_mini_u_b(a: v16u8, b: i32) -> v16u8;
806    #[link_name = "llvm.mips.mini.u.h"]
807    fn msa_mini_u_h(a: v8u16, b: i32) -> v8u16;
808    #[link_name = "llvm.mips.mini.u.w"]
809    fn msa_mini_u_w(a: v4u32, b: i32) -> v4u32;
810    #[link_name = "llvm.mips.mini.u.d"]
811    fn msa_mini_u_d(a: v2u64, b: i32) -> v2u64;
812    #[link_name = "llvm.mips.mod.s.b"]
813    fn msa_mod_s_b(a: v16i8, b: v16i8) -> v16i8;
814    #[link_name = "llvm.mips.mod.s.h"]
815    fn msa_mod_s_h(a: v8i16, b: v8i16) -> v8i16;
816    #[link_name = "llvm.mips.mod.s.w"]
817    fn msa_mod_s_w(a: v4i32, b: v4i32) -> v4i32;
818    #[link_name = "llvm.mips.mod.s.d"]
819    fn msa_mod_s_d(a: v2i64, b: v2i64) -> v2i64;
820    #[link_name = "llvm.mips.mod.u.b"]
821    fn msa_mod_u_b(a: v16u8, b: v16u8) -> v16u8;
822    #[link_name = "llvm.mips.mod.u.h"]
823    fn msa_mod_u_h(a: v8u16, b: v8u16) -> v8u16;
824    #[link_name = "llvm.mips.mod.u.w"]
825    fn msa_mod_u_w(a: v4u32, b: v4u32) -> v4u32;
826    #[link_name = "llvm.mips.mod.u.d"]
827    fn msa_mod_u_d(a: v2u64, b: v2u64) -> v2u64;
828    #[link_name = "llvm.mips.move.v"]
829    fn msa_move_v(a: v16i8) -> v16i8;
830    #[link_name = "llvm.mips.msub.q.h"]
831    fn msa_msub_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
832    #[link_name = "llvm.mips.msub.q.w"]
833    fn msa_msub_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
834    #[link_name = "llvm.mips.msubr.q.h"]
835    fn msa_msubr_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
836    #[link_name = "llvm.mips.msubr.q.w"]
837    fn msa_msubr_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
838    #[link_name = "llvm.mips.msubv.b"]
839    fn msa_msubv_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8;
840    #[link_name = "llvm.mips.msubv.h"]
841    fn msa_msubv_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
842    #[link_name = "llvm.mips.msubv.w"]
843    fn msa_msubv_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
844    #[link_name = "llvm.mips.msubv.d"]
845    fn msa_msubv_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64;
846    #[link_name = "llvm.mips.mul.q.h"]
847    fn msa_mul_q_h(a: v8i16, b: v8i16) -> v8i16;
848    #[link_name = "llvm.mips.mul.q.w"]
849    fn msa_mul_q_w(a: v4i32, b: v4i32) -> v4i32;
850    #[link_name = "llvm.mips.mulr.q.h"]
851    fn msa_mulr_q_h(a: v8i16, b: v8i16) -> v8i16;
852    #[link_name = "llvm.mips.mulr.q.w"]
853    fn msa_mulr_q_w(a: v4i32, b: v4i32) -> v4i32;
854    #[link_name = "llvm.mips.mulv.b"]
855    fn msa_mulv_b(a: v16i8, b: v16i8) -> v16i8;
856    #[link_name = "llvm.mips.mulv.h"]
857    fn msa_mulv_h(a: v8i16, b: v8i16) -> v8i16;
858    #[link_name = "llvm.mips.mulv.w"]
859    fn msa_mulv_w(a: v4i32, b: v4i32) -> v4i32;
860    #[link_name = "llvm.mips.mulv.d"]
861    fn msa_mulv_d(a: v2i64, b: v2i64) -> v2i64;
862    #[link_name = "llvm.mips.nloc.b"]
863    fn msa_nloc_b(a: v16i8) -> v16i8;
864    #[link_name = "llvm.mips.nloc.h"]
865    fn msa_nloc_h(a: v8i16) -> v8i16;
866    #[link_name = "llvm.mips.nloc.w"]
867    fn msa_nloc_w(a: v4i32) -> v4i32;
868    #[link_name = "llvm.mips.nloc.d"]
869    fn msa_nloc_d(a: v2i64) -> v2i64;
870    #[link_name = "llvm.mips.nlzc.b"]
871    fn msa_nlzc_b(a: v16i8) -> v16i8;
872    #[link_name = "llvm.mips.nlzc.h"]
873    fn msa_nlzc_h(a: v8i16) -> v8i16;
874    #[link_name = "llvm.mips.nlzc.w"]
875    fn msa_nlzc_w(a: v4i32) -> v4i32;
876    #[link_name = "llvm.mips.nlzc.d"]
877    fn msa_nlzc_d(a: v2i64) -> v2i64;
878    #[link_name = "llvm.mips.nor.v"]
879    fn msa_nor_v(a: v16u8, b: v16u8) -> v16u8;
880    #[link_name = "llvm.mips.nori.b"]
881    fn msa_nori_b(a: v16u8, b: i32) -> v16u8;
882    #[link_name = "llvm.mips.or.v"]
883    fn msa_or_v(a: v16u8, b: v16u8) -> v16u8;
884    #[link_name = "llvm.mips.ori.b"]
885    fn msa_ori_b(a: v16u8, b: i32) -> v16u8;
886    #[link_name = "llvm.mips.pckev.b"]
887    fn msa_pckev_b(a: v16i8, b: v16i8) -> v16i8;
888    #[link_name = "llvm.mips.pckev.h"]
889    fn msa_pckev_h(a: v8i16, b: v8i16) -> v8i16;
890    #[link_name = "llvm.mips.pckev.w"]
891    fn msa_pckev_w(a: v4i32, b: v4i32) -> v4i32;
892    #[link_name = "llvm.mips.pckev.d"]
893    fn msa_pckev_d(a: v2i64, b: v2i64) -> v2i64;
894    #[link_name = "llvm.mips.pckod.b"]
895    fn msa_pckod_b(a: v16i8, b: v16i8) -> v16i8;
896    #[link_name = "llvm.mips.pckod.h"]
897    fn msa_pckod_h(a: v8i16, b: v8i16) -> v8i16;
898    #[link_name = "llvm.mips.pckod.w"]
899    fn msa_pckod_w(a: v4i32, b: v4i32) -> v4i32;
900    #[link_name = "llvm.mips.pckod.d"]
901    fn msa_pckod_d(a: v2i64, b: v2i64) -> v2i64;
902    #[link_name = "llvm.mips.pcnt.b"]
903    fn msa_pcnt_b(a: v16i8) -> v16i8;
904    #[link_name = "llvm.mips.pcnt.h"]
905    fn msa_pcnt_h(a: v8i16) -> v8i16;
906    #[link_name = "llvm.mips.pcnt.w"]
907    fn msa_pcnt_w(a: v4i32) -> v4i32;
908    #[link_name = "llvm.mips.pcnt.d"]
909    fn msa_pcnt_d(a: v2i64) -> v2i64;
910    #[link_name = "llvm.mips.sat.s.b"]
911    fn msa_sat_s_b(a: v16i8, b: i32) -> v16i8;
912    #[link_name = "llvm.mips.sat.s.h"]
913    fn msa_sat_s_h(a: v8i16, b: i32) -> v8i16;
914    #[link_name = "llvm.mips.sat.s.w"]
915    fn msa_sat_s_w(a: v4i32, b: i32) -> v4i32;
916    #[link_name = "llvm.mips.sat.s.d"]
917    fn msa_sat_s_d(a: v2i64, b: i32) -> v2i64;
918    #[link_name = "llvm.mips.sat.u.b"]
919    fn msa_sat_u_b(a: v16u8, b: i32) -> v16u8;
920    #[link_name = "llvm.mips.sat.u.h"]
921    fn msa_sat_u_h(a: v8u16, b: i32) -> v8u16;
922    #[link_name = "llvm.mips.sat.u.w"]
923    fn msa_sat_u_w(a: v4u32, b: i32) -> v4u32;
924    #[link_name = "llvm.mips.sat.u.d"]
925    fn msa_sat_u_d(a: v2u64, b: i32) -> v2u64;
926    #[link_name = "llvm.mips.shf.b"]
927    fn msa_shf_b(a: v16i8, b: i32) -> v16i8;
928    #[link_name = "llvm.mips.shf.h"]
929    fn msa_shf_h(a: v8i16, b: i32) -> v8i16;
930    #[link_name = "llvm.mips.shf.w"]
931    fn msa_shf_w(a: v4i32, b: i32) -> v4i32;
932    #[link_name = "llvm.mips.sld.b"]
933    fn msa_sld_b(a: v16i8, b: v16i8, c: i32) -> v16i8;
934    #[link_name = "llvm.mips.sld.h"]
935    fn msa_sld_h(a: v8i16, b: v8i16, c: i32) -> v8i16;
936    #[link_name = "llvm.mips.sld.w"]
937    fn msa_sld_w(a: v4i32, b: v4i32, c: i32) -> v4i32;
938    #[link_name = "llvm.mips.sld.d"]
939    fn msa_sld_d(a: v2i64, b: v2i64, c: i32) -> v2i64;
940    #[link_name = "llvm.mips.sldi.b"]
941    fn msa_sldi_b(a: v16i8, b: v16i8, c: i32) -> v16i8;
942    #[link_name = "llvm.mips.sldi.h"]
943    fn msa_sldi_h(a: v8i16, b: v8i16, c: i32) -> v8i16;
944    #[link_name = "llvm.mips.sldi.w"]
945    fn msa_sldi_w(a: v4i32, b: v4i32, c: i32) -> v4i32;
946    #[link_name = "llvm.mips.sldi.d"]
947    fn msa_sldi_d(a: v2i64, b: v2i64, c: i32) -> v2i64;
948    #[link_name = "llvm.mips.sll.b"]
949    fn msa_sll_b(a: v16i8, b: v16i8) -> v16i8;
950    #[link_name = "llvm.mips.sll.h"]
951    fn msa_sll_h(a: v8i16, b: v8i16) -> v8i16;
952    #[link_name = "llvm.mips.sll.w"]
953    fn msa_sll_w(a: v4i32, b: v4i32) -> v4i32;
954    #[link_name = "llvm.mips.sll.d"]
955    fn msa_sll_d(a: v2i64, b: v2i64) -> v2i64;
956    #[link_name = "llvm.mips.slli.b"]
957    fn msa_slli_b(a: v16i8, b: i32) -> v16i8;
958    #[link_name = "llvm.mips.slli.h"]
959    fn msa_slli_h(a: v8i16, b: i32) -> v8i16;
960    #[link_name = "llvm.mips.slli.w"]
961    fn msa_slli_w(a: v4i32, b: i32) -> v4i32;
962    #[link_name = "llvm.mips.slli.d"]
963    fn msa_slli_d(a: v2i64, b: i32) -> v2i64;
964    #[link_name = "llvm.mips.splat.b"]
965    fn msa_splat_b(a: v16i8, c: i32) -> v16i8;
966    #[link_name = "llvm.mips.splat.h"]
967    fn msa_splat_h(a: v8i16, c: i32) -> v8i16;
968    #[link_name = "llvm.mips.splat.w"]
969    fn msa_splat_w(a: v4i32, w: i32) -> v4i32;
970    #[link_name = "llvm.mips.splat.d"]
971    fn msa_splat_d(a: v2i64, c: i32) -> v2i64;
972    #[link_name = "llvm.mips.splati.b"]
973    fn msa_splati_b(a: v16i8, b: i32) -> v16i8;
974    #[link_name = "llvm.mips.splati.h"]
975    fn msa_splati_h(a: v8i16, b: i32) -> v8i16;
976    #[link_name = "llvm.mips.splati.w"]
977    fn msa_splati_w(a: v4i32, b: i32) -> v4i32;
978    #[link_name = "llvm.mips.splati.d"]
979    fn msa_splati_d(a: v2i64, b: i32) -> v2i64;
980    #[link_name = "llvm.mips.sra.b"]
981    fn msa_sra_b(a: v16i8, b: v16i8) -> v16i8;
982    #[link_name = "llvm.mips.sra.h"]
983    fn msa_sra_h(a: v8i16, b: v8i16) -> v8i16;
984    #[link_name = "llvm.mips.sra.w"]
985    fn msa_sra_w(a: v4i32, b: v4i32) -> v4i32;
986    #[link_name = "llvm.mips.sra.d"]
987    fn msa_sra_d(a: v2i64, b: v2i64) -> v2i64;
988    #[link_name = "llvm.mips.srai.b"]
989    fn msa_srai_b(a: v16i8, b: i32) -> v16i8;
990    #[link_name = "llvm.mips.srai.h"]
991    fn msa_srai_h(a: v8i16, b: i32) -> v8i16;
992    #[link_name = "llvm.mips.srai.w"]
993    fn msa_srai_w(a: v4i32, b: i32) -> v4i32;
994    #[link_name = "llvm.mips.srai.d"]
995    fn msa_srai_d(a: v2i64, b: i32) -> v2i64;
996    #[link_name = "llvm.mips.srar.b"]
997    fn msa_srar_b(a: v16i8, b: v16i8) -> v16i8;
998    #[link_name = "llvm.mips.srar.h"]
999    fn msa_srar_h(a: v8i16, b: v8i16) -> v8i16;
1000    #[link_name = "llvm.mips.srar.w"]
1001    fn msa_srar_w(a: v4i32, b: v4i32) -> v4i32;
1002    #[link_name = "llvm.mips.srar.d"]
1003    fn msa_srar_d(a: v2i64, b: v2i64) -> v2i64;
1004    #[link_name = "llvm.mips.srari.b"]
1005    fn msa_srari_b(a: v16i8, b: i32) -> v16i8;
1006    #[link_name = "llvm.mips.srari.h"]
1007    fn msa_srari_h(a: v8i16, b: i32) -> v8i16;
1008    #[link_name = "llvm.mips.srari.w"]
1009    fn msa_srari_w(a: v4i32, b: i32) -> v4i32;
1010    #[link_name = "llvm.mips.srari.d"]
1011    fn msa_srari_d(a: v2i64, b: i32) -> v2i64;
1012    #[link_name = "llvm.mips.srl.b"]
1013    fn msa_srl_b(a: v16i8, b: v16i8) -> v16i8;
1014    #[link_name = "llvm.mips.srl.h"]
1015    fn msa_srl_h(a: v8i16, b: v8i16) -> v8i16;
1016    #[link_name = "llvm.mips.srl.w"]
1017    fn msa_srl_w(a: v4i32, b: v4i32) -> v4i32;
1018    #[link_name = "llvm.mips.srl.d"]
1019    fn msa_srl_d(a: v2i64, b: v2i64) -> v2i64;
1020    #[link_name = "llvm.mips.srli.b"]
1021    fn msa_srli_b(a: v16i8, b: i32) -> v16i8;
1022    #[link_name = "llvm.mips.srli.h"]
1023    fn msa_srli_h(a: v8i16, b: i32) -> v8i16;
1024    #[link_name = "llvm.mips.srli.w"]
1025    fn msa_srli_w(a: v4i32, b: i32) -> v4i32;
1026    #[link_name = "llvm.mips.srli.d"]
1027    fn msa_srli_d(a: v2i64, b: i32) -> v2i64;
1028    #[link_name = "llvm.mips.srlr.b"]
1029    fn msa_srlr_b(a: v16i8, b: v16i8) -> v16i8;
1030    #[link_name = "llvm.mips.srlr.h"]
1031    fn msa_srlr_h(a: v8i16, b: v8i16) -> v8i16;
1032    #[link_name = "llvm.mips.srlr.w"]
1033    fn msa_srlr_w(a: v4i32, b: v4i32) -> v4i32;
1034    #[link_name = "llvm.mips.srlr.d"]
1035    fn msa_srlr_d(a: v2i64, b: v2i64) -> v2i64;
1036    #[link_name = "llvm.mips.srlri.b"]
1037    fn msa_srlri_b(a: v16i8, b: i32) -> v16i8;
1038    #[link_name = "llvm.mips.srlri.h"]
1039    fn msa_srlri_h(a: v8i16, b: i32) -> v8i16;
1040    #[link_name = "llvm.mips.srlri.w"]
1041    fn msa_srlri_w(a: v4i32, b: i32) -> v4i32;
1042    #[link_name = "llvm.mips.srlri.d"]
1043    fn msa_srlri_d(a: v2i64, b: i32) -> v2i64;
1044    #[link_name = "llvm.mips.st.b"]
1045    fn msa_st_b(a: v16i8, mem_addr: *mut u8, imm_s10: i32) -> ();
1046    #[link_name = "llvm.mips.st.h"]
1047    fn msa_st_h(a: v8i16, mem_addr: *mut u8, imm_s11: i32) -> ();
1048    #[link_name = "llvm.mips.st.w"]
1049    fn msa_st_w(a: v4i32, mem_addr: *mut u8, imm_s12: i32) -> ();
1050    #[link_name = "llvm.mips.st.d"]
1051    fn msa_st_d(a: v2i64, mem_addr: *mut u8, imm_s13: i32) -> ();
1052    #[link_name = "llvm.mips.subs.s.b"]
1053    fn msa_subs_s_b(a: v16i8, b: v16i8) -> v16i8;
1054    #[link_name = "llvm.mips.subs.s.h"]
1055    fn msa_subs_s_h(a: v8i16, b: v8i16) -> v8i16;
1056    #[link_name = "llvm.mips.subs.s.w"]
1057    fn msa_subs_s_w(a: v4i32, b: v4i32) -> v4i32;
1058    #[link_name = "llvm.mips.subs.s.d"]
1059    fn msa_subs_s_d(a: v2i64, b: v2i64) -> v2i64;
1060    #[link_name = "llvm.mips.subs.u.b"]
1061    fn msa_subs_u_b(a: v16u8, b: v16u8) -> v16u8;
1062    #[link_name = "llvm.mips.subs.u.h"]
1063    fn msa_subs_u_h(a: v8u16, b: v8u16) -> v8u16;
1064    #[link_name = "llvm.mips.subs.u.w"]
1065    fn msa_subs_u_w(a: v4u32, b: v4u32) -> v4u32;
1066    #[link_name = "llvm.mips.subs.u.d"]
1067    fn msa_subs_u_d(a: v2u64, b: v2u64) -> v2u64;
1068    #[link_name = "llvm.mips.subsus.u.b"]
1069    fn msa_subsus_u_b(a: v16u8, b: v16i8) -> v16u8;
1070    #[link_name = "llvm.mips.subsus.u.h"]
1071    fn msa_subsus_u_h(a: v8u16, b: v8i16) -> v8u16;
1072    #[link_name = "llvm.mips.subsus.u.w"]
1073    fn msa_subsus_u_w(a: v4u32, b: v4i32) -> v4u32;
1074    #[link_name = "llvm.mips.subsus.u.d"]
1075    fn msa_subsus_u_d(a: v2u64, b: v2i64) -> v2u64;
1076    #[link_name = "llvm.mips.subsuu.s.b"]
1077    fn msa_subsuu_s_b(a: v16u8, b: v16u8) -> v16i8;
1078    #[link_name = "llvm.mips.subsuu.s.h"]
1079    fn msa_subsuu_s_h(a: v8u16, b: v8u16) -> v8i16;
1080    #[link_name = "llvm.mips.subsuu.s.w"]
1081    fn msa_subsuu_s_w(a: v4u32, b: v4u32) -> v4i32;
1082    #[link_name = "llvm.mips.subsuu.s.d"]
1083    fn msa_subsuu_s_d(a: v2u64, b: v2u64) -> v2i64;
1084    #[link_name = "llvm.mips.subv.b"]
1085    fn msa_subv_b(a: v16i8, b: v16i8) -> v16i8;
1086    #[link_name = "llvm.mips.subv.h"]
1087    fn msa_subv_h(a: v8i16, b: v8i16) -> v8i16;
1088    #[link_name = "llvm.mips.subv.w"]
1089    fn msa_subv_w(a: v4i32, b: v4i32) -> v4i32;
1090    #[link_name = "llvm.mips.subv.d"]
1091    fn msa_subv_d(a: v2i64, b: v2i64) -> v2i64;
1092    #[link_name = "llvm.mips.subvi.b"]
1093    fn msa_subvi_b(a: v16i8, b: i32) -> v16i8;
1094    #[link_name = "llvm.mips.subvi.h"]
1095    fn msa_subvi_h(a: v8i16, b: i32) -> v8i16;
1096    #[link_name = "llvm.mips.subvi.w"]
1097    fn msa_subvi_w(a: v4i32, b: i32) -> v4i32;
1098    #[link_name = "llvm.mips.subvi.d"]
1099    fn msa_subvi_d(a: v2i64, b: i32) -> v2i64;
1100    #[link_name = "llvm.mips.vshf.b"]
1101    fn msa_vshf_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8;
1102    #[link_name = "llvm.mips.vshf.h"]
1103    fn msa_vshf_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16;
1104    #[link_name = "llvm.mips.vshf.w"]
1105    fn msa_vshf_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32;
1106    #[link_name = "llvm.mips.vshf.d"]
1107    fn msa_vshf_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64;
1108    #[link_name = "llvm.mips.xor.v"]
1109    fn msa_xor_v(a: v16u8, b: v16u8) -> v16u8;
1110    #[link_name = "llvm.mips.xori.b"]
1111    fn msa_xori_b(a: v16u8, b: i32) -> v16u8;
1112}
1113
1114/// Vector Add Absolute Values.
1115///
1116/// The absolute values of the elements in vector in `a` (sixteen signed 8-bit integer numbers)
1117/// are added to the absolute values of the elements in vector `b` (sixteen signed 8-bit integer numbers).
1118/// The result is written to vector (sixteen signed 8-bit integer numbers).
1119///
1120#[inline]
1121#[target_feature(enable = "msa")]
1122#[cfg_attr(test, assert_instr(add_a.b))]
1123#[unstable(feature = "stdarch_mips", issue = "111198")]
1124pub unsafe fn __msa_add_a_b(a: v16i8, b: v16i8) -> v16i8 {
1125    msa_add_a_b(a, mem::transmute(b))
1126}
1127
1128/// Vector Add Absolute Values
1129///
1130/// The absolute values of the elements in vector in `a` (eight signed 16-bit integer numbers)
1131/// are added to the absolute values of the elements in vector `b` (eight signed 16-bit integer numbers).
1132/// The result is written to vector (eight signed 16-bit integer numbers).
1133///
1134#[inline]
1135#[target_feature(enable = "msa")]
1136#[cfg_attr(test, assert_instr(add_a.h))]
1137#[unstable(feature = "stdarch_mips", issue = "111198")]
1138pub unsafe fn __msa_add_a_h(a: v8i16, b: v8i16) -> v8i16 {
1139    msa_add_a_h(a, mem::transmute(b))
1140}
1141
1142/// Vector Add Absolute Values
1143///
1144/// The absolute values of the elements in vector in `a` (four signed 32-bit integer numbers)
1145/// are added to the absolute values of the elements in vector `b` (four signed 32-bit integer numbers).
1146/// The result is written to vector (four signed 32-bit integer numbers).
1147///
1148#[inline]
1149#[target_feature(enable = "msa")]
1150#[cfg_attr(test, assert_instr(add_a.w))]
1151#[unstable(feature = "stdarch_mips", issue = "111198")]
1152pub unsafe fn __msa_add_a_w(a: v4i32, b: v4i32) -> v4i32 {
1153    msa_add_a_w(a, mem::transmute(b))
1154}
1155
1156/// Vector Add Absolute Values
1157///
1158/// The absolute values of the elements in vector in `a` (two signed 64-bit integer numbers)
1159/// are added to the absolute values of the elements in vector `b` (two signed 64-bit integer numbers).
1160/// The result is written to vector (two signed 64-bit integer numbers).
1161///
1162#[inline]
1163#[target_feature(enable = "msa")]
1164#[cfg_attr(test, assert_instr(add_a.d))]
1165#[unstable(feature = "stdarch_mips", issue = "111198")]
1166pub unsafe fn __msa_add_a_d(a: v2i64, b: v2i64) -> v2i64 {
1167    msa_add_a_d(a, mem::transmute(b))
1168}
1169
1170/// Signed Saturated Vector Saturated Add of Absolute Values
1171///
1172/// The absolute values of the elements in vector in `a` (sixteen signed 8-bit integer numbers)
1173/// are added to the absolute values of the elements in vector `b` (sixteen signed 8-bit integer numbers).
1174/// The saturated signed result is written to vector (sixteen signed 8-bit integer numbers).
1175///
1176#[inline]
1177#[target_feature(enable = "msa")]
1178#[cfg_attr(test, assert_instr(adds_a.b))]
1179#[unstable(feature = "stdarch_mips", issue = "111198")]
1180pub unsafe fn __msa_adds_a_b(a: v16i8, b: v16i8) -> v16i8 {
1181    msa_adds_a_b(a, mem::transmute(b))
1182}
1183
1184/// Vector Saturated Add of Absolute Values
1185///
1186/// The absolute values of the elements in vector in `a` (eight signed 16-bit integer numbers)
1187/// are added to the absolute values of the elements in vector `b` (eight signed 16-bit integer numbers).
1188/// The saturated signed result is written to vector (eight signed 16-bit integer numbers).
1189///
1190#[inline]
1191#[target_feature(enable = "msa")]
1192#[cfg_attr(test, assert_instr(adds_a.h))]
1193#[unstable(feature = "stdarch_mips", issue = "111198")]
1194pub unsafe fn __msa_adds_a_h(a: v8i16, b: v8i16) -> v8i16 {
1195    msa_adds_a_h(a, mem::transmute(b))
1196}
1197
1198/// Vector Saturated Add of Absolute Values
1199///
1200/// The absolute values of the elements in vector in `a` (four signed 32-bit integer numbers)
1201/// are added to the absolute values of the elements in vector `b` (four signed 32-bit integer numbers).
1202/// The saturated signed result is written to vector (four signed 32-bit integer numbers).
1203///
1204#[inline]
1205#[target_feature(enable = "msa")]
1206#[cfg_attr(test, assert_instr(adds_a.w))]
1207#[unstable(feature = "stdarch_mips", issue = "111198")]
1208pub unsafe fn __msa_adds_a_w(a: v4i32, b: v4i32) -> v4i32 {
1209    msa_adds_a_w(a, mem::transmute(b))
1210}
1211
1212/// Vector Saturated Add of Absolute Values
1213///
1214/// The absolute values of the elements in vector in `a` (two signed 64-bit integer numbers)
1215/// are added to the absolute values of the elements in vector `b` (two signed 64-bit integer numbers).
1216/// The saturated signed result is written to vector (two signed 64-bit integer numbers).
1217///
1218#[inline]
1219#[target_feature(enable = "msa")]
1220#[cfg_attr(test, assert_instr(adds_a.d))]
1221#[unstable(feature = "stdarch_mips", issue = "111198")]
1222pub unsafe fn __msa_adds_a_d(a: v2i64, b: v2i64) -> v2i64 {
1223    msa_adds_a_d(a, mem::transmute(b))
1224}
1225
1226/// Vector Signed Saturated Add of Signed Values
1227///
1228/// The elements in vector in `a` (sixteen signed 8-bit integer numbers)
1229/// are added to the elements in vector `b` (sixteen signed 8-bit integer numbers).
1230/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
1231/// representable signed values before writing the result to vector (sixteen signed 8-bit integer numbers).
1232///
1233#[inline]
1234#[target_feature(enable = "msa")]
1235#[cfg_attr(test, assert_instr(adds_s.b))]
1236#[unstable(feature = "stdarch_mips", issue = "111198")]
1237pub unsafe fn __msa_adds_s_b(a: v16i8, b: v16i8) -> v16i8 {
1238    msa_adds_s_b(a, mem::transmute(b))
1239}
1240
1241/// Vector Signed Saturated Add of Signed Values
1242///
1243/// The elements in vector in `a` (eight signed 16-bit integer numbers)
1244/// are added to the elements in vector `b` (eight signed 16-bit integer numbers).
1245/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
1246/// representable signed values before writing the result to vector (eight signed 16-bit integer numbers).
1247///
1248#[inline]
1249#[target_feature(enable = "msa")]
1250#[cfg_attr(test, assert_instr(adds_s.h))]
1251#[unstable(feature = "stdarch_mips", issue = "111198")]
1252pub unsafe fn __msa_adds_s_h(a: v8i16, b: v8i16) -> v8i16 {
1253    msa_adds_s_h(a, mem::transmute(b))
1254}
1255
1256/// Vector Signed Saturated Add of Signed Values
1257///
1258/// The elements in vector in `a` (four signed 32-bit integer numbers)
1259/// are added to the elements in vector `b` (four signed 32-bit integer numbers).
1260/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
1261/// representable signed values before writing the result to vector (four signed 32-bit integer numbers).
1262///
1263#[inline]
1264#[target_feature(enable = "msa")]
1265#[cfg_attr(test, assert_instr(adds_s.w))]
1266#[unstable(feature = "stdarch_mips", issue = "111198")]
1267pub unsafe fn __msa_adds_s_w(a: v4i32, b: v4i32) -> v4i32 {
1268    msa_adds_s_w(a, mem::transmute(b))
1269}
1270
1271/// Vector Signed Saturated Add of Signed Values
1272///
1273/// The elements in vector in `a` (two signed 64-bit integer numbers)
1274/// are added to the elements in vector `b` (two signed 64-bit integer numbers).
1275/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
1276/// representable signed values before writing the result to vector (two signed 64-bit integer numbers).
1277///
1278#[inline]
1279#[target_feature(enable = "msa")]
1280#[cfg_attr(test, assert_instr(adds_s.d))]
1281#[unstable(feature = "stdarch_mips", issue = "111198")]
1282pub unsafe fn __msa_adds_s_d(a: v2i64, b: v2i64) -> v2i64 {
1283    msa_adds_s_d(a, mem::transmute(b))
1284}
1285
1286/// Vector Unsigned Saturated Add of Unsigned Values
1287///
1288/// The elements in vector in `a` (sixteen unsigned 8-bit integer numbers)
1289/// are added to the elements in vector `b` (sixteen unsigned 8-bit integer numbers).
1290/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
1291/// representable signed values before writing the result to vector (sixteen unsigned 8-bit integer numbers).
1292///
1293#[inline]
1294#[target_feature(enable = "msa")]
1295#[cfg_attr(test, assert_instr(adds_u.b))]
1296#[unstable(feature = "stdarch_mips", issue = "111198")]
1297pub unsafe fn __msa_adds_u_b(a: v16u8, b: v16u8) -> v16u8 {
1298    msa_adds_u_b(a, mem::transmute(b))
1299}
1300
1301/// Vector Unsigned Saturated Add of Unsigned Values
1302///
1303/// The elements in vector in `a` (eight unsigned 16-bit integer numbers)
1304/// are added to the elements in vector `b` (eight unsigned 16-bit integer numbers).
1305/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
1306/// representable signed values before writing the result to vector (eight unsigned 16-bit integer numbers).
1307///
1308#[inline]
1309#[target_feature(enable = "msa")]
1310#[cfg_attr(test, assert_instr(adds_u.h))]
1311#[unstable(feature = "stdarch_mips", issue = "111198")]
1312pub unsafe fn __msa_adds_u_h(a: v8u16, b: v8u16) -> v8u16 {
1313    msa_adds_u_h(a, mem::transmute(b))
1314}
1315
1316/// Vector Unsigned Saturated Add of Unsigned Values
1317///
1318/// The elements in vector in `a` (four unsigned 32-bit integer numbers)
1319/// are added to the elements in vector `b` (four unsigned 32-bit integer numbers).
1320/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
1321/// representable signed values before writing the result to vector (four unsigned 32-bit integer numbers).
1322///
1323#[inline]
1324#[target_feature(enable = "msa")]
1325#[cfg_attr(test, assert_instr(adds_u.w))]
1326#[unstable(feature = "stdarch_mips", issue = "111198")]
1327pub unsafe fn __msa_adds_u_w(a: v4u32, b: v4u32) -> v4u32 {
1328    msa_adds_u_w(a, mem::transmute(b))
1329}
1330
1331/// Vector Unsigned Saturated Add of Unsigned Values
1332///
1333/// The elements in vector in `a` (two unsigned 64-bit integer numbers)
1334/// are added to the elements in vector `b` (two unsigned 64-bit integer numbers).
1335/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
1336/// representable signed values before writing the result to vector (two unsigned 64-bit integer numbers).
1337///
1338#[inline]
1339#[target_feature(enable = "msa")]
1340#[cfg_attr(test, assert_instr(adds_u.d))]
1341#[unstable(feature = "stdarch_mips", issue = "111198")]
1342pub unsafe fn __msa_adds_u_d(a: v2u64, b: v2u64) -> v2u64 {
1343    msa_adds_u_d(a, mem::transmute(b))
1344}
1345
1346/// Vector Add
1347///
1348/// The elements in vector in `a` (sixteen signed 8-bit integer numbers)
1349/// are added to the elements in vector `b` (sixteen signed 8-bit integer numbers).
1350/// The result is written to vector (sixteen signed 8-bit integer numbers).
1351///
1352#[inline]
1353#[target_feature(enable = "msa")]
1354#[cfg_attr(test, assert_instr(addv.b))]
1355#[unstable(feature = "stdarch_mips", issue = "111198")]
1356pub unsafe fn __msa_addv_b(a: v16i8, b: v16i8) -> v16i8 {
1357    msa_addv_b(a, mem::transmute(b))
1358}
1359
1360/// Vector Add
1361///
1362/// The elements in vector in `a` (eight signed 16-bit integer numbers)
1363/// are added to the elements in vector `b` (eight signed 16-bit integer numbers).
1364/// The result is written to vector (eight signed 16-bit integer numbers).
1365///
1366#[inline]
1367#[target_feature(enable = "msa")]
1368#[cfg_attr(test, assert_instr(addv.h))]
1369#[unstable(feature = "stdarch_mips", issue = "111198")]
1370pub unsafe fn __msa_addv_h(a: v8i16, b: v8i16) -> v8i16 {
1371    msa_addv_h(a, mem::transmute(b))
1372}
1373
1374/// Vector Add
1375///
1376/// The elements in vector in `a` (four signed 32-bit integer numbers)
1377/// are added to the elements in vector `b` (four signed 32-bit integer numbers).
1378/// The result is written to vector (four signed 32-bit integer numbers).
1379///
1380#[inline]
1381#[target_feature(enable = "msa")]
1382#[cfg_attr(test, assert_instr(addv.w))]
1383#[unstable(feature = "stdarch_mips", issue = "111198")]
1384pub unsafe fn __msa_addv_w(a: v4i32, b: v4i32) -> v4i32 {
1385    msa_addv_w(a, mem::transmute(b))
1386}
1387
1388/// Vector Add
1389///
1390/// The elements in vector in `a` (two signed 64-bit integer numbers)
1391/// are added to the elements in vector `b` (two signed 64-bit integer numbers).
1392/// The result is written to vector (two signed 64-bit integer numbers).
1393///
1394#[inline]
1395#[target_feature(enable = "msa")]
1396#[cfg_attr(test, assert_instr(addv.d))]
1397#[unstable(feature = "stdarch_mips", issue = "111198")]
1398pub unsafe fn __msa_addv_d(a: v2i64, b: v2i64) -> v2i64 {
1399    msa_addv_d(a, mem::transmute(b))
1400}
1401
1402/// Immediate Add
1403///
1404/// The 5-bit immediate unsigned value `imm5` is added to the elements
1405/// vector in `a` (sixteen signed 8-bit integer numbers).
1406/// The result is written to vector (sixteen signed 8-bit integer numbers).
1407///
1408#[inline]
1409#[target_feature(enable = "msa")]
1410#[cfg_attr(test, assert_instr(addvi.b, IMM5 = 0b10111))]
1411#[rustc_legacy_const_generics(1)]
1412#[unstable(feature = "stdarch_mips", issue = "111198")]
1413pub unsafe fn __msa_addvi_b<const IMM5: i32>(a: v16i8) -> v16i8 {
1414    static_assert_uimm_bits!(IMM5, 5);
1415    msa_addvi_b(a, IMM5)
1416}
1417
1418/// Immediate Add
1419///
1420/// The 5-bit immediate unsigned value `imm5` is added to the elements
1421/// vector in `a` (eight signed 16-bit integer numbers).
1422/// The result is written to vector (eight signed 16-bit integer numbers).
1423///
1424#[inline]
1425#[target_feature(enable = "msa")]
1426#[cfg_attr(test, assert_instr(addvi.h, IMM5 = 0b10111))]
1427#[rustc_legacy_const_generics(1)]
1428#[unstable(feature = "stdarch_mips", issue = "111198")]
1429pub unsafe fn __msa_addvi_h<const IMM5: i32>(a: v8i16) -> v8i16 {
1430    static_assert_uimm_bits!(IMM5, 5);
1431    msa_addvi_h(a, IMM5)
1432}
1433
1434/// Immediate Add
1435///
1436/// The 5-bit immediate unsigned value `imm5` is added to the elements
1437/// vector in `a` (four signed 32-bit integer numbers).
1438/// The result is written to vector (four signed 32-bit integer numbers).
1439///
1440#[inline]
1441#[target_feature(enable = "msa")]
1442#[cfg_attr(test, assert_instr(addvi.w, IMM5 = 0b10111))]
1443#[rustc_legacy_const_generics(1)]
1444#[unstable(feature = "stdarch_mips", issue = "111198")]
1445pub unsafe fn __msa_addvi_w<const IMM5: i32>(a: v4i32) -> v4i32 {
1446    static_assert_uimm_bits!(IMM5, 5);
1447    msa_addvi_w(a, IMM5)
1448}
1449
1450/// Immediate Add
1451///
1452/// The 5-bit immediate unsigned value `imm5` is added to the elements
1453/// vector in `a` (two signed 64-bit integer numbers).
1454/// The result is written to vector (two signed 64-bit integer numbers).
1455///
1456#[inline]
1457#[target_feature(enable = "msa")]
1458#[cfg_attr(test, assert_instr(addvi.d, IMM5 = 0b10111))]
1459#[rustc_legacy_const_generics(1)]
1460#[unstable(feature = "stdarch_mips", issue = "111198")]
1461pub unsafe fn __msa_addvi_d<const IMM5: i32>(a: v2i64) -> v2i64 {
1462    static_assert_uimm_bits!(IMM5, 5);
1463    msa_addvi_d(a, IMM5)
1464}
1465
1466/// Vector Logical And
1467///
1468/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
1469/// is combined with the corresponding bit of vector `b` (sixteen unsigned 8-bit integer numbers)
1470/// in a bitwise logical AND operation.
1471/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
1472///
1473#[inline]
1474#[target_feature(enable = "msa")]
1475#[cfg_attr(test, assert_instr(and.v))]
1476#[unstable(feature = "stdarch_mips", issue = "111198")]
1477pub unsafe fn __msa_and_v(a: v16u8, b: v16u8) -> v16u8 {
1478    msa_and_v(a, mem::transmute(b))
1479}
1480
1481/// Immediate Logical And
1482///
1483/// Each byte element of vector `a` (sixteen unsigned 8-bit integer numbers)
1484/// is combined with the 8-bit immediate i8 (signed 8-bit integer number) in a bitwise logical AND operation.
1485/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
1486///
1487#[inline]
1488#[target_feature(enable = "msa")]
1489#[cfg_attr(test, assert_instr(andi.b, IMM8 = 0b10010111))]
1490#[rustc_legacy_const_generics(1)]
1491#[unstable(feature = "stdarch_mips", issue = "111198")]
1492pub unsafe fn __msa_andi_b<const IMM8: i32>(a: v16u8) -> v16u8 {
1493    static_assert_uimm_bits!(IMM8, 8);
1494    msa_andi_b(a, IMM8)
1495}
1496
1497/// Vector Absolute Values of Signed Subtract
1498///
1499/// The signed elements in vector `a` (sixteen signed 8-bit integer numbers)
1500/// are subtracted from the signed elements in vector `b` (sixteen signed 8-bit integer numbers).
1501/// The absolute value of the signed result is written to vector (sixteen signed 8-bit integer numbers).
1502///
1503#[inline]
1504#[target_feature(enable = "msa")]
1505#[cfg_attr(test, assert_instr(asub_s.b))]
1506#[unstable(feature = "stdarch_mips", issue = "111198")]
1507pub unsafe fn __msa_asub_s_b(a: v16i8, b: v16i8) -> v16i8 {
1508    msa_asub_s_b(a, mem::transmute(b))
1509}
1510
1511/// Vector Absolute Values of Signed Subtract
1512///
1513/// The signed elements in vector `a` (eight signed 16-bit integer numbers)
1514/// are subtracted from the signed elements in vector `b` (eight signed 16-bit integer numbers).
1515/// The absolute value of the signed result is written to vector (eight signed 16-bit integer numbers).
1516///
1517#[inline]
1518#[target_feature(enable = "msa")]
1519#[cfg_attr(test, assert_instr(asub_s.h))]
1520#[unstable(feature = "stdarch_mips", issue = "111198")]
1521pub unsafe fn __msa_asub_s_h(a: v8i16, b: v8i16) -> v8i16 {
1522    msa_asub_s_h(a, mem::transmute(b))
1523}
1524
1525/// Vector Absolute Values of Signed Subtract
1526///
1527/// The signed elements in vector `a` (four signed 32-bit integer numbers)
1528/// are subtracted from the signed elements in vector `b` (four signed 32-bit integer numbers).
1529/// The absolute value of the signed result is written to vector (four signed 32-bit integer numbers).
1530///
1531#[inline]
1532#[target_feature(enable = "msa")]
1533#[cfg_attr(test, assert_instr(asub_s.w))]
1534#[unstable(feature = "stdarch_mips", issue = "111198")]
1535pub unsafe fn __msa_asub_s_w(a: v4i32, b: v4i32) -> v4i32 {
1536    msa_asub_s_w(a, mem::transmute(b))
1537}
1538
1539/// Vector Absolute Values of Signed Subtract
1540///
1541/// The signed elements in vector `a` (two signed 64-bit integer numbers)
1542/// are subtracted from the signed elements in vector `b` (two signed 64-bit integer numbers).
1543/// The absolute value of the signed result is written to vector (two signed 64-bit integer numbers).
1544///
1545#[inline]
1546#[target_feature(enable = "msa")]
1547#[cfg_attr(test, assert_instr(asub_s.d))]
1548#[unstable(feature = "stdarch_mips", issue = "111198")]
1549pub unsafe fn __msa_asub_s_d(a: v2i64, b: v2i64) -> v2i64 {
1550    msa_asub_s_d(a, mem::transmute(b))
1551}
1552
1553/// Vector Absolute Values of Unsigned Subtract
1554///
1555/// The unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
1556/// are subtracted from the unsigned elements in vector `b` (sixteen unsigned 8-bit integer numbers).
1557/// The absolute value of the unsigned result is written to vector (sixteen unsigned 8-bit integer numbers).
1558///
1559#[inline]
1560#[target_feature(enable = "msa")]
1561#[cfg_attr(test, assert_instr(asub_u.b))]
1562#[unstable(feature = "stdarch_mips", issue = "111198")]
1563pub unsafe fn __msa_asub_u_b(a: v16u8, b: v16u8) -> v16u8 {
1564    msa_asub_u_b(a, mem::transmute(b))
1565}
1566
1567/// Vector Absolute Values of Unsigned Subtract
1568///
1569/// The unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
1570/// are subtracted from the unsigned elements in vector `b` (eight unsigned 16-bit integer numbers).
1571/// The absolute value of the unsigned result is written to vector (eight unsigned 16-bit integer numbers).
1572///
1573#[inline]
1574#[target_feature(enable = "msa")]
1575#[cfg_attr(test, assert_instr(asub_u.h))]
1576#[unstable(feature = "stdarch_mips", issue = "111198")]
1577pub unsafe fn __msa_asub_u_h(a: v8u16, b: v8u16) -> v8u16 {
1578    msa_asub_u_h(a, mem::transmute(b))
1579}
1580
1581/// Vector Absolute Values of Unsigned Subtract
1582///
1583/// The unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
1584/// are subtracted from the unsigned elements in vector `b` (four unsigned 32-bit integer numbers).
1585/// The absolute value of the unsigned result is written to vector (four unsigned 32-bit integer numbers).
1586///
1587#[inline]
1588#[target_feature(enable = "msa")]
1589#[cfg_attr(test, assert_instr(asub_u.w))]
1590#[unstable(feature = "stdarch_mips", issue = "111198")]
1591pub unsafe fn __msa_asub_u_w(a: v4u32, b: v4u32) -> v4u32 {
1592    msa_asub_u_w(a, mem::transmute(b))
1593}
1594
1595/// Vector Absolute Values of Unsigned Subtract
1596///
1597/// The unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
1598/// are subtracted from the unsigned elements in vector `b` (two unsigned 64-bit integer numbers).
1599/// The absolute value of the unsigned result is written to vector (two unsigned 64-bit integer numbers).
1600///
1601#[inline]
1602#[target_feature(enable = "msa")]
1603#[cfg_attr(test, assert_instr(asub_u.d))]
1604#[unstable(feature = "stdarch_mips", issue = "111198")]
1605pub unsafe fn __msa_asub_u_d(a: v2u64, b: v2u64) -> v2u64 {
1606    msa_asub_u_d(a, mem::transmute(b))
1607}
1608
1609/// Vector Signed Average
1610///
1611/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
1612/// are added to the elements in vector `b` (sixteen signed 8-bit integer numbers).
1613/// The addition is done signed with full precision, i.e. the result has one extra bit.
1614/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
1615/// writing the result to vector (sixteen signed 8-bit integer numbers).
1616///
1617#[inline]
1618#[target_feature(enable = "msa")]
1619#[cfg_attr(test, assert_instr(ave_s.b))]
1620#[unstable(feature = "stdarch_mips", issue = "111198")]
1621pub unsafe fn __msa_ave_s_b(a: v16i8, b: v16i8) -> v16i8 {
1622    msa_ave_s_b(a, mem::transmute(b))
1623}
1624
1625/// Vector Signed Average
1626///
1627/// The elements in vector `a` (eight signed 16-bit integer numbers)
1628/// are added to the elements in vector `b` (eight signed 16-bit integer numbers).
1629/// The addition is done signed with full precision, i.e. the result has one extra bit.
1630/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
1631/// writing the result to vector (eight signed 16-bit integer numbers).
1632///
1633#[inline]
1634#[target_feature(enable = "msa")]
1635#[cfg_attr(test, assert_instr(ave_s.h))]
1636#[unstable(feature = "stdarch_mips", issue = "111198")]
1637pub unsafe fn __msa_ave_s_h(a: v8i16, b: v8i16) -> v8i16 {
1638    msa_ave_s_h(a, mem::transmute(b))
1639}
1640
1641/// Vector Signed Average
1642///
1643/// The elements in vector `a` (four signed 32-bit integer numbers)
1644/// are added to the elements in vector `b` (four signed 32-bit integer numbers).
1645/// The addition is done signed with full precision, i.e. the result has one extra bit.
1646/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
1647/// writing the result to vector (four signed 32-bit integer numbers).
1648///
1649#[inline]
1650#[target_feature(enable = "msa")]
1651#[cfg_attr(test, assert_instr(ave_s.w))]
1652#[unstable(feature = "stdarch_mips", issue = "111198")]
1653pub unsafe fn __msa_ave_s_w(a: v4i32, b: v4i32) -> v4i32 {
1654    msa_ave_s_w(a, mem::transmute(b))
1655}
1656
1657/// Vector Signed Average
1658///
1659/// The elements in vector `a` (two signed 64-bit integer numbers)
1660/// are added to the elements in vector `b` (two signed 64-bit integer numbers).
1661/// The addition is done signed with full precision, i.e. the result has one extra bit.
1662/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
1663/// writing the result to vector (two signed 64-bit integer numbers).
1664///
1665#[inline]
1666#[target_feature(enable = "msa")]
1667#[cfg_attr(test, assert_instr(ave_s.d))]
1668#[unstable(feature = "stdarch_mips", issue = "111198")]
1669pub unsafe fn __msa_ave_s_d(a: v2i64, b: v2i64) -> v2i64 {
1670    msa_ave_s_d(a, mem::transmute(b))
1671}
1672
1673/// Vector Unsigned Average
1674///
1675/// The elements in vector `a` (sixteen unsigned 8-bit integer numbers)
1676/// are added to the elements in vector `b` (sixteen unsigned 8-bit integer numbers).
1677/// The addition is done unsigned with full precision, i.e. the result has one extra bit.
1678/// Unsigned division by 2 (or logical shift right by one bit) is performed before
1679/// writing the result to vector (sixteen unsigned 8-bit integer numbers).
1680///
1681#[inline]
1682#[target_feature(enable = "msa")]
1683#[cfg_attr(test, assert_instr(ave_u.b))]
1684#[unstable(feature = "stdarch_mips", issue = "111198")]
1685pub unsafe fn __msa_ave_u_b(a: v16u8, b: v16u8) -> v16u8 {
1686    msa_ave_u_b(a, mem::transmute(b))
1687}
1688
1689/// Vector Unsigned Average
1690///
1691/// The elements in vector `a` (eight unsigned 16-bit integer numbers)
1692/// are added to the elements in vector `b` (eight unsigned 16-bit integer numbers).
1693/// The addition is done unsigned with full precision, i.e. the result has one extra bit.
1694/// Unsigned division by 2 (or logical shift right by one bit) is performed before
1695/// writing the result to vector (eight unsigned 16-bit integer numbers).
1696///
1697#[inline]
1698#[target_feature(enable = "msa")]
1699#[cfg_attr(test, assert_instr(ave_u.h))]
1700#[unstable(feature = "stdarch_mips", issue = "111198")]
1701pub unsafe fn __msa_ave_u_h(a: v8u16, b: v8u16) -> v8u16 {
1702    msa_ave_u_h(a, mem::transmute(b))
1703}
1704
1705/// Vector Unsigned Average
1706///
1707/// The elements in vector `a` (four unsigned 32-bit integer numbers)
1708/// are added to the elements in vector `b` (four unsigned 32-bit integer numbers).
1709/// The addition is done unsigned with full precision, i.e. the result has one extra bit.
1710/// Unsigned division by 2 (or logical shift right by one bit) is performed before
1711/// writing the result to vector (four unsigned 32-bit integer numbers).
1712///
1713#[inline]
1714#[target_feature(enable = "msa")]
1715#[cfg_attr(test, assert_instr(ave_u.w))]
1716#[unstable(feature = "stdarch_mips", issue = "111198")]
1717pub unsafe fn __msa_ave_u_w(a: v4u32, b: v4u32) -> v4u32 {
1718    msa_ave_u_w(a, mem::transmute(b))
1719}
1720
1721/// Vector Unsigned Average
1722///
1723/// The elements in vector `a` (two unsigned 64-bit integer numbers)
1724/// are added to the elements in vector `b` (two unsigned 64-bit integer numbers).
1725/// The addition is done unsigned with full precision, i.e. the result has one extra bit.
1726/// Unsigned division by 2 (or logical shift right by one bit) is performed before
1727/// writing the result to vector (two unsigned 64-bit integer numbers).
1728///
1729#[inline]
1730#[target_feature(enable = "msa")]
1731#[cfg_attr(test, assert_instr(ave_u.d))]
1732#[unstable(feature = "stdarch_mips", issue = "111198")]
1733pub unsafe fn __msa_ave_u_d(a: v2u64, b: v2u64) -> v2u64 {
1734    msa_ave_u_d(a, mem::transmute(b))
1735}
1736
1737/// Vector Signed Average Rounded
1738///
1739/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
1740/// are added to the elements in vector `b` (sixteen signed 8-bit integer numbers).
1741/// The addition of the elements plus 1 (for rounding) is done signed with full precision,
1742/// i.e. the result has one extra bit.
1743/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
1744/// writing the result to vector (sixteen signed 8-bit integer numbers).
1745///
1746#[inline]
1747#[target_feature(enable = "msa")]
1748#[cfg_attr(test, assert_instr(aver_s.b))]
1749#[unstable(feature = "stdarch_mips", issue = "111198")]
1750pub unsafe fn __msa_aver_s_b(a: v16i8, b: v16i8) -> v16i8 {
1751    msa_aver_s_b(a, mem::transmute(b))
1752}
1753
1754/// Vector Signed Average Rounded
1755///
1756/// The elements in vector `a` (eight signed 16-bit integer numbers)
1757/// are added to the elements in vector `b` (eight signed 16-bit integer numbers).
1758/// The addition of the elements plus 1 (for rounding) is done signed with full precision,
1759/// i.e. the result has one extra bit.
1760/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
1761/// writing the result to vector (eight signed 16-bit integer numbers).
1762///
1763#[inline]
1764#[target_feature(enable = "msa")]
1765#[cfg_attr(test, assert_instr(aver_s.h))]
1766#[unstable(feature = "stdarch_mips", issue = "111198")]
1767pub unsafe fn __msa_aver_s_h(a: v8i16, b: v8i16) -> v8i16 {
1768    msa_aver_s_h(a, mem::transmute(b))
1769}
1770
1771/// Vector Signed Average Rounded
1772///
1773/// The elements in vector `a` (four signed 32-bit integer numbers)
1774/// are added to the elements in vector `b` (four signed 32-bit integer numbers).
1775/// The addition of the elements plus 1 (for rounding) is done signed with full precision,
1776/// i.e. the result has one extra bit.
1777/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
1778/// writing the result to vector (four signed 32-bit integer numbers).
1779///
1780#[inline]
1781#[target_feature(enable = "msa")]
1782#[cfg_attr(test, assert_instr(aver_s.w))]
1783#[unstable(feature = "stdarch_mips", issue = "111198")]
1784pub unsafe fn __msa_aver_s_w(a: v4i32, b: v4i32) -> v4i32 {
1785    msa_aver_s_w(a, mem::transmute(b))
1786}
1787
1788/// Vector Signed Average Rounded
1789///
1790/// The elements in vector `a` (two signed 64-bit integer numbers)
1791/// are added to the elements in vector `b` (two signed 64-bit integer numbers).
1792/// The addition of the elements plus 1 (for rounding) is done signed with full precision,
1793/// i.e. the result has one extra bit.
1794/// Signed division by 2 (or arithmetic shift right by one bit) is performed before
1795/// writing the result to vector (two signed 64-bit integer numbers).
1796///
1797#[inline]
1798#[target_feature(enable = "msa")]
1799#[cfg_attr(test, assert_instr(aver_s.d))]
1800#[unstable(feature = "stdarch_mips", issue = "111198")]
1801pub unsafe fn __msa_aver_s_d(a: v2i64, b: v2i64) -> v2i64 {
1802    msa_aver_s_d(a, mem::transmute(b))
1803}
1804
1805/// Vector Unsigned Average Rounded
1806///
1807/// The elements in vector `a` (sixteen unsigned 8-bit integer numbers)
1808/// are added to the elements in vector `b` (sixteen unsigned 8-bit integer numbers).
1809/// The addition of the elements plus 1 (for rounding) is done unsigned with full precision,
1810/// i.e. the result has one extra bit.
1811/// Unsigned division by 2 (or logical shift right by one bit) is performed before
1812/// writing the result to vector (sixteen unsigned 8-bit integer numbers).
1813///
1814#[inline]
1815#[target_feature(enable = "msa")]
1816#[cfg_attr(test, assert_instr(aver_u.b))]
1817#[unstable(feature = "stdarch_mips", issue = "111198")]
1818pub unsafe fn __msa_aver_u_b(a: v16u8, b: v16u8) -> v16u8 {
1819    msa_aver_u_b(a, mem::transmute(b))
1820}
1821
1822/// Vector Unsigned Average Rounded
1823///
1824/// The elements in vector `a` (eight unsigned 16-bit integer numbers)
1825/// are added to the elements in vector `b` (eight unsigned 16-bit integer numbers).
1826/// The addition of the elements plus 1 (for rounding) is done unsigned with full precision,
1827/// i.e. the result has one extra bit.
1828/// Unsigned division by 2 (or logical shift right by one bit) is performed before
1829/// writing the result to vector (eight unsigned 16-bit integer numbers).
1830///
1831#[inline]
1832#[target_feature(enable = "msa")]
1833#[cfg_attr(test, assert_instr(aver_u.h))]
1834#[unstable(feature = "stdarch_mips", issue = "111198")]
1835pub unsafe fn __msa_aver_u_h(a: v8u16, b: v8u16) -> v8u16 {
1836    msa_aver_u_h(a, mem::transmute(b))
1837}
1838
1839/// Vector Unsigned Average Rounded
1840///
1841/// The elements in vector `a` (four unsigned 32-bit integer numbers)
1842/// are added to the elements in vector `b` (four unsigned 32-bit integer numbers).
1843/// The addition of the elements plus 1 (for rounding) is done unsigned with full precision,
1844/// i.e. the result has one extra bit.
1845/// Unsigned division by 2 (or logical shift right by one bit) is performed before
1846/// writing the result to vector (four unsigned 32-bit integer numbers).
1847///
1848#[inline]
1849#[target_feature(enable = "msa")]
1850#[cfg_attr(test, assert_instr(aver_u.w))]
1851#[unstable(feature = "stdarch_mips", issue = "111198")]
1852pub unsafe fn __msa_aver_u_w(a: v4u32, b: v4u32) -> v4u32 {
1853    msa_aver_u_w(a, mem::transmute(b))
1854}
1855
1856/// Vector Unsigned Average Rounded
1857///
1858/// The elements in vector `a` (two unsigned 64-bit integer numbers)
1859/// are added to the elements in vector `b` (two unsigned 64-bit integer numbers).
1860/// The addition of the elements plus 1 (for rounding) is done unsigned with full precision,
1861/// i.e. the result has one extra bit.
1862/// Unsigned division by 2 (or logical shift right by one bit) is performed before
1863/// writing the result to vector (two unsigned 64-bit integer numbers).
1864///
1865#[inline]
1866#[target_feature(enable = "msa")]
1867#[cfg_attr(test, assert_instr(aver_u.d))]
1868#[unstable(feature = "stdarch_mips", issue = "111198")]
1869pub unsafe fn __msa_aver_u_d(a: v2u64, b: v2u64) -> v2u64 {
1870    msa_aver_u_d(a, mem::transmute(b))
1871}
1872
1873/// Vector Bit Clear
1874///
1875/// Clear (set to 0) one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
1876/// The bit position is given by the elements in `b` (sixteen unsigned 8-bit integer numbers)
1877/// modulo the size of the element in bits.
1878/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
1879///
1880#[inline]
1881#[target_feature(enable = "msa")]
1882#[cfg_attr(test, assert_instr(bclr.b))]
1883#[unstable(feature = "stdarch_mips", issue = "111198")]
1884pub unsafe fn __msa_bclr_b(a: v16u8, b: v16u8) -> v16u8 {
1885    msa_bclr_b(a, mem::transmute(b))
1886}
1887
1888/// Vector Bit Clear
1889///
1890/// Clear (set to 0) one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
1891/// The bit position is given by the elements in `b` (eight unsigned 16-bit integer numbers)
1892/// modulo the size of the element in bits.
1893/// The result is written to vector (eight unsigned 16-bit integer numbers).
1894///
1895#[inline]
1896#[target_feature(enable = "msa")]
1897#[cfg_attr(test, assert_instr(bclr.h))]
1898#[unstable(feature = "stdarch_mips", issue = "111198")]
1899pub unsafe fn __msa_bclr_h(a: v8u16, b: v8u16) -> v8u16 {
1900    msa_bclr_h(a, mem::transmute(b))
1901}
1902
1903/// Vector Bit Clear
1904///
1905/// Clear (set to 0) one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
1906/// The bit position is given by the elements in `b` (four unsigned 32-bit integer numbers)
1907/// modulo the size of the element in bits.
1908/// The result is written to vector (four unsigned 32-bit integer numbers).
1909///
1910#[inline]
1911#[target_feature(enable = "msa")]
1912#[cfg_attr(test, assert_instr(bclr.w))]
1913#[unstable(feature = "stdarch_mips", issue = "111198")]
1914pub unsafe fn __msa_bclr_w(a: v4u32, b: v4u32) -> v4u32 {
1915    msa_bclr_w(a, mem::transmute(b))
1916}
1917
1918/// Vector Bit Clear
1919///
1920/// Clear (set to 0) one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
1921/// The bit position is given by the elements in `b` (two unsigned 64-bit integer numbers)
1922/// modulo the size of the element in bits.
1923/// The result is written to vector (two unsigned 64-bit integer numbers).
1924///
1925#[inline]
1926#[target_feature(enable = "msa")]
1927#[cfg_attr(test, assert_instr(bclr.d))]
1928#[unstable(feature = "stdarch_mips", issue = "111198")]
1929pub unsafe fn __msa_bclr_d(a: v2u64, b: v2u64) -> v2u64 {
1930    msa_bclr_d(a, mem::transmute(b))
1931}
1932
1933/// Immediate Bit Clear
1934///
1935/// Clear (set to 0) one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
1936/// The bit position is given by the immediate `m` modulo the size of the element in bits.
1937/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
1938///
1939#[inline]
1940#[target_feature(enable = "msa")]
1941#[cfg_attr(test, assert_instr(bclri.b, IMM3 = 0b111))]
1942#[rustc_legacy_const_generics(1)]
1943#[unstable(feature = "stdarch_mips", issue = "111198")]
1944pub unsafe fn __msa_bclri_b<const IMM3: i32>(a: v16u8) -> v16u8 {
1945    static_assert_uimm_bits!(IMM3, 3);
1946    msa_bclri_b(a, IMM3)
1947}
1948
1949/// Immediate Bit Clear
1950///
1951/// Clear (set to 0) one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
1952/// The bit position is given by the immediate `m` modulo the size of the element in bits.
1953/// The result is written to vector (eight unsigned 16-bit integer numbers).
1954///
1955#[inline]
1956#[target_feature(enable = "msa")]
1957#[cfg_attr(test, assert_instr(bclri.h, IMM4 = 0b1111))]
1958#[rustc_legacy_const_generics(1)]
1959#[unstable(feature = "stdarch_mips", issue = "111198")]
1960pub unsafe fn __msa_bclri_h<const IMM4: i32>(a: v8u16) -> v8u16 {
1961    static_assert_uimm_bits!(IMM4, 4);
1962    msa_bclri_h(a, IMM4)
1963}
1964
1965/// Immediate Bit Clear
1966///
1967/// Clear (set to 0) one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
1968/// The bit position is given by the immediate `m` modulo the size of the element in bits.
1969/// The result is written to vector (four unsigned 32-bit integer numbers).
1970///
1971#[inline]
1972#[target_feature(enable = "msa")]
1973#[cfg_attr(test, assert_instr(bclri.w, IMM5 = 0b11111))]
1974#[rustc_legacy_const_generics(1)]
1975#[unstable(feature = "stdarch_mips", issue = "111198")]
1976pub unsafe fn __msa_bclri_w<const IMM5: i32>(a: v4u32) -> v4u32 {
1977    static_assert_uimm_bits!(IMM5, 5);
1978    msa_bclri_w(a, IMM5)
1979}
1980
1981/// Immediate Bit Clear
1982///
1983/// Clear (set to 0) one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
1984/// The bit position is given by the immediate `m` modulo the size of the element in bits.
1985/// The result is written to vector (two unsigned 64-bit integer numbers).
1986///
1987#[inline]
1988#[target_feature(enable = "msa")]
1989#[cfg_attr(test, assert_instr(bclri.d, IMM6 = 0b111111))]
1990#[rustc_legacy_const_generics(1)]
1991#[unstable(feature = "stdarch_mips", issue = "111198")]
1992pub unsafe fn __msa_bclri_d<const IMM6: i32>(a: v2u64) -> v2u64 {
1993    static_assert_uimm_bits!(IMM6, 6);
1994    msa_bclri_d(a, IMM6)
1995}
1996
1997/// Vector Bit Insert Left
1998///
1999/// Copy most significant (left) bits in each element of vector `b` (sixteen unsigned 8-bit integer numbers)
2000/// to elements in vector `a` (sixteen unsigned 8-bit integer numbers) while preserving the least significant (right) bits.
2001/// The number of bits to copy is given by the elements in vector `c` (sixteen unsigned 8-bit integer numbers)
2002/// modulo the size of the element in bits plus 1.
2003///
2004#[inline]
2005#[target_feature(enable = "msa")]
2006#[cfg_attr(test, assert_instr(binsl.b))]
2007#[unstable(feature = "stdarch_mips", issue = "111198")]
2008pub unsafe fn __msa_binsl_b(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
2009    msa_binsl_b(a, mem::transmute(b), c)
2010}
2011
2012/// Vector Bit Insert Left
2013///
2014/// Copy most significant (left) bits in each element of vector `b` (eight unsigned 16-bit integer numbers)
2015/// to elements in vector `a` (eight unsigned 16-bit integer numbers) while preserving the least significant (right) bits.
2016/// The number of bits to copy is given by the elements in vector `c` (eight unsigned 16-bit integer numbers)
2017/// modulo the size of the element in bits plus 1.
2018///
2019#[inline]
2020#[target_feature(enable = "msa")]
2021#[cfg_attr(test, assert_instr(binsl.h))]
2022#[unstable(feature = "stdarch_mips", issue = "111198")]
2023pub unsafe fn __msa_binsl_h(a: v8u16, b: v8u16, c: v8u16) -> v8u16 {
2024    msa_binsl_h(a, mem::transmute(b), c)
2025}
2026
2027/// Vector Bit Insert Left
2028///
2029/// Copy most significant (left) bits in each element of vector `b` (four unsigned 32-bit integer numbers)
2030/// to elements in vector `a` (four unsigned 32-bit integer numbers) while preserving the least significant (right) bits.
2031/// The number of bits to copy is given by the elements in vector `c` (four unsigned 32-bit integer numbers)
2032/// modulo the size of the element in bits plus 1.
2033///
2034#[inline]
2035#[target_feature(enable = "msa")]
2036#[cfg_attr(test, assert_instr(binsl.w))]
2037#[unstable(feature = "stdarch_mips", issue = "111198")]
2038pub unsafe fn __msa_binsl_w(a: v4u32, b: v4u32, c: v4u32) -> v4u32 {
2039    msa_binsl_w(a, mem::transmute(b), c)
2040}
2041
2042/// Vector Bit Insert Left
2043///
2044/// Copy most significant (left) bits in each element of vector `b` (two unsigned 64-bit integer numbers)
2045/// to elements in vector `a` (two unsigned 64-bit integer numbers) while preserving the least significant (right) bits.
2046/// The number of bits to copy is given by the elements in vector `c` (two unsigned 64-bit integer numbers)
2047/// modulo the size of the element in bits plus 1.
2048///
2049#[inline]
2050#[target_feature(enable = "msa")]
2051#[cfg_attr(test, assert_instr(binsl.d))]
2052#[unstable(feature = "stdarch_mips", issue = "111198")]
2053pub unsafe fn __msa_binsl_d(a: v2u64, b: v2u64, c: v2u64) -> v2u64 {
2054    msa_binsl_d(a, mem::transmute(b), c)
2055}
2056
2057/// Immediate Bit Insert Left
2058///
2059/// Copy most significant (left) bits in each element of vector `b` (sixteen unsigned 8-bit integer numbers)
2060/// to elements in vector `a` (sixteen unsigned 8-bit integer numbers) while preserving the least significant (right) bits.
2061/// The number of bits to copy is given by the immediate `imm3` modulo the size of the element in bits plus 1.
2062///
2063#[inline]
2064#[target_feature(enable = "msa")]
2065#[cfg_attr(test, assert_instr(binsli.b, IMM3 = 0b111))]
2066#[rustc_legacy_const_generics(2)]
2067#[unstable(feature = "stdarch_mips", issue = "111198")]
2068pub unsafe fn __msa_binsli_b<const IMM3: i32>(a: v16u8, b: v16u8) -> v16u8 {
2069    static_assert_uimm_bits!(IMM3, 3);
2070    msa_binsli_b(a, mem::transmute(b), IMM3)
2071}
2072
2073/// Immediate Bit Insert Left
2074///
2075/// Copy most significant (left) bits in each element of vector `b` (eight unsigned 16-bit integer numbers)
2076/// to elements in vector `a` (eight unsigned 16-bit integer numbers) while preserving the least significant (right) bits.
2077/// The number of bits to copy is given by the immediate `imm4` modulo the size of the element in bits plus 1.
2078///
2079#[inline]
2080#[target_feature(enable = "msa")]
2081#[cfg_attr(test, assert_instr(binsli.h, IMM4 = 0b1111))]
2082#[rustc_legacy_const_generics(2)]
2083#[unstable(feature = "stdarch_mips", issue = "111198")]
2084pub unsafe fn __msa_binsli_h<const IMM4: i32>(a: v8u16, b: v8u16) -> v8u16 {
2085    static_assert_uimm_bits!(IMM4, 4);
2086    msa_binsli_h(a, mem::transmute(b), IMM4)
2087}
2088
2089/// Immediate Bit Insert Left
2090///
2091/// Copy most significant (left) bits in each element of vector `b` (four unsigned 32-bit integer numbers)
2092/// to elements in vector `a` (four unsigned 32-bit integer numbers) while preserving the least significant (right) bits.
2093/// The number of bits to copy is given by the immediate `imm5` modulo the size of the element in bits plus 1.
2094///
2095#[inline]
2096#[target_feature(enable = "msa")]
2097#[cfg_attr(test, assert_instr(binsli.w, IMM5 = 0b11111))]
2098#[rustc_legacy_const_generics(2)]
2099#[unstable(feature = "stdarch_mips", issue = "111198")]
2100pub unsafe fn __msa_binsli_w<const IMM5: i32>(a: v4u32, b: v4u32) -> v4u32 {
2101    static_assert_uimm_bits!(IMM5, 5);
2102    msa_binsli_w(a, mem::transmute(b), IMM5)
2103}
2104
2105/// Immediate Bit Insert Left
2106///
2107/// Copy most significant (left) bits in each element of vector `b` (two unsigned 64-bit integer numbers)
2108/// to elements in vector `a` (two unsigned 64-bit integer numbers) while preserving the least significant (right) bits.
2109/// The number of bits to copy is given by the immediate `imm6` modulo the size of the element in bits plus 1.
2110///
2111#[inline]
2112#[target_feature(enable = "msa")]
2113#[cfg_attr(test, assert_instr(binsli.d, IMM6 = 0b111111))]
2114#[rustc_legacy_const_generics(2)]
2115#[unstable(feature = "stdarch_mips", issue = "111198")]
2116pub unsafe fn __msa_binsli_d<const IMM6: i32>(a: v2u64, b: v2u64) -> v2u64 {
2117    static_assert_uimm_bits!(IMM6, 6);
2118    msa_binsli_d(a, mem::transmute(b), IMM6)
2119}
2120
2121/// Vector Bit Insert Right
2122///
2123/// Copy most significant (right) bits in each element of vector `b` (sixteen unsigned 8-bit integer numbers)
2124/// to elements in vector `a` (sixteen unsigned 8-bit integer numbers) while preserving the least significant (left) bits.
2125/// The number of bits to copy is given by the elements in vector `c` (sixteen unsigned 8-bit integer numbers)
2126/// modulo the size of the element in bits plus 1.
2127///
2128#[inline]
2129#[target_feature(enable = "msa")]
2130#[cfg_attr(test, assert_instr(binsr.b))]
2131#[unstable(feature = "stdarch_mips", issue = "111198")]
2132pub unsafe fn __msa_binsr_b(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
2133    msa_binsr_b(a, mem::transmute(b), c)
2134}
2135
2136/// Vector Bit Insert Right
2137///
2138/// Copy most significant (right) bits in each element of vector `b` (eight unsigned 16-bit integer numbers)
2139/// to elements in vector `a` (eight unsigned 16-bit integer numbers) while preserving the least significant (left) bits.
2140/// The number of bits to copy is given by the elements in vector `c` (eight unsigned 16-bit integer numbers)
2141/// modulo the size of the element in bits plus 1.
2142///
2143#[inline]
2144#[target_feature(enable = "msa")]
2145#[cfg_attr(test, assert_instr(binsr.h))]
2146#[unstable(feature = "stdarch_mips", issue = "111198")]
2147pub unsafe fn __msa_binsr_h(a: v8u16, b: v8u16, c: v8u16) -> v8u16 {
2148    msa_binsr_h(a, mem::transmute(b), c)
2149}
2150
2151/// Vector Bit Insert Right
2152///
2153/// Copy most significant (right) bits in each element of vector `b` (four unsigned 32-bit integer numbers)
2154/// to elements in vector `a` (four unsigned 32-bit integer numbers) while preserving the least significant (left) bits.
2155/// The number of bits to copy is given by the elements in vector `c` (four unsigned 32-bit integer numbers)
2156/// modulo the size of the element in bits plus 1.
2157///
2158#[inline]
2159#[target_feature(enable = "msa")]
2160#[cfg_attr(test, assert_instr(binsr.w))]
2161#[unstable(feature = "stdarch_mips", issue = "111198")]
2162pub unsafe fn __msa_binsr_w(a: v4u32, b: v4u32, c: v4u32) -> v4u32 {
2163    msa_binsr_w(a, mem::transmute(b), c)
2164}
2165
2166/// Vector Bit Insert Right
2167///
2168/// Copy most significant (right) bits in each element of vector `b` (two unsigned 64-bit integer numbers)
2169/// to elements in vector `a` (two unsigned 64-bit integer numbers) while preserving the least significant (left) bits.
2170/// The number of bits to copy is given by the elements in vector `c` (two unsigned 64-bit integer numbers)
2171/// modulo the size of the element in bits plus 1.
2172///
2173#[inline]
2174#[target_feature(enable = "msa")]
2175#[cfg_attr(test, assert_instr(binsr.d))]
2176#[unstable(feature = "stdarch_mips", issue = "111198")]
2177pub unsafe fn __msa_binsr_d(a: v2u64, b: v2u64, c: v2u64) -> v2u64 {
2178    msa_binsr_d(a, mem::transmute(b), c)
2179}
2180
2181/// Immediate Bit Insert Right
2182///
2183/// Copy most significant (right) bits in each element of vector `b` (sixteen unsigned 8-bit integer numbers)
2184/// to elements in vector `a` (sixteen unsigned 8-bit integer numbers) while preserving the least significant (left) bits.
2185/// The number of bits to copy is given by the immediate `imm3` modulo the size of the element in bits plus 1.
2186///
2187#[inline]
2188#[target_feature(enable = "msa")]
2189#[cfg_attr(test, assert_instr(binsri.b, IMM3 = 0b111))]
2190#[rustc_legacy_const_generics(2)]
2191#[unstable(feature = "stdarch_mips", issue = "111198")]
2192pub unsafe fn __msa_binsri_b<const IMM3: i32>(a: v16u8, b: v16u8) -> v16u8 {
2193    static_assert_uimm_bits!(IMM3, 3);
2194    msa_binsri_b(a, mem::transmute(b), IMM3)
2195}
2196
2197/// Immediate Bit Insert Right
2198///
2199/// Copy most significant (right) bits in each element of vector `b` (eight unsigned 16-bit integer numbers)
2200/// to elements in vector `a` (eight unsigned 16-bit integer numbers) while preserving the least significant (left) bits.
2201/// The number of bits to copy is given by the immediate `imm4` modulo the size of the element in bits plus 1.
2202///
2203#[inline]
2204#[target_feature(enable = "msa")]
2205#[cfg_attr(test, assert_instr(binsri.h, IMM4 = 0b1111))]
2206#[rustc_legacy_const_generics(2)]
2207#[unstable(feature = "stdarch_mips", issue = "111198")]
2208pub unsafe fn __msa_binsri_h<const IMM4: i32>(a: v8u16, b: v8u16) -> v8u16 {
2209    static_assert_uimm_bits!(IMM4, 4);
2210    msa_binsri_h(a, mem::transmute(b), IMM4)
2211}
2212
2213/// Immediate Bit Insert Right
2214///
2215/// Copy most significant (right) bits in each element of vector `b` (four unsigned 32-bit integer numbers)
2216/// to elements in vector `a` (four unsigned 32-bit integer numbers) while preserving the least significant (left) bits.
2217/// The number of bits to copy is given by the immediate `imm5` modulo the size of the element in bits plus 1.
2218///
2219#[inline]
2220#[target_feature(enable = "msa")]
2221#[cfg_attr(test, assert_instr(binsri.w, IMM5 = 0b11111))]
2222#[rustc_legacy_const_generics(2)]
2223#[unstable(feature = "stdarch_mips", issue = "111198")]
2224pub unsafe fn __msa_binsri_w<const IMM5: i32>(a: v4u32, b: v4u32) -> v4u32 {
2225    static_assert_uimm_bits!(IMM5, 5);
2226    msa_binsri_w(a, mem::transmute(b), IMM5)
2227}
2228
2229/// Immediate Bit Insert Right
2230///
2231/// Copy most significant (right) bits in each element of vector `b` (two unsigned 64-bit integer numbers)
2232/// to elements in vector `a` (two unsigned 64-bit integer numbers) while preserving the least significant (left) bits.
2233/// The number of bits to copy is given by the immediate `imm6` modulo the size of the element in bits plus 1.
2234///
2235#[inline]
2236#[target_feature(enable = "msa")]
2237#[cfg_attr(test, assert_instr(binsri.d, IMM6 = 0b111111))]
2238#[rustc_legacy_const_generics(2)]
2239#[unstable(feature = "stdarch_mips", issue = "111198")]
2240pub unsafe fn __msa_binsri_d<const IMM6: i32>(a: v2u64, b: v2u64) -> v2u64 {
2241    static_assert_uimm_bits!(IMM6, 6);
2242    msa_binsri_d(a, mem::transmute(b), IMM6)
2243}
2244
2245/// Vector Bit Move If Not Zero
2246///
2247/// Copy to destination vector `a` (sixteen unsigned 8-bit integer numbers) all bits from source vector
2248/// `b` (sixteen unsigned 8-bit integer numbers) for which the corresponding bits from target vector `c`
2249/// (sixteen unsigned 8-bit integer numbers) are 1 and leaves unchanged all destination bits
2250/// for which the corresponding target bits are 0.
2251///
2252#[inline]
2253#[target_feature(enable = "msa")]
2254#[cfg_attr(test, assert_instr(bmnz.v))]
2255#[unstable(feature = "stdarch_mips", issue = "111198")]
2256pub unsafe fn __msa_bmnz_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
2257    msa_bmnz_v(a, mem::transmute(b), c)
2258}
2259
2260/// Immediate Bit Move If Not Zero
2261///
2262/// Copy to destination vector `a` (sixteen unsigned 8-bit integer numbers) all bits from source vector
2263/// `b` (sixteen unsigned 8-bit integer numbers) for which the corresponding bits from immediate `imm8`
2264/// are 1 and leaves unchanged all destination bits for which the corresponding target bits are 0.
2265///
2266#[inline]
2267#[target_feature(enable = "msa")]
2268#[cfg_attr(test, assert_instr(bmnzi.b, IMM8 = 0b11111111))]
2269#[rustc_legacy_const_generics(2)]
2270#[unstable(feature = "stdarch_mips", issue = "111198")]
2271pub unsafe fn __msa_bmnzi_b<const IMM8: i32>(a: v16u8, b: v16u8) -> v16u8 {
2272    static_assert_uimm_bits!(IMM8, 8);
2273    msa_bmnzi_b(a, mem::transmute(b), IMM8)
2274}
2275
2276/// Vector Bit Move If Zero
2277///
2278/// Copy to destination vector `a` (sixteen unsigned 8-bit integer numbers) all bits from source vector
2279/// `b` (sixteen unsigned 8-bit integer numbers) for which the corresponding bits from target vector `c`
2280/// (sixteen unsigned 8-bit integer numbers) are 0 and leaves unchanged all destination bits
2281/// for which the corresponding target bits are 1.
2282///
2283#[inline]
2284#[target_feature(enable = "msa")]
2285#[cfg_attr(test, assert_instr(bmz.v))]
2286#[unstable(feature = "stdarch_mips", issue = "111198")]
2287pub unsafe fn __msa_bmz_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
2288    msa_bmz_v(a, mem::transmute(b), c)
2289}
2290
2291/// Immediate Bit Move If Zero
2292///
2293/// Copy to destination vector `a` (sixteen unsigned 8-bit integer numbers) all bits from source vector
2294/// `b` (sixteen unsigned 8-bit integer numbers) for which the corresponding bits from immediate `imm8`
2295/// are 0 and leaves unchanged all destination bits for which the corresponding immediate bits are 1.
2296///
2297#[inline]
2298#[target_feature(enable = "msa")]
2299#[cfg_attr(test, assert_instr(bmzi.b, IMM8 = 0b11111111))]
2300#[rustc_legacy_const_generics(2)]
2301#[unstable(feature = "stdarch_mips", issue = "111198")]
2302pub unsafe fn __msa_bmzi_b<const IMM8: i32>(a: v16u8, b: v16u8) -> v16u8 {
2303    static_assert_uimm_bits!(IMM8, 8);
2304    msa_bmzi_b(a, mem::transmute(b), IMM8)
2305}
2306
2307/// Vector Bit Negate
2308///
2309/// Negate (complement) one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
2310/// The bit position is given by the elements in vector `b` (sixteen unsigned 8-bit integer numbers)
2311/// modulo the size of the element in bits.
2312/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
2313///
2314#[inline]
2315#[target_feature(enable = "msa")]
2316#[cfg_attr(test, assert_instr(bneg.b))]
2317#[unstable(feature = "stdarch_mips", issue = "111198")]
2318pub unsafe fn __msa_bneg_b(a: v16u8, b: v16u8) -> v16u8 {
2319    msa_bneg_b(a, mem::transmute(b))
2320}
2321
2322/// Vector Bit Negate
2323///
2324/// Negate (complement) one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
2325/// The bit position is given by the elements in vector `b` (eight unsigned 16-bit integer numbers)
2326/// modulo the size of the element in bits.
2327/// The result is written to vector (eight unsigned 16-bit integer numbers).
2328///
2329#[inline]
2330#[target_feature(enable = "msa")]
2331#[cfg_attr(test, assert_instr(bneg.h))]
2332#[unstable(feature = "stdarch_mips", issue = "111198")]
2333pub unsafe fn __msa_bneg_h(a: v8u16, b: v8u16) -> v8u16 {
2334    msa_bneg_h(a, mem::transmute(b))
2335}
2336
2337/// Vector Bit Negate
2338///
2339/// Negate (complement) one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
2340/// The bit position is given by the elements in vector `b` (four unsigned 32-bit integer numbers)
2341/// modulo the size of the element in bits.
2342/// The result is written to vector (four unsigned 32-bit integer numbers).
2343///
2344#[inline]
2345#[target_feature(enable = "msa")]
2346#[cfg_attr(test, assert_instr(bneg.w))]
2347#[unstable(feature = "stdarch_mips", issue = "111198")]
2348pub unsafe fn __msa_bneg_w(a: v4u32, b: v4u32) -> v4u32 {
2349    msa_bneg_w(a, mem::transmute(b))
2350}
2351
2352/// Vector Bit Negate
2353///
2354/// Negate (complement) one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
2355/// The bit position is given by the elements in vector `b` (two unsigned 64-bit integer numbers)
2356/// modulo the size of the element in bits.
2357/// The result is written to vector (two unsigned 64-bit integer numbers).
2358///
2359#[inline]
2360#[target_feature(enable = "msa")]
2361#[cfg_attr(test, assert_instr(bneg.d))]
2362#[unstable(feature = "stdarch_mips", issue = "111198")]
2363pub unsafe fn __msa_bneg_d(a: v2u64, b: v2u64) -> v2u64 {
2364    msa_bneg_d(a, mem::transmute(b))
2365}
2366
2367/// Immediate Bit Negate
2368///
2369/// Negate (complement) one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
2370/// The bit position is given by immediate `imm3` modulo the size of the element in bits.
2371/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
2372///
2373#[inline]
2374#[target_feature(enable = "msa")]
2375#[cfg_attr(test, assert_instr(bnegi.b, IMM3 = 0b111))]
2376#[rustc_legacy_const_generics(1)]
2377#[unstable(feature = "stdarch_mips", issue = "111198")]
2378pub unsafe fn __msa_bnegi_b<const IMM3: i32>(a: v16u8) -> v16u8 {
2379    static_assert_uimm_bits!(IMM3, 3);
2380    msa_bnegi_b(a, IMM3)
2381}
2382
2383/// Immediate Bit Negate
2384///
2385/// Negate (complement) one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
2386/// The bit position is given by immediate `imm4` modulo the size of the element in bits.
2387/// The result is written to vector (eight unsigned 16-bit integer numbers).
2388///
2389#[inline]
2390#[target_feature(enable = "msa")]
2391#[cfg_attr(test, assert_instr(bnegi.h, IMM4 = 0b1111))]
2392#[rustc_legacy_const_generics(1)]
2393#[unstable(feature = "stdarch_mips", issue = "111198")]
2394pub unsafe fn __msa_bnegi_h<const IMM4: i32>(a: v8u16) -> v8u16 {
2395    static_assert_uimm_bits!(IMM4, 4);
2396    msa_bnegi_h(a, IMM4)
2397}
2398
2399/// Immediate Bit Negate
2400///
2401/// Negate (complement) one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
2402/// The bit position is given by immediate `imm5` modulo the size of the element in bits.
2403/// The result is written to vector (four unsigned 32-bit integer numbers).
2404///
2405#[inline]
2406#[target_feature(enable = "msa")]
2407#[cfg_attr(test, assert_instr(bnegi.w, IMM5 = 0b11111))]
2408#[rustc_legacy_const_generics(1)]
2409#[unstable(feature = "stdarch_mips", issue = "111198")]
2410pub unsafe fn __msa_bnegi_w<const IMM5: i32>(a: v4u32) -> v4u32 {
2411    static_assert_uimm_bits!(IMM5, 5);
2412    msa_bnegi_w(a, IMM5)
2413}
2414
2415/// Immediate Bit Negate
2416///
2417/// Negate (complement) one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
2418/// The bit position is given by immediate `imm6` modulo the size of the element in bits.
2419/// The result is written to vector (two unsigned 64-bit integer numbers).
2420///
2421#[inline]
2422#[target_feature(enable = "msa")]
2423#[cfg_attr(test, assert_instr(bnegi.d, IMM6 = 0b111111))]
2424#[rustc_legacy_const_generics(1)]
2425#[unstable(feature = "stdarch_mips", issue = "111198")]
2426pub unsafe fn __msa_bnegi_d<const IMM6: i32>(a: v2u64) -> v2u64 {
2427    static_assert_uimm_bits!(IMM6, 6);
2428    msa_bnegi_d(a, IMM6)
2429}
2430
2431/// Immediate Branch If All Elements Are Not Zero
2432///
2433/// PC-relative branch if all elements in `a` (sixteen unsigned 8-bit integer numbers) are not zero.
2434///
2435#[inline]
2436#[target_feature(enable = "msa")]
2437#[cfg_attr(test, assert_instr(bnz.b))]
2438#[unstable(feature = "stdarch_mips", issue = "111198")]
2439pub unsafe fn __msa_bnz_b(a: v16u8) -> i32 {
2440    msa_bnz_b(a)
2441}
2442
2443/// Immediate Branch If All Elements Are Not Zero
2444///
2445/// PC-relative branch if all elements in `a` (eight unsigned 16-bit integer numbers) are not zero.
2446///
2447#[inline]
2448#[target_feature(enable = "msa")]
2449#[cfg_attr(test, assert_instr(bnz.h))]
2450#[unstable(feature = "stdarch_mips", issue = "111198")]
2451pub unsafe fn __msa_bnz_h(a: v8u16) -> i32 {
2452    msa_bnz_h(a)
2453}
2454
2455/// Immediate Branch If All Elements Are Not Zero
2456///
2457/// PC-relative branch if all elements in `a` (four unsigned 32-bit integer numbers) are not zero.
2458///
2459#[inline]
2460#[target_feature(enable = "msa")]
2461#[cfg_attr(test, assert_instr(bnz.w))]
2462#[unstable(feature = "stdarch_mips", issue = "111198")]
2463pub unsafe fn __msa_bnz_w(a: v4u32) -> i32 {
2464    msa_bnz_w(a)
2465}
2466
2467/// Immediate Branch If All Elements Are Not Zero
2468///
2469/// PC-relative branch if all elements in `a` (two unsigned 64-bit integer numbers) are not zero.
2470///
2471#[inline]
2472#[target_feature(enable = "msa")]
2473#[cfg_attr(test, assert_instr(bnz.d))]
2474#[unstable(feature = "stdarch_mips", issue = "111198")]
2475pub unsafe fn __msa_bnz_d(a: v2u64) -> i32 {
2476    msa_bnz_d(a)
2477}
2478
2479/// Immediate Branch If Not Zero (At Least One Element of Any Format Is Not Zero)
2480///
2481/// PC-relative branch if at least one bit in `a` (four unsigned 32-bit integer numbers) are not zero.
2482/// i.e at least one element is not zero regardless of the data format.
2483///
2484#[inline]
2485#[target_feature(enable = "msa")]
2486#[cfg_attr(test, assert_instr(bnz.v))]
2487#[unstable(feature = "stdarch_mips", issue = "111198")]
2488pub unsafe fn __msa_bnz_v(a: v16u8) -> i32 {
2489    msa_bnz_v(a)
2490}
2491
2492/// Vector Bit Select
2493///
2494/// Selectively copy bits from the source vectors `b` (eight unsigned 16-bit integer numbers)
2495/// and `c` (eight unsigned 16-bit integer numbers)
2496/// into destination vector `a` (eight unsigned 16-bit integer numbers) based on the corresponding bit in `a`:
2497/// if 0 copies the bit from `b`, if 1 copies the bit from `c`.
2498///
2499#[inline]
2500#[target_feature(enable = "msa")]
2501#[cfg_attr(test, assert_instr(bsel.v))]
2502#[unstable(feature = "stdarch_mips", issue = "111198")]
2503pub unsafe fn __msa_bsel_v(a: v16u8, b: v16u8, c: v16u8) -> v16u8 {
2504    msa_bsel_v(a, mem::transmute(b), c)
2505}
2506
2507/// Immediate Bit Select
2508///
2509/// Selectively copy bits from the 8-bit immediate `imm8` and `c` (eight unsigned 16-bit integer numbers)
2510/// into destination vector `a` (eight unsigned 16-bit integer numbers) based on the corresponding bit in `a`:
2511/// if 0 copies the bit from `b`, if 1 copies the bit from `c`.
2512///
2513#[inline]
2514#[target_feature(enable = "msa")]
2515#[cfg_attr(test, assert_instr(bseli.b, IMM8 = 0b11111111))]
2516#[rustc_legacy_const_generics(2)]
2517#[unstable(feature = "stdarch_mips", issue = "111198")]
2518pub unsafe fn __msa_bseli_b<const IMM8: i32>(a: v16u8, b: v16u8) -> v16u8 {
2519    static_assert_uimm_bits!(IMM8, 8);
2520    msa_bseli_b(a, mem::transmute(b), IMM8)
2521}
2522
2523/// Vector Bit Set
2524///
2525/// Set to 1 one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
2526/// The bit position is given by the elements in vector `b` (sixteen unsigned 8-bit integer numbers)
2527/// modulo the size of the element in bits.
2528/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
2529///
2530#[inline]
2531#[target_feature(enable = "msa")]
2532#[cfg_attr(test, assert_instr(bset.b))]
2533#[unstable(feature = "stdarch_mips", issue = "111198")]
2534pub unsafe fn __msa_bset_b(a: v16u8, b: v16u8) -> v16u8 {
2535    msa_bset_b(a, mem::transmute(b))
2536}
2537
2538/// Vector Bit Set
2539///
2540/// Set to 1 one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
2541/// The bit position is given by the elements in vector `b` (eight unsigned 16-bit integer numbers)
2542/// modulo the size of the element in bits.
2543/// The result is written to vector (eight unsigned 16-bit integer numbers).
2544///
2545#[inline]
2546#[target_feature(enable = "msa")]
2547#[cfg_attr(test, assert_instr(bset.h))]
2548#[unstable(feature = "stdarch_mips", issue = "111198")]
2549pub unsafe fn __msa_bset_h(a: v8u16, b: v8u16) -> v8u16 {
2550    msa_bset_h(a, mem::transmute(b))
2551}
2552
2553/// Vector Bit Set
2554///
2555/// Set to 1 one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
2556/// The bit position is given by the elements in vector `b` (four unsigned 32-bit integer numbers)
2557/// modulo the size of the element in bits.
2558/// The result is written to vector (four unsigned 32-bit integer numbers).
2559///
2560#[inline]
2561#[target_feature(enable = "msa")]
2562#[cfg_attr(test, assert_instr(bset.w))]
2563#[unstable(feature = "stdarch_mips", issue = "111198")]
2564pub unsafe fn __msa_bset_w(a: v4u32, b: v4u32) -> v4u32 {
2565    msa_bset_w(a, mem::transmute(b))
2566}
2567
2568/// Vector Bit Set
2569///
2570/// Set to 1 one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
2571/// The bit position is given by the elements in vector `b` (two unsigned 64-bit integer numbers)
2572/// modulo the size of the element in bits.
2573/// The result is written to vector (two unsigned 64-bit integer numbers).
2574///
2575#[inline]
2576#[target_feature(enable = "msa")]
2577#[cfg_attr(test, assert_instr(bset.d))]
2578#[unstable(feature = "stdarch_mips", issue = "111198")]
2579pub unsafe fn __msa_bset_d(a: v2u64, b: v2u64) -> v2u64 {
2580    msa_bset_d(a, mem::transmute(b))
2581}
2582
2583/// Immediate Bit Set
2584///
2585/// Set to 1 one bit in each element of vector `a` (sixteen unsigned 8-bit integer numbers).
2586/// The bit position is given by immediate `imm3`.
2587/// The result is written to vector `a` (sixteen unsigned 8-bit integer numbers).
2588///
2589#[inline]
2590#[target_feature(enable = "msa")]
2591#[cfg_attr(test, assert_instr(bseti.b, IMM3 = 0b111))]
2592#[rustc_legacy_const_generics(1)]
2593#[unstable(feature = "stdarch_mips", issue = "111198")]
2594pub unsafe fn __msa_bseti_b<const IMM3: i32>(a: v16u8) -> v16u8 {
2595    static_assert_uimm_bits!(IMM3, 3);
2596    msa_bseti_b(a, IMM3)
2597}
2598
2599/// Immediate Bit Set
2600///
2601/// Set to 1 one bit in each element of vector `a` (eight unsigned 16-bit integer numbers).
2602/// The bit position is given by immediate `imm4`.
2603/// The result is written to vector `a` (eight unsigned 16-bit integer numbers).
2604///
2605#[inline]
2606#[target_feature(enable = "msa")]
2607#[cfg_attr(test, assert_instr(bseti.h, IMM4 = 0b1111))]
2608#[rustc_legacy_const_generics(1)]
2609#[unstable(feature = "stdarch_mips", issue = "111198")]
2610pub unsafe fn __msa_bseti_h<const IMM4: i32>(a: v8u16) -> v8u16 {
2611    static_assert_uimm_bits!(IMM4, 4);
2612    msa_bseti_h(a, IMM4)
2613}
2614
2615/// Immediate Bit Set
2616///
2617/// Set to 1 one bit in each element of vector `a` (four unsigned 32-bit integer numbers).
2618/// The bit position is given by immediate `imm5`.
2619/// The result is written to vector `a` (four unsigned 32-bit integer numbers).
2620///
2621#[inline]
2622#[target_feature(enable = "msa")]
2623#[cfg_attr(test, assert_instr(bseti.w, IMM5 = 0b11111))]
2624#[rustc_legacy_const_generics(1)]
2625#[unstable(feature = "stdarch_mips", issue = "111198")]
2626pub unsafe fn __msa_bseti_w<const IMM5: i32>(a: v4u32) -> v4u32 {
2627    static_assert_uimm_bits!(IMM5, 5);
2628    msa_bseti_w(a, IMM5)
2629}
2630
2631/// Immediate Bit Set
2632///
2633/// Set to 1 one bit in each element of vector `a` (two unsigned 64-bit integer numbers).
2634/// The bit position is given by immediate `imm6`.
2635/// The result is written to vector `a` (two unsigned 64-bit integer numbers).
2636///
2637#[inline]
2638#[target_feature(enable = "msa")]
2639#[cfg_attr(test, assert_instr(bseti.d, IMM6 = 0b111111))]
2640#[rustc_legacy_const_generics(1)]
2641#[unstable(feature = "stdarch_mips", issue = "111198")]
2642pub unsafe fn __msa_bseti_d<const IMM6: i32>(a: v2u64) -> v2u64 {
2643    static_assert_uimm_bits!(IMM6, 6);
2644    msa_bseti_d(a, IMM6)
2645}
2646
2647/// Immediate Branch If At Least One Element Is Zero
2648///
2649/// PC-relative branch if at least one element in `a` (sixteen unsigned 8-bit integer numbers) is zero.
2650///
2651#[inline]
2652#[target_feature(enable = "msa")]
2653#[cfg_attr(test, assert_instr(bz.b))]
2654#[unstable(feature = "stdarch_mips", issue = "111198")]
2655pub unsafe fn __msa_bz_b(a: v16u8) -> i32 {
2656    msa_bz_b(a)
2657}
2658
2659/// Immediate Branch If At Least One Element Is Zero
2660///
2661/// PC-relative branch if at least one element in `a` (eight unsigned 16-bit integer numbers) is zero.
2662///
2663#[inline]
2664#[target_feature(enable = "msa")]
2665#[cfg_attr(test, assert_instr(bz.h))]
2666#[unstable(feature = "stdarch_mips", issue = "111198")]
2667pub unsafe fn __msa_bz_h(a: v8u16) -> i32 {
2668    msa_bz_h(a)
2669}
2670
2671/// Immediate Branch If At Least One Element Is Zero
2672///
2673/// PC-relative branch if at least one element in `a` (four unsigned 32-bit integer numbers) is zero.
2674///
2675#[inline]
2676#[target_feature(enable = "msa")]
2677#[cfg_attr(test, assert_instr(bz.w))]
2678#[unstable(feature = "stdarch_mips", issue = "111198")]
2679pub unsafe fn __msa_bz_w(a: v4u32) -> i32 {
2680    msa_bz_w(a)
2681}
2682
2683/// Immediate Branch If At Least One Element Is Zero
2684///
2685/// PC-relative branch if at least one element in `a` (two unsigned 64-bit integer numbers) is zero.
2686///
2687#[inline]
2688#[target_feature(enable = "msa")]
2689#[cfg_attr(test, assert_instr(bz.d))]
2690#[unstable(feature = "stdarch_mips", issue = "111198")]
2691pub unsafe fn __msa_bz_d(a: v2u64) -> i32 {
2692    msa_bz_d(a)
2693}
2694
2695/// Immediate Branch If Zero (All Elements of Any Format Are Zero)
2696///
2697/// PC-relative branch if all elements in `a` (sixteen unsigned 8-bit integer numbers) bits are zero,
2698/// i.e. all elements are zero regardless of the data format.
2699///
2700#[inline]
2701#[target_feature(enable = "msa")]
2702#[cfg_attr(test, assert_instr(bz.v))]
2703#[unstable(feature = "stdarch_mips", issue = "111198")]
2704pub unsafe fn __msa_bz_v(a: v16u8) -> i32 {
2705    msa_bz_v(a)
2706}
2707
2708/// Vector Compare Equal
2709///
2710/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
2711/// if the corresponding `a` (sixteen signed 8-bit integer numbers) and `b` (sixteen signed 8-bit integer numbers)
2712/// elements are equal, otherwise set all bits to 0.
2713///
2714#[inline]
2715#[target_feature(enable = "msa")]
2716#[cfg_attr(test, assert_instr(ceq.b))]
2717#[unstable(feature = "stdarch_mips", issue = "111198")]
2718pub unsafe fn __msa_ceq_b(a: v16i8, b: v16i8) -> v16i8 {
2719    msa_ceq_b(a, mem::transmute(b))
2720}
2721
2722/// Vector Compare Equal
2723///
2724/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
2725/// if the corresponding `a` (eight signed 16-bit integer numbers) and `b` (eight signed 16-bit integer numbers)
2726/// elements are equal, otherwise set all bits to 0.
2727///
2728#[inline]
2729#[target_feature(enable = "msa")]
2730#[cfg_attr(test, assert_instr(ceq.h))]
2731#[unstable(feature = "stdarch_mips", issue = "111198")]
2732pub unsafe fn __msa_ceq_h(a: v8i16, b: v8i16) -> v8i16 {
2733    msa_ceq_h(a, mem::transmute(b))
2734}
2735
2736/// Vector Compare Equal
2737///
2738/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
2739/// if the corresponding `a` (four signed 32-bit integer numbers) and `b` (four signed 32-bit integer numbers)
2740/// elements are equal, otherwise set all bits to 0.
2741///
2742#[inline]
2743#[target_feature(enable = "msa")]
2744#[cfg_attr(test, assert_instr(ceq.w))]
2745#[unstable(feature = "stdarch_mips", issue = "111198")]
2746pub unsafe fn __msa_ceq_w(a: v4i32, b: v4i32) -> v4i32 {
2747    msa_ceq_w(a, mem::transmute(b))
2748}
2749
2750/// Vector Compare Equal
2751///
2752/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
2753/// if the corresponding `a` (two signed 64-bit integer numbers) and `b` (two signed 64-bit integer numbers)
2754/// elements are equal, otherwise set all bits to 0.
2755///
2756#[inline]
2757#[target_feature(enable = "msa")]
2758#[cfg_attr(test, assert_instr(ceq.d))]
2759#[unstable(feature = "stdarch_mips", issue = "111198")]
2760pub unsafe fn __msa_ceq_d(a: v2i64, b: v2i64) -> v2i64 {
2761    msa_ceq_d(a, mem::transmute(b))
2762}
2763
2764/// Immediate Compare Equal
2765///
2766/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
2767/// if the corresponding `a` (sixteen signed 8-bit integer numbers) the 5-bit signed immediate imm_s5
2768/// are equal, otherwise set all bits to 0.
2769///
2770#[inline]
2771#[target_feature(enable = "msa")]
2772#[cfg_attr(test, assert_instr(ceqi.b, IMM_S5 = -1))]
2773#[rustc_legacy_const_generics(1)]
2774#[unstable(feature = "stdarch_mips", issue = "111198")]
2775pub unsafe fn __msa_ceqi_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
2776    static_assert_simm_bits!(IMM_S5, 5);
2777    msa_ceqi_b(a, IMM_S5)
2778}
2779
2780/// Immediate Compare Equal
2781///
2782/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
2783/// if the corresponding `a` (eight signed 16-bit integer numbers) the 5-bit signed immediate imm_s5
2784/// are equal, otherwise set all bits to 0.
2785///
2786#[inline]
2787#[target_feature(enable = "msa")]
2788#[cfg_attr(test, assert_instr(ceqi.h, IMM_S5 = -1))]
2789#[rustc_legacy_const_generics(1)]
2790#[unstable(feature = "stdarch_mips", issue = "111198")]
2791pub unsafe fn __msa_ceqi_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
2792    static_assert_simm_bits!(IMM_S5, 5);
2793    msa_ceqi_h(a, IMM_S5)
2794}
2795
2796/// Immediate Compare Equal
2797///
2798/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
2799/// if the corresponding `a` (four signed 32-bit integer numbers) the 5-bit signed immediate imm_s5
2800/// are equal, otherwise set all bits to 0.
2801///
2802#[inline]
2803#[target_feature(enable = "msa")]
2804#[cfg_attr(test, assert_instr(ceqi.w, IMM_S5 = -1))]
2805#[rustc_legacy_const_generics(1)]
2806#[unstable(feature = "stdarch_mips", issue = "111198")]
2807pub unsafe fn __msa_ceqi_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
2808    static_assert_simm_bits!(IMM_S5, 5);
2809    msa_ceqi_w(a, IMM_S5)
2810}
2811
2812/// Immediate Compare Equal
2813///
2814/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
2815/// if the corresponding `a` (two signed 64-bit integer numbers) the 5-bit signed immediate imm_s5
2816/// are equal, otherwise set all bits to 0.
2817///
2818#[inline]
2819#[target_feature(enable = "msa")]
2820#[cfg_attr(test, assert_instr(ceqi.d, IMM_S5 = -1))]
2821#[rustc_legacy_const_generics(1)]
2822#[unstable(feature = "stdarch_mips", issue = "111198")]
2823pub unsafe fn __msa_ceqi_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
2824    static_assert_simm_bits!(IMM_S5, 5);
2825    msa_ceqi_d(a, IMM_S5)
2826}
2827
2828/// GPR Copy from MSA Control Register
2829///
2830/// The sign extended content of MSA control register cs is copied to GPR rd.
2831///
2832/// Can not be tested in user mode
2833#[inline]
2834#[target_feature(enable = "msa")]
2835#[cfg_attr(test, assert_instr(cfcmsa, IMM5 = 0b11111))]
2836#[rustc_legacy_const_generics(0)]
2837#[unstable(feature = "stdarch_mips", issue = "111198")]
2838pub unsafe fn __msa_cfcmsa<const IMM5: i32>() -> i32 {
2839    static_assert_uimm_bits!(IMM5, 5);
2840    msa_cfcmsa(IMM5)
2841}
2842
2843/// Vector Compare Signed Less Than or Equal
2844///
2845/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
2846/// if the corresponding `a` (sixteen signed 8-bit integer numbers) element
2847/// are signed less than or equal to `b` (sixteen signed 8-bit integer numbers) element.
2848/// Otherwise set all bits to 0.
2849///
2850#[inline]
2851#[target_feature(enable = "msa")]
2852#[cfg_attr(test, assert_instr(cle_s.b))]
2853#[unstable(feature = "stdarch_mips", issue = "111198")]
2854pub unsafe fn __msa_cle_s_b(a: v16i8, b: v16i8) -> v16i8 {
2855    msa_cle_s_b(a, mem::transmute(b))
2856}
2857
2858/// Vector Compare Signed Less Than or Equal
2859///
2860/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
2861/// if the corresponding `a` (eight signed 16-bit integer numbers) element
2862/// are signed less than or equal to `b` (eight signed 16-bit integer numbers) element.
2863/// Otherwise set all bits to 0.
2864///
2865#[inline]
2866#[target_feature(enable = "msa")]
2867#[cfg_attr(test, assert_instr(cle_s.h))]
2868#[unstable(feature = "stdarch_mips", issue = "111198")]
2869pub unsafe fn __msa_cle_s_h(a: v8i16, b: v8i16) -> v8i16 {
2870    msa_cle_s_h(a, mem::transmute(b))
2871}
2872
2873/// Vector Compare Signed Less Than or Equal
2874///
2875/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
2876/// if the corresponding `a` (four signed 32-bit integer numbers) element
2877/// are signed less than or equal to `b` (four signed 32-bit integer numbers) element.
2878/// Otherwise set all bits to 0.
2879///
2880#[inline]
2881#[target_feature(enable = "msa")]
2882#[cfg_attr(test, assert_instr(cle_s.w))]
2883#[unstable(feature = "stdarch_mips", issue = "111198")]
2884pub unsafe fn __msa_cle_s_w(a: v4i32, b: v4i32) -> v4i32 {
2885    msa_cle_s_w(a, mem::transmute(b))
2886}
2887
2888/// Vector Compare Signed Less Than or Equal
2889///
2890/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
2891/// if the corresponding `a` (two signed 64-bit integer numbers) element
2892/// are signed less than or equal to `b` (two signed 64-bit integer numbers) element.
2893/// Otherwise set all bits to 0.
2894///
2895#[inline]
2896#[target_feature(enable = "msa")]
2897#[cfg_attr(test, assert_instr(cle_s.d))]
2898#[unstable(feature = "stdarch_mips", issue = "111198")]
2899pub unsafe fn __msa_cle_s_d(a: v2i64, b: v2i64) -> v2i64 {
2900    msa_cle_s_d(a, mem::transmute(b))
2901}
2902
2903/// Vector Compare Unsigned Less Than or Equal
2904///
2905/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
2906/// if the corresponding `a` (sixteen unsigned 8-bit integer numbers) element
2907/// are unsigned less than or equal to `b` (sixteen unsigned 8-bit integer numbers) element.
2908/// Otherwise set all bits to 0.
2909///
2910#[inline]
2911#[target_feature(enable = "msa")]
2912#[cfg_attr(test, assert_instr(cle_u.b))]
2913#[unstable(feature = "stdarch_mips", issue = "111198")]
2914pub unsafe fn __msa_cle_u_b(a: v16u8, b: v16u8) -> v16i8 {
2915    msa_cle_u_b(a, mem::transmute(b))
2916}
2917
2918/// Vector Compare Unsigned Less Than or Equal
2919///
2920/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
2921/// if the corresponding `a` (eight unsigned 16-bit integer numbers) element
2922/// are unsigned less than or equal to `b` (eight unsigned 16-bit integer numbers) element.
2923/// Otherwise set all bits to 0.
2924///
2925#[inline]
2926#[target_feature(enable = "msa")]
2927#[cfg_attr(test, assert_instr(cle_u.h))]
2928#[unstable(feature = "stdarch_mips", issue = "111198")]
2929pub unsafe fn __msa_cle_u_h(a: v8u16, b: v8u16) -> v8i16 {
2930    msa_cle_u_h(a, mem::transmute(b))
2931}
2932
2933/// Vector Compare Unsigned Less Than or Equal
2934///
2935/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
2936/// if the corresponding `a` (four unsigned 32-bit integer numbers) element
2937/// are unsigned less than or equal to `b` (four unsigned 32-bit integer numbers) element.
2938/// Otherwise set all bits to 0.
2939///
2940#[inline]
2941#[target_feature(enable = "msa")]
2942#[cfg_attr(test, assert_instr(cle_u.w))]
2943#[unstable(feature = "stdarch_mips", issue = "111198")]
2944pub unsafe fn __msa_cle_u_w(a: v4u32, b: v4u32) -> v4i32 {
2945    msa_cle_u_w(a, mem::transmute(b))
2946}
2947
2948/// Vector Compare Unsigned Less Than or Equal
2949///
2950/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
2951/// if the corresponding `a` (two unsigned 64-bit integer numbers) element
2952/// are unsigned less than or equal to `b` (two unsigned 64-bit integer numbers) element.
2953/// Otherwise set all bits to 0.
2954///
2955#[inline]
2956#[target_feature(enable = "msa")]
2957#[cfg_attr(test, assert_instr(cle_u.d))]
2958#[unstable(feature = "stdarch_mips", issue = "111198")]
2959pub unsafe fn __msa_cle_u_d(a: v2u64, b: v2u64) -> v2i64 {
2960    msa_cle_u_d(a, mem::transmute(b))
2961}
2962
2963/// Immediate Compare Signed Less Than or Equal
2964///
2965/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
2966/// if the corresponding `a` (sixteen signed 8-bit integer numbers) element
2967/// is less than or equal to the 5-bit signed immediate imm_s5,
2968/// otherwise set all bits to 0.
2969///
2970#[inline]
2971#[target_feature(enable = "msa")]
2972#[cfg_attr(test, assert_instr(clei_s.b, IMM_S5 = -1))]
2973#[rustc_legacy_const_generics(1)]
2974#[unstable(feature = "stdarch_mips", issue = "111198")]
2975pub unsafe fn __msa_clei_s_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
2976    static_assert_simm_bits!(IMM_S5, 5);
2977    msa_clei_s_b(a, IMM_S5)
2978}
2979
2980/// Immediate Compare Signed Less Than or Equal
2981///
2982/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
2983/// if the corresponding `a` (eight signed 16-bit integer numbers) element
2984/// is less than or equal to the 5-bit signed immediate imm_s5,
2985/// otherwise set all bits to 0.
2986///
2987#[inline]
2988#[target_feature(enable = "msa")]
2989#[cfg_attr(test, assert_instr(clei_s.h, IMM_S5 = -1))]
2990#[rustc_legacy_const_generics(1)]
2991#[unstable(feature = "stdarch_mips", issue = "111198")]
2992pub unsafe fn __msa_clei_s_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
2993    static_assert_simm_bits!(IMM_S5, 5);
2994    msa_clei_s_h(a, IMM_S5)
2995}
2996
2997/// Immediate Compare Signed Less Than or Equal
2998///
2999/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
3000/// if the corresponding `a` (four signed 32-bit integer numbers) element
3001/// is less than or equal to the 5-bit signed immediate imm_s5,
3002/// otherwise set all bits to 0.
3003///
3004#[inline]
3005#[target_feature(enable = "msa")]
3006#[cfg_attr(test, assert_instr(clei_s.w, IMM_S5 = -1))]
3007#[rustc_legacy_const_generics(1)]
3008#[unstable(feature = "stdarch_mips", issue = "111198")]
3009pub unsafe fn __msa_clei_s_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
3010    static_assert_simm_bits!(IMM_S5, 5);
3011    msa_clei_s_w(a, IMM_S5)
3012}
3013
3014/// Immediate Compare Signed Less Than or Equal
3015///
3016/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
3017/// if the corresponding `a` (two signed 64-bit integer numbers) element
3018/// is less than or equal to the 5-bit signed immediate imm_s5,
3019/// otherwise set all bits to 0.
3020///
3021#[inline]
3022#[target_feature(enable = "msa")]
3023#[cfg_attr(test, assert_instr(clei_s.d, IMM_S5 = -1))]
3024#[rustc_legacy_const_generics(1)]
3025#[unstable(feature = "stdarch_mips", issue = "111198")]
3026pub unsafe fn __msa_clei_s_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
3027    static_assert_simm_bits!(IMM_S5, 5);
3028    msa_clei_s_d(a, IMM_S5)
3029}
3030
3031/// Immediate Compare Unsigned Less Than or Equal
3032///
3033/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
3034/// if the corresponding `a` (sixteen unsigned 8-bit integer numbers) element
3035/// is unsigned less than or equal to the 5-bit unsigned immediate `imm5`,
3036/// otherwise set all bits to 0.
3037///
3038#[inline]
3039#[target_feature(enable = "msa")]
3040#[cfg_attr(test, assert_instr(clei_u.b, IMM5 = 0b111))]
3041#[rustc_legacy_const_generics(1)]
3042#[unstable(feature = "stdarch_mips", issue = "111198")]
3043pub unsafe fn __msa_clei_u_b<const IMM5: i32>(a: v16u8) -> v16i8 {
3044    static_assert_uimm_bits!(IMM5, 5);
3045    msa_clei_u_b(a, IMM5)
3046}
3047
3048/// Immediate Compare Unsigned Less Than or Equal
3049///
3050/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
3051/// if the corresponding `a` (eight unsigned 16-bit integer numbers) element
3052/// is unsigned less than or equal to the 5-bit unsigned immediate `imm5`,
3053/// otherwise set all bits to 0.
3054///
3055#[inline]
3056#[target_feature(enable = "msa")]
3057#[cfg_attr(test, assert_instr(clei_u.h, IMM5 = 0b11111))]
3058#[rustc_legacy_const_generics(1)]
3059#[unstable(feature = "stdarch_mips", issue = "111198")]
3060pub unsafe fn __msa_clei_u_h<const IMM5: i32>(a: v8u16) -> v8i16 {
3061    static_assert_uimm_bits!(IMM5, 5);
3062    msa_clei_u_h(a, IMM5)
3063}
3064
3065/// Immediate Compare Unsigned Less Than or Equal
3066///
3067/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
3068/// if the corresponding `a` (four unsigned 32-bit integer numbers) element
3069/// is unsigned less than or equal to the 5-bit unsigned immediate `imm5`,
3070/// otherwise set all bits to 0.
3071///
3072#[inline]
3073#[target_feature(enable = "msa")]
3074#[cfg_attr(test, assert_instr(clei_u.w, IMM5 = 0b11111))]
3075#[rustc_legacy_const_generics(1)]
3076#[unstable(feature = "stdarch_mips", issue = "111198")]
3077pub unsafe fn __msa_clei_u_w<const IMM5: i32>(a: v4u32) -> v4i32 {
3078    static_assert_uimm_bits!(IMM5, 5);
3079    msa_clei_u_w(a, IMM5)
3080}
3081
3082/// Immediate Compare Unsigned Less Than or Equal
3083///
3084/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
3085/// if the corresponding `a` (two unsigned 64-bit integer numbers) element
3086/// is unsigned less than or equal to the 5-bit unsigned immediate `imm5`,
3087/// otherwise set all bits to 0.
3088///
3089#[inline]
3090#[target_feature(enable = "msa")]
3091#[cfg_attr(test, assert_instr(clei_u.d, IMM5 = 0b11111))]
3092#[rustc_legacy_const_generics(1)]
3093#[unstable(feature = "stdarch_mips", issue = "111198")]
3094pub unsafe fn __msa_clei_u_d<const IMM5: i32>(a: v2u64) -> v2i64 {
3095    static_assert_uimm_bits!(IMM5, 5);
3096    msa_clei_u_d(a, IMM5)
3097}
3098
3099/// Vector Compare Signed Less Than
3100///
3101/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
3102/// if the corresponding `a` (sixteen signed 8-bit integer numbers) element
3103/// are signed less than `b` (sixteen signed 8-bit integer numbers) element.
3104/// Otherwise set all bits to 0.
3105///
3106#[inline]
3107#[target_feature(enable = "msa")]
3108#[cfg_attr(test, assert_instr(clt_s.b))]
3109#[unstable(feature = "stdarch_mips", issue = "111198")]
3110pub unsafe fn __msa_clt_s_b(a: v16i8, b: v16i8) -> v16i8 {
3111    msa_clt_s_b(a, mem::transmute(b))
3112}
3113
3114/// Vector Compare Signed Less Than
3115///
3116/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
3117/// if the corresponding `a` (eight signed 16-bit integer numbers) element
3118/// are signed less than `b` (eight signed 16-bit integer numbers) element.
3119/// Otherwise set all bits to 0.
3120///
3121#[inline]
3122#[target_feature(enable = "msa")]
3123#[cfg_attr(test, assert_instr(clt_s.h))]
3124#[unstable(feature = "stdarch_mips", issue = "111198")]
3125pub unsafe fn __msa_clt_s_h(a: v8i16, b: v8i16) -> v8i16 {
3126    msa_clt_s_h(a, mem::transmute(b))
3127}
3128
3129/// Vector Compare Signed Less Than
3130///
3131/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
3132/// if the corresponding `a` (four signed 32-bit integer numbers) element
3133/// are signed less than `b` (four signed 32-bit integer numbers) element.
3134/// Otherwise set all bits to 0.
3135///
3136#[inline]
3137#[target_feature(enable = "msa")]
3138#[cfg_attr(test, assert_instr(clt_s.w))]
3139#[unstable(feature = "stdarch_mips", issue = "111198")]
3140pub unsafe fn __msa_clt_s_w(a: v4i32, b: v4i32) -> v4i32 {
3141    msa_clt_s_w(a, mem::transmute(b))
3142}
3143
3144/// Vector Compare Signed Less Than
3145///
3146/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
3147/// if the corresponding `a` (two signed 64-bit integer numbers) element
3148/// are signed less than `b` (two signed 64-bit integer numbers) element.
3149/// Otherwise set all bits to 0.
3150///
3151#[inline]
3152#[target_feature(enable = "msa")]
3153#[cfg_attr(test, assert_instr(clt_s.d))]
3154#[unstable(feature = "stdarch_mips", issue = "111198")]
3155pub unsafe fn __msa_clt_s_d(a: v2i64, b: v2i64) -> v2i64 {
3156    msa_clt_s_d(a, mem::transmute(b))
3157}
3158
3159/// Vector Compare Unsigned Less Than
3160///
3161/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
3162/// if the corresponding `a` (sixteen unsigned 8-bit integer numbers) element
3163/// are unsigned less than `b` (sixteen unsigned 8-bit integer numbers) element.
3164/// Otherwise set all bits to 0.
3165///
3166#[inline]
3167#[target_feature(enable = "msa")]
3168#[cfg_attr(test, assert_instr(clt_u.b))]
3169#[unstable(feature = "stdarch_mips", issue = "111198")]
3170pub unsafe fn __msa_clt_u_b(a: v16u8, b: v16u8) -> v16i8 {
3171    msa_clt_u_b(a, mem::transmute(b))
3172}
3173
3174/// Vector Compare Unsigned Less Than
3175///
3176/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
3177/// if the corresponding `a` (eight unsigned 16-bit integer numbers) element
3178/// are unsigned less than `b` (eight unsigned 16-bit integer numbers) element.
3179/// Otherwise set all bits to 0.
3180///
3181#[inline]
3182#[target_feature(enable = "msa")]
3183#[cfg_attr(test, assert_instr(clt_u.h))]
3184#[unstable(feature = "stdarch_mips", issue = "111198")]
3185pub unsafe fn __msa_clt_u_h(a: v8u16, b: v8u16) -> v8i16 {
3186    msa_clt_u_h(a, mem::transmute(b))
3187}
3188
3189/// Vector Compare Unsigned Less Than
3190///
3191/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
3192/// if the corresponding `a` (four unsigned 32-bit integer numbers) element
3193/// are unsigned less than `b` (four unsigned 32-bit integer numbers) element.
3194/// Otherwise set all bits to 0.
3195///
3196#[inline]
3197#[target_feature(enable = "msa")]
3198#[cfg_attr(test, assert_instr(clt_u.w))]
3199#[unstable(feature = "stdarch_mips", issue = "111198")]
3200pub unsafe fn __msa_clt_u_w(a: v4u32, b: v4u32) -> v4i32 {
3201    msa_clt_u_w(a, mem::transmute(b))
3202}
3203
3204/// Vector Compare Unsigned Less Than
3205///
3206/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
3207/// if the corresponding `a` (two unsigned 64-bit integer numbers) element
3208/// are unsigned less than `b` (two unsigned 64-bit integer numbers) element.
3209/// Otherwise set all bits to 0.
3210///
3211#[inline]
3212#[target_feature(enable = "msa")]
3213#[cfg_attr(test, assert_instr(clt_u.d))]
3214#[unstable(feature = "stdarch_mips", issue = "111198")]
3215pub unsafe fn __msa_clt_u_d(a: v2u64, b: v2u64) -> v2i64 {
3216    msa_clt_u_d(a, mem::transmute(b))
3217}
3218
3219/// Immediate Compare Signed Less Than
3220///
3221/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
3222/// if the corresponding `a` (sixteen signed 8-bit integer numbers) element
3223/// is less than the 5-bit signed immediate imm_s5,
3224/// otherwise set all bits to 0.
3225///
3226#[inline]
3227#[target_feature(enable = "msa")]
3228#[cfg_attr(test, assert_instr(clti_s.b, IMM_S5 = 0b111))]
3229#[rustc_legacy_const_generics(1)]
3230#[unstable(feature = "stdarch_mips", issue = "111198")]
3231pub unsafe fn __msa_clti_s_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
3232    static_assert_simm_bits!(IMM_S5, 5);
3233    msa_clti_s_b(a, IMM_S5)
3234}
3235
3236/// Immediate Compare Signed Less Than
3237///
3238/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
3239/// if the corresponding `a` (eight signed 16-bit integer numbers) element
3240/// is less than the 5-bit signed immediate imm_s5,
3241/// otherwise set all bits to 0.
3242///
3243#[inline]
3244#[target_feature(enable = "msa")]
3245#[cfg_attr(test, assert_instr(clti_s.h, IMM_S5 = -1))]
3246#[rustc_legacy_const_generics(1)]
3247#[unstable(feature = "stdarch_mips", issue = "111198")]
3248pub unsafe fn __msa_clti_s_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
3249    static_assert_simm_bits!(IMM_S5, 5);
3250    msa_clti_s_h(a, IMM_S5)
3251}
3252
3253/// Immediate Compare Signed Less Than
3254///
3255/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
3256/// if the corresponding `a` (four signed 32-bit integer numbers) element
3257/// is less than the 5-bit signed immediate imm_s5,
3258/// otherwise set all bits to 0.
3259///
3260#[inline]
3261#[target_feature(enable = "msa")]
3262#[cfg_attr(test, assert_instr(clti_s.w, IMM_S5 = -1))]
3263#[rustc_legacy_const_generics(1)]
3264#[unstable(feature = "stdarch_mips", issue = "111198")]
3265pub unsafe fn __msa_clti_s_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
3266    static_assert_simm_bits!(IMM_S5, 5);
3267    msa_clti_s_w(a, IMM_S5)
3268}
3269
3270/// Immediate Compare Signed Less Than
3271///
3272/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
3273/// if the corresponding `a` (two signed 64-bit integer numbers) element
3274/// is less than the 5-bit signed immediate imm_s5,
3275/// otherwise set all bits to 0.
3276///
3277#[inline]
3278#[target_feature(enable = "msa")]
3279#[cfg_attr(test, assert_instr(clti_s.d, IMM_S5 = -1))]
3280#[rustc_legacy_const_generics(1)]
3281#[unstable(feature = "stdarch_mips", issue = "111198")]
3282pub unsafe fn __msa_clti_s_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
3283    static_assert_simm_bits!(IMM_S5, 5);
3284    msa_clti_s_d(a, IMM_S5)
3285}
3286
3287/// Immediate Compare Unsigned Less Than
3288///
3289/// Set all bits to 1 in vector (sixteen signed 8-bit integer numbers) elements
3290/// if the corresponding `a` (sixteen unsigned 8-bit integer numbers) element
3291/// is unsigned less than the 5-bit unsigned immediate `imm5`,
3292/// otherwise set all bits to 0.
3293///
3294#[inline]
3295#[target_feature(enable = "msa")]
3296#[cfg_attr(test, assert_instr(clti_u.b, IMM5 = 0b111))]
3297#[rustc_legacy_const_generics(1)]
3298#[unstable(feature = "stdarch_mips", issue = "111198")]
3299pub unsafe fn __msa_clti_u_b<const IMM5: i32>(a: v16u8) -> v16i8 {
3300    static_assert_uimm_bits!(IMM5, 5);
3301    msa_clti_u_b(a, IMM5)
3302}
3303
3304/// Immediate Compare Unsigned Less Than
3305///
3306/// Set all bits to 1 in vector (eight signed 16-bit integer numbers) elements
3307/// if the corresponding `a` (eight unsigned 16-bit integer numbers) element
3308/// is unsigned less than the 5-bit unsigned immediate `imm5`,
3309/// otherwise set all bits to 0.
3310///
3311#[inline]
3312#[target_feature(enable = "msa")]
3313#[cfg_attr(test, assert_instr(clti_u.h, IMM5 = 0b11111))]
3314#[rustc_legacy_const_generics(1)]
3315#[unstable(feature = "stdarch_mips", issue = "111198")]
3316pub unsafe fn __msa_clti_u_h<const IMM5: i32>(a: v8u16) -> v8i16 {
3317    static_assert_uimm_bits!(IMM5, 5);
3318    msa_clti_u_h(a, IMM5)
3319}
3320
3321/// Immediate Compare Unsigned Less Than
3322///
3323/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
3324/// if the corresponding `a` (four unsigned 32-bit integer numbers) element
3325/// is unsigned less than the 5-bit unsigned immediate `imm5`,
3326/// otherwise set all bits to 0.
3327///
3328#[inline]
3329#[target_feature(enable = "msa")]
3330#[cfg_attr(test, assert_instr(clti_u.w, IMM5 = 0b11111))]
3331#[rustc_legacy_const_generics(1)]
3332#[unstable(feature = "stdarch_mips", issue = "111198")]
3333pub unsafe fn __msa_clti_u_w<const IMM5: i32>(a: v4u32) -> v4i32 {
3334    static_assert_uimm_bits!(IMM5, 5);
3335    msa_clti_u_w(a, IMM5)
3336}
3337
3338/// Immediate Compare Unsigned Less Than
3339///
3340/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
3341/// if the corresponding `a` (two unsigned 64-bit integer numbers) element
3342/// is unsigned less than the 5-bit unsigned immediate `imm5`,
3343/// otherwise set all bits to 0.
3344///
3345#[inline]
3346#[target_feature(enable = "msa")]
3347#[cfg_attr(test, assert_instr(clti_u.d, IMM5 = 0b11111))]
3348#[rustc_legacy_const_generics(1)]
3349#[unstable(feature = "stdarch_mips", issue = "111198")]
3350pub unsafe fn __msa_clti_u_d<const IMM5: i32>(a: v2u64) -> v2i64 {
3351    static_assert_uimm_bits!(IMM5, 5);
3352    msa_clti_u_d(a, IMM5)
3353}
3354
3355/// Element Copy to GPR Signed
3356///
3357/// Sign-extend element `imm4` of vector `a` (sixteen signed 8-bit integer numbers)
3358/// and copy the result to GPR rd.
3359///
3360#[inline]
3361#[target_feature(enable = "msa")]
3362#[cfg_attr(test, assert_instr(copy_s.b, IMM4 = 0b1111))]
3363#[rustc_legacy_const_generics(1)]
3364#[unstable(feature = "stdarch_mips", issue = "111198")]
3365pub unsafe fn __msa_copy_s_b<const IMM4: i32>(a: v16i8) -> i32 {
3366    static_assert_uimm_bits!(IMM4, 4);
3367    msa_copy_s_b(a, IMM4)
3368}
3369
3370/// Element Copy to GPR Signed
3371///
3372/// Sign-extend element `imm3` of vector `a` (eight signed 16-bit integer numbers)
3373/// and copy the result to GPR rd.
3374///
3375#[inline]
3376#[target_feature(enable = "msa")]
3377#[cfg_attr(test, assert_instr(copy_s.h, IMM3 = 0b111))]
3378#[rustc_legacy_const_generics(1)]
3379#[unstable(feature = "stdarch_mips", issue = "111198")]
3380pub unsafe fn __msa_copy_s_h<const IMM3: i32>(a: v8i16) -> i32 {
3381    static_assert_uimm_bits!(IMM3, 3);
3382    msa_copy_s_h(a, IMM3)
3383}
3384
3385/// Element Copy to GPR Signed
3386///
3387/// Sign-extend element `imm2` of vector `a` (four signed 32-bit integer numbers)
3388/// and copy the result to GPR rd.
3389///
3390#[inline]
3391#[target_feature(enable = "msa")]
3392#[cfg_attr(test, assert_instr(copy_s.w, IMM2 = 0b11))]
3393#[rustc_legacy_const_generics(1)]
3394#[unstable(feature = "stdarch_mips", issue = "111198")]
3395pub unsafe fn __msa_copy_s_w<const IMM2: i32>(a: v4i32) -> i32 {
3396    static_assert_uimm_bits!(IMM2, 2);
3397    msa_copy_s_w(a, IMM2)
3398}
3399
3400/// Element Copy to GPR Signed
3401///
3402/// Sign-extend element `imm1` of vector `a` (two signed 64-bit integer numbers)
3403/// and copy the result to GPR rd.
3404///
3405#[inline]
3406#[target_feature(enable = "msa")]
3407#[cfg_attr(test, assert_instr(copy_s.d, IMM1 = 0b1))]
3408#[rustc_legacy_const_generics(1)]
3409#[unstable(feature = "stdarch_mips", issue = "111198")]
3410pub unsafe fn __msa_copy_s_d<const IMM1: i32>(a: v2i64) -> i64 {
3411    static_assert_uimm_bits!(IMM1, 1);
3412    msa_copy_s_d(a, IMM1)
3413}
3414
3415/// Element Copy to GPR Unsigned
3416///
3417/// Zero-extend element `imm4` of vector `a` (sixteen signed 8-bit integer numbers)
3418/// and copy the result to GPR rd.
3419///
3420#[inline]
3421#[target_feature(enable = "msa")]
3422#[cfg_attr(test, assert_instr(copy_u.b, IMM4 = 0b1111))]
3423#[rustc_legacy_const_generics(1)]
3424#[unstable(feature = "stdarch_mips", issue = "111198")]
3425pub unsafe fn __msa_copy_u_b<const IMM4: i32>(a: v16i8) -> u32 {
3426    static_assert_uimm_bits!(IMM4, 4);
3427    msa_copy_u_b(a, IMM4)
3428}
3429
3430/// Element Copy to GPR Unsigned
3431///
3432/// Zero-extend element `imm3` of vector `a` (eight signed 16-bit integer numbers)
3433/// and copy the result to GPR rd.
3434///
3435#[inline]
3436#[target_feature(enable = "msa")]
3437#[cfg_attr(test, assert_instr(copy_u.h, IMM3 = 0b111))]
3438#[rustc_legacy_const_generics(1)]
3439#[unstable(feature = "stdarch_mips", issue = "111198")]
3440pub unsafe fn __msa_copy_u_h<const IMM3: i32>(a: v8i16) -> u32 {
3441    static_assert_uimm_bits!(IMM3, 3);
3442    msa_copy_u_h(a, IMM3)
3443}
3444
3445/// Element Copy to GPR Unsigned
3446///
3447/// Zero-extend element `imm2` of vector `a` (four signed 32-bit integer numbers)
3448/// and copy the result to GPR rd.
3449///
3450#[inline]
3451#[target_feature(enable = "msa")]
3452#[cfg_attr(test, assert_instr(copy_u.w, IMM2 = 0b11))]
3453#[rustc_legacy_const_generics(1)]
3454#[unstable(feature = "stdarch_mips", issue = "111198")]
3455pub unsafe fn __msa_copy_u_w<const IMM2: i32>(a: v4i32) -> u32 {
3456    static_assert_uimm_bits!(IMM2, 2);
3457    msa_copy_u_w(a, IMM2)
3458}
3459
3460/// Element Copy to GPR Unsigned
3461///
3462/// Zero-extend element `imm1` of vector `a` (two signed 64-bit integer numbers)
3463/// and copy the result to GPR rd.
3464///
3465#[inline]
3466#[target_feature(enable = "msa")]
3467#[cfg_attr(test, assert_instr(copy_u.d, IMM1 = 0b1))]
3468#[rustc_legacy_const_generics(1)]
3469#[unstable(feature = "stdarch_mips", issue = "111198")]
3470pub unsafe fn __msa_copy_u_d<const IMM1: i32>(a: v2i64) -> u64 {
3471    static_assert_uimm_bits!(IMM1, 1);
3472    msa_copy_u_d(a, IMM1)
3473}
3474
3475/// GPR Copy to MSA Control Register
3476///
3477/// The content of the least significant 31 bits of GPR `imm1` is copied to
3478/// MSA control register cd.
3479///
3480/// Can not be tested in user mode
3481///
3482#[inline]
3483#[target_feature(enable = "msa")]
3484#[cfg_attr(test, assert_instr(ctcmsa, IMM5 = 0b1))]
3485#[rustc_legacy_const_generics(0)]
3486#[unstable(feature = "stdarch_mips", issue = "111198")]
3487pub unsafe fn __msa_ctcmsa<const IMM5: i32>(a: i32) -> () {
3488    static_assert_uimm_bits!(IMM5, 5);
3489    msa_ctcmsa(IMM5, a)
3490}
3491
3492/// Vector Signed Divide
3493///
3494/// The signed integer elements in vector `a` (sixteen signed 8-bit integer numbers)
3495/// are divided by signed integer elements in vector `b` (sixteen signed 8-bit integer numbers).
3496/// The result is written to vector (sixteen signed 8-bit integer numbers).
3497///
3498#[inline]
3499#[target_feature(enable = "msa")]
3500#[cfg_attr(test, assert_instr(div_s.b))]
3501#[unstable(feature = "stdarch_mips", issue = "111198")]
3502pub unsafe fn __msa_div_s_b(a: v16i8, b: v16i8) -> v16i8 {
3503    msa_div_s_b(a, mem::transmute(b))
3504}
3505
3506/// Vector Signed Divide
3507///
3508/// The signed integer elements in vector `a` (eight signed 16-bit integer numbers)
3509/// are divided by signed integer elements in vector `b` (eight signed 16-bit integer numbers).
3510/// The result is written to vector (eight signed 16-bit integer numbers).
3511///
3512#[inline]
3513#[target_feature(enable = "msa")]
3514#[cfg_attr(test, assert_instr(div_s.h))]
3515#[unstable(feature = "stdarch_mips", issue = "111198")]
3516pub unsafe fn __msa_div_s_h(a: v8i16, b: v8i16) -> v8i16 {
3517    msa_div_s_h(a, mem::transmute(b))
3518}
3519
3520/// Vector Signed Divide
3521///
3522/// The signed integer elements in vector `a` (four signed 32-bit integer numbers)
3523/// are divided by signed integer elements in vector `b` (four signed 32-bit integer numbers).
3524/// The result is written to vector (four signed 32-bit integer numbers).
3525///
3526#[inline]
3527#[target_feature(enable = "msa")]
3528#[cfg_attr(test, assert_instr(div_s.w))]
3529#[unstable(feature = "stdarch_mips", issue = "111198")]
3530pub unsafe fn __msa_div_s_w(a: v4i32, b: v4i32) -> v4i32 {
3531    msa_div_s_w(a, mem::transmute(b))
3532}
3533
3534/// Vector Signed Divide
3535///
3536/// The signed integer elements in vector `a` (two signed 64-bit integer numbers)
3537/// are divided by signed integer elements in vector `b` (two signed 64-bit integer numbers).
3538/// The result is written to vector (two signed 64-bit integer numbers).
3539///
3540#[inline]
3541#[target_feature(enable = "msa")]
3542#[cfg_attr(test, assert_instr(div_s.d))]
3543#[unstable(feature = "stdarch_mips", issue = "111198")]
3544pub unsafe fn __msa_div_s_d(a: v2i64, b: v2i64) -> v2i64 {
3545    msa_div_s_d(a, mem::transmute(b))
3546}
3547
3548/// Vector Unsigned Divide
3549///
3550/// The unsigned integer elements in vector `a` (sixteen unsigned 8-bit integer numbers)
3551/// are divided by unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers).
3552/// The result is written to vector (sixteen unsigned 8-bit integer numbers).
3553///
3554#[inline]
3555#[target_feature(enable = "msa")]
3556#[cfg_attr(test, assert_instr(div_u.b))]
3557#[unstable(feature = "stdarch_mips", issue = "111198")]
3558pub unsafe fn __msa_div_u_b(a: v16u8, b: v16u8) -> v16u8 {
3559    msa_div_u_b(a, mem::transmute(b))
3560}
3561
3562/// Vector Unsigned Divide
3563///
3564/// The unsigned integer elements in vector `a` (eight unsigned 16-bit integer numbers)
3565/// are divided by unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers).
3566/// The result is written to vector (eight unsigned 16-bit integer numbers).
3567///
3568#[inline]
3569#[target_feature(enable = "msa")]
3570#[cfg_attr(test, assert_instr(div_u.h))]
3571#[unstable(feature = "stdarch_mips", issue = "111198")]
3572pub unsafe fn __msa_div_u_h(a: v8u16, b: v8u16) -> v8u16 {
3573    msa_div_u_h(a, mem::transmute(b))
3574}
3575
3576/// Vector Unsigned Divide
3577///
3578/// The unsigned integer elements in vector `a` (four unsigned 32-bit integer numbers)
3579/// are divided by unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers).
3580/// The result is written to vector (four unsigned 32-bit integer numbers).
3581///
3582#[inline]
3583#[target_feature(enable = "msa")]
3584#[cfg_attr(test, assert_instr(div_u.w))]
3585#[unstable(feature = "stdarch_mips", issue = "111198")]
3586pub unsafe fn __msa_div_u_w(a: v4u32, b: v4u32) -> v4u32 {
3587    msa_div_u_w(a, mem::transmute(b))
3588}
3589
3590/// Vector Unsigned Divide
3591///
3592/// The unsigned integer elements in vector `a` (two unsigned 64-bit integer numbers)
3593/// are divided by unsigned integer elements in vector `b` (two unsigned 64-bit integer numbers).
3594/// The result is written to vector (two unsigned 64-bit integer numbers).
3595///
3596#[inline]
3597#[target_feature(enable = "msa")]
3598#[cfg_attr(test, assert_instr(div_u.d))]
3599#[unstable(feature = "stdarch_mips", issue = "111198")]
3600pub unsafe fn __msa_div_u_d(a: v2u64, b: v2u64) -> v2u64 {
3601    msa_div_u_d(a, mem::transmute(b))
3602}
3603
3604/// Vector Signed Dot Product
3605///
3606/// The signed integer elements in vector `a` (sixteen signed 8-bit integer numbers)
3607/// are multiplied by signed integer elements in vector `b` (sixteen signed 8-bit integer numbers)
3608/// producing a result the size of the input operands. The multiplication results of
3609/// adjacent odd/even elements are added and stored to the destination
3610/// vector (eight signed 16-bit integer numbers).
3611///
3612#[inline]
3613#[target_feature(enable = "msa")]
3614#[cfg_attr(test, assert_instr(dotp_s.h))]
3615#[unstable(feature = "stdarch_mips", issue = "111198")]
3616pub unsafe fn __msa_dotp_s_h(a: v16i8, b: v16i8) -> v8i16 {
3617    msa_dotp_s_h(a, mem::transmute(b))
3618}
3619
3620/// Vector Signed Dot Product
3621///
3622/// The signed integer elements in vector `a` (eight signed 16-bit integer numbers)
3623/// are multiplied by signed integer elements in vector `b` (eight signed 16-bit integer numbers)
3624/// producing a result the size of the input operands. The multiplication results of
3625/// adjacent odd/even elements are added and stored to the destination
3626/// vector (four signed 32-bit integer numbers).
3627///
3628#[inline]
3629#[target_feature(enable = "msa")]
3630#[cfg_attr(test, assert_instr(dotp_s.w))]
3631#[unstable(feature = "stdarch_mips", issue = "111198")]
3632pub unsafe fn __msa_dotp_s_w(a: v8i16, b: v8i16) -> v4i32 {
3633    msa_dotp_s_w(a, mem::transmute(b))
3634}
3635
3636/// Vector Signed Dot Product
3637///
3638/// The signed integer elements in vector `a` (four signed 32-bit integer numbers)
3639/// are multiplied by signed integer elements in vector `b` (four signed 32-bit integer numbers)
3640/// producing a result the size of the input operands. The multiplication results of
3641/// adjacent odd/even elements are added and stored to the destination
3642/// vector (two signed 64-bit integer numbers).
3643///
3644#[inline]
3645#[target_feature(enable = "msa")]
3646#[cfg_attr(test, assert_instr(dotp_s.d))]
3647#[unstable(feature = "stdarch_mips", issue = "111198")]
3648pub unsafe fn __msa_dotp_s_d(a: v4i32, b: v4i32) -> v2i64 {
3649    msa_dotp_s_d(a, mem::transmute(b))
3650}
3651
3652/// Vector Unsigned Dot Product
3653///
3654/// The unsigned integer elements in vector `a` (sixteen unsigned 8-bit integer numbers)
3655/// are multiplied by unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers)
3656/// producing a result the size of the input operands. The multiplication results of
3657/// adjacent odd/even elements are added and stored to the destination
3658/// vector (eight unsigned 16-bit integer numbers).
3659///
3660#[inline]
3661#[target_feature(enable = "msa")]
3662#[cfg_attr(test, assert_instr(dotp_u.h))]
3663#[unstable(feature = "stdarch_mips", issue = "111198")]
3664pub unsafe fn __msa_dotp_u_h(a: v16u8, b: v16u8) -> v8u16 {
3665    msa_dotp_u_h(a, mem::transmute(b))
3666}
3667
3668/// Vector Unsigned Dot Product
3669///
3670/// The unsigned integer elements in vector `a` (eight unsigned 16-bit integer numbers)
3671/// are multiplied by unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers)
3672/// producing a result the size of the input operands. The multiplication results of
3673/// adjacent odd/even elements are added and stored to the destination
3674/// vector (four unsigned 32-bit integer numbers).
3675///
3676#[inline]
3677#[target_feature(enable = "msa")]
3678#[cfg_attr(test, assert_instr(dotp_u.w))]
3679#[unstable(feature = "stdarch_mips", issue = "111198")]
3680pub unsafe fn __msa_dotp_u_w(a: v8u16, b: v8u16) -> v4u32 {
3681    msa_dotp_u_w(a, mem::transmute(b))
3682}
3683
3684/// Vector Unsigned Dot Product
3685///
3686/// The unsigned integer elements in vector `a` (four unsigned 32-bit integer numbers)
3687/// are multiplied by unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers)
3688/// producing a result the size of the input operands. The multiplication results of
3689/// adjacent odd/even elements are added and stored to the destination
3690/// vector (two unsigned 64-bit integer numbers).
3691///
3692#[inline]
3693#[target_feature(enable = "msa")]
3694#[cfg_attr(test, assert_instr(dotp_u.d))]
3695#[unstable(feature = "stdarch_mips", issue = "111198")]
3696pub unsafe fn __msa_dotp_u_d(a: v4u32, b: v4u32) -> v2u64 {
3697    msa_dotp_u_d(a, mem::transmute(b))
3698}
3699
3700/// Vector Signed Dot Product and Add
3701///
3702/// The signed integer elements in vector `b` (sixteen signed 8-bit integer numbers)
3703/// are multiplied by signed integer elements in vector `c` (sixteen signed 8-bit integer numbers)
3704/// producing a result twice the size of the input operands. The multiplication results
3705/// of adjacent odd/even elements are added to the vector `a` (eight signed 16-bit integer numbers).
3706///
3707#[inline]
3708#[target_feature(enable = "msa")]
3709#[cfg_attr(test, assert_instr(dpadd_s.h))]
3710#[unstable(feature = "stdarch_mips", issue = "111198")]
3711pub unsafe fn __msa_dpadd_s_h(a: v8i16, b: v16i8, c: v16i8) -> v8i16 {
3712    msa_dpadd_s_h(a, mem::transmute(b), c)
3713}
3714
3715/// Vector Signed Dot Product and Add
3716///
3717/// The signed integer elements in vector `b` (eight signed 16-bit integer numbers)
3718/// are multiplied by signed integer elements in vector `c` (eight signed 16-bit integer numbers)
3719/// producing a result twice the size of the input operands. The multiplication results
3720/// of adjacent odd/even elements are added to the vector `a` (four signed 32-bit integer numbers).
3721///
3722#[inline]
3723#[target_feature(enable = "msa")]
3724#[cfg_attr(test, assert_instr(dpadd_s.w))]
3725#[unstable(feature = "stdarch_mips", issue = "111198")]
3726pub unsafe fn __msa_dpadd_s_w(a: v4i32, b: v8i16, c: v8i16) -> v4i32 {
3727    msa_dpadd_s_w(a, mem::transmute(b), c)
3728}
3729
3730/// Vector Signed Dot Product and Add
3731///
3732/// The signed integer elements in vector `b` (four signed 32-bit integer numbers)
3733/// are multiplied by signed integer elements in vector `c` (four signed 32-bit integer numbers)
3734/// producing a result twice the size of the input operands. The multiplication results
3735/// of adjacent odd/even elements are added to the vector `a` (two signed 64-bit integer numbers).
3736///
3737#[inline]
3738#[target_feature(enable = "msa")]
3739#[cfg_attr(test, assert_instr(dpadd_s.d))]
3740#[unstable(feature = "stdarch_mips", issue = "111198")]
3741pub unsafe fn __msa_dpadd_s_d(a: v2i64, b: v4i32, c: v4i32) -> v2i64 {
3742    msa_dpadd_s_d(a, mem::transmute(b), c)
3743}
3744
3745/// Vector Unsigned Dot Product and Add
3746///
3747/// The unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers)
3748/// are multiplied by unsigned integer elements in vector `c` (sixteen unsigned 8-bit integer numbers)
3749/// producing a result twice the size of the input operands. The multiplication results
3750/// of adjacent odd/even elements are added to the vector `a` (eight unsigned 16-bit integer numbers).
3751///
3752#[inline]
3753#[target_feature(enable = "msa")]
3754#[cfg_attr(test, assert_instr(dpadd_u.h))]
3755#[unstable(feature = "stdarch_mips", issue = "111198")]
3756pub unsafe fn __msa_dpadd_u_h(a: v8u16, b: v16u8, c: v16u8) -> v8u16 {
3757    msa_dpadd_u_h(a, mem::transmute(b), c)
3758}
3759
3760/// Vector Unsigned Dot Product and Add
3761///
3762/// The unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers)
3763/// are multiplied by unsigned integer elements in vector `c` (eight unsigned 16-bit integer numbers)
3764/// producing a result twice the size of the input operands. The multiplication results
3765/// of adjacent odd/even elements are added to the vector `a` (four unsigned 32-bit integer numbers).
3766///
3767#[inline]
3768#[target_feature(enable = "msa")]
3769#[cfg_attr(test, assert_instr(dpadd_u.w))]
3770#[unstable(feature = "stdarch_mips", issue = "111198")]
3771pub unsafe fn __msa_dpadd_u_w(a: v4u32, b: v8u16, c: v8u16) -> v4u32 {
3772    msa_dpadd_u_w(a, mem::transmute(b), c)
3773}
3774
3775/// Vector Unsigned Dot Product and Add
3776///
3777/// The unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers)
3778/// are multiplied by unsigned integer elements in vector `c` (four unsigned 32-bit integer numbers)
3779/// producing a result twice the size of the input operands. The multiplication results
3780/// of adjacent odd/even elements are added to the vector `a` (two unsigned 64-bit integer numbers).
3781///
3782#[inline]
3783#[target_feature(enable = "msa")]
3784#[cfg_attr(test, assert_instr(dpadd_u.d))]
3785#[unstable(feature = "stdarch_mips", issue = "111198")]
3786pub unsafe fn __msa_dpadd_u_d(a: v2u64, b: v4u32, c: v4u32) -> v2u64 {
3787    msa_dpadd_u_d(a, mem::transmute(b), c)
3788}
3789
3790/// Vector Signed Dot Product and Add
3791///
3792/// The signed integer elements in vector `b` (sixteen signed 8-bit integer numbers)
3793/// are multiplied by signed integer elements in vector `c` (sixteen signed 8-bit integer numbers)
3794/// producing a result twice the size of the input operands. The multiplication results
3795/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
3796/// (eight signed 16-bit integer numbers).
3797///
3798#[inline]
3799#[target_feature(enable = "msa")]
3800#[cfg_attr(test, assert_instr(dpsub_s.h))]
3801#[unstable(feature = "stdarch_mips", issue = "111198")]
3802pub unsafe fn __msa_dpsub_s_h(a: v8i16, b: v16i8, c: v16i8) -> v8i16 {
3803    msa_dpsub_s_h(a, mem::transmute(b), c)
3804}
3805
3806/// Vector Signed Dot Product and Add
3807///
3808/// The signed integer elements in vector `b` (eight signed 16-bit integer numbers)
3809/// are multiplied by signed integer elements in vector `c` (eight signed 16-bit integer numbers)
3810/// producing a result twice the size of the input operands. The multiplication results
3811/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
3812/// (four signed 32-bit integer numbers).
3813///
3814#[inline]
3815#[target_feature(enable = "msa")]
3816#[cfg_attr(test, assert_instr(dpsub_s.w))]
3817#[unstable(feature = "stdarch_mips", issue = "111198")]
3818pub unsafe fn __msa_dpsub_s_w(a: v4i32, b: v8i16, c: v8i16) -> v4i32 {
3819    msa_dpsub_s_w(a, mem::transmute(b), c)
3820}
3821
3822/// Vector Signed Dot Product and Add
3823///
3824/// The signed integer elements in vector `b` (four signed 32-bit integer numbers)
3825/// are multiplied by signed integer elements in vector `c` (four signed 32-bit integer numbers)
3826/// producing a result twice the size of the input operands. The multiplication results
3827/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
3828/// (two signed 64-bit integer numbers).
3829///
3830#[inline]
3831#[target_feature(enable = "msa")]
3832#[cfg_attr(test, assert_instr(dpsub_s.d))]
3833#[unstable(feature = "stdarch_mips", issue = "111198")]
3834pub unsafe fn __msa_dpsub_s_d(a: v2i64, b: v4i32, c: v4i32) -> v2i64 {
3835    msa_dpsub_s_d(a, mem::transmute(b), c)
3836}
3837
3838/// Vector Unsigned Dot Product and Add
3839///
3840/// The unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers)
3841/// are multiplied by unsigned integer elements in vector `c` (sixteen unsigned 8-bit integer numbers)
3842/// producing a result twice the size of the input operands. The multiplication results
3843/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
3844/// (eight signed 16-bit integer numbers).
3845///
3846#[inline]
3847#[target_feature(enable = "msa")]
3848#[cfg_attr(test, assert_instr(dpsub_u.h))]
3849#[unstable(feature = "stdarch_mips", issue = "111198")]
3850pub unsafe fn __msa_dpsub_u_h(a: v8i16, b: v16u8, c: v16u8) -> v8i16 {
3851    msa_dpsub_u_h(a, mem::transmute(b), c)
3852}
3853
3854/// Vector Unsigned Dot Product and Add
3855///
3856/// The unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers)
3857/// are multiplied by unsigned integer elements in vector `c` (eight unsigned 16-bit integer numbers)
3858/// producing a result twice the size of the input operands. The multiplication results
3859/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
3860/// (four signed 32-bit integer numbers).
3861///
3862#[inline]
3863#[target_feature(enable = "msa")]
3864#[cfg_attr(test, assert_instr(dpsub_u.w))]
3865#[unstable(feature = "stdarch_mips", issue = "111198")]
3866pub unsafe fn __msa_dpsub_u_w(a: v4i32, b: v8u16, c: v8u16) -> v4i32 {
3867    msa_dpsub_u_w(a, mem::transmute(b), c)
3868}
3869
3870/// Vector Unsigned Dot Product and Add
3871///
3872/// The unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers)
3873/// are multiplied by unsigned integer elements in vector `c` (four unsigned 32-bit integer numbers)
3874/// producing a result twice the size of the input operands. The multiplication results
3875/// of adjacent odd/even elements are subtracted from the integer elements in vector `a`
3876/// (two signed 64-bit integer numbers).
3877///
3878#[inline]
3879#[target_feature(enable = "msa")]
3880#[cfg_attr(test, assert_instr(dpsub_u.d))]
3881#[unstable(feature = "stdarch_mips", issue = "111198")]
3882pub unsafe fn __msa_dpsub_u_d(a: v2i64, b: v4u32, c: v4u32) -> v2i64 {
3883    msa_dpsub_u_d(a, mem::transmute(b), c)
3884}
3885
3886/// Vector Floating-Point Addition
3887///
3888/// The floating-point elements in vector `a` (four 32-bit floating point numbers)
3889/// are added to the floating-point elements in `bc` (four 32-bit floating point numbers).
3890/// The result is written to vector (four 32-bit floating point numbers).
3891///
3892#[inline]
3893#[target_feature(enable = "msa")]
3894#[cfg_attr(test, assert_instr(fadd.w))]
3895#[unstable(feature = "stdarch_mips", issue = "111198")]
3896pub unsafe fn __msa_fadd_w(a: v4f32, b: v4f32) -> v4f32 {
3897    msa_fadd_w(a, mem::transmute(b))
3898}
3899
3900/// Vector Floating-Point Addition
3901///
3902/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
3903/// are added to the floating-point elements in `bc` (two 64-bit floating point numbers).
3904/// The result is written to vector (two 64-bit floating point numbers).
3905///
3906#[inline]
3907#[target_feature(enable = "msa")]
3908#[cfg_attr(test, assert_instr(fadd.d))]
3909#[unstable(feature = "stdarch_mips", issue = "111198")]
3910pub unsafe fn __msa_fadd_d(a: v2f64, b: v2f64) -> v2f64 {
3911    msa_fadd_d(a, mem::transmute(b))
3912}
3913
3914/// Vector Floating-Point Quiet Compare Always False
3915///
3916/// Set all bits to 0 in vector (four signed 32-bit integer numbers).
3917/// Signaling NaN elements in `a` (four 32-bit floating point numbers)
3918/// or `b` (four 32-bit floating point numbers) signal Invalid Operation exception.
3919///
3920#[inline]
3921#[target_feature(enable = "msa")]
3922#[cfg_attr(test, assert_instr(fcaf.w))]
3923#[unstable(feature = "stdarch_mips", issue = "111198")]
3924pub unsafe fn __msa_fcaf_w(a: v4f32, b: v4f32) -> v4i32 {
3925    msa_fcaf_w(a, mem::transmute(b))
3926}
3927
3928/// Vector Floating-Point Quiet Compare Always False
3929///
3930/// Set all bits to 0 in vector (two signed 64-bit integer numbers).
3931/// Signaling NaN elements in `a` (two 64-bit floating point numbers)
3932/// or `b` (two 64-bit floating point numbers) signal Invalid Operation exception.
3933///
3934#[inline]
3935#[target_feature(enable = "msa")]
3936#[cfg_attr(test, assert_instr(fcaf.d))]
3937#[unstable(feature = "stdarch_mips", issue = "111198")]
3938pub unsafe fn __msa_fcaf_d(a: v2f64, b: v2f64) -> v2i64 {
3939    msa_fcaf_d(a, mem::transmute(b))
3940}
3941
3942/// Vector Floating-Point Quiet Compare Equal
3943///
3944/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
3945/// elements if the corresponding in `a` (four 32-bit floating point numbers)
3946/// and `b` (four 32-bit floating point numbers) elements are ordered and equal,
3947/// otherwise set all bits to 0.
3948///
3949#[inline]
3950#[target_feature(enable = "msa")]
3951#[cfg_attr(test, assert_instr(fceq.w))]
3952#[unstable(feature = "stdarch_mips", issue = "111198")]
3953pub unsafe fn __msa_fceq_w(a: v4f32, b: v4f32) -> v4i32 {
3954    msa_fceq_w(a, mem::transmute(b))
3955}
3956
3957/// Vector Floating-Point Quiet Compare Equal
3958///
3959/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
3960/// elements if the corresponding in `a` (two 64-bit floating point numbers)
3961/// and `b` (two 64-bit floating point numbers) elements are ordered and equal,
3962/// otherwise set all bits to 0.
3963///
3964#[inline]
3965#[target_feature(enable = "msa")]
3966#[cfg_attr(test, assert_instr(fceq.d))]
3967#[unstable(feature = "stdarch_mips", issue = "111198")]
3968pub unsafe fn __msa_fceq_d(a: v2f64, b: v2f64) -> v2i64 {
3969    msa_fceq_d(a, mem::transmute(b))
3970}
3971
3972/// Vector Floating-Point Class Mask
3973///
3974/// Store in each element of vector (four signed 32-bit integer numbers)
3975/// a bit mask reflecting the floating-point class of the corresponding element of vector
3976/// `a` (four 32-bit floating point numbers).
3977/// The mask has 10 bits as follows. Bits 0 and 1 indicate NaN values: signaling NaN (bit 0) and quiet NaN (bit 1).
3978/// Bits 2, 3, 4, 5 classify negative values: infinity (bit 2), normal (bit 3), subnormal (bit 4), and zero (bit 5).
3979/// Bits 6, 7, 8, 9 classify positive values: infinity (bit 6), normal (bit 7), subnormal (bit 8), and zero (bit 9).
3980///
3981#[inline]
3982#[target_feature(enable = "msa")]
3983#[cfg_attr(test, assert_instr(fclass.w))]
3984#[unstable(feature = "stdarch_mips", issue = "111198")]
3985pub unsafe fn __msa_fclass_w(a: v4f32) -> v4i32 {
3986    msa_fclass_w(a)
3987}
3988
3989/// Vector Floating-Point Class Mask
3990///
3991/// Store in each element of vector (two signed 64-bit integer numbers)
3992/// a bit mask reflecting the floating-point class of the corresponding element of vector
3993/// `a` (two 64-bit floating point numbers).
3994/// The mask has 10 bits as follows. Bits 0 and 1 indicate NaN values: signaling NaN (bit 0) and quiet NaN (bit 1).
3995/// Bits 2, 3, 4, 5 classify negative values: infinity (bit 2), normal (bit 3), subnormal (bit 4), and zero (bit 5).
3996/// Bits 6, 7, 8, 9 classify positive values: infinity (bit 6), normal (bit 7), subnormal (bit 8), and zero (bit 9).
3997///
3998#[inline]
3999#[target_feature(enable = "msa")]
4000#[cfg_attr(test, assert_instr(fclass.d))]
4001#[unstable(feature = "stdarch_mips", issue = "111198")]
4002pub unsafe fn __msa_fclass_d(a: v2f64) -> v2i64 {
4003    msa_fclass_d(a)
4004}
4005
4006/// Vector Floating-Point Quiet Compare Less or Equal
4007///
4008/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4009/// elements if the corresponding `a` (four 32-bit floating point numbers) elements are ordered
4010/// and either less than or equal to `b` (four 32-bit floating point numbers) elements,
4011/// otherwise set all bits to 0.
4012///
4013#[inline]
4014#[target_feature(enable = "msa")]
4015#[cfg_attr(test, assert_instr(fcle.w))]
4016#[unstable(feature = "stdarch_mips", issue = "111198")]
4017pub unsafe fn __msa_fcle_w(a: v4f32, b: v4f32) -> v4i32 {
4018    msa_fcle_w(a, mem::transmute(b))
4019}
4020
4021/// Vector Floating-Point Quiet Compare Less or Equal
4022///
4023/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4024/// elements if the corresponding `a` (two 64-bit floating point numbers) elements are ordered
4025/// and either less than or equal to `b` (two 64-bit floating point numbers) elements,
4026/// otherwise set all bits to 0.
4027///
4028#[inline]
4029#[target_feature(enable = "msa")]
4030#[cfg_attr(test, assert_instr(fcle.d))]
4031#[unstable(feature = "stdarch_mips", issue = "111198")]
4032pub unsafe fn __msa_fcle_d(a: v2f64, b: v2f64) -> v2i64 {
4033    msa_fcle_d(a, mem::transmute(b))
4034}
4035
4036/// Vector Floating-Point Quiet Compare Less Than
4037///
4038/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4039/// elements if the corresponding `a` (four 32-bit floating point numbers) elements are ordered
4040/// and less than `b` (four 32-bit floating point numbers) elements,
4041/// otherwise set all bits to 0.
4042///
4043#[inline]
4044#[target_feature(enable = "msa")]
4045#[cfg_attr(test, assert_instr(fclt.w))]
4046#[unstable(feature = "stdarch_mips", issue = "111198")]
4047pub unsafe fn __msa_fclt_w(a: v4f32, b: v4f32) -> v4i32 {
4048    msa_fclt_w(a, mem::transmute(b))
4049}
4050
4051/// Vector Floating-Point Quiet Compare Less Than
4052///
4053/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4054/// elements if the corresponding `a` (two 64-bit floating point numbers) elements are ordered
4055/// and less than `b` (two 64-bit floating point numbers) elements,
4056/// otherwise set all bits to 0.
4057///
4058#[inline]
4059#[target_feature(enable = "msa")]
4060#[cfg_attr(test, assert_instr(fclt.d))]
4061#[unstable(feature = "stdarch_mips", issue = "111198")]
4062pub unsafe fn __msa_fclt_d(a: v2f64, b: v2f64) -> v2i64 {
4063    msa_fclt_d(a, mem::transmute(b))
4064}
4065
4066/// Vector Floating-Point Quiet Compare Not Equal
4067///
4068/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4069/// elements if the corresponding `a` (four 32-bit floating point numbers) and
4070/// `b` (four 32-bit floating point numbers) elements are ordered and not equal,
4071/// otherwise set all bits to 0.
4072///
4073#[inline]
4074#[target_feature(enable = "msa")]
4075#[cfg_attr(test, assert_instr(fcne.w))]
4076#[unstable(feature = "stdarch_mips", issue = "111198")]
4077pub unsafe fn __msa_fcne_w(a: v4f32, b: v4f32) -> v4i32 {
4078    msa_fcne_w(a, mem::transmute(b))
4079}
4080
4081/// Vector Floating-Point Quiet Compare Not Equal
4082///
4083/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4084/// elements if the corresponding `a` (two 64-bit floating point numbers) and
4085/// `b` (two 64-bit floating point numbers) elements are ordered and not equal,
4086/// otherwise set all bits to 0.
4087///
4088#[inline]
4089#[target_feature(enable = "msa")]
4090#[cfg_attr(test, assert_instr(fcne.d))]
4091#[unstable(feature = "stdarch_mips", issue = "111198")]
4092pub unsafe fn __msa_fcne_d(a: v2f64, b: v2f64) -> v2i64 {
4093    msa_fcne_d(a, mem::transmute(b))
4094}
4095
4096/// Vector Floating-Point Quiet Compare Ordered
4097///
4098/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4099/// elements if the corresponding `a` (four 32-bit floating point numbers) and
4100/// `b` (four 32-bit floating point numbers) elements are ordered, i.e. both elements are not NaN values,
4101/// otherwise set all bits to 0.
4102///
4103#[inline]
4104#[target_feature(enable = "msa")]
4105#[cfg_attr(test, assert_instr(fcor.w))]
4106#[unstable(feature = "stdarch_mips", issue = "111198")]
4107pub unsafe fn __msa_fcor_w(a: v4f32, b: v4f32) -> v4i32 {
4108    msa_fcor_w(a, mem::transmute(b))
4109}
4110
4111/// Vector Floating-Point Quiet Compare Ordered
4112///
4113/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4114/// elements if the corresponding `a` (two 64-bit floating point numbers) and
4115/// `b` (two 64-bit floating point numbers) elements are ordered, i.e. both elements are not NaN values,
4116/// otherwise set all bits to 0.
4117///
4118#[inline]
4119#[target_feature(enable = "msa")]
4120#[cfg_attr(test, assert_instr(fcor.d))]
4121#[unstable(feature = "stdarch_mips", issue = "111198")]
4122pub unsafe fn __msa_fcor_d(a: v2f64, b: v2f64) -> v2i64 {
4123    msa_fcor_d(a, mem::transmute(b))
4124}
4125
4126/// Vector Floating-Point Quiet Compare Unordered or Equal
4127///
4128/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4129/// elements if the corresponding `a` (four 32-bit floating point numbers) and
4130/// `b` (four 32-bit floating point numbers) elements are unordered or equal,
4131/// otherwise set all bits to 0.
4132///
4133#[inline]
4134#[target_feature(enable = "msa")]
4135#[cfg_attr(test, assert_instr(fcueq.w))]
4136#[unstable(feature = "stdarch_mips", issue = "111198")]
4137pub unsafe fn __msa_fcueq_w(a: v4f32, b: v4f32) -> v4i32 {
4138    msa_fcueq_w(a, mem::transmute(b))
4139}
4140
4141/// Vector Floating-Point Quiet Compare Unordered or Equal
4142///
4143/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4144/// elements if the corresponding `a` (two 64-bit floating point numbers) and
4145/// `b` (two 64-bit floating point numbers) elements are unordered or equal,
4146/// otherwise set all bits to 0.
4147///
4148#[inline]
4149#[target_feature(enable = "msa")]
4150#[cfg_attr(test, assert_instr(fcueq.d))]
4151#[unstable(feature = "stdarch_mips", issue = "111198")]
4152pub unsafe fn __msa_fcueq_d(a: v2f64, b: v2f64) -> v2i64 {
4153    msa_fcueq_d(a, mem::transmute(b))
4154}
4155
4156/// Vector Floating-Point Quiet Compare Unordered or Less or Equal
4157///
4158/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4159/// elements if the corresponding elements in `a` (four 32-bit floating point numbers)
4160/// are unordered or less than or equal to `b` (four 32-bit floating point numbers) elements,
4161/// otherwise set all bits to 0.
4162///
4163#[inline]
4164#[target_feature(enable = "msa")]
4165#[cfg_attr(test, assert_instr(fcule.w))]
4166#[unstable(feature = "stdarch_mips", issue = "111198")]
4167pub unsafe fn __msa_fcule_w(a: v4f32, b: v4f32) -> v4i32 {
4168    msa_fcule_w(a, mem::transmute(b))
4169}
4170
4171/// Vector Floating-Point Quiet Compare Unordered or Less or Equal
4172///
4173/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4174/// elements if the corresponding elements in `a` (two 64-bit floating point numbers)
4175/// are unordered or less than or equal to `b` (two 64-bit floating point numbers) elements,
4176/// otherwise set all bits to 0.
4177///
4178#[inline]
4179#[target_feature(enable = "msa")]
4180#[cfg_attr(test, assert_instr(fcule.d))]
4181#[unstable(feature = "stdarch_mips", issue = "111198")]
4182pub unsafe fn __msa_fcule_d(a: v2f64, b: v2f64) -> v2i64 {
4183    msa_fcule_d(a, mem::transmute(b))
4184}
4185
4186/// Vector Floating-Point Quiet Compare Unordered or Less Than
4187///
4188/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4189/// elements if the corresponding elements in `a` (four 32-bit floating point numbers)
4190/// are unordered or less than `b` (four 32-bit floating point numbers) elements,
4191/// otherwise set all bits to 0.
4192///
4193#[inline]
4194#[target_feature(enable = "msa")]
4195#[cfg_attr(test, assert_instr(fcult.w))]
4196#[unstable(feature = "stdarch_mips", issue = "111198")]
4197pub unsafe fn __msa_fcult_w(a: v4f32, b: v4f32) -> v4i32 {
4198    msa_fcult_w(a, mem::transmute(b))
4199}
4200
4201/// Vector Floating-Point Quiet Compare Unordered or Less Than
4202///
4203/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4204/// elements if the corresponding elements in `a` (two 64-bit floating point numbers)
4205/// are unordered or less than `b` (two 64-bit floating point numbers) elements,
4206/// otherwise set all bits to 0.
4207///
4208#[inline]
4209#[target_feature(enable = "msa")]
4210#[cfg_attr(test, assert_instr(fcult.d))]
4211#[unstable(feature = "stdarch_mips", issue = "111198")]
4212pub unsafe fn __msa_fcult_d(a: v2f64, b: v2f64) -> v2i64 {
4213    msa_fcult_d(a, mem::transmute(b))
4214}
4215
4216/// Vector Floating-Point Quiet Compare Unordered
4217///
4218/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4219/// elements if the corresponding `a` (four 32-bit floating point numbers)
4220/// and `b` (four 32-bit floating point numbers) elements are unordered,
4221/// i.e. at least one element is a NaN value, otherwise set all bits to 0.
4222///
4223#[inline]
4224#[target_feature(enable = "msa")]
4225#[cfg_attr(test, assert_instr(fcun.w))]
4226#[unstable(feature = "stdarch_mips", issue = "111198")]
4227pub unsafe fn __msa_fcun_w(a: v4f32, b: v4f32) -> v4i32 {
4228    msa_fcun_w(a, mem::transmute(b))
4229}
4230
4231/// Vector Floating-Point Quiet Compare Unordered
4232///
4233/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4234/// elements if the corresponding `a` (two 64-bit floating point numbers)
4235/// and `b` (two 64-bit floating point numbers) elements are unordered,
4236/// i.e. at least one element is a NaN value, otherwise set all bits to 0.
4237///
4238#[inline]
4239#[target_feature(enable = "msa")]
4240#[cfg_attr(test, assert_instr(fcun.d))]
4241#[unstable(feature = "stdarch_mips", issue = "111198")]
4242pub unsafe fn __msa_fcun_d(a: v2f64, b: v2f64) -> v2i64 {
4243    msa_fcun_d(a, mem::transmute(b))
4244}
4245
4246/// Vector Floating-Point Quiet Compare Unordered or Not Equal
4247///
4248/// Set all bits to 1 in vector (four signed 32-bit integer numbers)
4249/// elements if the corresponding `a` (four 32-bit floating point numbers)
4250/// and `b` (four 32-bit floating point numbers) elements are unordered or not equal,
4251/// otherwise set all bits to 0.
4252///
4253#[inline]
4254#[target_feature(enable = "msa")]
4255#[cfg_attr(test, assert_instr(fcune.w))]
4256#[unstable(feature = "stdarch_mips", issue = "111198")]
4257pub unsafe fn __msa_fcune_w(a: v4f32, b: v4f32) -> v4i32 {
4258    msa_fcune_w(a, mem::transmute(b))
4259}
4260
4261/// Vector Floating-Point Quiet Compare Unordered or Not Equal
4262///
4263/// Set all bits to 1 in vector (two signed 64-bit integer numbers)
4264/// elements if the corresponding `a` (two 64-bit floating point numbers)
4265/// and `b` (two 64-bit floating point numbers) elements are unordered or not equal,
4266/// otherwise set all bits to 0.
4267///
4268#[inline]
4269#[target_feature(enable = "msa")]
4270#[cfg_attr(test, assert_instr(fcune.d))]
4271#[unstable(feature = "stdarch_mips", issue = "111198")]
4272pub unsafe fn __msa_fcune_d(a: v2f64, b: v2f64) -> v2i64 {
4273    msa_fcune_d(a, mem::transmute(b))
4274}
4275
4276/// Vector Floating-Point Division
4277///
4278/// The floating-point elements in vector `a` (four 32-bit floating point numbers)
4279/// are divided by the floating-point elements in vector `b` (four 32-bit floating point numbers).
4280/// The result is written to vector (four 32-bit floating point numbers).
4281///
4282#[inline]
4283#[target_feature(enable = "msa")]
4284#[cfg_attr(test, assert_instr(fdiv.w))]
4285#[unstable(feature = "stdarch_mips", issue = "111198")]
4286pub unsafe fn __msa_fdiv_w(a: v4f32, b: v4f32) -> v4f32 {
4287    msa_fdiv_w(a, mem::transmute(b))
4288}
4289
4290/// Vector Floating-Point Division
4291///
4292/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
4293/// are divided by the floating-point elements in vector `b` (two 64-bit floating point numbers).
4294/// The result is written to vector (two 64-bit floating point numbers).
4295///
4296#[inline]
4297#[target_feature(enable = "msa")]
4298#[cfg_attr(test, assert_instr(fdiv.d))]
4299#[unstable(feature = "stdarch_mips", issue = "111198")]
4300pub unsafe fn __msa_fdiv_d(a: v2f64, b: v2f64) -> v2f64 {
4301    msa_fdiv_d(a, mem::transmute(b))
4302}
4303
4304/* FIXME: 16-bit float
4305/// Vector Floating-Point Down-Convert Interchange Format
4306///
4307/// The floating-point elements in vector `a` (four 64-bit floating point numbers)
4308/// and vector `b` (four 64-bit floating point numbers) are down-converted
4309/// to a smaller interchange format, i.e. from 64-bit to 32-bit, or from 32-bit to 16-bit.
4310/// The result is written to vector (8 16-bit floating point numbers).
4311///
4312#[inline]
4313#[target_feature(enable = "msa")]
4314#[cfg_attr(test, assert_instr(fexdo.h))]
4315    #[unstable(feature = "stdarch_mips", issue = "111198")] pub unsafe fn __msa_fexdo_h(a: v4f32, b: v4f32) -> f16x8 {
4316    msa_fexdo_h(a, mem::transmute(b))
4317}*/
4318
4319/// Vector Floating-Point Down-Convert Interchange Format
4320///
4321/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
4322/// and vector `b` (two 64-bit floating point numbers) are down-converted
4323/// to a smaller interchange format, i.e. from 64-bit to 32-bit, or from 32-bit to 16-bit.
4324/// The result is written to vector (four 32-bit floating point numbers).
4325///
4326#[inline]
4327#[target_feature(enable = "msa")]
4328#[cfg_attr(test, assert_instr(fexdo.w))]
4329#[unstable(feature = "stdarch_mips", issue = "111198")]
4330pub unsafe fn __msa_fexdo_w(a: v2f64, b: v2f64) -> v4f32 {
4331    msa_fexdo_w(a, mem::transmute(b))
4332}
4333
4334/// Vector Floating-Point Down-Convert Interchange Format
4335///
4336/// The floating-point elements in vector `a` (four 32-bit floating point numbers)
4337/// are scaled, i.e. multiplied, by 2 to the power of integer elements in vector `b`
4338/// (four signed 32-bit integer numbers).
4339/// The result is written to vector (four 32-bit floating point numbers).
4340///
4341#[inline]
4342#[target_feature(enable = "msa")]
4343#[cfg_attr(test, assert_instr(fexp2.w))]
4344#[unstable(feature = "stdarch_mips", issue = "111198")]
4345pub unsafe fn __msa_fexp2_w(a: v4f32, b: v4i32) -> v4f32 {
4346    msa_fexp2_w(a, mem::transmute(b))
4347}
4348
4349/// Vector Floating-Point Down-Convert Interchange Format
4350///
4351/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
4352/// are scaled, i.e. multiplied, by 2 to the power of integer elements in vector `b`
4353/// (two signed 64-bit integer numbers).
4354/// The result is written to vector (two 64-bit floating point numbers).
4355///
4356#[inline]
4357#[target_feature(enable = "msa")]
4358#[cfg_attr(test, assert_instr(fexp2.d))]
4359#[unstable(feature = "stdarch_mips", issue = "111198")]
4360pub unsafe fn __msa_fexp2_d(a: v2f64, b: v2i64) -> v2f64 {
4361    msa_fexp2_d(a, mem::transmute(b))
4362}
4363
4364/* FIXME: 16-bit float
4365/// Vector Floating-Point Up-Convert Interchange Format Left
4366///
4367/// The left half floating-point elements in vector `a` (two 16-bit floating point numbers)
4368/// are up-converted to a larger interchange format,
4369/// i.e. from 16-bit to 32-bit, or from 32-bit to 64-bit.
4370/// The result is written to vector (four 32-bit floating point numbers).
4371///
4372#[inline]
4373#[target_feature(enable = "msa")]
4374#[cfg_attr(test, assert_instr(fexupl.w))]
4375    #[unstable(feature = "stdarch_mips", issue = "111198")] pub unsafe fn __msa_fexupl_w(a: f16x8) -> v4f32 {
4376    msa_fexupl_w(a)
4377}*/
4378
4379/// Vector Floating-Point Up-Convert Interchange Format Left
4380///
4381/// The left half floating-point elements in vector `a` (four 32-bit floating point numbers)
4382/// are up-converted to a larger interchange format,
4383/// i.e. from 16-bit to 32-bit, or from 32-bit to 64-bit.
4384/// The result is written to vector (two 64-bit floating point numbers).
4385///
4386#[inline]
4387#[target_feature(enable = "msa")]
4388#[cfg_attr(test, assert_instr(fexupl.d))]
4389#[unstable(feature = "stdarch_mips", issue = "111198")]
4390pub unsafe fn __msa_fexupl_d(a: v4f32) -> v2f64 {
4391    msa_fexupl_d(a)
4392}
4393
4394/* FIXME: 16-bit float
4395/// Vector Floating-Point Up-Convert Interchange Format Left
4396///
4397/// The right half floating-point elements in vector `a` (two 16-bit floating point numbers)
4398/// are up-converted to a larger interchange format,
4399/// i.e. from 16-bit to 32-bit, or from 32-bit to 64-bit.
4400/// The result is written to vector (four 32-bit floating point numbers).
4401///
4402#[inline]
4403#[target_feature(enable = "msa")]
4404#[cfg_attr(test, assert_instr(fexupr.w))]
4405    #[unstable(feature = "stdarch_mips", issue = "111198")] pub unsafe fn __msa_fexupr_w(a: f16x8) -> v4f32 {
4406    msa_fexupr_w(a)
4407} */
4408
4409/// Vector Floating-Point Up-Convert Interchange Format Left
4410///
4411/// The right half floating-point elements in vector `a` (four 32-bit floating point numbers)
4412/// are up-converted to a larger interchange format,
4413/// i.e. from 16-bit to 32-bit, or from 32-bit to 64-bit.
4414/// The result is written to vector (two 64-bit floating point numbers).
4415///
4416#[inline]
4417#[target_feature(enable = "msa")]
4418#[cfg_attr(test, assert_instr(fexupr.d))]
4419#[unstable(feature = "stdarch_mips", issue = "111198")]
4420pub unsafe fn __msa_fexupr_d(a: v4f32) -> v2f64 {
4421    msa_fexupr_d(a)
4422}
4423
4424/// Vector Floating-Point Round and Convert from Signed Integer
4425///
4426/// The signed integer elements in vector `a` (four signed 32-bit integer numbers)
4427/// are converted to floating-point values.
4428/// The result is written to vector (four 32-bit floating point numbers).
4429///
4430#[inline]
4431#[target_feature(enable = "msa")]
4432#[cfg_attr(test, assert_instr(ffint_s.w))]
4433#[unstable(feature = "stdarch_mips", issue = "111198")]
4434pub unsafe fn __msa_ffint_s_w(a: v4i32) -> v4f32 {
4435    msa_ffint_s_w(a)
4436}
4437
4438/// Vector Floating-Point Round and Convert from Signed Integer
4439///
4440/// The signed integer elements in vector `a` (two signed 64-bit integer numbers)
4441/// are converted to floating-point values.
4442/// The result is written to vector (two 64-bit floating point numbers).
4443///
4444#[inline]
4445#[target_feature(enable = "msa")]
4446#[cfg_attr(test, assert_instr(ffint_s.d))]
4447#[unstable(feature = "stdarch_mips", issue = "111198")]
4448pub unsafe fn __msa_ffint_s_d(a: v2i64) -> v2f64 {
4449    msa_ffint_s_d(a)
4450}
4451
4452/// Vector Floating-Point Round and Convert from Unsigned Integer
4453///
4454/// The unsigned integer elements in vector `a` (four unsigned 32-bit integer numbers)
4455/// are converted to floating-point values.
4456/// The result is written to vector (four 32-bit floating point numbers).
4457///
4458#[inline]
4459#[target_feature(enable = "msa")]
4460#[cfg_attr(test, assert_instr(ffint_u.w))]
4461#[unstable(feature = "stdarch_mips", issue = "111198")]
4462pub unsafe fn __msa_ffint_u_w(a: v4u32) -> v4f32 {
4463    msa_ffint_u_w(a)
4464}
4465
4466/// Vector Floating-Point Round and Convert from Unsigned Integer
4467///
4468/// The unsigned integer elements in vector `a` (two unsigned 64-bit integer numbers)
4469/// are converted to floating-point values.
4470/// The result is written to vector (two 64-bit floating point numbers).
4471///
4472#[inline]
4473#[target_feature(enable = "msa")]
4474#[cfg_attr(test, assert_instr(ffint_u.d))]
4475#[unstable(feature = "stdarch_mips", issue = "111198")]
4476pub unsafe fn __msa_ffint_u_d(a: v2u64) -> v2f64 {
4477    msa_ffint_u_d(a)
4478}
4479
4480/// Vector Floating-Point Convert from Fixed-Point Left
4481///
4482/// The left half fixed-point elements in vector `a` (eight signed 16-bit integer numbers)
4483/// are up-converted to floating-point data format.
4484/// i.e. from 16-bit Q15 to 32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point.
4485/// The result is written to vector (four 32-bit floating point numbers).
4486///
4487#[inline]
4488#[target_feature(enable = "msa")]
4489#[cfg_attr(test, assert_instr(ffql.w))]
4490#[unstable(feature = "stdarch_mips", issue = "111198")]
4491pub unsafe fn __msa_ffql_w(a: v8i16) -> v4f32 {
4492    msa_ffql_w(a)
4493}
4494
4495/// Vector Floating-Point Convert from Fixed-Point Left
4496///
4497/// The left half fixed-point elements in vector `a` (four signed 32-bit integer numbers)
4498/// are up-converted to floating-point data format.
4499/// i.e. from 16-bit Q15 to 32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point.
4500/// The result is written to vector (two 64-bit floating point numbers).
4501///
4502#[inline]
4503#[target_feature(enable = "msa")]
4504#[cfg_attr(test, assert_instr(ffql.d))]
4505#[unstable(feature = "stdarch_mips", issue = "111198")]
4506pub unsafe fn __msa_ffql_d(a: v4i32) -> v2f64 {
4507    msa_ffql_d(a)
4508}
4509
4510/// Vector Floating-Point Convert from Fixed-Point Left
4511///
4512/// The right half fixed-point elements in vector `a` (eight signed 16-bit integer numbers)
4513/// are up-converted to floating-point data format.
4514/// i.e. from 16-bit Q15 to 32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point.
4515/// The result is written to vector (four 32-bit floating point numbers).
4516///
4517#[inline]
4518#[target_feature(enable = "msa")]
4519#[cfg_attr(test, assert_instr(ffqr.w))]
4520#[unstable(feature = "stdarch_mips", issue = "111198")]
4521pub unsafe fn __msa_ffqr_w(a: v8i16) -> v4f32 {
4522    msa_ffqr_w(a)
4523}
4524
4525/// Vector Floating-Point Convert from Fixed-Point Left
4526///
4527/// The right half fixed-point elements in vector `a` (four signed 32-bit integer numbers)
4528/// are up-converted to floating-point data format.
4529/// i.e. from 16-bit Q15 to 32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point.
4530/// The result is written to vector (two 64-bit floating point numbers).
4531///
4532#[inline]
4533#[target_feature(enable = "msa")]
4534#[cfg_attr(test, assert_instr(ffqr.d))]
4535#[unstable(feature = "stdarch_mips", issue = "111198")]
4536pub unsafe fn __msa_ffqr_d(a: v4i32) -> v2f64 {
4537    msa_ffqr_d(a)
4538}
4539
4540/// Vector Fill from GPR
4541///
4542/// Replicate GPR rs value to all elements in vector (sixteen signed 8-bit integer numbers).
4543/// If the source GPR is wider than the destination data format, the destination's elements
4544/// will be set to the least significant bits of the GPR.
4545///
4546#[inline]
4547#[target_feature(enable = "msa")]
4548#[cfg_attr(test, assert_instr(fill.b))]
4549#[unstable(feature = "stdarch_mips", issue = "111198")]
4550pub unsafe fn __msa_fill_b(a: i32) -> v16i8 {
4551    msa_fill_b(a)
4552}
4553
4554/// Vector Fill from GPR
4555///
4556/// Replicate GPR rs value to all elements in vector (eight signed 16-bit integer numbers).
4557/// If the source GPR is wider than the destination data format, the destination's elements
4558/// will be set to the least significant bits of the GPR.
4559///
4560#[inline]
4561#[target_feature(enable = "msa")]
4562#[cfg_attr(test, assert_instr(fill.h))]
4563#[unstable(feature = "stdarch_mips", issue = "111198")]
4564pub unsafe fn __msa_fill_h(a: i32) -> v8i16 {
4565    msa_fill_h(a)
4566}
4567
4568/// Vector Fill from GPR
4569///
4570/// Replicate GPR rs value to all elements in vector (four signed 32-bit integer numbers).
4571/// If the source GPR is wider than the destination data format, the destination's elements
4572/// will be set to the least significant bits of the GPR.
4573///
4574#[inline]
4575#[target_feature(enable = "msa")]
4576#[cfg_attr(test, assert_instr(fill.w))]
4577#[unstable(feature = "stdarch_mips", issue = "111198")]
4578pub unsafe fn __msa_fill_w(a: i32) -> v4i32 {
4579    msa_fill_w(a)
4580}
4581
4582/// Vector Fill from GPR
4583///
4584/// Replicate GPR rs value to all elements in vector (two signed 64-bit integer numbers).
4585/// If the source GPR is wider than the destination data format, the destination's elements
4586/// will be set to the least significant bits of the GPR.
4587///
4588#[inline]
4589#[target_feature(enable = "msa")]
4590#[cfg_attr(test, assert_instr(fill.d))]
4591#[unstable(feature = "stdarch_mips", issue = "111198")]
4592pub unsafe fn __msa_fill_d(a: i64) -> v2i64 {
4593    msa_fill_d(a)
4594}
4595
4596/// Vector Floating-Point Base 2 Logarithm
4597///
4598/// The signed integral base 2 exponents of floating-point elements in vector `a`
4599/// (four 32-bit floating point numbers) are written as floating-point values to vector elements
4600/// (four 32-bit floating point numbers).
4601///
4602#[inline]
4603#[target_feature(enable = "msa")]
4604#[cfg_attr(test, assert_instr(flog2.w))]
4605#[unstable(feature = "stdarch_mips", issue = "111198")]
4606pub unsafe fn __msa_flog2_w(a: v4f32) -> v4f32 {
4607    msa_flog2_w(a)
4608}
4609
4610/// Vector Floating-Point Base 2 Logarithm
4611///
4612/// The signed integral base 2 exponents of floating-point elements in vector `a`
4613/// (two 64-bit floating point numbers) are written as floating-point values to vector elements
4614/// (two 64-bit floating point numbers).
4615///
4616#[inline]
4617#[target_feature(enable = "msa")]
4618#[cfg_attr(test, assert_instr(flog2.d))]
4619#[unstable(feature = "stdarch_mips", issue = "111198")]
4620pub unsafe fn __msa_flog2_d(a: v2f64) -> v2f64 {
4621    msa_flog2_d(a)
4622}
4623
4624/// Vector Floating-Point Multiply-Add
4625///
4626/// The floating-point elements in vector `b` (four 32-bit floating point numbers)
4627/// multiplied by floating-point elements in vector `c` (four 32-bit floating point numbers)
4628/// are added to the floating-point elements in vector `a` (four 32-bit floating point numbers).
4629///
4630#[inline]
4631#[target_feature(enable = "msa")]
4632#[cfg_attr(test, assert_instr(fmadd.w))]
4633#[unstable(feature = "stdarch_mips", issue = "111198")]
4634pub unsafe fn __msa_fmadd_w(a: v4f32, b: v4f32, c: v4f32) -> v4f32 {
4635    msa_fmadd_w(a, mem::transmute(b), c)
4636}
4637
4638/// Vector Floating-Point Multiply-Add
4639///
4640/// The floating-point elements in vector `b` (two 64-bit floating point numbers)
4641/// multiplied by floating-point elements in vector `c` (two 64-bit floating point numbers)
4642/// are added to the floating-point elements in vector `a` (two 64-bit floating point numbers).
4643///
4644#[inline]
4645#[target_feature(enable = "msa")]
4646#[cfg_attr(test, assert_instr(fmadd.d))]
4647#[unstable(feature = "stdarch_mips", issue = "111198")]
4648pub unsafe fn __msa_fmadd_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 {
4649    msa_fmadd_d(a, mem::transmute(b), c)
4650}
4651
4652/// Vector Floating-Point Maximum
4653///
4654/// The largest values between corresponding floating-point elements in vector `a`
4655/// (four 32-bit floating point numbers) and vector `b` (four 32-bit floating point numbers)
4656/// are written to vector (four 32-bit floating point numbers).
4657///
4658#[inline]
4659#[target_feature(enable = "msa")]
4660#[cfg_attr(test, assert_instr(fmax.w))]
4661#[unstable(feature = "stdarch_mips", issue = "111198")]
4662pub unsafe fn __msa_fmax_w(a: v4f32, b: v4f32) -> v4f32 {
4663    msa_fmax_w(a, mem::transmute(b))
4664}
4665
4666/// Vector Floating-Point Maximum
4667///
4668/// The largest values between corresponding floating-point elements in vector `a`
4669/// (two 64-bit floating point numbers) and vector `b` (two 64-bit floating point numbers)
4670/// are written to vector (two 64-bit floating point numbers).
4671///
4672#[inline]
4673#[target_feature(enable = "msa")]
4674#[cfg_attr(test, assert_instr(fmax.d))]
4675#[unstable(feature = "stdarch_mips", issue = "111198")]
4676pub unsafe fn __msa_fmax_d(a: v2f64, b: v2f64) -> v2f64 {
4677    msa_fmax_d(a, mem::transmute(b))
4678}
4679
4680/// Vector Floating-Point Maximum Based on Absolute Values
4681///
4682/// The value with the largest magnitude, i.e. absolute value, between corresponding
4683/// floating-point elements in vector `a` (four 32-bit floating point numbers)
4684/// and vector `b` (four 32-bit floating point numbers)
4685/// are written to vector (four 32-bit floating point numbers).
4686///
4687#[inline]
4688#[target_feature(enable = "msa")]
4689#[cfg_attr(test, assert_instr(fmax_a.w))]
4690#[unstable(feature = "stdarch_mips", issue = "111198")]
4691pub unsafe fn __msa_fmax_a_w(a: v4f32, b: v4f32) -> v4f32 {
4692    msa_fmax_a_w(a, mem::transmute(b))
4693}
4694
4695/// Vector Floating-Point Maximum Based on Absolute Values
4696///
4697/// The value with the largest magnitude, i.e. absolute value, between corresponding
4698/// floating-point elements in vector `a` (two 64-bit floating point numbers)
4699/// and vector `b` (two 64-bit floating point numbers)
4700/// are written to vector (two 64-bit floating point numbers).
4701///
4702#[inline]
4703#[target_feature(enable = "msa")]
4704#[cfg_attr(test, assert_instr(fmax_a.d))]
4705#[unstable(feature = "stdarch_mips", issue = "111198")]
4706pub unsafe fn __msa_fmax_a_d(a: v2f64, b: v2f64) -> v2f64 {
4707    msa_fmax_a_d(a, mem::transmute(b))
4708}
4709
4710/// Vector Floating-Point Minimum
4711///
4712/// The smallest values between corresponding floating-point elements in vector `a`
4713/// (four 32-bit floating point numbers) and vector `b` (four 32-bit floating point numbers)
4714/// are written to vector (four 32-bit floating point numbers).
4715///
4716#[inline]
4717#[target_feature(enable = "msa")]
4718#[cfg_attr(test, assert_instr(fmin.w))]
4719#[unstable(feature = "stdarch_mips", issue = "111198")]
4720pub unsafe fn __msa_fmin_w(a: v4f32, b: v4f32) -> v4f32 {
4721    msa_fmin_w(a, mem::transmute(b))
4722}
4723
4724/// Vector Floating-Point Minimum
4725///
4726/// The smallest values between corresponding floating-point elements in vector `a`
4727/// (two 64-bit floating point numbers) and vector `b` (two 64-bit floating point numbers)
4728/// are written to vector (two 64-bit floating point numbers).
4729///
4730#[inline]
4731#[target_feature(enable = "msa")]
4732#[cfg_attr(test, assert_instr(fmin.d))]
4733#[unstable(feature = "stdarch_mips", issue = "111198")]
4734pub unsafe fn __msa_fmin_d(a: v2f64, b: v2f64) -> v2f64 {
4735    msa_fmin_d(a, mem::transmute(b))
4736}
4737
4738/// Vector Floating-Point Minimum Based on Absolute Values
4739///
4740/// The value with the smallest magnitude, i.e. absolute value, between corresponding
4741/// floating-point elements in vector `a` (four 32-bit floating point numbers)
4742/// and vector `b` (four 32-bit floating point numbers)
4743/// are written to vector (four 32-bit floating point numbers).
4744///
4745#[inline]
4746#[target_feature(enable = "msa")]
4747#[cfg_attr(test, assert_instr(fmin_a.w))]
4748#[unstable(feature = "stdarch_mips", issue = "111198")]
4749pub unsafe fn __msa_fmin_a_w(a: v4f32, b: v4f32) -> v4f32 {
4750    msa_fmin_a_w(a, mem::transmute(b))
4751}
4752
4753/// Vector Floating-Point Minimum Based on Absolute Values
4754///
4755/// The value with the smallest magnitude, i.e. absolute value, between corresponding
4756/// floating-point elements in vector `a` (two 64-bit floating point numbers)
4757/// and vector `b` (two 64-bit floating point numbers)
4758/// are written to vector (two 64-bit floating point numbers).
4759///
4760#[inline]
4761#[target_feature(enable = "msa")]
4762#[cfg_attr(test, assert_instr(fmin_a.d))]
4763#[unstable(feature = "stdarch_mips", issue = "111198")]
4764pub unsafe fn __msa_fmin_a_d(a: v2f64, b: v2f64) -> v2f64 {
4765    msa_fmin_a_d(a, mem::transmute(b))
4766}
4767
4768/// Vector Floating-Point Multiply-Sub
4769///
4770/// The floating-point elements in vector `b` (four 32-bit floating point numbers)
4771/// multiplied by floating-point elements in vector `c` (four 32-bit floating point numbers)
4772/// are subtracted from the floating-point elements in vector `a` (four 32-bit floating point numbers).
4773///
4774#[inline]
4775#[target_feature(enable = "msa")]
4776#[cfg_attr(test, assert_instr(fmsub.w))]
4777#[unstable(feature = "stdarch_mips", issue = "111198")]
4778pub unsafe fn __msa_fmsub_w(a: v4f32, b: v4f32, c: v4f32) -> v4f32 {
4779    msa_fmsub_w(a, mem::transmute(b), c)
4780}
4781
4782/// Vector Floating-Point Multiply-Sub
4783///
4784/// The floating-point elements in vector `b` (two 64-bit floating point numbers)
4785/// multiplied by floating-point elements in vector `c` (two 64-bit floating point numbers)
4786/// are subtracted from the floating-point elements in vector `a` (two 64-bit floating point numbers).
4787///
4788#[inline]
4789#[target_feature(enable = "msa")]
4790#[cfg_attr(test, assert_instr(fmsub.d))]
4791#[unstable(feature = "stdarch_mips", issue = "111198")]
4792pub unsafe fn __msa_fmsub_d(a: v2f64, b: v2f64, c: v2f64) -> v2f64 {
4793    msa_fmsub_d(a, mem::transmute(b), c)
4794}
4795
4796/// Vector Floating-Point Multiplication
4797///
4798/// The floating-point elements in vector `a` (four 32-bit floating point numbers) are
4799/// multiplied by floating-point elements in vector `b` (four 32-bit floating point numbers).
4800///
4801#[inline]
4802#[target_feature(enable = "msa")]
4803#[cfg_attr(test, assert_instr(fmul.w))]
4804#[unstable(feature = "stdarch_mips", issue = "111198")]
4805pub unsafe fn __msa_fmul_w(a: v4f32, b: v4f32) -> v4f32 {
4806    msa_fmul_w(a, mem::transmute(b))
4807}
4808
4809/// Vector Floating-Point Multiplication
4810///
4811/// The floating-point elements in vector `a` (two 64-bit floating point numbers) are
4812/// multiplied by floating-point elements in vector `b` (two 64-bit floating point numbers).
4813///
4814#[inline]
4815#[target_feature(enable = "msa")]
4816#[cfg_attr(test, assert_instr(fmul.d))]
4817#[unstable(feature = "stdarch_mips", issue = "111198")]
4818pub unsafe fn __msa_fmul_d(a: v2f64, b: v2f64) -> v2f64 {
4819    msa_fmul_d(a, mem::transmute(b))
4820}
4821
4822/// Vector Floating-Point Round to Integer
4823///
4824/// The floating-point elements in vector `a` (four 32-bit floating point numbers)
4825/// are rounded to an integral valued floating-point number in the same format based
4826/// on the rounding mode bits RM in MSA Control and Status Register MSACSR.
4827///
4828#[inline]
4829#[target_feature(enable = "msa")]
4830#[cfg_attr(test, assert_instr(frint.w))]
4831#[unstable(feature = "stdarch_mips", issue = "111198")]
4832pub unsafe fn __msa_frint_w(a: v4f32) -> v4f32 {
4833    msa_frint_w(a)
4834}
4835
4836/// Vector Floating-Point Round to Integer
4837///
4838/// The floating-point elements in vector `a` (two 64-bit floating point numbers)
4839/// are rounded to an integral valued floating-point number in the same format based
4840/// on the rounding mode bits RM in MSA Control and Status Register MSACSR.
4841///
4842#[inline]
4843#[target_feature(enable = "msa")]
4844#[cfg_attr(test, assert_instr(frint.d))]
4845#[unstable(feature = "stdarch_mips", issue = "111198")]
4846pub unsafe fn __msa_frint_d(a: v2f64) -> v2f64 {
4847    msa_frint_d(a)
4848}
4849
4850/// Vector Approximate Floating-Point Reciprocal
4851///
4852/// The reciprocals of floating-point elements in vector `a` (four 32-bit floating point numbers)
4853/// are calculated and the result is written to vector (four 32-bit floating point numbers).
4854///
4855#[inline]
4856#[target_feature(enable = "msa")]
4857#[cfg_attr(test, assert_instr(frcp.w))]
4858#[unstable(feature = "stdarch_mips", issue = "111198")]
4859pub unsafe fn __msa_frcp_w(a: v4f32) -> v4f32 {
4860    msa_frcp_w(a)
4861}
4862
4863/// Vector Approximate Floating-Point Reciprocal
4864///
4865/// The reciprocals of floating-point elements in vector `a` (two 64-bit floating point numbers)
4866/// are calculated and the result is written to vector (two 64-bit floating point numbers).
4867///
4868#[inline]
4869#[target_feature(enable = "msa")]
4870#[cfg_attr(test, assert_instr(frcp.d))]
4871#[unstable(feature = "stdarch_mips", issue = "111198")]
4872pub unsafe fn __msa_frcp_d(a: v2f64) -> v2f64 {
4873    msa_frcp_d(a)
4874}
4875
4876/// Vector Approximate Floating-Point Reciprocal of Square Root
4877///
4878/// The reciprocals of the square roots of floating-point elements in vector `a` (four 32-bit floating point numbers)
4879/// are calculated and the result is written to vector (four 32-bit floating point numbers).
4880///
4881#[inline]
4882#[target_feature(enable = "msa")]
4883#[cfg_attr(test, assert_instr(frsqrt.w))]
4884#[unstable(feature = "stdarch_mips", issue = "111198")]
4885pub unsafe fn __msa_frsqrt_w(a: v4f32) -> v4f32 {
4886    msa_frsqrt_w(a)
4887}
4888
4889/// Vector Approximate Floating-Point Reciprocal of Square Root
4890///
4891/// The reciprocals of the square roots of floating-point elements in vector `a` (two 64-bit floating point numbers)
4892/// are calculated and the result is written to vector (two 64-bit floating point numbers).
4893///
4894#[inline]
4895#[target_feature(enable = "msa")]
4896#[cfg_attr(test, assert_instr(frsqrt.d))]
4897#[unstable(feature = "stdarch_mips", issue = "111198")]
4898pub unsafe fn __msa_frsqrt_d(a: v2f64) -> v2f64 {
4899    msa_frsqrt_d(a)
4900}
4901
4902/// Vector Floating-Point Signaling Compare Always False
4903///
4904/// Set all bits to 0 in vector (four signed 32-bit integer numbers) elements.
4905/// Signaling and quiet NaN elements in vector `a` (four 32-bit floating point numbers)
4906/// or `b` (four 32-bit floating point numbers) signal Invalid Operation exception.
4907/// In case of a floating-point exception, the default result has all bits set to 0.
4908///
4909#[inline]
4910#[target_feature(enable = "msa")]
4911#[cfg_attr(test, assert_instr(fsaf.w))]
4912#[unstable(feature = "stdarch_mips", issue = "111198")]
4913pub unsafe fn __msa_fsaf_w(a: v4f32, b: v4f32) -> v4i32 {
4914    msa_fsaf_w(a, mem::transmute(b))
4915}
4916
4917/// Vector Floating-Point Signaling Compare Always False
4918///
4919/// Set all bits to 0 in vector (two signed 64-bit integer numbers) elements.
4920/// Signaling and quiet NaN elements in vector `a` (two 64-bit floating point numbers)
4921/// or `b` (two 64-bit floating point numbers) signal Invalid Operation exception.
4922/// In case of a floating-point exception, the default result has all bits set to 0.
4923///
4924#[inline]
4925#[target_feature(enable = "msa")]
4926#[cfg_attr(test, assert_instr(fsaf.d))]
4927#[unstable(feature = "stdarch_mips", issue = "111198")]
4928pub unsafe fn __msa_fsaf_d(a: v2f64, b: v2f64) -> v2i64 {
4929    msa_fsaf_d(a, mem::transmute(b))
4930}
4931
4932/// Vector Floating-Point Signaling Compare Equal
4933///
4934/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
4935/// if the corresponding `a` (four 32-bit floating point numbers)
4936/// and `b` (four 32-bit floating point numbers) elements are equal, otherwise set all bits to 0.
4937///
4938#[inline]
4939#[target_feature(enable = "msa")]
4940#[cfg_attr(test, assert_instr(fseq.w))]
4941#[unstable(feature = "stdarch_mips", issue = "111198")]
4942pub unsafe fn __msa_fseq_w(a: v4f32, b: v4f32) -> v4i32 {
4943    msa_fseq_w(a, mem::transmute(b))
4944}
4945
4946/// Vector Floating-Point Signaling Compare Equal
4947///
4948/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
4949/// if the corresponding `a` (two 64-bit floating point numbers)
4950/// and `b` (two 64-bit floating point numbers) elements are equal, otherwise set all bits to 0.
4951///
4952#[inline]
4953#[target_feature(enable = "msa")]
4954#[cfg_attr(test, assert_instr(fseq.d))]
4955#[unstable(feature = "stdarch_mips", issue = "111198")]
4956pub unsafe fn __msa_fseq_d(a: v2f64, b: v2f64) -> v2i64 {
4957    msa_fseq_d(a, mem::transmute(b))
4958}
4959
4960/// Vector Floating-Point Signaling Compare Less or Equal
4961///
4962/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
4963/// if the corresponding `a` (four 32-bit floating point numbers) elements
4964/// are less than or equal to `b` (four 32-bit floating point numbers) elements, otherwise set all bits to 0.
4965///
4966#[inline]
4967#[target_feature(enable = "msa")]
4968#[cfg_attr(test, assert_instr(fsle.w))]
4969#[unstable(feature = "stdarch_mips", issue = "111198")]
4970pub unsafe fn __msa_fsle_w(a: v4f32, b: v4f32) -> v4i32 {
4971    msa_fsle_w(a, mem::transmute(b))
4972}
4973
4974/// Vector Floating-Point Signaling Compare Less or Equal
4975///
4976/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
4977/// if the corresponding `a` (two 64-bit floating point numbers) elements
4978/// are less than or equal to `b` (two 64-bit floating point numbers) elements, otherwise set all bits to 0.
4979///
4980#[inline]
4981#[target_feature(enable = "msa")]
4982#[cfg_attr(test, assert_instr(fsle.d))]
4983#[unstable(feature = "stdarch_mips", issue = "111198")]
4984pub unsafe fn __msa_fsle_d(a: v2f64, b: v2f64) -> v2i64 {
4985    msa_fsle_d(a, mem::transmute(b))
4986}
4987
4988/// Vector Floating-Point Signaling Compare Less Than
4989///
4990/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
4991/// if the corresponding `a` (four 32-bit floating point numbers) elements
4992/// are less than `b` (four 32-bit floating point numbers) elements, otherwise set all bits to 0.
4993///
4994#[inline]
4995#[target_feature(enable = "msa")]
4996#[cfg_attr(test, assert_instr(fslt.w))]
4997#[unstable(feature = "stdarch_mips", issue = "111198")]
4998pub unsafe fn __msa_fslt_w(a: v4f32, b: v4f32) -> v4i32 {
4999    msa_fslt_w(a, mem::transmute(b))
5000}
5001
5002/// Vector Floating-Point Signaling Compare Less Than
5003///
5004/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
5005/// if the corresponding `a` (two 64-bit floating point numbers) elements
5006/// are less than `b` (two 64-bit floating point numbers) elements, otherwise set all bits to 0.
5007///
5008#[inline]
5009#[target_feature(enable = "msa")]
5010#[cfg_attr(test, assert_instr(fslt.d))]
5011#[unstable(feature = "stdarch_mips", issue = "111198")]
5012pub unsafe fn __msa_fslt_d(a: v2f64, b: v2f64) -> v2i64 {
5013    msa_fslt_d(a, mem::transmute(b))
5014}
5015
5016/// Vector Floating-Point Signaling Compare Not Equal
5017///
5018/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
5019/// if the corresponding `a` (four 32-bit floating point numbers) and
5020/// `b` (four 32-bit floating point numbers) elements are not equal, otherwise set all bits to 0.
5021///
5022#[inline]
5023#[target_feature(enable = "msa")]
5024#[cfg_attr(test, assert_instr(fsne.w))]
5025#[unstable(feature = "stdarch_mips", issue = "111198")]
5026pub unsafe fn __msa_fsne_w(a: v4f32, b: v4f32) -> v4i32 {
5027    msa_fsne_w(a, mem::transmute(b))
5028}
5029
5030/// Vector Floating-Point Signaling Compare Not Equal
5031///
5032/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
5033/// if the corresponding `a` (two 64-bit floating point numbers) and
5034/// `b` (two 64-bit floating point numbers) elements are not equal, otherwise set all bits to 0.
5035///
5036#[inline]
5037#[target_feature(enable = "msa")]
5038#[cfg_attr(test, assert_instr(fsne.d))]
5039#[unstable(feature = "stdarch_mips", issue = "111198")]
5040pub unsafe fn __msa_fsne_d(a: v2f64, b: v2f64) -> v2i64 {
5041    msa_fsne_d(a, mem::transmute(b))
5042}
5043
5044/// Vector Floating-Point Signaling Compare Ordered
5045///
5046/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
5047/// if the corresponding `a` (four 32-bit floating point numbers) and
5048/// `b` (four 32-bit floating point numbers) elements are ordered,
5049/// i.e. both elements are not NaN values, otherwise set all bits to 0.
5050///
5051#[inline]
5052#[target_feature(enable = "msa")]
5053#[cfg_attr(test, assert_instr(fsor.w))]
5054#[unstable(feature = "stdarch_mips", issue = "111198")]
5055pub unsafe fn __msa_fsor_w(a: v4f32, b: v4f32) -> v4i32 {
5056    msa_fsor_w(a, mem::transmute(b))
5057}
5058
5059/// Vector Floating-Point Signaling Compare Ordered
5060///
5061/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
5062/// if the corresponding `a` (two 64-bit floating point numbers) and
5063/// `b` (two 64-bit floating point numbers) elements are ordered,
5064/// i.e. both elements are not NaN values, otherwise set all bits to 0.
5065///
5066#[inline]
5067#[target_feature(enable = "msa")]
5068#[cfg_attr(test, assert_instr(fsor.d))]
5069#[unstable(feature = "stdarch_mips", issue = "111198")]
5070pub unsafe fn __msa_fsor_d(a: v2f64, b: v2f64) -> v2i64 {
5071    msa_fsor_d(a, mem::transmute(b))
5072}
5073
5074/// Vector Floating-Point Square Root
5075///
5076/// The square roots of floating-point elements in vector `a`
5077/// (four 32-bit floating point numbers) are written to vector
5078/// (four 32-bit floating point numbers) elements are ordered,.
5079///
5080#[inline]
5081#[target_feature(enable = "msa")]
5082#[cfg_attr(test, assert_instr(fsqrt.w))]
5083#[unstable(feature = "stdarch_mips", issue = "111198")]
5084pub unsafe fn __msa_fsqrt_w(a: v4f32) -> v4f32 {
5085    msa_fsqrt_w(a)
5086}
5087
5088/// Vector Floating-Point Square Root
5089///
5090/// The square roots of floating-point elements in vector `a`
5091/// (two 64-bit floating point numbers) are written to vector
5092/// (two 64-bit floating point numbers) elements are ordered,.
5093///
5094#[inline]
5095#[target_feature(enable = "msa")]
5096#[cfg_attr(test, assert_instr(fsqrt.d))]
5097#[unstable(feature = "stdarch_mips", issue = "111198")]
5098pub unsafe fn __msa_fsqrt_d(a: v2f64) -> v2f64 {
5099    msa_fsqrt_d(a)
5100}
5101
5102/// Vector Floating-Point Subtraction
5103///
5104/// The floating-point elements in vector `b` (four 32-bit floating point numbers)
5105/// are subtracted from the floating-point elements in vector `a`
5106/// (four 32-bit floating point numbers).
5107/// The result is written to vector (four 32-bit floating point numbers).
5108///
5109#[inline]
5110#[target_feature(enable = "msa")]
5111#[cfg_attr(test, assert_instr(fsub.w))]
5112#[unstable(feature = "stdarch_mips", issue = "111198")]
5113pub unsafe fn __msa_fsub_w(a: v4f32, b: v4f32) -> v4f32 {
5114    msa_fsub_w(a, mem::transmute(b))
5115}
5116
5117/// Vector Floating-Point Subtraction
5118///
5119/// The floating-point elements in vector `b` (two 64-bit floating point numbers)
5120/// are subtracted from the floating-point elements in vector `a`
5121/// (two 64-bit floating point numbers).
5122/// The result is written to vector (two 64-bit floating point numbers).
5123///
5124#[inline]
5125#[target_feature(enable = "msa")]
5126#[cfg_attr(test, assert_instr(fsub.d))]
5127#[unstable(feature = "stdarch_mips", issue = "111198")]
5128pub unsafe fn __msa_fsub_d(a: v2f64, b: v2f64) -> v2f64 {
5129    msa_fsub_d(a, mem::transmute(b))
5130}
5131
5132/// Vector Floating-Point Signaling Compare Ordered
5133///
5134/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
5135/// if the corresponding `a` (four 32-bit floating point numbers) and
5136/// `b` (four 32-bit floating point numbers) elements are unordered or equal,
5137/// otherwise set all bits to 0.
5138///
5139#[inline]
5140#[target_feature(enable = "msa")]
5141#[cfg_attr(test, assert_instr(fsueq.w))]
5142#[unstable(feature = "stdarch_mips", issue = "111198")]
5143pub unsafe fn __msa_fsueq_w(a: v4f32, b: v4f32) -> v4i32 {
5144    msa_fsueq_w(a, mem::transmute(b))
5145}
5146
5147/// Vector Floating-Point Signaling Compare Ordered
5148///
5149/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
5150/// if the corresponding `a` (two 64-bit floating point numbers) and
5151/// `b` (two 64-bit floating point numbers) elements are unordered or equal,
5152/// otherwise set all bits to 0.
5153///
5154#[inline]
5155#[target_feature(enable = "msa")]
5156#[cfg_attr(test, assert_instr(fsueq.d))]
5157#[unstable(feature = "stdarch_mips", issue = "111198")]
5158pub unsafe fn __msa_fsueq_d(a: v2f64, b: v2f64) -> v2i64 {
5159    msa_fsueq_d(a, mem::transmute(b))
5160}
5161
5162/// Vector Floating-Point Signaling Compare Unordered or Less or Equal
5163///
5164/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
5165/// if the corresponding `a` (four 32-bit floating point numbers) elements are
5166/// unordered or less than or equal to `b` (four 32-bit floating point numbers) elements,
5167/// otherwise set all bits to 0.
5168///
5169#[inline]
5170#[target_feature(enable = "msa")]
5171#[cfg_attr(test, assert_instr(fsule.w))]
5172#[unstable(feature = "stdarch_mips", issue = "111198")]
5173pub unsafe fn __msa_fsule_w(a: v4f32, b: v4f32) -> v4i32 {
5174    msa_fsule_w(a, mem::transmute(b))
5175}
5176
5177/// Vector Floating-Point Signaling Compare Unordered or Less or Equal
5178///
5179/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
5180/// if the corresponding `a` (two 64-bit floating point numbers) elements are
5181/// unordered or less than or equal to `b` (two 64-bit floating point numbers) elements,
5182/// otherwise set all bits to 0.
5183///
5184#[inline]
5185#[target_feature(enable = "msa")]
5186#[cfg_attr(test, assert_instr(fsule.d))]
5187#[unstable(feature = "stdarch_mips", issue = "111198")]
5188pub unsafe fn __msa_fsule_d(a: v2f64, b: v2f64) -> v2i64 {
5189    msa_fsule_d(a, mem::transmute(b))
5190}
5191
5192/// Vector Floating-Point Signaling Compare Unordered or Less Than
5193///
5194/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
5195/// if the corresponding `a` (four 32-bit floating point numbers) elements
5196/// are unordered or less than `b` (four 32-bit floating point numbers) elements,
5197/// otherwise set all bits to 0.
5198///
5199#[inline]
5200#[target_feature(enable = "msa")]
5201#[cfg_attr(test, assert_instr(fsult.w))]
5202#[unstable(feature = "stdarch_mips", issue = "111198")]
5203pub unsafe fn __msa_fsult_w(a: v4f32, b: v4f32) -> v4i32 {
5204    msa_fsult_w(a, mem::transmute(b))
5205}
5206
5207/// Vector Floating-Point Signaling Compare Unordered or Less Than
5208///
5209/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
5210/// if the corresponding `a` (two 64-bit floating point numbers) elements
5211/// are unordered or less than `b` (two 64-bit floating point numbers) elements,
5212/// otherwise set all bits to 0.
5213///
5214#[inline]
5215#[target_feature(enable = "msa")]
5216#[cfg_attr(test, assert_instr(fsult.d))]
5217#[unstable(feature = "stdarch_mips", issue = "111198")]
5218pub unsafe fn __msa_fsult_d(a: v2f64, b: v2f64) -> v2i64 {
5219    msa_fsult_d(a, mem::transmute(b))
5220}
5221
5222/// Vector Floating-Point Signaling Compare Unordered
5223///
5224/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
5225/// if the corresponding `a` (four 32-bit floating point numbers) and
5226/// `b` (four 32-bit floating point numbers) elements are unordered,
5227/// i.e. at least one element is a NaN value, otherwise set all bits to 0.
5228///
5229#[inline]
5230#[target_feature(enable = "msa")]
5231#[cfg_attr(test, assert_instr(fsun.w))]
5232#[unstable(feature = "stdarch_mips", issue = "111198")]
5233pub unsafe fn __msa_fsun_w(a: v4f32, b: v4f32) -> v4i32 {
5234    msa_fsun_w(a, mem::transmute(b))
5235}
5236
5237/// Vector Floating-Point Signaling Compare Unordered
5238///
5239/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
5240/// if the corresponding `a` (two 64-bit floating point numbers) and
5241/// `b` (two 64-bit floating point numbers) elements are unordered,
5242/// i.e. at least one element is a NaN value, otherwise set all bits to 0.
5243///
5244#[inline]
5245#[target_feature(enable = "msa")]
5246#[cfg_attr(test, assert_instr(fsun.d))]
5247#[unstable(feature = "stdarch_mips", issue = "111198")]
5248pub unsafe fn __msa_fsun_d(a: v2f64, b: v2f64) -> v2i64 {
5249    msa_fsun_d(a, mem::transmute(b))
5250}
5251
5252/// Vector Floating-Point Signaling Compare Unordered or Not Equal
5253///
5254/// Set all bits to 1 in vector (four signed 32-bit integer numbers) elements
5255/// if the corresponding `a` (four 32-bit floating point numbers) and
5256/// `b` (four 32-bit floating point numbers) elements are unordered or not equal,
5257/// otherwise set all bits to 0.
5258///
5259#[inline]
5260#[target_feature(enable = "msa")]
5261#[cfg_attr(test, assert_instr(fsune.w))]
5262#[unstable(feature = "stdarch_mips", issue = "111198")]
5263pub unsafe fn __msa_fsune_w(a: v4f32, b: v4f32) -> v4i32 {
5264    msa_fsune_w(a, mem::transmute(b))
5265}
5266
5267/// Vector Floating-Point Signaling Compare Unordered or Not Equal
5268///
5269/// Set all bits to 1 in vector (two signed 64-bit integer numbers) elements
5270/// if the corresponding `a` (two 64-bit floating point numbers) and
5271/// `b` (two 64-bit floating point numbers) elements are unordered or not equal,
5272/// otherwise set all bits to 0.
5273///
5274#[inline]
5275#[target_feature(enable = "msa")]
5276#[cfg_attr(test, assert_instr(fsune.d))]
5277#[unstable(feature = "stdarch_mips", issue = "111198")]
5278pub unsafe fn __msa_fsune_d(a: v2f64, b: v2f64) -> v2i64 {
5279    msa_fsune_d(a, mem::transmute(b))
5280}
5281
5282/// Vector Floating-Point Convert to Signed Integer
5283///
5284///The elements in vector `a` (four 32-bit floating point numbers)
5285/// are rounded and converted to signed integer values based on the
5286/// rounding mode bits RM in MSA Control and Status Register MSACSR.
5287/// The result is written to vector (four signed 32-bit integer numbers).
5288///
5289#[inline]
5290#[target_feature(enable = "msa")]
5291#[cfg_attr(test, assert_instr(ftint_s.w))]
5292#[unstable(feature = "stdarch_mips", issue = "111198")]
5293pub unsafe fn __msa_ftint_s_w(a: v4f32) -> v4i32 {
5294    msa_ftint_s_w(a)
5295}
5296
5297/// Vector Floating-Point Convert to Signed Integer
5298///
5299///The elements in vector `a` (two 64-bit floating point numbers)
5300/// are rounded and converted to signed integer values based on the
5301/// rounding mode bits RM in MSA Control and Status Register MSACSR.
5302/// The result is written to vector (two signed 64-bit integer numbers).
5303///
5304#[inline]
5305#[target_feature(enable = "msa")]
5306#[cfg_attr(test, assert_instr(ftint_s.d))]
5307#[unstable(feature = "stdarch_mips", issue = "111198")]
5308pub unsafe fn __msa_ftint_s_d(a: v2f64) -> v2i64 {
5309    msa_ftint_s_d(a)
5310}
5311
5312/// Vector Floating-Point Convert to Unsigned Integer
5313///
5314/// The elements in vector `a` (four 32-bit floating point numbers)
5315/// are rounded and converted to signed integer values based on the
5316/// rounding mode bits RM in MSA Control and Status Register MSACSR.
5317/// The result is written to vector (four unsigned 32-bit integer numbers).
5318///
5319#[inline]
5320#[target_feature(enable = "msa")]
5321#[cfg_attr(test, assert_instr(ftint_u.w))]
5322#[unstable(feature = "stdarch_mips", issue = "111198")]
5323pub unsafe fn __msa_ftint_u_w(a: v4f32) -> v4u32 {
5324    msa_ftint_u_w(a)
5325}
5326
5327/// Vector Floating-Point Convert to Unsigned Integer
5328///
5329/// The elements in vector `a` (two 64-bit floating point numbers)
5330/// are rounded and converted to signed integer values based on the
5331/// rounding mode bits RM in MSA Control and Status Register MSACSR.
5332/// The result is written to vector (two unsigned 64-bit integer numbers).
5333///
5334#[inline]
5335#[target_feature(enable = "msa")]
5336#[cfg_attr(test, assert_instr(ftint_u.d))]
5337#[unstable(feature = "stdarch_mips", issue = "111198")]
5338pub unsafe fn __msa_ftint_u_d(a: v2f64) -> v2u64 {
5339    msa_ftint_u_d(a)
5340}
5341
5342/// Vector Floating-Point Convert to Fixed-Point
5343///
5344/// The elements in vector `a` (four 32-bit floating point numbers)
5345/// and `b` (four 32-bit floating point numbers) are down-converted to a fixed-point
5346/// representation, i.e. from 64-bit floating-point to 32-bit Q31 fixed-point
5347/// representation, or from 32-bit floating-point to 16-bit Q15 fixed-point representation.
5348/// The result is written to vector (eight signed 16-bit integer numbers).
5349///
5350#[inline]
5351#[target_feature(enable = "msa")]
5352#[cfg_attr(test, assert_instr(ftq.h))]
5353#[unstable(feature = "stdarch_mips", issue = "111198")]
5354pub unsafe fn __msa_ftq_h(a: v4f32, b: v4f32) -> v8i16 {
5355    msa_ftq_h(a, mem::transmute(b))
5356}
5357
5358/// Vector Floating-Point Convert to Fixed-Point
5359///
5360/// The elements in vector `a` (two 64-bit floating point numbers)
5361/// and `b` (two 64-bit floating point numbers) are down-converted to a fixed-point
5362/// representation, i.e. from 64-bit floating-point to 32-bit Q31 fixed-point
5363/// representation, or from 32-bit floating-point to 16-bit Q15 fixed-point representation.
5364/// The result is written to vector (four signed 32-bit integer numbers).
5365///
5366#[inline]
5367#[target_feature(enable = "msa")]
5368#[cfg_attr(test, assert_instr(ftq.w))]
5369#[unstable(feature = "stdarch_mips", issue = "111198")]
5370pub unsafe fn __msa_ftq_w(a: v2f64, b: v2f64) -> v4i32 {
5371    msa_ftq_w(a, mem::transmute(b))
5372}
5373
5374/// Vector Floating-Point Truncate and Convert to Signed Integer
5375///
5376/// The elements in vector `a` (four 32-bit floating point numbers)
5377/// are truncated, i.e. rounded toward zero, to signed integer values.
5378/// The result is written to vector (four signed 32-bit integer numbers).
5379///
5380#[inline]
5381#[target_feature(enable = "msa")]
5382#[cfg_attr(test, assert_instr(ftrunc_s.w))]
5383#[unstable(feature = "stdarch_mips", issue = "111198")]
5384pub unsafe fn __msa_ftrunc_s_w(a: v4f32) -> v4i32 {
5385    msa_ftrunc_s_w(a)
5386}
5387
5388/// Vector Floating-Point Truncate and Convert to Signed Integer
5389///
5390/// The elements in vector `a` (two 64-bit floating point numbers)
5391/// are truncated, i.e. rounded toward zero, to signed integer values.
5392/// The result is written to vector (two signed 64-bit integer numbers).
5393///
5394#[inline]
5395#[target_feature(enable = "msa")]
5396#[cfg_attr(test, assert_instr(ftrunc_s.d))]
5397#[unstable(feature = "stdarch_mips", issue = "111198")]
5398pub unsafe fn __msa_ftrunc_s_d(a: v2f64) -> v2i64 {
5399    msa_ftrunc_s_d(a)
5400}
5401
5402/// Vector Floating-Point Truncate and Convert to Unsigned Integer
5403///
5404/// The elements in vector `a` (four 32-bit floating point numbers)
5405/// are truncated, i.e. rounded toward zero, to unsigned integer values.
5406/// The result is written to vector (four unsigned 32-bit integer numbers).
5407///
5408#[inline]
5409#[target_feature(enable = "msa")]
5410#[cfg_attr(test, assert_instr(ftrunc_u.w))]
5411#[unstable(feature = "stdarch_mips", issue = "111198")]
5412pub unsafe fn __msa_ftrunc_u_w(a: v4f32) -> v4u32 {
5413    msa_ftrunc_u_w(a)
5414}
5415
5416/// Vector Floating-Point Truncate and Convert to Unsigned Integer
5417///
5418/// The elements in vector `a` (two 64-bit floating point numbers)
5419/// are truncated, i.e. rounded toward zero, to unsigned integer values.
5420/// The result is written to vector (two unsigned 64-bit integer numbers).
5421///
5422#[inline]
5423#[target_feature(enable = "msa")]
5424#[cfg_attr(test, assert_instr(ftrunc_u.d))]
5425#[unstable(feature = "stdarch_mips", issue = "111198")]
5426pub unsafe fn __msa_ftrunc_u_d(a: v2f64) -> v2u64 {
5427    msa_ftrunc_u_d(a)
5428}
5429
5430/// Vector Signed Horizontal Add
5431///
5432/// The sign-extended odd elements in vector `a` (sixteen signed 8-bit integer numbers)
5433/// are added to the sign-extended even elements in vector `b` (sixteen signed 8-bit integer numbers)
5434/// producing a result twice the size of the input operands.
5435/// The result is written to vector (eight signed 16-bit integer numbers).
5436///
5437#[inline]
5438#[target_feature(enable = "msa")]
5439#[cfg_attr(test, assert_instr(hadd_s.h))]
5440#[unstable(feature = "stdarch_mips", issue = "111198")]
5441pub unsafe fn __msa_hadd_s_h(a: v16i8, b: v16i8) -> v8i16 {
5442    msa_hadd_s_h(a, mem::transmute(b))
5443}
5444
5445/// Vector Signed Horizontal Add
5446///
5447/// The sign-extended odd elements in vector `a` (eight signed 16-bit integer numbers)
5448/// are added to the sign-extended even elements in vector `b` (eight signed 16-bit integer numbers)
5449/// producing a result twice the size of the input operands.
5450/// The result is written to vector (four signed 32-bit integer numbers).
5451///
5452#[inline]
5453#[target_feature(enable = "msa")]
5454#[cfg_attr(test, assert_instr(hadd_s.w))]
5455#[unstable(feature = "stdarch_mips", issue = "111198")]
5456pub unsafe fn __msa_hadd_s_w(a: v8i16, b: v8i16) -> v4i32 {
5457    msa_hadd_s_w(a, mem::transmute(b))
5458}
5459
5460/// Vector Signed Horizontal Add
5461///
5462/// The sign-extended odd elements in vector `a` (four signed 32-bit integer numbers)
5463/// are added to the sign-extended even elements in vector `b` (four signed 32-bit integer numbers)
5464/// producing a result twice the size of the input operands.
5465/// The result is written to vector (two signed 64-bit integer numbers).
5466///
5467#[inline]
5468#[target_feature(enable = "msa")]
5469#[cfg_attr(test, assert_instr(hadd_s.d))]
5470#[unstable(feature = "stdarch_mips", issue = "111198")]
5471pub unsafe fn __msa_hadd_s_d(a: v4i32, b: v4i32) -> v2i64 {
5472    msa_hadd_s_d(a, mem::transmute(b))
5473}
5474
5475/// Vector Unsigned Horizontal Add
5476///
5477/// The zero-extended odd elements in vector `a` (sixteen unsigned 8-bit integer numbers)
5478/// are added to the zero-extended even elements in vector `b` (sixteen unsigned 8-bit integer numbers)
5479/// producing a result twice the size of the input operands.
5480/// The result is written to vector (eight unsigned 16-bit integer numbers).
5481///
5482#[inline]
5483#[target_feature(enable = "msa")]
5484#[cfg_attr(test, assert_instr(hadd_u.h))]
5485#[unstable(feature = "stdarch_mips", issue = "111198")]
5486pub unsafe fn __msa_hadd_u_h(a: v16u8, b: v16u8) -> v8u16 {
5487    msa_hadd_u_h(a, mem::transmute(b))
5488}
5489
5490/// Vector Unsigned Horizontal Add
5491///
5492/// The zero-extended odd elements in vector `a` (eight unsigned 16-bit integer numbers)
5493/// are added to the zero-extended even elements in vector `b` (eight unsigned 16-bit integer numbers)
5494/// producing a result twice the size of the input operands.
5495/// The result is written to vector (four unsigned 32-bit integer numbers).
5496///
5497#[inline]
5498#[target_feature(enable = "msa")]
5499#[cfg_attr(test, assert_instr(hadd_u.w))]
5500#[unstable(feature = "stdarch_mips", issue = "111198")]
5501pub unsafe fn __msa_hadd_u_w(a: v8u16, b: v8u16) -> v4u32 {
5502    msa_hadd_u_w(a, mem::transmute(b))
5503}
5504
5505/// Vector Unsigned Horizontal Add
5506///
5507/// The zero-extended odd elements in vector `a` (four unsigned 32-bit integer numbers)
5508/// are added to the zero-extended even elements in vector `b` (four unsigned 32-bit integer numbers)
5509/// producing a result twice the size of the input operands.
5510/// The result is written to vector (two unsigned 64-bit integer numbers).
5511///
5512#[inline]
5513#[target_feature(enable = "msa")]
5514#[cfg_attr(test, assert_instr(hadd_u.d))]
5515#[unstable(feature = "stdarch_mips", issue = "111198")]
5516pub unsafe fn __msa_hadd_u_d(a: v4u32, b: v4u32) -> v2u64 {
5517    msa_hadd_u_d(a, mem::transmute(b))
5518}
5519
5520/// Vector Signed Horizontal Subtract
5521///
5522/// The sign-extended odd elements in vector `b` (sixteen signed 8-bit integer numbers)
5523/// are subtracted from the sign-extended elements in vector `a` (sixteen signed 8-bit integer numbers)
5524/// producing a result twice the size of the input operands.
5525/// The result is written to vector (eight signed 16-bit integer numbers).
5526///
5527#[inline]
5528#[target_feature(enable = "msa")]
5529#[cfg_attr(test, assert_instr(hsub_s.h))]
5530#[unstable(feature = "stdarch_mips", issue = "111198")]
5531pub unsafe fn __msa_hsub_s_h(a: v16i8, b: v16i8) -> v8i16 {
5532    msa_hsub_s_h(a, mem::transmute(b))
5533}
5534
5535/// Vector Signed Horizontal Subtract
5536///
5537/// The sign-extended odd elements in vector `b` (eight signed 16-bit integer numbers)
5538/// are subtracted from the sign-extended elements in vector `a` (eight signed 16-bit integer numbers)
5539/// producing a result twice the size of the input operands.
5540/// The result is written to vector (four signed 32-bit integer numbers).
5541///
5542#[inline]
5543#[target_feature(enable = "msa")]
5544#[cfg_attr(test, assert_instr(hsub_s.w))]
5545#[unstable(feature = "stdarch_mips", issue = "111198")]
5546pub unsafe fn __msa_hsub_s_w(a: v8i16, b: v8i16) -> v4i32 {
5547    msa_hsub_s_w(a, mem::transmute(b))
5548}
5549
5550/// Vector Signed Horizontal Subtract
5551///
5552/// The sign-extended odd elements in vector `b` (four signed 32-bit integer numbers)
5553/// are subtracted from the sign-extended elements in vector `a` (four signed 32-bit integer numbers)
5554/// producing a result twice the size of the input operands.
5555/// The result is written to vector (two signed 64-bit integer numbers).
5556///
5557#[inline]
5558#[target_feature(enable = "msa")]
5559#[cfg_attr(test, assert_instr(hsub_s.d))]
5560#[unstable(feature = "stdarch_mips", issue = "111198")]
5561pub unsafe fn __msa_hsub_s_d(a: v4i32, b: v4i32) -> v2i64 {
5562    msa_hsub_s_d(a, mem::transmute(b))
5563}
5564
5565/// Vector Unsigned Horizontal Subtract
5566///
5567/// The zero-extended odd elements in vector `b` (sixteen unsigned 8-bit integer numbers)
5568/// are subtracted from the zero-extended elements in vector `a` (sixteen unsigned 8-bit integer numbers)
5569/// producing a result twice the size of the input operands.
5570/// The result is written to vector (eight signed 16-bit integer numbers).
5571///
5572#[inline]
5573#[target_feature(enable = "msa")]
5574#[cfg_attr(test, assert_instr(hsub_u.h))]
5575#[unstable(feature = "stdarch_mips", issue = "111198")]
5576pub unsafe fn __msa_hsub_u_h(a: v16u8, b: v16u8) -> v8i16 {
5577    msa_hsub_u_h(a, mem::transmute(b))
5578}
5579
5580/// Vector Unsigned Horizontal Subtract
5581///
5582/// The zero-extended odd elements in vector `b` (eight unsigned 16-bit integer numbers)
5583/// are subtracted from the zero-extended elements in vector `a` (eight unsigned 16-bit integer numbers)
5584/// producing a result twice the size of the input operands.
5585/// The result is written to vector (four signed 32-bit integer numbers).
5586///
5587#[inline]
5588#[target_feature(enable = "msa")]
5589#[cfg_attr(test, assert_instr(hsub_u.w))]
5590#[unstable(feature = "stdarch_mips", issue = "111198")]
5591pub unsafe fn __msa_hsub_u_w(a: v8u16, b: v8u16) -> v4i32 {
5592    msa_hsub_u_w(a, mem::transmute(b))
5593}
5594
5595/// Vector Unsigned Horizontal Subtract
5596///
5597/// The zero-extended odd elements in vector `b` (four unsigned 32-bit integer numbers)
5598/// are subtracted from the zero-extended elements in vector `a` (four unsigned 32-bit integer numbers)
5599/// producing a result twice the size of the input operands.
5600/// The result is written to vector (two signed 64-bit integer numbers).
5601///
5602#[inline]
5603#[target_feature(enable = "msa")]
5604#[cfg_attr(test, assert_instr(hsub_u.d))]
5605#[unstable(feature = "stdarch_mips", issue = "111198")]
5606pub unsafe fn __msa_hsub_u_d(a: v4u32, b: v4u32) -> v2i64 {
5607    msa_hsub_u_d(a, mem::transmute(b))
5608}
5609
5610/// Vector Interleave Even
5611///
5612/// Even elements in vectors `a` (sixteen signed 8-bit integer numbers)
5613/// and vector `b` (sixteen signed 8-bit integer numbers) are copied to the result
5614/// (sixteen signed 8-bit integer numbers)
5615/// alternating one element from `a` with one element from `b`.
5616///
5617#[inline]
5618#[target_feature(enable = "msa")]
5619#[cfg_attr(test, assert_instr(ilvev.b))]
5620#[unstable(feature = "stdarch_mips", issue = "111198")]
5621pub unsafe fn __msa_ilvev_b(a: v16i8, b: v16i8) -> v16i8 {
5622    msa_ilvev_b(a, mem::transmute(b))
5623}
5624
5625/// Vector Interleave Even
5626///
5627/// Even elements in vectors `a` (eight signed 16-bit integer numbers)
5628/// and vector `b` (eight signed 16-bit integer numbers) are copied to the result
5629/// (eight signed 16-bit integer numbers)
5630/// alternating one element from `a` with one element from `b`.
5631///
5632#[inline]
5633#[target_feature(enable = "msa")]
5634#[cfg_attr(test, assert_instr(ilvev.h))]
5635#[unstable(feature = "stdarch_mips", issue = "111198")]
5636pub unsafe fn __msa_ilvev_h(a: v8i16, b: v8i16) -> v8i16 {
5637    msa_ilvev_h(a, mem::transmute(b))
5638}
5639
5640/// Vector Interleave Even
5641///
5642/// Even elements in vectors `a` (four signed 32-bit integer numbers)
5643/// and vector `b` (four signed 32-bit integer numbers) are copied to the result
5644/// (four signed 32-bit integer numbers)
5645/// alternating one element from `a` with one element from `b`.
5646///
5647#[inline]
5648#[target_feature(enable = "msa")]
5649#[cfg_attr(test, assert_instr(ilvev.w))]
5650#[unstable(feature = "stdarch_mips", issue = "111198")]
5651pub unsafe fn __msa_ilvev_w(a: v4i32, b: v4i32) -> v4i32 {
5652    msa_ilvev_w(a, mem::transmute(b))
5653}
5654
5655/// Vector Interleave Even
5656///
5657/// Even elements in vectors `a` (two signed 64-bit integer numbers)
5658/// and vector `b` (two signed 64-bit integer numbers) are copied to the result
5659/// (two signed 64-bit integer numbers)
5660/// alternating one element from `a` with one element from `b`.
5661///
5662#[inline]
5663#[target_feature(enable = "msa")]
5664#[cfg_attr(test, assert_instr(ilvev.d))]
5665#[unstable(feature = "stdarch_mips", issue = "111198")]
5666pub unsafe fn __msa_ilvev_d(a: v2i64, b: v2i64) -> v2i64 {
5667    msa_ilvev_d(a, mem::transmute(b))
5668}
5669
5670/// Vector Interleave Left
5671///
5672/// The left half elements in vectors `a` (sixteen signed 8-bit integer numbers)
5673/// and vector `b` (sixteen signed 8-bit integer numbers) are copied to the result
5674/// (sixteen signed 8-bit integer numbers)
5675/// alternating one element from `a` with one element from `b`.
5676///
5677#[inline]
5678#[target_feature(enable = "msa")]
5679#[cfg_attr(test, assert_instr(ilvl.b))]
5680#[unstable(feature = "stdarch_mips", issue = "111198")]
5681pub unsafe fn __msa_ilvl_b(a: v16i8, b: v16i8) -> v16i8 {
5682    msa_ilvl_b(a, mem::transmute(b))
5683}
5684
5685/// Vector Interleave Left
5686///
5687/// The left half elements in vectors `a` (eight signed 16-bit integer numbers)
5688/// and vector `b` (eight signed 16-bit integer numbers) are copied to the result
5689/// (eight signed 16-bit integer numbers)
5690/// alternating one element from `a` with one element from `b`.
5691///
5692#[inline]
5693#[target_feature(enable = "msa")]
5694#[cfg_attr(test, assert_instr(ilvl.h))]
5695#[unstable(feature = "stdarch_mips", issue = "111198")]
5696pub unsafe fn __msa_ilvl_h(a: v8i16, b: v8i16) -> v8i16 {
5697    msa_ilvl_h(a, mem::transmute(b))
5698}
5699
5700/// Vector Interleave Left
5701///
5702/// The left half elements in vectors `a` (four signed 32-bit integer numbers)
5703/// and vector `b` (four signed 32-bit integer numbers) are copied to the result
5704/// (four signed 32-bit integer numbers)
5705/// alternating one element from `a` with one element from `b`.
5706///
5707#[inline]
5708#[target_feature(enable = "msa")]
5709#[cfg_attr(test, assert_instr(ilvl.w))]
5710#[unstable(feature = "stdarch_mips", issue = "111198")]
5711pub unsafe fn __msa_ilvl_w(a: v4i32, b: v4i32) -> v4i32 {
5712    msa_ilvl_w(a, mem::transmute(b))
5713}
5714
5715/// Vector Interleave Left
5716///
5717/// The left half elements in vectors `a` (two signed 64-bit integer numbers)
5718/// and vector `b` (two signed 64-bit integer numbers) are copied to the result
5719/// (two signed 64-bit integer numbers)
5720/// alternating one element from `a` with one element from `b`.
5721///
5722#[inline]
5723#[target_feature(enable = "msa")]
5724#[cfg_attr(test, assert_instr(ilvl.d))]
5725#[unstable(feature = "stdarch_mips", issue = "111198")]
5726pub unsafe fn __msa_ilvl_d(a: v2i64, b: v2i64) -> v2i64 {
5727    msa_ilvl_d(a, mem::transmute(b))
5728}
5729
5730/// Vector Interleave Odd
5731///
5732/// Odd elements in vectors `a` (sixteen signed 8-bit integer numbers)
5733/// and vector `b` (sixteen signed 8-bit integer numbers) are copied to the result
5734/// (sixteen signed 8-bit integer numbers)
5735/// alternating one element from `a` with one element from `b`.
5736///
5737#[inline]
5738#[target_feature(enable = "msa")]
5739#[cfg_attr(test, assert_instr(ilvod.b))]
5740#[unstable(feature = "stdarch_mips", issue = "111198")]
5741pub unsafe fn __msa_ilvod_b(a: v16i8, b: v16i8) -> v16i8 {
5742    msa_ilvod_b(a, mem::transmute(b))
5743}
5744
5745/// Vector Interleave Odd
5746///
5747/// Odd elements in vectors `a` (eight signed 16-bit integer numbers)
5748/// and vector `b` (eight signed 16-bit integer numbers) are copied to the result
5749/// (eight signed 16-bit integer numbers)
5750/// alternating one element from `a` with one element from `b`.
5751///
5752#[inline]
5753#[target_feature(enable = "msa")]
5754#[cfg_attr(test, assert_instr(ilvod.h))]
5755#[unstable(feature = "stdarch_mips", issue = "111198")]
5756pub unsafe fn __msa_ilvod_h(a: v8i16, b: v8i16) -> v8i16 {
5757    msa_ilvod_h(a, mem::transmute(b))
5758}
5759
5760/// Vector Interleave Odd
5761///
5762/// Odd elements in vectors `a` (four signed 32-bit integer numbers)
5763/// and vector `b` (four signed 32-bit integer numbers) are copied to the result
5764/// (four signed 32-bit integer numbers)
5765/// alternating one element from `a` with one element from `b`.
5766///
5767#[inline]
5768#[target_feature(enable = "msa")]
5769#[cfg_attr(test, assert_instr(ilvod.w))]
5770#[unstable(feature = "stdarch_mips", issue = "111198")]
5771pub unsafe fn __msa_ilvod_w(a: v4i32, b: v4i32) -> v4i32 {
5772    msa_ilvod_w(a, mem::transmute(b))
5773}
5774
5775/// Vector Interleave Odd
5776///
5777/// Odd elements in vectors `a` (two signed 64-bit integer numbers)
5778/// and vector `b` (two signed 64-bit integer numbers) are copied to the result
5779/// (two signed 64-bit integer numbers)
5780/// alternating one element from `a` with one element from `b`.
5781///
5782#[inline]
5783#[target_feature(enable = "msa")]
5784#[cfg_attr(test, assert_instr(ilvod.d))]
5785#[unstable(feature = "stdarch_mips", issue = "111198")]
5786pub unsafe fn __msa_ilvod_d(a: v2i64, b: v2i64) -> v2i64 {
5787    msa_ilvod_d(a, mem::transmute(b))
5788}
5789
5790/// Vector Interleave Right
5791///
5792/// The right half elements in vectors `a` (sixteen signed 8-bit integer numbers)
5793/// and vector `b` (sixteen signed 8-bit integer numbers) are copied to the result
5794/// (sixteen signed 8-bit integer numbers)
5795/// alternating one element from `a` with one element from `b`.
5796///
5797#[inline]
5798#[target_feature(enable = "msa")]
5799#[cfg_attr(test, assert_instr(ilvr.b))]
5800#[unstable(feature = "stdarch_mips", issue = "111198")]
5801pub unsafe fn __msa_ilvr_b(a: v16i8, b: v16i8) -> v16i8 {
5802    msa_ilvr_b(a, mem::transmute(b))
5803}
5804
5805/// Vector Interleave Right
5806///
5807/// The right half elements in vectors `a` (eight signed 16-bit integer numbers)
5808/// and vector `b` (eight signed 16-bit integer numbers) are copied to the result
5809/// (eight signed 16-bit integer numbers)
5810/// alternating one element from `a` with one element from `b`.
5811///
5812#[inline]
5813#[target_feature(enable = "msa")]
5814#[cfg_attr(test, assert_instr(ilvr.h))]
5815#[unstable(feature = "stdarch_mips", issue = "111198")]
5816pub unsafe fn __msa_ilvr_h(a: v8i16, b: v8i16) -> v8i16 {
5817    msa_ilvr_h(a, mem::transmute(b))
5818}
5819
5820/// Vector Interleave Right
5821///
5822/// The right half elements in vectors `a` (four signed 32-bit integer numbers)
5823/// and vector `b` (four signed 32-bit integer numbers) are copied to the result
5824/// (four signed 32-bit integer numbers)
5825/// alternating one element from `a` with one element from `b`.
5826///
5827#[inline]
5828#[target_feature(enable = "msa")]
5829#[cfg_attr(test, assert_instr(ilvr.w))]
5830#[unstable(feature = "stdarch_mips", issue = "111198")]
5831pub unsafe fn __msa_ilvr_w(a: v4i32, b: v4i32) -> v4i32 {
5832    msa_ilvr_w(a, mem::transmute(b))
5833}
5834
5835/// Vector Interleave Right
5836///
5837/// The right half elements in vectors `a` (two signed 64-bit integer numbers)
5838/// and vector `b` (two signed 64-bit integer numbers) are copied to the result
5839/// (two signed 64-bit integer numbers)
5840/// alternating one element from `a` with one element from `b`.
5841///
5842#[inline]
5843#[target_feature(enable = "msa")]
5844#[cfg_attr(test, assert_instr(ilvr.d))]
5845#[unstable(feature = "stdarch_mips", issue = "111198")]
5846pub unsafe fn __msa_ilvr_d(a: v2i64, b: v2i64) -> v2i64 {
5847    msa_ilvr_d(a, mem::transmute(b))
5848}
5849
5850/// GPR Insert Element
5851///
5852/// Set element `imm4` in vector `a` (sixteen signed 8-bit integer numbers) to GPR `c` value.
5853/// All other elements in vector `a` are unchanged. If the source GPR is wider than the
5854/// destination data format, the destination's elements will be set to the least significant bits of the GPR.
5855///
5856#[inline]
5857#[target_feature(enable = "msa")]
5858#[cfg_attr(test, assert_instr(insert.b, IMM4 = 0b1111))]
5859#[rustc_legacy_const_generics(1)]
5860#[unstable(feature = "stdarch_mips", issue = "111198")]
5861pub unsafe fn __msa_insert_b<const IMM4: i32>(a: v16i8, c: i32) -> v16i8 {
5862    static_assert_uimm_bits!(IMM4, 4);
5863    msa_insert_b(a, IMM4, c)
5864}
5865
5866/// GPR Insert Element
5867///
5868/// Set element `imm3` in vector `a` (eight signed 16-bit integer numbers) to GPR `c` value.
5869/// All other elements in vector `a` are unchanged. If the source GPR is wider than the
5870/// destination data format, the destination's elements will be set to the least significant bits of the GPR.
5871///
5872#[inline]
5873#[target_feature(enable = "msa")]
5874#[cfg_attr(test, assert_instr(insert.h, IMM3 = 0b111))]
5875#[rustc_legacy_const_generics(1)]
5876#[unstable(feature = "stdarch_mips", issue = "111198")]
5877pub unsafe fn __msa_insert_h<const IMM3: i32>(a: v8i16, c: i32) -> v8i16 {
5878    static_assert_uimm_bits!(IMM3, 3);
5879    msa_insert_h(a, IMM3, c)
5880}
5881
5882/// GPR Insert Element
5883///
5884/// Set element `imm2` in vector `a` (four signed 32-bit integer numbers) to GPR `c` value.
5885/// All other elements in vector `a` are unchanged. If the source GPR is wider than the
5886/// destination data format, the destination's elements will be set to the least significant bits of the GPR.
5887///
5888#[inline]
5889#[target_feature(enable = "msa")]
5890#[cfg_attr(test, assert_instr(insert.w, IMM2 = 0b11))]
5891#[rustc_legacy_const_generics(1)]
5892#[unstable(feature = "stdarch_mips", issue = "111198")]
5893pub unsafe fn __msa_insert_w<const IMM2: i32>(a: v4i32, c: i32) -> v4i32 {
5894    static_assert_uimm_bits!(IMM2, 2);
5895    msa_insert_w(a, IMM2, c)
5896}
5897
5898/// GPR Insert Element
5899///
5900/// Set element `imm1` in vector `a` (two signed 64-bit integer numbers) to GPR `c` value.
5901/// All other elements in vector `a` are unchanged. If the source GPR is wider than the
5902/// destination data format, the destination's elements will be set to the least significant bits of the GPR.
5903///
5904#[inline]
5905#[target_feature(enable = "msa")]
5906#[cfg_attr(test, assert_instr(insert.d, IMM1 = 0b1))]
5907#[rustc_legacy_const_generics(1)]
5908#[unstable(feature = "stdarch_mips", issue = "111198")]
5909pub unsafe fn __msa_insert_d<const IMM1: i32>(a: v2i64, c: i64) -> v2i64 {
5910    static_assert_uimm_bits!(IMM1, 1);
5911    msa_insert_d(a, IMM1, c)
5912}
5913
5914/// Element Insert Element
5915///
5916/// Set element `imm1` in the result vector `a` (sixteen signed 8-bit integer numbers) to element 0
5917/// in vector `c` (sixteen signed 8-bit integer numbers) value.
5918/// All other elements in vector `a` are unchanged.
5919///
5920#[inline]
5921#[target_feature(enable = "msa")]
5922#[cfg_attr(test, assert_instr(insve.b, IMM4 = 0b1111))]
5923#[rustc_legacy_const_generics(1)]
5924#[unstable(feature = "stdarch_mips", issue = "111198")]
5925pub unsafe fn __msa_insve_b<const IMM4: i32>(a: v16i8, c: v16i8) -> v16i8 {
5926    static_assert_uimm_bits!(IMM4, 4);
5927    msa_insve_b(a, IMM4, c)
5928}
5929
5930/// Element Insert Element
5931///
5932/// Set element `imm1` in the result vector `a` (eight signed 16-bit integer numbers) to element 0
5933/// in vector `c` (eight signed 16-bit integer numbers) value.
5934/// All other elements in vector `a` are unchanged.
5935///
5936#[inline]
5937#[target_feature(enable = "msa")]
5938#[cfg_attr(test, assert_instr(insve.h, IMM3 = 0b111))]
5939#[rustc_legacy_const_generics(1)]
5940#[unstable(feature = "stdarch_mips", issue = "111198")]
5941pub unsafe fn __msa_insve_h<const IMM3: i32>(a: v8i16, c: v8i16) -> v8i16 {
5942    static_assert_uimm_bits!(IMM3, 3);
5943    msa_insve_h(a, IMM3, c)
5944}
5945
5946/// Element Insert Element
5947///
5948/// Set element `imm1` in the result vector `a` (four signed 32-bit integer numbers) to element 0
5949/// in vector `c` (four signed 32-bit integer numbers) value.
5950/// All other elements in vector `a` are unchanged.
5951///
5952#[inline]
5953#[target_feature(enable = "msa")]
5954#[cfg_attr(test, assert_instr(insve.w, IMM2 = 0b11))]
5955#[rustc_legacy_const_generics(1)]
5956#[unstable(feature = "stdarch_mips", issue = "111198")]
5957pub unsafe fn __msa_insve_w<const IMM2: i32>(a: v4i32, c: v4i32) -> v4i32 {
5958    static_assert_uimm_bits!(IMM2, 2);
5959    msa_insve_w(a, IMM2, c)
5960}
5961
5962/// Element Insert Element
5963///
5964/// Set element `imm1` in the result vector `a` (two signed 64-bit integer numbers) to element 0
5965/// in vector `c` (two signed 64-bit integer numbers) value.
5966/// All other elements in vector `a` are unchanged.
5967///
5968#[inline]
5969#[target_feature(enable = "msa")]
5970#[cfg_attr(test, assert_instr(insve.d, IMM1 = 0b1))]
5971#[rustc_legacy_const_generics(1)]
5972#[unstable(feature = "stdarch_mips", issue = "111198")]
5973pub unsafe fn __msa_insve_d<const IMM1: i32>(a: v2i64, c: v2i64) -> v2i64 {
5974    static_assert_uimm_bits!(IMM1, 1);
5975    msa_insve_d(a, IMM1, c)
5976}
5977
5978/// Vector Load
5979///
5980/// The WRLEN / 8 bytes at the effective memory location addressed by the base
5981/// `mem_addr` and the 10-bit signed immediate offset `imm_s10` are fetched and placed in
5982/// the vector (sixteen signed 8-bit integer numbers) value.
5983///
5984#[inline]
5985#[target_feature(enable = "msa")]
5986#[cfg_attr(test, assert_instr(ld.b, IMM_S10 = -1))]
5987#[rustc_legacy_const_generics(1)]
5988#[unstable(feature = "stdarch_mips", issue = "111198")]
5989pub unsafe fn __msa_ld_b<const IMM_S10: i32>(mem_addr: *mut u8) -> v16i8 {
5990    static_assert_simm_bits!(IMM_S10, 10);
5991    msa_ld_b(mem_addr, IMM_S10)
5992}
5993
5994/// Vector Load
5995///
5996/// The WRLEN / 8 bytes at the effective memory location addressed by the base
5997/// `mem_addr` and the 10-bit signed immediate offset `imm_s11` are fetched and placed in
5998/// the vector (eight signed 16-bit integer numbers) value.
5999///
6000#[inline]
6001#[target_feature(enable = "msa")]
6002#[cfg_attr(test, assert_instr(ld.h, IMM_S11 = -2))]
6003#[rustc_legacy_const_generics(1)]
6004#[unstable(feature = "stdarch_mips", issue = "111198")]
6005pub unsafe fn __msa_ld_h<const IMM_S11: i32>(mem_addr: *mut u8) -> v8i16 {
6006    static_assert_simm_bits!(IMM_S11, 11);
6007    static_assert!(IMM_S11 % 2 == 0);
6008    msa_ld_h(mem_addr, IMM_S11)
6009}
6010
6011/// Vector Load
6012///
6013/// The WRLEN / 8 bytes at the effective memory location addressed by the base
6014/// `mem_addr` and the 10-bit signed immediate offset `imm_s12` are fetched and placed in
6015/// the vector (four signed 32-bit integer numbers) value.
6016///
6017#[inline]
6018#[target_feature(enable = "msa")]
6019#[cfg_attr(test, assert_instr(ld.w, IMM_S12 = -4))]
6020#[rustc_legacy_const_generics(1)]
6021#[unstable(feature = "stdarch_mips", issue = "111198")]
6022pub unsafe fn __msa_ld_w<const IMM_S12: i32>(mem_addr: *mut u8) -> v4i32 {
6023    static_assert_simm_bits!(IMM_S12, 12);
6024    static_assert!(IMM_S12 % 4 == 0);
6025    msa_ld_w(mem_addr, IMM_S12)
6026}
6027
6028/// Vector Load
6029///
6030/// The WRLEN / 8 bytes at the effective memory location addressed by the base
6031/// `mem_addr` and the 10-bit signed immediate offset `imm_s13` are fetched and placed in
6032/// the vector (two signed 64-bit integer numbers) value.
6033///
6034#[inline]
6035#[target_feature(enable = "msa")]
6036#[cfg_attr(test, assert_instr(ld.d, IMM_S13 = -8))]
6037#[rustc_legacy_const_generics(1)]
6038#[unstable(feature = "stdarch_mips", issue = "111198")]
6039pub unsafe fn __msa_ld_d<const IMM_S13: i32>(mem_addr: *mut u8) -> v2i64 {
6040    static_assert_simm_bits!(IMM_S13, 13);
6041    static_assert!(IMM_S13 % 8 == 0);
6042    msa_ld_d(mem_addr, IMM_S13)
6043}
6044
6045/// Immediate Load
6046///
6047/// The signed immediate imm_s10 is replicated in all vector
6048/// (sixteen signed 8-bit integer numbers) elements. For byte elements,
6049/// only the least significant 8 bits of imm_s10 will be used.
6050///
6051#[inline]
6052#[target_feature(enable = "msa")]
6053#[cfg_attr(test, assert_instr(ldi.b, IMM_S10 = -1))]
6054#[rustc_legacy_const_generics(0)]
6055#[unstable(feature = "stdarch_mips", issue = "111198")]
6056pub unsafe fn __msa_ldi_b<const IMM_S10: i32>() -> v16i8 {
6057    static_assert_simm_bits!(IMM_S10, 10);
6058    msa_ldi_b(IMM_S10)
6059}
6060
6061/// Immediate Load
6062///
6063/// The signed immediate imm_s10 is replicated in all vector
6064/// (eight signed 16-bit integer numbers) elements. For byte elements,
6065/// only the least significant 8 bits of imm_s10 will be used.
6066///
6067#[inline]
6068#[target_feature(enable = "msa")]
6069#[cfg_attr(test, assert_instr(ldi.h, IMM_S10 = -1))]
6070#[rustc_legacy_const_generics(0)]
6071#[unstable(feature = "stdarch_mips", issue = "111198")]
6072pub unsafe fn __msa_ldi_h<const IMM_S10: i32>() -> v8i16 {
6073    static_assert_simm_bits!(IMM_S10, 10);
6074    msa_ldi_h(IMM_S10)
6075}
6076
6077/// Immediate Load
6078///
6079/// The signed immediate imm_s10 is replicated in all vector
6080/// (four signed 32-bit integer numbers) elements. For byte elements,
6081/// only the least significant 8 bits of imm_s10 will be used.
6082///
6083#[inline]
6084#[target_feature(enable = "msa")]
6085#[cfg_attr(test, assert_instr(ldi.w, IMM_S10 = -1))]
6086#[rustc_legacy_const_generics(0)]
6087#[unstable(feature = "stdarch_mips", issue = "111198")]
6088pub unsafe fn __msa_ldi_w<const IMM_S10: i32>() -> v4i32 {
6089    static_assert_simm_bits!(IMM_S10, 10);
6090    msa_ldi_w(IMM_S10)
6091}
6092
6093/// Immediate Load
6094///
6095/// The signed immediate imm_s10 is replicated in all vector
6096/// (two signed 64-bit integer numbers) elements. For byte elements,
6097/// only the least significant 8 bits of imm_s10 will be used.
6098///
6099#[inline]
6100#[target_feature(enable = "msa")]
6101#[cfg_attr(test, assert_instr(ldi.d, IMM_S10 = -1))]
6102#[rustc_legacy_const_generics(0)]
6103#[unstable(feature = "stdarch_mips", issue = "111198")]
6104pub unsafe fn __msa_ldi_d<const IMM_S10: i32>() -> v2i64 {
6105    static_assert_simm_bits!(IMM_S10, 10);
6106    msa_ldi_d(IMM_S10)
6107}
6108
6109/// Vector Fixed-Point Multiply and Add
6110///
6111/// The products of fixed-point elements in `b` (eight signed 16-bit integer numbers)
6112/// by fixed-point elements in vector `c` (eight signed 16-bit integer numbers)
6113/// are added to the fixed-point elements in vector `a` (eight signed 16-bit integer numbers).
6114/// The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.
6115/// The saturated fixed-point results are stored to vector `a`.
6116///
6117#[inline]
6118#[target_feature(enable = "msa")]
6119#[cfg_attr(test, assert_instr(madd_q.h))]
6120#[unstable(feature = "stdarch_mips", issue = "111198")]
6121pub unsafe fn __msa_madd_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
6122    msa_madd_q_h(a, mem::transmute(b), c)
6123}
6124
6125/// Vector Fixed-Point Multiply and Add
6126///
6127/// The products of fixed-point elements in `b` (four signed 32-bit integer numbers)
6128/// by fixed-point elements in vector `c` (four signed 32-bit integer numbers)
6129/// are added to the fixed-point elements in vector `a` (four signed 32-bit integer numbers).
6130/// The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.
6131/// The saturated fixed-point results are stored to vector `a`.
6132///
6133#[inline]
6134#[target_feature(enable = "msa")]
6135#[cfg_attr(test, assert_instr(madd_q.w))]
6136#[unstable(feature = "stdarch_mips", issue = "111198")]
6137pub unsafe fn __msa_madd_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
6138    msa_madd_q_w(a, mem::transmute(b), c)
6139}
6140
6141/// Vector Fixed-Point Multiply and Add Rounded
6142///
6143/// The products of fixed-point elements in `b` (eight signed 16-bit integer numbers)
6144/// by fixed-point elements in vector `c` (eight signed 16-bit integer numbers)
6145/// are added to the fixed-point elements in vector `a` (eight signed 16-bit integer numbers).
6146/// The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.
6147/// The rounded and saturated fixed-point results are stored to vector `a`.
6148///
6149#[inline]
6150#[target_feature(enable = "msa")]
6151#[cfg_attr(test, assert_instr(maddr_q.h))]
6152#[unstable(feature = "stdarch_mips", issue = "111198")]
6153pub unsafe fn __msa_maddr_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
6154    msa_maddr_q_h(a, mem::transmute(b), c)
6155}
6156
6157/// Vector Fixed-Point Multiply and Add Rounded
6158///
6159/// The products of fixed-point elements in `b` (four signed 32-bit integer numbers)
6160/// by fixed-point elements in vector `c` (four signed 32-bit integer numbers)
6161/// are added to the fixed-point elements in vector `a` (four signed 32-bit integer numbers).
6162/// The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.
6163/// The rounded and saturated fixed-point results are stored to vector `a`.
6164///
6165#[inline]
6166#[target_feature(enable = "msa")]
6167#[cfg_attr(test, assert_instr(maddr_q.w))]
6168#[unstable(feature = "stdarch_mips", issue = "111198")]
6169pub unsafe fn __msa_maddr_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
6170    msa_maddr_q_w(a, mem::transmute(b), c)
6171}
6172
6173/// Vector Multiply and Add
6174///
6175/// The integer elements in vector `b` (sixteen signed 8-bit integer numbers)
6176/// are multiplied by integer elements in vector `c` (sixteen signed 8-bit integer numbers)
6177/// and added to the integer elements in vector `a` (sixteen signed 8-bit integer numbers).
6178/// The most significant half of the multiplication result is discarded.
6179///
6180#[inline]
6181#[target_feature(enable = "msa")]
6182#[cfg_attr(test, assert_instr(maddv.b))]
6183#[unstable(feature = "stdarch_mips", issue = "111198")]
6184pub unsafe fn __msa_maddv_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 {
6185    msa_maddv_b(a, mem::transmute(b), c)
6186}
6187
6188/// Vector Multiply and Add
6189///
6190/// The integer elements in vector `b` (eight signed 16-bit integer numbers)
6191/// are multiplied by integer elements in vector `c` (eight signed 16-bit integer numbers)
6192/// and added to the integer elements in vector `a` (eight signed 16-bit integer numbers).
6193/// The most significant half of the multiplication result is discarded.
6194///
6195#[inline]
6196#[target_feature(enable = "msa")]
6197#[cfg_attr(test, assert_instr(maddv.h))]
6198#[unstable(feature = "stdarch_mips", issue = "111198")]
6199pub unsafe fn __msa_maddv_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
6200    msa_maddv_h(a, mem::transmute(b), c)
6201}
6202
6203/// Vector Multiply and Add
6204///
6205/// The integer elements in vector `b` (four signed 32-bit integer numbers)
6206/// are multiplied by integer elements in vector `c` (four signed 32-bit integer numbers)
6207/// and added to the integer elements in vector `a` (four signed 32-bit integer numbers).
6208/// The most significant half of the multiplication result is discarded.
6209///
6210#[inline]
6211#[target_feature(enable = "msa")]
6212#[cfg_attr(test, assert_instr(maddv.w))]
6213#[unstable(feature = "stdarch_mips", issue = "111198")]
6214pub unsafe fn __msa_maddv_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
6215    msa_maddv_w(a, mem::transmute(b), c)
6216}
6217
6218/// Vector Multiply and Add
6219///
6220/// The integer elements in vector `b` (two signed 64-bit integer numbers)
6221/// are multiplied by integer elements in vector `c` (two signed 64-bit integer numbers)
6222/// and added to the integer elements in vector `a` (two signed 64-bit integer numbers).
6223/// The most significant half of the multiplication result is discarded.
6224///
6225#[inline]
6226#[target_feature(enable = "msa")]
6227#[cfg_attr(test, assert_instr(maddv.d))]
6228#[unstable(feature = "stdarch_mips", issue = "111198")]
6229pub unsafe fn __msa_maddv_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 {
6230    msa_maddv_d(a, mem::transmute(b), c)
6231}
6232
6233/// Vector Maximum Based on Absolute Values
6234///
6235/// The value with the largest magnitude, i.e. absolute value, between corresponding
6236/// signed elements in vector `a` (sixteen signed 8-bit integer numbers) and
6237/// `b` (sixteen signed 8-bit integer numbers) are written to vector
6238/// (sixteen signed 8-bit integer numbers).
6239///
6240#[inline]
6241#[target_feature(enable = "msa")]
6242#[cfg_attr(test, assert_instr(max_a.b))]
6243#[unstable(feature = "stdarch_mips", issue = "111198")]
6244pub unsafe fn __msa_max_a_b(a: v16i8, b: v16i8) -> v16i8 {
6245    msa_max_a_b(a, mem::transmute(b))
6246}
6247
6248/// Vector Maximum Based on Absolute Values
6249///
6250/// The value with the largest magnitude, i.e. absolute value, between corresponding
6251/// signed elements in vector `a` (eight signed 16-bit integer numbers) and
6252/// `b` (eight signed 16-bit integer numbers) are written to vector
6253/// (eight signed 16-bit integer numbers).
6254///
6255#[inline]
6256#[target_feature(enable = "msa")]
6257#[cfg_attr(test, assert_instr(max_a.h))]
6258#[unstable(feature = "stdarch_mips", issue = "111198")]
6259pub unsafe fn __msa_max_a_h(a: v8i16, b: v8i16) -> v8i16 {
6260    msa_max_a_h(a, mem::transmute(b))
6261}
6262
6263/// Vector Maximum Based on Absolute Values
6264///
6265/// The value with the largest magnitude, i.e. absolute value, between corresponding
6266/// signed elements in vector `a` (four signed 32-bit integer numbers) and
6267/// `b` (four signed 32-bit integer numbers) are written to vector
6268/// (four signed 32-bit integer numbers).
6269///
6270#[inline]
6271#[target_feature(enable = "msa")]
6272#[cfg_attr(test, assert_instr(max_a.w))]
6273#[unstable(feature = "stdarch_mips", issue = "111198")]
6274pub unsafe fn __msa_max_a_w(a: v4i32, b: v4i32) -> v4i32 {
6275    msa_max_a_w(a, mem::transmute(b))
6276}
6277
6278/// Vector Maximum Based on Absolute Values
6279///
6280/// The value with the largest magnitude, i.e. absolute value, between corresponding
6281/// signed elements in vector `a` (two signed 64-bit integer numbers) and
6282/// `b` (two signed 64-bit integer numbers) are written to vector
6283/// (two signed 64-bit integer numbers).
6284///
6285#[inline]
6286#[target_feature(enable = "msa")]
6287#[cfg_attr(test, assert_instr(max_a.d))]
6288#[unstable(feature = "stdarch_mips", issue = "111198")]
6289pub unsafe fn __msa_max_a_d(a: v2i64, b: v2i64) -> v2i64 {
6290    msa_max_a_d(a, mem::transmute(b))
6291}
6292
6293/// Vector Signed Maximum
6294///
6295/// Maximum values between signed elements in vector `a` (sixteen signed 8-bit integer numbers)
6296/// and signed elements in vector `b` (sixteen signed 8-bit integer numbers) are written to vector
6297/// (sixteen signed 8-bit integer numbers).
6298///
6299#[inline]
6300#[target_feature(enable = "msa")]
6301#[cfg_attr(test, assert_instr(max_s.b))]
6302#[unstable(feature = "stdarch_mips", issue = "111198")]
6303pub unsafe fn __msa_max_s_b(a: v16i8, b: v16i8) -> v16i8 {
6304    msa_max_s_b(a, mem::transmute(b))
6305}
6306
6307/// Vector Signed Maximum
6308///
6309/// Maximum values between signed elements in vector `a` (eight signed 16-bit integer numbers)
6310/// and signed elements in vector `b` (eight signed 16-bit integer numbers) are written to vector
6311/// (eight signed 16-bit integer numbers).
6312///
6313#[inline]
6314#[target_feature(enable = "msa")]
6315#[cfg_attr(test, assert_instr(max_s.h))]
6316#[unstable(feature = "stdarch_mips", issue = "111198")]
6317pub unsafe fn __msa_max_s_h(a: v8i16, b: v8i16) -> v8i16 {
6318    msa_max_s_h(a, mem::transmute(b))
6319}
6320
6321/// Vector Signed Maximum
6322///
6323/// Maximum values between signed elements in vector `a` (four signed 32-bit integer numbers)
6324/// and signed elements in vector `b` (four signed 32-bit integer numbers) are written to vector
6325/// (four signed 32-bit integer numbers).
6326///
6327#[inline]
6328#[target_feature(enable = "msa")]
6329#[cfg_attr(test, assert_instr(max_s.w))]
6330#[unstable(feature = "stdarch_mips", issue = "111198")]
6331pub unsafe fn __msa_max_s_w(a: v4i32, b: v4i32) -> v4i32 {
6332    msa_max_s_w(a, mem::transmute(b))
6333}
6334
6335/// Vector Signed Maximum
6336///
6337/// Maximum values between signed elements in vector `a` (two signed 64-bit integer numbers)
6338/// and signed elements in vector `b` (two signed 64-bit integer numbers) are written to vector
6339/// (two signed 64-bit integer numbers).
6340///
6341#[inline]
6342#[target_feature(enable = "msa")]
6343#[cfg_attr(test, assert_instr(max_s.d))]
6344#[unstable(feature = "stdarch_mips", issue = "111198")]
6345pub unsafe fn __msa_max_s_d(a: v2i64, b: v2i64) -> v2i64 {
6346    msa_max_s_d(a, mem::transmute(b))
6347}
6348
6349/// Vector Unsigned Maximum
6350///
6351/// Maximum values between unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
6352/// and unsigned elements in vector `b` (sixteen unsigned 8-bit integer numbers) are written to vector
6353/// (sixteen unsigned 8-bit integer numbers).
6354///
6355#[inline]
6356#[target_feature(enable = "msa")]
6357#[cfg_attr(test, assert_instr(max_u.b))]
6358#[unstable(feature = "stdarch_mips", issue = "111198")]
6359pub unsafe fn __msa_max_u_b(a: v16u8, b: v16u8) -> v16u8 {
6360    msa_max_u_b(a, mem::transmute(b))
6361}
6362
6363/// Vector Unsigned Maximum
6364///
6365/// Maximum values between unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
6366/// and unsigned elements in vector `b` (eight unsigned 16-bit integer numbers) are written to vector
6367/// (eight unsigned 16-bit integer numbers).
6368///
6369#[inline]
6370#[target_feature(enable = "msa")]
6371#[cfg_attr(test, assert_instr(max_u.h))]
6372#[unstable(feature = "stdarch_mips", issue = "111198")]
6373pub unsafe fn __msa_max_u_h(a: v8u16, b: v8u16) -> v8u16 {
6374    msa_max_u_h(a, mem::transmute(b))
6375}
6376
6377/// Vector Unsigned Maximum
6378///
6379/// Maximum values between unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
6380/// and unsigned elements in vector `b` (four unsigned 32-bit integer numbers) are written to vector
6381/// (four unsigned 32-bit integer numbers).
6382///
6383#[inline]
6384#[target_feature(enable = "msa")]
6385#[cfg_attr(test, assert_instr(max_u.w))]
6386#[unstable(feature = "stdarch_mips", issue = "111198")]
6387pub unsafe fn __msa_max_u_w(a: v4u32, b: v4u32) -> v4u32 {
6388    msa_max_u_w(a, mem::transmute(b))
6389}
6390
6391/// Vector Unsigned Maximum
6392///
6393/// Maximum values between unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
6394/// and unsigned elements in vector `b` (two unsigned 64-bit integer numbers) are written to vector
6395/// (two unsigned 64-bit integer numbers).
6396///
6397#[inline]
6398#[target_feature(enable = "msa")]
6399#[cfg_attr(test, assert_instr(max_u.d))]
6400#[unstable(feature = "stdarch_mips", issue = "111198")]
6401pub unsafe fn __msa_max_u_d(a: v2u64, b: v2u64) -> v2u64 {
6402    msa_max_u_d(a, mem::transmute(b))
6403}
6404
6405/// Immediate Signed Maximum
6406///
6407/// Maximum values between signed elements in vector `a` (sixteen signed 8-bit integer numbers)
6408/// and the 5-bit signed immediate imm_s5 are written to vector
6409/// (sixteen signed 8-bit integer numbers).
6410///
6411#[inline]
6412#[target_feature(enable = "msa")]
6413#[cfg_attr(test, assert_instr(maxi_s.b, IMM_S5 = -1))]
6414#[rustc_legacy_const_generics(1)]
6415#[unstable(feature = "stdarch_mips", issue = "111198")]
6416pub unsafe fn __msa_maxi_s_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
6417    static_assert_simm_bits!(IMM_S5, 5);
6418    msa_maxi_s_b(a, IMM_S5)
6419}
6420
6421/// Immediate Signed Maximum
6422///
6423/// Maximum values between signed elements in vector `a` (eight signed 16-bit integer numbers)
6424/// and the 5-bit signed immediate imm_s5 are written to vector
6425/// (eight signed 16-bit integer numbers).
6426///
6427#[inline]
6428#[target_feature(enable = "msa")]
6429#[cfg_attr(test, assert_instr(maxi_s.h, IMM_S5 = -1))]
6430#[rustc_legacy_const_generics(1)]
6431#[unstable(feature = "stdarch_mips", issue = "111198")]
6432pub unsafe fn __msa_maxi_s_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
6433    static_assert_simm_bits!(IMM_S5, 5);
6434    msa_maxi_s_h(a, IMM_S5)
6435}
6436
6437/// Immediate Signed Maximum
6438///
6439/// Maximum values between signed elements in vector `a` (four signed 32-bit integer numbers)
6440/// and the 5-bit signed immediate imm_s5 are written to vector
6441/// (four signed 32-bit integer numbers).
6442///
6443#[inline]
6444#[target_feature(enable = "msa")]
6445#[cfg_attr(test, assert_instr(maxi_s.w, IMM_S5 = -1))]
6446#[rustc_legacy_const_generics(1)]
6447#[unstable(feature = "stdarch_mips", issue = "111198")]
6448pub unsafe fn __msa_maxi_s_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
6449    static_assert_simm_bits!(IMM_S5, 5);
6450    msa_maxi_s_w(a, IMM_S5)
6451}
6452
6453/// Immediate Signed Maximum
6454///
6455/// Maximum values between signed elements in vector `a` (two signed 64-bit integer numbers)
6456/// and the 5-bit signed immediate imm_s5 are written to vector
6457/// (two signed 64-bit integer numbers).
6458///
6459#[inline]
6460#[target_feature(enable = "msa")]
6461#[cfg_attr(test, assert_instr(maxi_s.d, IMM_S5 = -1))]
6462#[rustc_legacy_const_generics(1)]
6463#[unstable(feature = "stdarch_mips", issue = "111198")]
6464pub unsafe fn __msa_maxi_s_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
6465    static_assert_simm_bits!(IMM_S5, 5);
6466    msa_maxi_s_d(a, IMM_S5)
6467}
6468
6469/// Immediate Unsigned Maximum
6470///
6471/// Maximum values between unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
6472/// and the 5-bit unsigned immediate `imm5` are written to vector
6473/// (sixteen unsigned 8-bit integer numbers).
6474///
6475#[inline]
6476#[target_feature(enable = "msa")]
6477#[cfg_attr(test, assert_instr(maxi_u.b, IMM5 = 0b11111))]
6478#[rustc_legacy_const_generics(1)]
6479#[unstable(feature = "stdarch_mips", issue = "111198")]
6480pub unsafe fn __msa_maxi_u_b<const IMM5: i32>(a: v16u8) -> v16u8 {
6481    static_assert_uimm_bits!(IMM5, 5);
6482    msa_maxi_u_b(a, IMM5)
6483}
6484
6485/// Immediate Unsigned Maximum
6486///
6487/// Maximum values between unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
6488/// and the 5-bit unsigned immediate `imm5` are written to vector
6489/// (eight unsigned 16-bit integer numbers).
6490///
6491#[inline]
6492#[target_feature(enable = "msa")]
6493#[cfg_attr(test, assert_instr(maxi_u.h, IMM5 = 0b11111))]
6494#[rustc_legacy_const_generics(1)]
6495#[unstable(feature = "stdarch_mips", issue = "111198")]
6496pub unsafe fn __msa_maxi_u_h<const IMM5: i32>(a: v8u16) -> v8u16 {
6497    static_assert_uimm_bits!(IMM5, 5);
6498    msa_maxi_u_h(a, IMM5)
6499}
6500
6501/// Immediate Unsigned Maximum
6502///
6503/// Maximum values between unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
6504/// and the 5-bit unsigned immediate `imm5` are written to vector
6505/// (four unsigned 32-bit integer numbers).
6506///
6507#[inline]
6508#[target_feature(enable = "msa")]
6509#[cfg_attr(test, assert_instr(maxi_u.w, IMM5 = 0b11111))]
6510#[rustc_legacy_const_generics(1)]
6511#[unstable(feature = "stdarch_mips", issue = "111198")]
6512pub unsafe fn __msa_maxi_u_w<const IMM5: i32>(a: v4u32) -> v4u32 {
6513    static_assert_uimm_bits!(IMM5, 5);
6514    msa_maxi_u_w(a, IMM5)
6515}
6516
6517/// Immediate Unsigned Maximum
6518///
6519/// Maximum values between unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
6520/// and the 5-bit unsigned immediate `imm5` are written to vector
6521/// (two unsigned 64-bit integer numbers).
6522///
6523#[inline]
6524#[target_feature(enable = "msa")]
6525#[cfg_attr(test, assert_instr(maxi_u.d, IMM5 = 0b11111))]
6526#[rustc_legacy_const_generics(1)]
6527#[unstable(feature = "stdarch_mips", issue = "111198")]
6528pub unsafe fn __msa_maxi_u_d<const IMM5: i32>(a: v2u64) -> v2u64 {
6529    static_assert_uimm_bits!(IMM5, 5);
6530    msa_maxi_u_d(a, IMM5)
6531}
6532
6533/// Vector Minimum Based on Absolute Value
6534///
6535/// The value with the smallest magnitude, i.e. absolute value, between corresponding
6536/// signed elements in vector `a` (sixteen signed 8-bit integer numbers) and
6537/// `b` (sixteen signed 8-bit integer numbers) are written to vector
6538/// (sixteen signed 8-bit integer numbers).
6539///
6540#[inline]
6541#[target_feature(enable = "msa")]
6542#[cfg_attr(test, assert_instr(min_a.b))]
6543#[unstable(feature = "stdarch_mips", issue = "111198")]
6544pub unsafe fn __msa_min_a_b(a: v16i8, b: v16i8) -> v16i8 {
6545    msa_min_a_b(a, mem::transmute(b))
6546}
6547
6548/// Vector Minimum Based on Absolute Value
6549///
6550/// The value with the smallest magnitude, i.e. absolute value, between corresponding
6551/// signed elements in vector `a` (eight signed 16-bit integer numbers) and
6552/// `b` (eight signed 16-bit integer numbers) are written to vector
6553/// (eight signed 16-bit integer numbers).
6554///
6555#[inline]
6556#[target_feature(enable = "msa")]
6557#[cfg_attr(test, assert_instr(min_a.h))]
6558#[unstable(feature = "stdarch_mips", issue = "111198")]
6559pub unsafe fn __msa_min_a_h(a: v8i16, b: v8i16) -> v8i16 {
6560    msa_min_a_h(a, mem::transmute(b))
6561}
6562
6563/// Vector Minimum Based on Absolute Value
6564///
6565/// The value with the smallest magnitude, i.e. absolute value, between corresponding
6566/// signed elements in vector `a` (four signed 32-bit integer numbers) and
6567/// `b` (four signed 32-bit integer numbers) are written to vector
6568/// (four signed 32-bit integer numbers).
6569///
6570#[inline]
6571#[target_feature(enable = "msa")]
6572#[cfg_attr(test, assert_instr(min_a.w))]
6573#[unstable(feature = "stdarch_mips", issue = "111198")]
6574pub unsafe fn __msa_min_a_w(a: v4i32, b: v4i32) -> v4i32 {
6575    msa_min_a_w(a, mem::transmute(b))
6576}
6577
6578/// Vector Minimum Based on Absolute Value
6579///
6580/// The value with the smallest magnitude, i.e. absolute value, between corresponding
6581/// signed elements in vector `a` (two signed 64-bit integer numbers) and
6582/// `b` (two signed 64-bit integer numbers) are written to vector
6583/// (two signed 64-bit integer numbers).
6584///
6585#[inline]
6586#[target_feature(enable = "msa")]
6587#[cfg_attr(test, assert_instr(min_a.d))]
6588#[unstable(feature = "stdarch_mips", issue = "111198")]
6589pub unsafe fn __msa_min_a_d(a: v2i64, b: v2i64) -> v2i64 {
6590    msa_min_a_d(a, mem::transmute(b))
6591}
6592
6593/// Vector Signed Minimum
6594///
6595/// Minimum values between signed elements in vector `a` (sixteen signed 8-bit integer numbers)
6596/// and signed elements in vector `b` (sixteen signed 8-bit integer numbers) are written to vector
6597/// (sixteen signed 8-bit integer numbers).
6598///
6599#[inline]
6600#[target_feature(enable = "msa")]
6601#[cfg_attr(test, assert_instr(min_s.b))]
6602#[unstable(feature = "stdarch_mips", issue = "111198")]
6603pub unsafe fn __msa_min_s_b(a: v16i8, b: v16i8) -> v16i8 {
6604    msa_min_s_b(a, mem::transmute(b))
6605}
6606
6607/// Vector Signed Minimum
6608///
6609/// Minimum values between signed elements in vector `a` (eight signed 16-bit integer numbers)
6610/// and signed elements in vector `b` (eight signed 16-bit integer numbers) are written to vector
6611/// (eight signed 16-bit integer numbers).
6612///
6613#[inline]
6614#[target_feature(enable = "msa")]
6615#[cfg_attr(test, assert_instr(min_s.h))]
6616#[unstable(feature = "stdarch_mips", issue = "111198")]
6617pub unsafe fn __msa_min_s_h(a: v8i16, b: v8i16) -> v8i16 {
6618    msa_min_s_h(a, mem::transmute(b))
6619}
6620
6621/// Vector Signed Minimum
6622///
6623/// Minimum values between signed elements in vector `a` (four signed 32-bit integer numbers)
6624/// and signed elements in vector `b` (four signed 32-bit integer numbers) are written to vector
6625/// (four signed 32-bit integer numbers).
6626///
6627#[inline]
6628#[target_feature(enable = "msa")]
6629#[cfg_attr(test, assert_instr(min_s.w))]
6630#[unstable(feature = "stdarch_mips", issue = "111198")]
6631pub unsafe fn __msa_min_s_w(a: v4i32, b: v4i32) -> v4i32 {
6632    msa_min_s_w(a, mem::transmute(b))
6633}
6634
6635/// Vector Signed Minimum
6636///
6637/// Minimum values between signed elements in vector `a` (two signed 64-bit integer numbers)
6638/// and signed elements in vector `b` (two signed 64-bit integer numbers) are written to vector
6639/// (two signed 64-bit integer numbers).
6640///
6641#[inline]
6642#[target_feature(enable = "msa")]
6643#[cfg_attr(test, assert_instr(min_s.d))]
6644#[unstable(feature = "stdarch_mips", issue = "111198")]
6645pub unsafe fn __msa_min_s_d(a: v2i64, b: v2i64) -> v2i64 {
6646    msa_min_s_d(a, mem::transmute(b))
6647}
6648
6649/// Immediate Signed Minimum
6650///
6651/// Minimum values between signed elements in vector `a` (sixteen signed 8-bit integer numbers)
6652/// and the 5-bit signed immediate imm_s5 are written to vector
6653/// (sixteen signed 8-bit integer numbers).
6654///
6655#[inline]
6656#[target_feature(enable = "msa")]
6657#[cfg_attr(test, assert_instr(mini_s.b, IMM_S5 = -1))]
6658#[rustc_legacy_const_generics(1)]
6659#[unstable(feature = "stdarch_mips", issue = "111198")]
6660pub unsafe fn __msa_mini_s_b<const IMM_S5: i32>(a: v16i8) -> v16i8 {
6661    static_assert_simm_bits!(IMM_S5, 5);
6662    msa_mini_s_b(a, IMM_S5)
6663}
6664
6665/// Immediate Signed Minimum
6666///
6667/// Minimum values between signed elements in vector `a` (eight signed 16-bit integer numbers)
6668/// and the 5-bit signed immediate imm_s5 are written to vector
6669/// (eight signed 16-bit integer numbers).
6670///
6671#[inline]
6672#[target_feature(enable = "msa")]
6673#[cfg_attr(test, assert_instr(mini_s.h, IMM_S5 = -1))]
6674#[rustc_legacy_const_generics(1)]
6675#[unstable(feature = "stdarch_mips", issue = "111198")]
6676pub unsafe fn __msa_mini_s_h<const IMM_S5: i32>(a: v8i16) -> v8i16 {
6677    static_assert_simm_bits!(IMM_S5, 5);
6678    msa_mini_s_h(a, IMM_S5)
6679}
6680
6681/// Immediate Signed Minimum
6682///
6683/// Minimum values between signed elements in vector `a` (four signed 32-bit integer numbers)
6684/// and the 5-bit signed immediate imm_s5 are written to vector
6685/// (four signed 32-bit integer numbers).
6686///
6687#[inline]
6688#[target_feature(enable = "msa")]
6689#[cfg_attr(test, assert_instr(mini_s.w, IMM_S5 = -1))]
6690#[rustc_legacy_const_generics(1)]
6691#[unstable(feature = "stdarch_mips", issue = "111198")]
6692pub unsafe fn __msa_mini_s_w<const IMM_S5: i32>(a: v4i32) -> v4i32 {
6693    static_assert_simm_bits!(IMM_S5, 5);
6694    msa_mini_s_w(a, IMM_S5)
6695}
6696
6697/// Immediate Signed Minimum
6698///
6699/// Minimum values between signed elements in vector `a` (two signed 64-bit integer numbers)
6700/// and the 5-bit signed immediate imm_s5 are written to vector
6701/// (two signed 64-bit integer numbers).
6702///
6703#[inline]
6704#[target_feature(enable = "msa")]
6705#[cfg_attr(test, assert_instr(mini_s.d, IMM_S5 = -1))]
6706#[rustc_legacy_const_generics(1)]
6707#[unstable(feature = "stdarch_mips", issue = "111198")]
6708pub unsafe fn __msa_mini_s_d<const IMM_S5: i32>(a: v2i64) -> v2i64 {
6709    static_assert_simm_bits!(IMM_S5, 5);
6710    msa_mini_s_d(a, IMM_S5)
6711}
6712
6713/// Vector Unsigned Minimum
6714///
6715/// Minimum values between unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
6716/// and unsigned elements in vector `b` (sixteen unsigned 8-bit integer numbers) are written to vector
6717/// (sixteen unsigned 8-bit integer numbers).
6718///
6719#[inline]
6720#[target_feature(enable = "msa")]
6721#[cfg_attr(test, assert_instr(min_u.b))]
6722#[unstable(feature = "stdarch_mips", issue = "111198")]
6723pub unsafe fn __msa_min_u_b(a: v16u8, b: v16u8) -> v16u8 {
6724    msa_min_u_b(a, mem::transmute(b))
6725}
6726
6727/// Vector Unsigned Minimum
6728///
6729/// Minimum values between unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
6730/// and unsigned elements in vector `b` (eight unsigned 16-bit integer numbers) are written to vector
6731/// (eight unsigned 16-bit integer numbers).
6732///
6733#[inline]
6734#[target_feature(enable = "msa")]
6735#[cfg_attr(test, assert_instr(min_u.h))]
6736#[unstable(feature = "stdarch_mips", issue = "111198")]
6737pub unsafe fn __msa_min_u_h(a: v8u16, b: v8u16) -> v8u16 {
6738    msa_min_u_h(a, mem::transmute(b))
6739}
6740
6741/// Vector Unsigned Minimum
6742///
6743/// Minimum values between unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
6744/// and unsigned elements in vector `b` (four unsigned 32-bit integer numbers) are written to vector
6745/// (four unsigned 32-bit integer numbers).
6746///
6747#[inline]
6748#[target_feature(enable = "msa")]
6749#[cfg_attr(test, assert_instr(min_u.w))]
6750#[unstable(feature = "stdarch_mips", issue = "111198")]
6751pub unsafe fn __msa_min_u_w(a: v4u32, b: v4u32) -> v4u32 {
6752    msa_min_u_w(a, mem::transmute(b))
6753}
6754
6755/// Vector Unsigned Minimum
6756///
6757/// Minimum values between unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
6758/// and unsigned elements in vector `b` (two unsigned 64-bit integer numbers) are written to vector
6759/// (two unsigned 64-bit integer numbers).
6760///
6761#[inline]
6762#[target_feature(enable = "msa")]
6763#[cfg_attr(test, assert_instr(min_u.d))]
6764#[unstable(feature = "stdarch_mips", issue = "111198")]
6765pub unsafe fn __msa_min_u_d(a: v2u64, b: v2u64) -> v2u64 {
6766    msa_min_u_d(a, mem::transmute(b))
6767}
6768
6769/// Immediate Unsigned Minimum
6770///
6771/// Minimum values between unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
6772/// and the 5-bit unsigned immediate `imm5` are written to vector
6773/// (sixteen unsigned 8-bit integer numbers).
6774///
6775#[inline]
6776#[target_feature(enable = "msa")]
6777#[cfg_attr(test, assert_instr(mini_u.b, IMM5 = 0b11111))]
6778#[rustc_legacy_const_generics(1)]
6779#[unstable(feature = "stdarch_mips", issue = "111198")]
6780pub unsafe fn __msa_mini_u_b<const IMM5: i32>(a: v16u8) -> v16u8 {
6781    static_assert_uimm_bits!(IMM5, 5);
6782    msa_mini_u_b(a, IMM5)
6783}
6784
6785/// Immediate Unsigned Minimum
6786///
6787/// Minimum values between unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
6788/// and the 5-bit unsigned immediate `imm5` are written to vector
6789/// (eight unsigned 16-bit integer numbers).
6790///
6791#[inline]
6792#[target_feature(enable = "msa")]
6793#[cfg_attr(test, assert_instr(mini_u.h, IMM5 = 0b11111))]
6794#[rustc_legacy_const_generics(1)]
6795#[unstable(feature = "stdarch_mips", issue = "111198")]
6796pub unsafe fn __msa_mini_u_h<const IMM5: i32>(a: v8u16) -> v8u16 {
6797    static_assert_uimm_bits!(IMM5, 5);
6798    msa_mini_u_h(a, IMM5)
6799}
6800
6801/// Immediate Unsigned Minimum
6802///
6803/// Minimum values between unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
6804/// and the 5-bit unsigned immediate `imm5` are written to vector
6805/// (four unsigned 32-bit integer numbers).
6806///
6807#[inline]
6808#[target_feature(enable = "msa")]
6809#[cfg_attr(test, assert_instr(mini_u.w, IMM5 = 0b11111))]
6810#[rustc_legacy_const_generics(1)]
6811#[unstable(feature = "stdarch_mips", issue = "111198")]
6812pub unsafe fn __msa_mini_u_w<const IMM5: i32>(a: v4u32) -> v4u32 {
6813    static_assert_uimm_bits!(IMM5, 5);
6814    msa_mini_u_w(a, IMM5)
6815}
6816
6817/// Immediate Unsigned Minimum
6818///
6819/// Minimum values between unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
6820/// and the 5-bit unsigned immediate `imm5` are written to vector
6821/// (two unsigned 64-bit integer numbers).
6822///
6823#[inline]
6824#[target_feature(enable = "msa")]
6825#[cfg_attr(test, assert_instr(mini_u.d, IMM5 = 0b11111))]
6826#[rustc_legacy_const_generics(1)]
6827#[unstable(feature = "stdarch_mips", issue = "111198")]
6828pub unsafe fn __msa_mini_u_d<const IMM5: i32>(a: v2u64) -> v2u64 {
6829    static_assert_uimm_bits!(IMM5, 5);
6830    msa_mini_u_d(a, IMM5)
6831}
6832
6833/// Vector Signed Modulo
6834///
6835/// The signed integer elements in vector `a` (sixteen signed 8-bit integer numbers)
6836/// are divided by signed integer elements in vector `b` (sixteen signed 8-bit integer numbers).
6837/// The remainder of the same sign as the dividend is written to vector
6838/// (sixteen signed 8-bit integer numbers). If a divisor element vector `b` is zero,
6839/// the result value is UNPREDICTABLE.
6840///
6841#[inline]
6842#[target_feature(enable = "msa")]
6843#[cfg_attr(test, assert_instr(mod_s.b))]
6844#[unstable(feature = "stdarch_mips", issue = "111198")]
6845pub unsafe fn __msa_mod_s_b(a: v16i8, b: v16i8) -> v16i8 {
6846    msa_mod_s_b(a, mem::transmute(b))
6847}
6848
6849/// Vector Signed Modulo
6850///
6851/// The signed integer elements in vector `a` (eight signed 16-bit integer numbers)
6852/// are divided by signed integer elements in vector `b` (eight signed 16-bit integer numbers).
6853/// The remainder of the same sign as the dividend is written to vector
6854/// (eight signed 16-bit integer numbers). If a divisor element vector `b` is zero,
6855/// the result value is UNPREDICTABLE.
6856///
6857#[inline]
6858#[target_feature(enable = "msa")]
6859#[cfg_attr(test, assert_instr(mod_s.h))]
6860#[unstable(feature = "stdarch_mips", issue = "111198")]
6861pub unsafe fn __msa_mod_s_h(a: v8i16, b: v8i16) -> v8i16 {
6862    msa_mod_s_h(a, mem::transmute(b))
6863}
6864
6865/// Vector Signed Modulo
6866///
6867/// The signed integer elements in vector `a` (four signed 32-bit integer numbers)
6868/// are divided by signed integer elements in vector `b` (four signed 32-bit integer numbers).
6869/// The remainder of the same sign as the dividend is written to vector
6870/// (four signed 32-bit integer numbers). If a divisor element vector `b` is zero,
6871/// the result value is UNPREDICTABLE.
6872///
6873#[inline]
6874#[target_feature(enable = "msa")]
6875#[cfg_attr(test, assert_instr(mod_s.w))]
6876#[unstable(feature = "stdarch_mips", issue = "111198")]
6877pub unsafe fn __msa_mod_s_w(a: v4i32, b: v4i32) -> v4i32 {
6878    msa_mod_s_w(a, mem::transmute(b))
6879}
6880
6881/// Vector Signed Modulo
6882///
6883/// The signed integer elements in vector `a` (two signed 64-bit integer numbers)
6884/// are divided by signed integer elements in vector `b` (two signed 64-bit integer numbers).
6885/// The remainder of the same sign as the dividend is written to vector
6886/// (two signed 64-bit integer numbers). If a divisor element vector `b` is zero,
6887/// the result value is UNPREDICTABLE.
6888///
6889#[inline]
6890#[target_feature(enable = "msa")]
6891#[cfg_attr(test, assert_instr(mod_s.d))]
6892#[unstable(feature = "stdarch_mips", issue = "111198")]
6893pub unsafe fn __msa_mod_s_d(a: v2i64, b: v2i64) -> v2i64 {
6894    msa_mod_s_d(a, mem::transmute(b))
6895}
6896
6897/// Vector Unsigned Modulo
6898///
6899/// The unsigned integer elements in vector `a` (sixteen unsigned 8-bit integer numbers)
6900/// are divided by unsigned integer elements in vector `b` (sixteen unsigned 8-bit integer numbers).
6901/// The remainder of the same sign as the dividend is written to vector
6902/// (sixteen unsigned 8-bit integer numbers). If a divisor element vector `b` is zero,
6903/// the result value is UNPREDICTABLE.
6904///
6905#[inline]
6906#[target_feature(enable = "msa")]
6907#[cfg_attr(test, assert_instr(mod_u.b))]
6908#[unstable(feature = "stdarch_mips", issue = "111198")]
6909pub unsafe fn __msa_mod_u_b(a: v16u8, b: v16u8) -> v16u8 {
6910    msa_mod_u_b(a, mem::transmute(b))
6911}
6912
6913/// Vector Unsigned Modulo
6914///
6915/// The unsigned integer elements in vector `a` (eight unsigned 16-bit integer numbers)
6916/// are divided by unsigned integer elements in vector `b` (eight unsigned 16-bit integer numbers).
6917/// The remainder of the same sign as the dividend is written to vector
6918/// (eight unsigned 16-bit integer numbers). If a divisor element vector `b` is zero,
6919/// the result value is UNPREDICTABLE.
6920///
6921#[inline]
6922#[target_feature(enable = "msa")]
6923#[cfg_attr(test, assert_instr(mod_u.h))]
6924#[unstable(feature = "stdarch_mips", issue = "111198")]
6925pub unsafe fn __msa_mod_u_h(a: v8u16, b: v8u16) -> v8u16 {
6926    msa_mod_u_h(a, mem::transmute(b))
6927}
6928
6929/// Vector Unsigned Modulo
6930///
6931/// The unsigned integer elements in vector `a` (four unsigned 32-bit integer numbers)
6932/// are divided by unsigned integer elements in vector `b` (four unsigned 32-bit integer numbers).
6933/// The remainder of the same sign as the dividend is written to vector
6934/// (four unsigned 32-bit integer numbers). If a divisor element vector `b` is zero,
6935/// the result value is UNPREDICTABLE.
6936///
6937#[inline]
6938#[target_feature(enable = "msa")]
6939#[cfg_attr(test, assert_instr(mod_u.w))]
6940#[unstable(feature = "stdarch_mips", issue = "111198")]
6941pub unsafe fn __msa_mod_u_w(a: v4u32, b: v4u32) -> v4u32 {
6942    msa_mod_u_w(a, mem::transmute(b))
6943}
6944
6945/// Vector Unsigned Modulo
6946///
6947/// The unsigned integer elements in vector `a` (two unsigned 64-bit integer numbers)
6948/// are divided by unsigned integer elements in vector `b` (two unsigned 64-bit integer numbers).
6949/// The remainder of the same sign as the dividend is written to vector
6950/// (two unsigned 64-bit integer numbers). If a divisor element vector `b` is zero,
6951/// the result value is UNPREDICTABLE.
6952///
6953#[inline]
6954#[target_feature(enable = "msa")]
6955#[cfg_attr(test, assert_instr(mod_u.d))]
6956#[unstable(feature = "stdarch_mips", issue = "111198")]
6957pub unsafe fn __msa_mod_u_d(a: v2u64, b: v2u64) -> v2u64 {
6958    msa_mod_u_d(a, mem::transmute(b))
6959}
6960
6961/// Vector Move
6962///
6963/// Copy all WRLEN bits in vector `a` (eight signed 16-bit integer numbers)
6964/// to vector (eight signed 16-bit integer numbers).
6965///
6966#[inline]
6967#[target_feature(enable = "msa")]
6968#[cfg_attr(test, assert_instr(move.v))]
6969#[unstable(feature = "stdarch_mips", issue = "111198")]
6970pub unsafe fn __msa_move_v(a: v16i8) -> v16i8 {
6971    msa_move_v(a)
6972}
6973
6974/// Vector Fixed-Point Multiply and Subtract
6975///
6976/// The product of fixed-point elements in vector `c` (eight signed 16-bit integer numbers)
6977/// by fixed-point elements in vector `b` (eight signed 16-bit integer numbers)
6978/// are subtracted from the fixed-point elements in vector `a`
6979/// (eight signed 16-bit integer numbers). The multiplication result is not saturated,
6980/// i.e. exact (-1) * (-1) = 1 is subtracted from the destination.
6981/// The saturated fixed-point results are stored back to vector `a`.
6982///
6983#[inline]
6984#[target_feature(enable = "msa")]
6985#[cfg_attr(test, assert_instr(msub_q.h))]
6986#[unstable(feature = "stdarch_mips", issue = "111198")]
6987pub unsafe fn __msa_msub_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
6988    msa_msub_q_h(a, mem::transmute(b), c)
6989}
6990
6991/// Vector Fixed-Point Multiply and Subtract
6992///
6993/// The product of fixed-point elements in vector `c` (four signed 32-bit integer numbers)
6994/// by fixed-point elements in vector `b` (four signed 32-bit integer numbers)
6995/// are subtracted from the fixed-point elements in vector `a`
6996/// (four signed 32-bit integer numbers). The multiplication result is not saturated,
6997/// i.e. exact (-1) * (-1) = 1 is subtracted from the destination.
6998/// The saturated fixed-point results are stored back to vector `a`.
6999///
7000#[inline]
7001#[target_feature(enable = "msa")]
7002#[cfg_attr(test, assert_instr(msub_q.w))]
7003#[unstable(feature = "stdarch_mips", issue = "111198")]
7004pub unsafe fn __msa_msub_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
7005    msa_msub_q_w(a, mem::transmute(b), c)
7006}
7007
7008/// Vector Fixed-Point Multiply and Subtract Rounded
7009///
7010/// The product of fixed-point elements in vector `c` (eight signed 16-bit integer numbers)
7011/// by fixed-point elements in vector `b` (eight signed 16-bit integer numbers)
7012/// are subtracted from the fixed-point elements in vector `a`
7013/// (eight signed 16-bit integer numbers). The multiplication result is not saturated,
7014/// i.e. exact (-1) * (-1) = 1 is subtracted from the destination.
7015/// The rounded and saturated fixed-point results are stored back to vector `a`.
7016///
7017#[inline]
7018#[target_feature(enable = "msa")]
7019#[cfg_attr(test, assert_instr(msubr_q.h))]
7020#[unstable(feature = "stdarch_mips", issue = "111198")]
7021pub unsafe fn __msa_msubr_q_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
7022    msa_msubr_q_h(a, mem::transmute(b), c)
7023}
7024
7025/// Vector Fixed-Point Multiply and Subtract Rounded
7026///
7027/// The product of fixed-point elements in vector `c` (four signed 32-bit integer numbers)
7028/// by fixed-point elements in vector `b` (four signed 32-bit integer numbers)
7029/// are subtracted from the fixed-point elements in vector `a`
7030/// (four signed 32-bit integer numbers). The multiplication result is not saturated,
7031/// i.e. exact (-1) * (-1) = 1 is subtracted from the destination.
7032/// The rounded and saturated fixed-point results are stored back to vector `a`.
7033///
7034#[inline]
7035#[target_feature(enable = "msa")]
7036#[cfg_attr(test, assert_instr(msubr_q.w))]
7037#[unstable(feature = "stdarch_mips", issue = "111198")]
7038pub unsafe fn __msa_msubr_q_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
7039    msa_msubr_q_w(a, mem::transmute(b), c)
7040}
7041
7042/// Vector Multiply and Subtract
7043///
7044/// The integer elements in vector `c` (sixteen signed 8-bit integer numbers)
7045/// are multiplied by integer elements in vector `b` (sixteen signed 8-bit integer numbers)
7046/// and subtracted from the integer elements in vector `a` (sixteen signed 8-bit integer numbers).
7047/// The most significant half of the multiplication result is discarded.
7048///
7049#[inline]
7050#[target_feature(enable = "msa")]
7051#[cfg_attr(test, assert_instr(msubv.b))]
7052#[unstable(feature = "stdarch_mips", issue = "111198")]
7053pub unsafe fn __msa_msubv_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 {
7054    msa_msubv_b(a, mem::transmute(b), c)
7055}
7056
7057/// Vector Multiply and Subtract
7058///
7059/// The integer elements in vector `c` (eight signed 16-bit integer numbers)
7060/// are multiplied by integer elements in vector `b` (eight signed 16-bit integer numbers)
7061/// and subtracted from the integer elements in vector `a` (eight signed 16-bit integer numbers).
7062/// The most significant half of the multiplication result is discarded.
7063///
7064#[inline]
7065#[target_feature(enable = "msa")]
7066#[cfg_attr(test, assert_instr(msubv.h))]
7067#[unstable(feature = "stdarch_mips", issue = "111198")]
7068pub unsafe fn __msa_msubv_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
7069    msa_msubv_h(a, mem::transmute(b), c)
7070}
7071
7072/// Vector Multiply and Subtract
7073///
7074/// The integer elements in vector `c` (four signed 32-bit integer numbers)
7075/// are multiplied by integer elements in vector `b` (four signed 32-bit integer numbers)
7076/// and subtracted from the integer elements in vector `a` (four signed 32-bit integer numbers).
7077/// The most significant half of the multiplication result is discarded.
7078///
7079#[inline]
7080#[target_feature(enable = "msa")]
7081#[cfg_attr(test, assert_instr(msubv.w))]
7082#[unstable(feature = "stdarch_mips", issue = "111198")]
7083pub unsafe fn __msa_msubv_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
7084    msa_msubv_w(a, mem::transmute(b), c)
7085}
7086
7087/// Vector Multiply and Subtract
7088///
7089/// The integer elements in vector `c` (two signed 64-bit integer numbers)
7090/// are multiplied by integer elements in vector `b` (two signed 64-bit integer numbers)
7091/// and subtracted from the integer elements in vector `a` (two signed 64-bit integer numbers).
7092/// The most significant half of the multiplication result is discarded.
7093///
7094#[inline]
7095#[target_feature(enable = "msa")]
7096#[cfg_attr(test, assert_instr(msubv.d))]
7097#[unstable(feature = "stdarch_mips", issue = "111198")]
7098pub unsafe fn __msa_msubv_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 {
7099    msa_msubv_d(a, mem::transmute(b), c)
7100}
7101
7102/// Vector Fixed-Point Multiply
7103///
7104/// The fixed-point elements in vector `a` (eight signed 16-bit integer numbers)
7105/// multiplied by fixed-point elements in vector `b` (eight signed 16-bit integer numbers).
7106/// The result is written to vector (eight signed 16-bit integer numbers).
7107///
7108#[inline]
7109#[target_feature(enable = "msa")]
7110#[cfg_attr(test, assert_instr(mul_q.h))]
7111#[unstable(feature = "stdarch_mips", issue = "111198")]
7112pub unsafe fn __msa_mul_q_h(a: v8i16, b: v8i16) -> v8i16 {
7113    msa_mul_q_h(a, mem::transmute(b))
7114}
7115
7116/// Vector Fixed-Point Multiply
7117///
7118/// The fixed-point elements in vector `a` (four signed 32-bit integer numbers)
7119/// multiplied by fixed-point elements in vector `b` (four signed 32-bit integer numbers).
7120/// The result is written to vector (four signed 32-bit integer numbers).
7121///
7122#[inline]
7123#[target_feature(enable = "msa")]
7124#[cfg_attr(test, assert_instr(mul_q.w))]
7125#[unstable(feature = "stdarch_mips", issue = "111198")]
7126pub unsafe fn __msa_mul_q_w(a: v4i32, b: v4i32) -> v4i32 {
7127    msa_mul_q_w(a, mem::transmute(b))
7128}
7129
7130/// Vector Fixed-Point Multiply Rounded
7131///
7132/// The fixed-point elements in vector `a` (eight signed 16-bit integer numbers)
7133/// multiplied by fixed-point elements in vector `b` (eight signed 16-bit integer numbers).
7134/// The rounded result is written to vector (eight signed 16-bit integer numbers).
7135///
7136#[inline]
7137#[target_feature(enable = "msa")]
7138#[cfg_attr(test, assert_instr(mulr_q.h))]
7139#[unstable(feature = "stdarch_mips", issue = "111198")]
7140pub unsafe fn __msa_mulr_q_h(a: v8i16, b: v8i16) -> v8i16 {
7141    msa_mulr_q_h(a, mem::transmute(b))
7142}
7143
7144/// Vector Fixed-Point Multiply Rounded
7145///
7146/// The fixed-point elements in vector `a` (four signed 32-bit integer numbers)
7147/// multiplied by fixed-point elements in vector `b` (four signed 32-bit integer numbers).
7148/// The rounded result is written to vector (four signed 32-bit integer numbers).
7149///
7150#[inline]
7151#[target_feature(enable = "msa")]
7152#[cfg_attr(test, assert_instr(mulr_q.w))]
7153#[unstable(feature = "stdarch_mips", issue = "111198")]
7154pub unsafe fn __msa_mulr_q_w(a: v4i32, b: v4i32) -> v4i32 {
7155    msa_mulr_q_w(a, mem::transmute(b))
7156}
7157
7158/// Vector Multiply
7159///
7160/// The integer elements in vector `a` (sixteen signed 8-bit integer numbers)
7161/// are multiplied by integer elements in vector `b` (sixteen signed 8-bit integer numbers).
7162/// The result is written to vector (sixteen signed 8-bit integer numbers).
7163/// The most significant half of the multiplication result is discarded.
7164///
7165#[inline]
7166#[target_feature(enable = "msa")]
7167#[cfg_attr(test, assert_instr(mulv.b))]
7168#[unstable(feature = "stdarch_mips", issue = "111198")]
7169pub unsafe fn __msa_mulv_b(a: v16i8, b: v16i8) -> v16i8 {
7170    msa_mulv_b(a, mem::transmute(b))
7171}
7172
7173/// Vector Multiply
7174///
7175/// The integer elements in vector `a` (eight signed 16-bit integer numbers)
7176/// are multiplied by integer elements in vector `b` (eight signed 16-bit integer numbers).
7177/// The result is written to vector (eight signed 16-bit integer numbers).
7178/// The most significant half of the multiplication result is discarded.
7179///
7180#[inline]
7181#[target_feature(enable = "msa")]
7182#[cfg_attr(test, assert_instr(mulv.h))]
7183#[unstable(feature = "stdarch_mips", issue = "111198")]
7184pub unsafe fn __msa_mulv_h(a: v8i16, b: v8i16) -> v8i16 {
7185    msa_mulv_h(a, mem::transmute(b))
7186}
7187
7188/// Vector Multiply
7189///
7190/// The integer elements in vector `a` (four signed 32-bit integer numbers)
7191/// are multiplied by integer elements in vector `b` (four signed 32-bit integer numbers).
7192/// The result is written to vector (four signed 32-bit integer numbers).
7193/// The most significant half of the multiplication result is discarded.
7194///
7195#[inline]
7196#[target_feature(enable = "msa")]
7197#[cfg_attr(test, assert_instr(mulv.w))]
7198#[unstable(feature = "stdarch_mips", issue = "111198")]
7199pub unsafe fn __msa_mulv_w(a: v4i32, b: v4i32) -> v4i32 {
7200    msa_mulv_w(a, mem::transmute(b))
7201}
7202
7203/// Vector Multiply
7204///
7205/// The integer elements in vector `a` (two signed 64-bit integer numbers)
7206/// are multiplied by integer elements in vector `b` (two signed 64-bit integer numbers).
7207/// The result is written to vector (two signed 64-bit integer numbers).
7208/// The most significant half of the multiplication result is discarded.
7209///
7210#[inline]
7211#[target_feature(enable = "msa")]
7212#[cfg_attr(test, assert_instr(mulv.d))]
7213#[unstable(feature = "stdarch_mips", issue = "111198")]
7214pub unsafe fn __msa_mulv_d(a: v2i64, b: v2i64) -> v2i64 {
7215    msa_mulv_d(a, mem::transmute(b))
7216}
7217
7218/// Vector Leading Ones Count
7219///
7220/// The number of leading ones for elements in vector `a` (sixteen signed 8-bit integer numbers)
7221/// is stored to the elements in vector (sixteen signed 8-bit integer numbers).
7222///
7223#[inline]
7224#[target_feature(enable = "msa")]
7225#[cfg_attr(test, assert_instr(nloc.b))]
7226#[unstable(feature = "stdarch_mips", issue = "111198")]
7227pub unsafe fn __msa_nloc_b(a: v16i8) -> v16i8 {
7228    msa_nloc_b(a)
7229}
7230
7231/// Vector Leading Ones Count
7232///
7233/// The number of leading ones for elements in vector `a` (eight signed 16-bit integer numbers)
7234/// is stored to the elements in vector (eight signed 16-bit integer numbers).
7235///
7236#[inline]
7237#[target_feature(enable = "msa")]
7238#[cfg_attr(test, assert_instr(nloc.h))]
7239#[unstable(feature = "stdarch_mips", issue = "111198")]
7240pub unsafe fn __msa_nloc_h(a: v8i16) -> v8i16 {
7241    msa_nloc_h(a)
7242}
7243
7244/// Vector Leading Ones Count
7245///
7246/// The number of leading ones for elements in vector `a` (four signed 32-bit integer numbers)
7247/// is stored to the elements in vector (four signed 32-bit integer numbers).
7248///
7249#[inline]
7250#[target_feature(enable = "msa")]
7251#[cfg_attr(test, assert_instr(nloc.w))]
7252#[unstable(feature = "stdarch_mips", issue = "111198")]
7253pub unsafe fn __msa_nloc_w(a: v4i32) -> v4i32 {
7254    msa_nloc_w(a)
7255}
7256
7257/// Vector Leading Ones Count
7258///
7259/// The number of leading ones for elements in vector `a` (two signed 64-bit integer numbers)
7260/// is stored to the elements in vector (two signed 64-bit integer numbers).
7261///
7262#[inline]
7263#[target_feature(enable = "msa")]
7264#[cfg_attr(test, assert_instr(nloc.d))]
7265#[unstable(feature = "stdarch_mips", issue = "111198")]
7266pub unsafe fn __msa_nloc_d(a: v2i64) -> v2i64 {
7267    msa_nloc_d(a)
7268}
7269
7270/// Vector Leading Zeros Count
7271///
7272/// The number of leading zeros for elements in vector `a` (sixteen signed 8-bit integer numbers)
7273/// is stored to the elements in vector (sixteen signed 8-bit integer numbers).
7274///
7275#[inline]
7276#[target_feature(enable = "msa")]
7277#[cfg_attr(test, assert_instr(nlzc.b))]
7278#[unstable(feature = "stdarch_mips", issue = "111198")]
7279pub unsafe fn __msa_nlzc_b(a: v16i8) -> v16i8 {
7280    msa_nlzc_b(a)
7281}
7282
7283/// Vector Leading Zeros Count
7284///
7285/// The number of leading zeros for elements in vector `a` (eight signed 16-bit integer numbers)
7286/// is stored to the elements in vector (eight signed 16-bit integer numbers).
7287///
7288#[inline]
7289#[target_feature(enable = "msa")]
7290#[cfg_attr(test, assert_instr(nlzc.h))]
7291#[unstable(feature = "stdarch_mips", issue = "111198")]
7292pub unsafe fn __msa_nlzc_h(a: v8i16) -> v8i16 {
7293    msa_nlzc_h(a)
7294}
7295
7296/// Vector Leading Zeros Count
7297///
7298/// The number of leading zeros for elements in vector `a` (four signed 32-bit integer numbers)
7299/// is stored to the elements in vector (four signed 32-bit integer numbers).
7300///
7301#[inline]
7302#[target_feature(enable = "msa")]
7303#[cfg_attr(test, assert_instr(nlzc.w))]
7304#[unstable(feature = "stdarch_mips", issue = "111198")]
7305pub unsafe fn __msa_nlzc_w(a: v4i32) -> v4i32 {
7306    msa_nlzc_w(a)
7307}
7308
7309/// Vector Leading Zeros Count
7310///
7311/// The number of leading zeros for elements in vector `a` (two signed 64-bit integer numbers)
7312/// is stored to the elements in vector (two signed 64-bit integer numbers).
7313///
7314#[inline]
7315#[target_feature(enable = "msa")]
7316#[cfg_attr(test, assert_instr(nlzc.d))]
7317#[unstable(feature = "stdarch_mips", issue = "111198")]
7318pub unsafe fn __msa_nlzc_d(a: v2i64) -> v2i64 {
7319    msa_nlzc_d(a)
7320}
7321
7322/// Vector Logical Negated Or
7323///
7324/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
7325/// is combined with the corresponding bit of vector `b` (sixteen unsigned 8-bit integer numbers)
7326/// in a bitwise logical NOR operation. The result is written to vector
7327/// (sixteen unsigned 8-bit integer numbers).
7328///
7329#[inline]
7330#[target_feature(enable = "msa")]
7331#[cfg_attr(test, assert_instr(nor.v))]
7332#[unstable(feature = "stdarch_mips", issue = "111198")]
7333pub unsafe fn __msa_nor_v(a: v16u8, b: v16u8) -> v16u8 {
7334    msa_nor_v(a, mem::transmute(b))
7335}
7336
7337/// Immediate Logical Negated Or
7338///
7339/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
7340/// is combined with the 8-bit immediate `imm8`
7341/// in a bitwise logical NOR operation. The result is written to vector
7342/// (sixteen unsigned 8-bit integer numbers).
7343///
7344#[inline]
7345#[target_feature(enable = "msa")]
7346#[cfg_attr(test, assert_instr(nori.b, IMM8 = 0b11111111))]
7347#[rustc_legacy_const_generics(1)]
7348#[unstable(feature = "stdarch_mips", issue = "111198")]
7349pub unsafe fn __msa_nori_b<const IMM8: i32>(a: v16u8) -> v16u8 {
7350    static_assert_uimm_bits!(IMM8, 8);
7351    msa_nori_b(a, IMM8)
7352}
7353
7354/// Vector Logical Or
7355///
7356/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
7357/// is combined with the corresponding bit of vector `b` (sixteen unsigned 8-bit integer numbers)
7358/// in a bitwise logical OR operation. The result is written to vector
7359/// (sixteen unsigned 8-bit integer numbers).
7360///
7361#[inline]
7362#[target_feature(enable = "msa")]
7363#[cfg_attr(test, assert_instr(or.v))]
7364#[unstable(feature = "stdarch_mips", issue = "111198")]
7365pub unsafe fn __msa_or_v(a: v16u8, b: v16u8) -> v16u8 {
7366    msa_or_v(a, mem::transmute(b))
7367}
7368
7369/// Immediate Logical Or
7370///
7371/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
7372/// is combined with the 8-bit immediate `imm8`
7373/// in a bitwise logical OR operation. The result is written to vector
7374/// (sixteen unsigned 8-bit integer numbers).
7375///
7376#[inline]
7377#[target_feature(enable = "msa")]
7378#[cfg_attr(test, assert_instr(ori.b, IMM8 = 0b11111111))]
7379#[rustc_legacy_const_generics(1)]
7380#[unstable(feature = "stdarch_mips", issue = "111198")]
7381pub unsafe fn __msa_ori_b<const IMM8: i32>(a: v16u8) -> v16u8 {
7382    static_assert_uimm_bits!(IMM8, 8);
7383    msa_ori_b(a, IMM8)
7384}
7385
7386/// Vector Pack Even
7387///
7388/// Even elements in vectors `a` (sixteen signed 8-bit integer numbers)
7389/// are copied to the left half of the result vector and even elements in vector `b`
7390/// (sixteen signed 8-bit integer numbers) are copied to the right half of the result vector.
7391///
7392#[inline]
7393#[target_feature(enable = "msa")]
7394#[cfg_attr(test, assert_instr(pckev.b))]
7395#[unstable(feature = "stdarch_mips", issue = "111198")]
7396pub unsafe fn __msa_pckev_b(a: v16i8, b: v16i8) -> v16i8 {
7397    msa_pckev_b(a, mem::transmute(b))
7398}
7399
7400/// Vector Pack Even
7401///
7402/// Even elements in vectors `a` (eight signed 16-bit integer numbers)
7403/// are copied to the left half of the result vector and even elements in vector `b`
7404/// (eight signed 16-bit integer numbers) are copied to the right half of the result vector.
7405///
7406#[inline]
7407#[target_feature(enable = "msa")]
7408#[cfg_attr(test, assert_instr(pckev.h))]
7409#[unstable(feature = "stdarch_mips", issue = "111198")]
7410pub unsafe fn __msa_pckev_h(a: v8i16, b: v8i16) -> v8i16 {
7411    msa_pckev_h(a, mem::transmute(b))
7412}
7413
7414/// Vector Pack Even
7415///
7416/// Even elements in vectors `a` (four signed 32-bit integer numbers)
7417/// are copied to the left half of the result vector and even elements in vector `b`
7418/// (four signed 32-bit integer numbers) are copied to the right half of the result vector.
7419///
7420#[inline]
7421#[target_feature(enable = "msa")]
7422#[cfg_attr(test, assert_instr(pckev.w))]
7423#[unstable(feature = "stdarch_mips", issue = "111198")]
7424pub unsafe fn __msa_pckev_w(a: v4i32, b: v4i32) -> v4i32 {
7425    msa_pckev_w(a, mem::transmute(b))
7426}
7427
7428/// Vector Pack Even
7429///
7430/// Even elements in vectors `a` (two signed 64-bit integer numbers)
7431/// are copied to the left half of the result vector and even elements in vector `b`
7432/// (two signed 64-bit integer numbers) are copied to the right half of the result vector.
7433///
7434#[inline]
7435#[target_feature(enable = "msa")]
7436#[cfg_attr(test, assert_instr(pckev.d))]
7437#[unstable(feature = "stdarch_mips", issue = "111198")]
7438pub unsafe fn __msa_pckev_d(a: v2i64, b: v2i64) -> v2i64 {
7439    msa_pckev_d(a, mem::transmute(b))
7440}
7441
7442/// Vector Pack Odd
7443///
7444/// Odd elements in vectors `a` (sixteen signed 8-bit integer numbers)
7445/// are copied to the left half of the result vector and odd elements in vector `b`
7446/// (sixteen signed 8-bit integer numbers) are copied to the right half of the result vector.
7447///
7448#[inline]
7449#[target_feature(enable = "msa")]
7450#[cfg_attr(test, assert_instr(pckod.b))]
7451#[unstable(feature = "stdarch_mips", issue = "111198")]
7452pub unsafe fn __msa_pckod_b(a: v16i8, b: v16i8) -> v16i8 {
7453    msa_pckod_b(a, mem::transmute(b))
7454}
7455
7456/// Vector Pack Odd
7457///
7458/// Odd elements in vectors `a` (eight signed 16-bit integer numbers)
7459/// are copied to the left half of the result vector and odd elements in vector `b`
7460/// (eight signed 16-bit integer numbers) are copied to the right half of the result vector.
7461///
7462#[inline]
7463#[target_feature(enable = "msa")]
7464#[cfg_attr(test, assert_instr(pckod.h))]
7465#[unstable(feature = "stdarch_mips", issue = "111198")]
7466pub unsafe fn __msa_pckod_h(a: v8i16, b: v8i16) -> v8i16 {
7467    msa_pckod_h(a, mem::transmute(b))
7468}
7469
7470/// Vector Pack Odd
7471///
7472/// Odd elements in vectors `a` (four signed 32-bit integer numbers)
7473/// are copied to the left half of the result vector and odd elements in vector `b`
7474/// (four signed 32-bit integer numbers) are copied to the right half of the result vector.
7475///
7476#[inline]
7477#[target_feature(enable = "msa")]
7478#[cfg_attr(test, assert_instr(pckod.w))]
7479#[unstable(feature = "stdarch_mips", issue = "111198")]
7480pub unsafe fn __msa_pckod_w(a: v4i32, b: v4i32) -> v4i32 {
7481    msa_pckod_w(a, mem::transmute(b))
7482}
7483
7484/// Vector Pack Odd
7485///
7486/// Odd elements in vectors `a` (two signed 64-bit integer numbers)
7487/// are copied to the left half of the result vector and odd elements in vector `b`
7488/// (two signed 64-bit integer numbers) are copied to the right half of the result vector.
7489///
7490#[inline]
7491#[target_feature(enable = "msa")]
7492#[cfg_attr(test, assert_instr(pckod.d))]
7493#[unstable(feature = "stdarch_mips", issue = "111198")]
7494pub unsafe fn __msa_pckod_d(a: v2i64, b: v2i64) -> v2i64 {
7495    msa_pckod_d(a, mem::transmute(b))
7496}
7497
7498/// Vector Population Count
7499///
7500/// The number of bits set to 1 for elements in vector `a` (sixteen signed 8-bit integer numbers)
7501/// is stored to the elements in the result vector (sixteen signed 8-bit integer numbers).
7502///
7503#[inline]
7504#[target_feature(enable = "msa")]
7505#[cfg_attr(test, assert_instr(pcnt.b))]
7506#[unstable(feature = "stdarch_mips", issue = "111198")]
7507pub unsafe fn __msa_pcnt_b(a: v16i8) -> v16i8 {
7508    msa_pcnt_b(a)
7509}
7510
7511/// Vector Population Count
7512///
7513/// The number of bits set to 1 for elements in vector `a` (eight signed 16-bit integer numbers)
7514/// is stored to the elements in the result vector (eight signed 16-bit integer numbers).
7515///
7516#[inline]
7517#[target_feature(enable = "msa")]
7518#[cfg_attr(test, assert_instr(pcnt.h))]
7519#[unstable(feature = "stdarch_mips", issue = "111198")]
7520pub unsafe fn __msa_pcnt_h(a: v8i16) -> v8i16 {
7521    msa_pcnt_h(a)
7522}
7523
7524/// Vector Population Count
7525///
7526/// The number of bits set to 1 for elements in vector `a` (four signed 32-bit integer numbers)
7527/// is stored to the elements in the result vector (four signed 32-bit integer numbers).
7528///
7529#[inline]
7530#[target_feature(enable = "msa")]
7531#[cfg_attr(test, assert_instr(pcnt.w))]
7532#[unstable(feature = "stdarch_mips", issue = "111198")]
7533pub unsafe fn __msa_pcnt_w(a: v4i32) -> v4i32 {
7534    msa_pcnt_w(a)
7535}
7536
7537/// Vector Population Count
7538///
7539/// The number of bits set to 1 for elements in vector `a` (two signed 64-bit integer numbers)
7540/// is stored to the elements in the result vector (two signed 64-bit integer numbers).
7541///
7542#[inline]
7543#[target_feature(enable = "msa")]
7544#[cfg_attr(test, assert_instr(pcnt.d))]
7545#[unstable(feature = "stdarch_mips", issue = "111198")]
7546pub unsafe fn __msa_pcnt_d(a: v2i64) -> v2i64 {
7547    msa_pcnt_d(a)
7548}
7549
7550/// Immediate Signed Saturate
7551///
7552/// Signed elements in vector `a` (sixteen signed 8-bit integer numbers)
7553/// are saturated to signed values of `imm3+1` bits without changing the data width.
7554/// The result is stored in the vector (sixteen signed 8-bit integer numbers).
7555///
7556#[inline]
7557#[target_feature(enable = "msa")]
7558#[cfg_attr(test, assert_instr(sat_s.b, IMM3 = 0b111))]
7559#[rustc_legacy_const_generics(1)]
7560#[unstable(feature = "stdarch_mips", issue = "111198")]
7561pub unsafe fn __msa_sat_s_b<const IMM3: i32>(a: v16i8) -> v16i8 {
7562    static_assert_uimm_bits!(IMM3, 3);
7563    msa_sat_s_b(a, IMM3)
7564}
7565
7566/// Immediate Signed Saturate
7567///
7568/// Signed elements in vector `a` (eight signed 16-bit integer numbers)
7569/// are saturated to signed values of `imm4+1` bits without changing the data width.
7570/// The result is stored in the vector (eight signed 16-bit integer numbers).
7571///
7572#[inline]
7573#[target_feature(enable = "msa")]
7574#[cfg_attr(test, assert_instr(sat_s.h, IMM4 = 0b1111))]
7575#[rustc_legacy_const_generics(1)]
7576#[unstable(feature = "stdarch_mips", issue = "111198")]
7577pub unsafe fn __msa_sat_s_h<const IMM4: i32>(a: v8i16) -> v8i16 {
7578    static_assert_uimm_bits!(IMM4, 4);
7579    msa_sat_s_h(a, IMM4)
7580}
7581
7582/// Immediate Signed Saturate
7583///
7584/// Signed elements in vector `a` (four signed 32-bit integer numbers)
7585/// are saturated to signed values of `imm5+1` bits without changing the data width.
7586/// The result is stored in the vector (four signed 32-bit integer numbers).
7587///
7588#[inline]
7589#[target_feature(enable = "msa")]
7590#[cfg_attr(test, assert_instr(sat_s.w, IMM5 = 0b11111))]
7591#[rustc_legacy_const_generics(1)]
7592#[unstable(feature = "stdarch_mips", issue = "111198")]
7593pub unsafe fn __msa_sat_s_w<const IMM5: i32>(a: v4i32) -> v4i32 {
7594    static_assert_uimm_bits!(IMM5, 5);
7595    msa_sat_s_w(a, IMM5)
7596}
7597
7598/// Immediate Signed Saturate
7599///
7600/// Signed elements in vector `a` (two signed 64-bit integer numbers)
7601/// are saturated to signed values of `imm6+1` bits without changing the data width.
7602/// The result is stored in the vector (two signed 64-bit integer numbers).
7603///
7604#[inline]
7605#[target_feature(enable = "msa")]
7606#[cfg_attr(test, assert_instr(sat_s.d, IMM6 = 0b111111))]
7607#[rustc_legacy_const_generics(1)]
7608#[unstable(feature = "stdarch_mips", issue = "111198")]
7609pub unsafe fn __msa_sat_s_d<const IMM6: i32>(a: v2i64) -> v2i64 {
7610    static_assert_uimm_bits!(IMM6, 6);
7611    msa_sat_s_d(a, IMM6)
7612}
7613
7614/// Immediate Unsigned Saturate
7615///
7616/// Unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers)
7617/// are saturated to unsigned values of `imm3+1` bits without changing the data width.
7618/// The result is stored in the vector (sixteen unsigned 8-bit integer numbers).
7619///
7620#[inline]
7621#[target_feature(enable = "msa")]
7622#[cfg_attr(test, assert_instr(sat_u.b, IMM3 = 0b111))]
7623#[rustc_legacy_const_generics(1)]
7624#[unstable(feature = "stdarch_mips", issue = "111198")]
7625pub unsafe fn __msa_sat_u_b<const IMM3: i32>(a: v16u8) -> v16u8 {
7626    static_assert_uimm_bits!(IMM3, 3);
7627    msa_sat_u_b(a, IMM3)
7628}
7629
7630/// Immediate Unsigned Saturate
7631///
7632/// Unsigned elements in vector `a` (eight unsigned 16-bit integer numbers)
7633/// are saturated to unsigned values of `imm4+1` bits without changing the data width.
7634/// The result is stored in the vector (eight unsigned 16-bit integer numbers).
7635///
7636#[inline]
7637#[target_feature(enable = "msa")]
7638#[cfg_attr(test, assert_instr(sat_u.h, IMM4 = 0b1111))]
7639#[rustc_legacy_const_generics(1)]
7640#[unstable(feature = "stdarch_mips", issue = "111198")]
7641pub unsafe fn __msa_sat_u_h<const IMM4: i32>(a: v8u16) -> v8u16 {
7642    static_assert_uimm_bits!(IMM4, 4);
7643    msa_sat_u_h(a, IMM4)
7644}
7645
7646/// Immediate Unsigned Saturate
7647///
7648/// Unsigned elements in vector `a` (four unsigned 32-bit integer numbers)
7649/// are saturated to unsigned values of `imm5+1` bits without changing the data width.
7650/// The result is stored in the vector (four unsigned 32-bit integer numbers).
7651///
7652#[inline]
7653#[target_feature(enable = "msa")]
7654#[cfg_attr(test, assert_instr(sat_u.w, IMM5 = 0b11111))]
7655#[rustc_legacy_const_generics(1)]
7656#[unstable(feature = "stdarch_mips", issue = "111198")]
7657pub unsafe fn __msa_sat_u_w<const IMM5: i32>(a: v4u32) -> v4u32 {
7658    static_assert_uimm_bits!(IMM5, 5);
7659    msa_sat_u_w(a, IMM5)
7660}
7661
7662/// Immediate Unsigned Saturate
7663///
7664/// Unsigned elements in vector `a` (two unsigned 64-bit integer numbers)
7665/// are saturated to unsigned values of `imm6+1` bits without changing the data width.
7666/// The result is stored in the vector (two unsigned 64-bit integer numbers).
7667///
7668#[inline]
7669#[target_feature(enable = "msa")]
7670#[cfg_attr(test, assert_instr(sat_u.d, IMM6 = 0b111111))]
7671#[rustc_legacy_const_generics(1)]
7672#[unstable(feature = "stdarch_mips", issue = "111198")]
7673pub unsafe fn __msa_sat_u_d<const IMM6: i32>(a: v2u64) -> v2u64 {
7674    static_assert_uimm_bits!(IMM6, 6);
7675    msa_sat_u_d(a, IMM6)
7676}
7677
7678/// Immediate Set Shuffle Elements
7679///
7680/// The set shuffle instruction works on 4-element sets.
7681/// All sets are shuffled in the same way: the element i82i+1..2i in `a`
7682/// (sixteen signed 8-bit integer numbers) is copied over the element i in result vector
7683/// (sixteen signed 8-bit integer numbers), where i is 0, 1, 2, 3.
7684///
7685#[inline]
7686#[target_feature(enable = "msa")]
7687#[cfg_attr(test, assert_instr(shf.b, IMM8 = 0b11111111))]
7688#[rustc_legacy_const_generics(1)]
7689#[unstable(feature = "stdarch_mips", issue = "111198")]
7690pub unsafe fn __msa_shf_b<const IMM8: i32>(a: v16i8) -> v16i8 {
7691    static_assert_uimm_bits!(IMM8, 8);
7692    msa_shf_b(a, IMM8)
7693}
7694
7695/// Immediate Set Shuffle Elements
7696///
7697/// The set shuffle instruction works on 4-element sets.
7698/// All sets are shuffled in the same way: the element i82i+1..2i in `a`
7699/// (eight signed 16-bit integer numbers) is copied over the element i in result vector
7700/// (eight signed 16-bit integer numbers), where i is 0, 1, 2, 3.
7701///
7702#[inline]
7703#[target_feature(enable = "msa")]
7704#[cfg_attr(test, assert_instr(shf.h, IMM8 = 0b11111111))]
7705#[rustc_legacy_const_generics(1)]
7706#[unstable(feature = "stdarch_mips", issue = "111198")]
7707pub unsafe fn __msa_shf_h<const IMM8: i32>(a: v8i16) -> v8i16 {
7708    static_assert_uimm_bits!(IMM8, 8);
7709    msa_shf_h(a, IMM8)
7710}
7711
7712/// Immediate Set Shuffle Elements
7713///
7714/// The set shuffle instruction works on 4-element sets.
7715/// All sets are shuffled in the same way: the element i82i+1..2i in `a`
7716/// (four signed 32-bit integer numbers) is copied over the element i in result vector
7717/// (four signed 32-bit integer numbers), where i is 0, 1, 2, 3.
7718///
7719#[inline]
7720#[target_feature(enable = "msa")]
7721#[cfg_attr(test, assert_instr(shf.w, IMM8 = 0b11111111))]
7722#[rustc_legacy_const_generics(1)]
7723#[unstable(feature = "stdarch_mips", issue = "111198")]
7724pub unsafe fn __msa_shf_w<const IMM8: i32>(a: v4i32) -> v4i32 {
7725    static_assert_uimm_bits!(IMM8, 8);
7726    msa_shf_w(a, IMM8)
7727}
7728
7729/// GPR Columns Slide
7730///
7731/// Vector registers `a` (sixteen signed 8-bit integer numbers) and `b`
7732/// (sixteen signed 8-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
7733/// stored row-wise with as many rows as bytes in integer data format df.
7734/// The two source rectangles `b` and `a` are concatenated horizontally in the order
7735/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
7736/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
7737/// by the number of columns given in GPR `c`.
7738/// The result is written to vector (sixteen signed 8-bit integer numbers).
7739/// GPR `c` value is interpreted modulo the number of columns in destination rectangle,
7740/// or equivalently, the number of data format df elements in the destination vector.
7741///
7742#[inline]
7743#[target_feature(enable = "msa")]
7744#[cfg_attr(test, assert_instr(sld.b))]
7745#[unstable(feature = "stdarch_mips", issue = "111198")]
7746pub unsafe fn __msa_sld_b(a: v16i8, b: v16i8, c: i32) -> v16i8 {
7747    msa_sld_b(a, mem::transmute(b), c)
7748}
7749
7750/// GPR Columns Slide
7751///
7752/// Vector registers `a` (eight signed 16-bit integer numbers) and `b`
7753/// (eight signed 16-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
7754/// stored row-wise with as many rows as bytes in integer data format df.
7755/// The two source rectangles `b` and `a` are concatenated horizontally in the order
7756/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
7757/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
7758/// by the number of columns given in GPR `c`.
7759/// The result is written to vector (eight signed 16-bit integer numbers).
7760/// GPR `c` value is interpreted modulo the number of columns in destination rectangle,
7761/// or equivalently, the number of data format df elements in the destination vector.
7762///
7763#[inline]
7764#[target_feature(enable = "msa")]
7765#[cfg_attr(test, assert_instr(sld.h))]
7766#[unstable(feature = "stdarch_mips", issue = "111198")]
7767pub unsafe fn __msa_sld_h(a: v8i16, b: v8i16, c: i32) -> v8i16 {
7768    msa_sld_h(a, mem::transmute(b), c)
7769}
7770
7771/// GPR Columns Slide
7772///
7773/// Vector registers `a` (four signed 32-bit integer numbers) and `b`
7774/// (four signed 32-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
7775/// stored row-wise with as many rows as bytes in integer data format df.
7776/// The two source rectangles `b` and `a` are concatenated horizontally in the order
7777/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
7778/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
7779/// by the number of columns given in GPR `c`.
7780/// The result is written to vector (four signed 32-bit integer numbers).
7781/// GPR `c` value is interpreted modulo the number of columns in destination rectangle,
7782/// or equivalently, the number of data format df elements in the destination vector.
7783///
7784#[inline]
7785#[target_feature(enable = "msa")]
7786#[cfg_attr(test, assert_instr(sld.w))]
7787#[unstable(feature = "stdarch_mips", issue = "111198")]
7788pub unsafe fn __msa_sld_w(a: v4i32, b: v4i32, c: i32) -> v4i32 {
7789    msa_sld_w(a, mem::transmute(b), c)
7790}
7791
7792/// GPR Columns Slide
7793///
7794/// Vector registers `a` (two signed 64-bit integer numbers) and `b`
7795/// (two signed 64-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
7796/// stored row-wise with as many rows as bytes in integer data format df.
7797/// The two source rectangles `b` and `a` are concatenated horizontally in the order
7798/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
7799/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
7800/// by the number of columns given in GPR `c`.
7801/// The result is written to vector (two signed 64-bit integer numbers).
7802/// GPR `c` value is interpreted modulo the number of columns in destination rectangle,
7803/// or equivalently, the number of data format df elements in the destination vector.
7804///
7805#[inline]
7806#[target_feature(enable = "msa")]
7807#[cfg_attr(test, assert_instr(sld.d))]
7808#[unstable(feature = "stdarch_mips", issue = "111198")]
7809pub unsafe fn __msa_sld_d(a: v2i64, b: v2i64, c: i32) -> v2i64 {
7810    msa_sld_d(a, mem::transmute(b), c)
7811}
7812
7813/// Immediate Columns Slide
7814///
7815/// Vector registers `a` (sixteen signed 8-bit integer numbers) and `b`
7816/// (sixteen signed 8-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
7817/// stored row-wise with as many rows as bytes in integer data format df.
7818/// The two source rectangles `b` and `a` are concatenated horizontally in the order
7819/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
7820/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
7821/// by `imm1` columns.
7822/// The result is written to vector (sixteen signed 8-bit integer numbers).
7823///
7824#[inline]
7825#[target_feature(enable = "msa")]
7826#[cfg_attr(test, assert_instr(sldi.b, IMM4 = 0b1111))]
7827#[rustc_legacy_const_generics(2)]
7828#[unstable(feature = "stdarch_mips", issue = "111198")]
7829pub unsafe fn __msa_sldi_b<const IMM4: i32>(a: v16i8, b: v16i8) -> v16i8 {
7830    static_assert_uimm_bits!(IMM4, 4);
7831    msa_sldi_b(a, mem::transmute(b), IMM4)
7832}
7833
7834/// Immediate Columns Slide
7835///
7836/// Vector registers `a` (eight signed 16-bit integer numbers) and `b`
7837/// (eight signed 16-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
7838/// stored row-wise with as many rows as bytes in integer data format df.
7839/// The two source rectangles `b` and `a` are concatenated horizontally in the order
7840/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
7841/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
7842/// by `imm1` columns.
7843/// The result is written to vector (eight signed 16-bit integer numbers).
7844///
7845#[inline]
7846#[target_feature(enable = "msa")]
7847#[cfg_attr(test, assert_instr(sldi.h, IMM3 = 0b111))]
7848#[rustc_legacy_const_generics(2)]
7849#[unstable(feature = "stdarch_mips", issue = "111198")]
7850pub unsafe fn __msa_sldi_h<const IMM3: i32>(a: v8i16, b: v8i16) -> v8i16 {
7851    static_assert_uimm_bits!(IMM3, 3);
7852    msa_sldi_h(a, mem::transmute(b), IMM3)
7853}
7854
7855/// Immediate Columns Slide
7856///
7857/// Vector registers `a` (four signed 32-bit integer numbers) and `b`
7858/// (four signed 32-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
7859/// stored row-wise with as many rows as bytes in integer data format df.
7860/// The two source rectangles `b` and `a` are concatenated horizontally in the order
7861/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
7862/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
7863/// by `imm1` columns.
7864/// The result is written to vector (four signed 32-bit integer numbers).
7865///
7866#[inline]
7867#[target_feature(enable = "msa")]
7868#[cfg_attr(test, assert_instr(sldi.w, IMM2 = 0b11))]
7869#[rustc_legacy_const_generics(2)]
7870#[unstable(feature = "stdarch_mips", issue = "111198")]
7871pub unsafe fn __msa_sldi_w<const IMM2: i32>(a: v4i32, b: v4i32) -> v4i32 {
7872    static_assert_uimm_bits!(IMM2, 2);
7873    msa_sldi_w(a, mem::transmute(b), IMM2)
7874}
7875
7876/// Immediate Columns Slide
7877///
7878/// Vector registers `a` (two signed 64-bit integer numbers) and `b`
7879/// (two signed 64-bit integer numbers) contain 2-dimensional byte arrays (rectangles)
7880/// stored row-wise with as many rows as bytes in integer data format df.
7881/// The two source rectangles `b` and `a` are concatenated horizontally in the order
7882/// they appear in the syntax, i.e. first `a` and then `b`. Place a new destination
7883/// rectangle over `b` and then slide it to the left over the concatenation of `a` and `b`
7884/// by `imm1` columns.
7885/// The result is written to vector (two signed 64-bit integer numbers).
7886///
7887#[inline]
7888#[target_feature(enable = "msa")]
7889#[cfg_attr(test, assert_instr(sldi.d, IMM1 = 0b1))]
7890#[rustc_legacy_const_generics(2)]
7891#[unstable(feature = "stdarch_mips", issue = "111198")]
7892pub unsafe fn __msa_sldi_d<const IMM1: i32>(a: v2i64, b: v2i64) -> v2i64 {
7893    static_assert_uimm_bits!(IMM1, 1);
7894    msa_sldi_d(a, mem::transmute(b), IMM1)
7895}
7896
7897/// Vector Shift Left
7898///
7899/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
7900/// are shifted left by the number of bits the elements in vector `b`
7901/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
7902/// element in bits. The result is written to vector (sixteen signed 8-bit integer numbers).
7903///
7904#[inline]
7905#[target_feature(enable = "msa")]
7906#[cfg_attr(test, assert_instr(sll.b))]
7907#[unstable(feature = "stdarch_mips", issue = "111198")]
7908pub unsafe fn __msa_sll_b(a: v16i8, b: v16i8) -> v16i8 {
7909    msa_sll_b(a, mem::transmute(b))
7910}
7911
7912/// Vector Shift Left
7913///
7914/// The elements in vector `a` (eight signed 16-bit integer numbers)
7915/// are shifted left by the number of bits the elements in vector `b`
7916/// (eight signed 16-bit integer numbers) specify modulo the size of the
7917/// element in bits. The result is written to vector (eight signed 16-bit integer numbers).
7918///
7919#[inline]
7920#[target_feature(enable = "msa")]
7921#[cfg_attr(test, assert_instr(sll.h))]
7922#[unstable(feature = "stdarch_mips", issue = "111198")]
7923pub unsafe fn __msa_sll_h(a: v8i16, b: v8i16) -> v8i16 {
7924    msa_sll_h(a, mem::transmute(b))
7925}
7926
7927/// Vector Shift Left
7928///
7929/// The elements in vector `a` (four signed 32-bit integer numbers)
7930/// are shifted left by the number of bits the elements in vector `b`
7931/// (four signed 32-bit integer numbers) specify modulo the size of the
7932/// element in bits. The result is written to vector (four signed 32-bit integer numbers).
7933///
7934#[inline]
7935#[target_feature(enable = "msa")]
7936#[cfg_attr(test, assert_instr(sll.w))]
7937#[unstable(feature = "stdarch_mips", issue = "111198")]
7938pub unsafe fn __msa_sll_w(a: v4i32, b: v4i32) -> v4i32 {
7939    msa_sll_w(a, mem::transmute(b))
7940}
7941
7942/// Vector Shift Left
7943///
7944/// The elements in vector `a` (two signed 64-bit integer numbers)
7945/// are shifted left by the number of bits the elements in vector `b`
7946/// (two signed 64-bit integer numbers) specify modulo the size of the
7947/// element in bits. The result is written to vector (two signed 64-bit integer numbers).
7948///
7949#[inline]
7950#[target_feature(enable = "msa")]
7951#[cfg_attr(test, assert_instr(sll.d))]
7952#[unstable(feature = "stdarch_mips", issue = "111198")]
7953pub unsafe fn __msa_sll_d(a: v2i64, b: v2i64) -> v2i64 {
7954    msa_sll_d(a, mem::transmute(b))
7955}
7956
7957/// Immediate Shift Left
7958///
7959/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
7960/// are shifted left by `imm4` bits.
7961/// The result is written to vector (sixteen signed 8-bit integer numbers).
7962///
7963#[inline]
7964#[target_feature(enable = "msa")]
7965#[cfg_attr(test, assert_instr(slli.b, IMM4 = 0b1111))]
7966#[rustc_legacy_const_generics(1)]
7967#[unstable(feature = "stdarch_mips", issue = "111198")]
7968pub unsafe fn __msa_slli_b<const IMM4: i32>(a: v16i8) -> v16i8 {
7969    static_assert_uimm_bits!(IMM4, 4);
7970    msa_slli_b(a, IMM4)
7971}
7972
7973/// Immediate Shift Left
7974///
7975/// The elements in vector `a` (eight signed 16-bit integer numbers)
7976/// are shifted left by `imm3` bits.
7977/// The result is written to vector (eight signed 16-bit integer numbers).
7978///
7979#[inline]
7980#[target_feature(enable = "msa")]
7981#[cfg_attr(test, assert_instr(slli.h, IMM3 = 0b111))]
7982#[rustc_legacy_const_generics(1)]
7983#[unstable(feature = "stdarch_mips", issue = "111198")]
7984pub unsafe fn __msa_slli_h<const IMM3: i32>(a: v8i16) -> v8i16 {
7985    static_assert_uimm_bits!(IMM3, 3);
7986    msa_slli_h(a, IMM3)
7987}
7988
7989/// Immediate Shift Left
7990///
7991/// The elements in vector `a` (four signed 32-bit integer numbers)
7992/// are shifted left by `imm2` bits.
7993/// The result is written to vector (four signed 32-bit integer numbers).
7994///
7995#[inline]
7996#[target_feature(enable = "msa")]
7997#[cfg_attr(test, assert_instr(slli.w, IMM2 = 0b11))]
7998#[rustc_legacy_const_generics(1)]
7999#[unstable(feature = "stdarch_mips", issue = "111198")]
8000pub unsafe fn __msa_slli_w<const IMM2: i32>(a: v4i32) -> v4i32 {
8001    static_assert_uimm_bits!(IMM2, 2);
8002    msa_slli_w(a, IMM2)
8003}
8004
8005/// Immediate Shift Left
8006///
8007/// The elements in vector `a` (two signed 64-bit integer numbers)
8008/// are shifted left by `imm1` bits.
8009/// The result is written to vector (two signed 64-bit integer numbers).
8010///
8011#[inline]
8012#[target_feature(enable = "msa")]
8013#[cfg_attr(test, assert_instr(slli.d, IMM1 = 0b1))]
8014#[rustc_legacy_const_generics(1)]
8015#[unstable(feature = "stdarch_mips", issue = "111198")]
8016pub unsafe fn __msa_slli_d<const IMM1: i32>(a: v2i64) -> v2i64 {
8017    static_assert_uimm_bits!(IMM1, 1);
8018    msa_slli_d(a, IMM1)
8019}
8020
8021/// GPR Element Splat
8022///
8023/// Replicate vector `a` (sixteen signed 8-bit integer numbers)
8024/// element with index given by GPR `b` to all elements in vector
8025/// (sixteen signed 8-bit integer numbers) GPR `b` value is interpreted
8026/// modulo the number of data format df elements in the destination vector.
8027///
8028#[inline]
8029#[target_feature(enable = "msa")]
8030#[cfg_attr(test, assert_instr(splat.b))]
8031#[unstable(feature = "stdarch_mips", issue = "111198")]
8032pub unsafe fn __msa_splat_b(a: v16i8, b: i32) -> v16i8 {
8033    msa_splat_b(a, mem::transmute(b))
8034}
8035
8036/// GPR Element Splat
8037///
8038/// Replicate vector `a` (eight signed 16-bit integer numbers)
8039/// element with index given by GPR `b` to all elements in vector
8040/// (eight signed 16-bit integer numbers) GPR `b` value is interpreted
8041/// modulo the number of data format df elements in the destination vector.
8042///
8043#[inline]
8044#[target_feature(enable = "msa")]
8045#[cfg_attr(test, assert_instr(splat.h))]
8046#[unstable(feature = "stdarch_mips", issue = "111198")]
8047pub unsafe fn __msa_splat_h(a: v8i16, b: i32) -> v8i16 {
8048    msa_splat_h(a, mem::transmute(b))
8049}
8050
8051/// GPR Element Splat
8052///
8053/// Replicate vector `a` (four signed 32-bit integer numbers)
8054/// element with index given by GPR `b` to all elements in vector
8055/// (four signed 32-bit integer numbers) GPR `b` value is interpreted
8056/// modulo the number of data format df elements in the destination vector.
8057///
8058#[inline]
8059#[target_feature(enable = "msa")]
8060#[cfg_attr(test, assert_instr(splat.w))]
8061#[unstable(feature = "stdarch_mips", issue = "111198")]
8062pub unsafe fn __msa_splat_w(a: v4i32, b: i32) -> v4i32 {
8063    msa_splat_w(a, mem::transmute(b))
8064}
8065
8066/// GPR Element Splat
8067///
8068/// Replicate vector `a` (two signed 64-bit integer numbers)
8069/// element with index given by GPR `b` to all elements in vector
8070/// (two signed 64-bit integer numbers) GPR `b` value is interpreted
8071/// modulo the number of data format df elements in the destination vector.
8072///
8073#[inline]
8074#[target_feature(enable = "msa")]
8075#[cfg_attr(test, assert_instr(splat.d))]
8076#[unstable(feature = "stdarch_mips", issue = "111198")]
8077pub unsafe fn __msa_splat_d(a: v2i64, b: i32) -> v2i64 {
8078    msa_splat_d(a, mem::transmute(b))
8079}
8080
8081/// Immediate Element Splat
8082///
8083/// Replicate element `imm4` in vector `a` (sixteen signed 8-bit integer numbers)
8084/// to all elements in vector (sixteen signed 8-bit integer numbers).
8085///
8086#[inline]
8087#[target_feature(enable = "msa")]
8088#[cfg_attr(test, assert_instr(splati.b, IMM4 = 0b1111))]
8089#[rustc_legacy_const_generics(1)]
8090#[unstable(feature = "stdarch_mips", issue = "111198")]
8091pub unsafe fn __msa_splati_b<const IMM4: i32>(a: v16i8) -> v16i8 {
8092    static_assert_uimm_bits!(IMM4, 4);
8093    msa_splati_b(a, IMM4)
8094}
8095
8096/// Immediate Element Splat
8097///
8098/// Replicate element `imm3` in vector `a` (eight signed 16-bit integer numbers)
8099/// to all elements in vector (eight signed 16-bit integer numbers).
8100///
8101#[inline]
8102#[target_feature(enable = "msa")]
8103#[cfg_attr(test, assert_instr(splati.h, IMM3 = 0b111))]
8104#[rustc_legacy_const_generics(1)]
8105#[unstable(feature = "stdarch_mips", issue = "111198")]
8106pub unsafe fn __msa_splati_h<const IMM3: i32>(a: v8i16) -> v8i16 {
8107    static_assert_uimm_bits!(IMM3, 3);
8108    msa_splati_h(a, IMM3)
8109}
8110
8111/// Immediate Element Splat
8112///
8113/// Replicate element `imm2` in vector `a` (four signed 32-bit integer numbers)
8114/// to all elements in vector (four signed 32-bit integer numbers).
8115///
8116#[inline]
8117#[target_feature(enable = "msa")]
8118#[cfg_attr(test, assert_instr(splati.w, IMM2 = 0b11))]
8119#[rustc_legacy_const_generics(1)]
8120#[unstable(feature = "stdarch_mips", issue = "111198")]
8121pub unsafe fn __msa_splati_w<const IMM2: i32>(a: v4i32) -> v4i32 {
8122    static_assert_uimm_bits!(IMM2, 2);
8123    msa_splati_w(a, IMM2)
8124}
8125
8126/// Immediate Element Splat
8127///
8128/// Replicate element `imm1` in vector `a` (two signed 64-bit integer numbers)
8129/// to all elements in vector (two signed 64-bit integer numbers).
8130///
8131#[inline]
8132#[target_feature(enable = "msa")]
8133#[cfg_attr(test, assert_instr(splati.d, IMM1 = 0b1))]
8134#[rustc_legacy_const_generics(1)]
8135#[unstable(feature = "stdarch_mips", issue = "111198")]
8136pub unsafe fn __msa_splati_d<const IMM1: i32>(a: v2i64) -> v2i64 {
8137    static_assert_uimm_bits!(IMM1, 1);
8138    msa_splati_d(a, IMM1)
8139}
8140
8141/// Vector Shift Right Arithmetic
8142///
8143/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
8144/// are shifted right arithmetic by the number of bits the elements in vector `b`
8145/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
8146/// element in bits.The result is written to vector (sixteen signed 8-bit integer numbers).
8147///
8148#[inline]
8149#[target_feature(enable = "msa")]
8150#[cfg_attr(test, assert_instr(sra.b))]
8151#[unstable(feature = "stdarch_mips", issue = "111198")]
8152pub unsafe fn __msa_sra_b(a: v16i8, b: v16i8) -> v16i8 {
8153    msa_sra_b(a, mem::transmute(b))
8154}
8155
8156/// Vector Shift Right Arithmetic
8157///
8158/// The elements in vector `a` (eight signed 16-bit integer numbers)
8159/// are shifted right arithmetic by the number of bits the elements in vector `b`
8160/// (eight signed 16-bit integer numbers) specify modulo the size of the
8161/// element in bits.The result is written to vector (eight signed 16-bit integer numbers).
8162///
8163#[inline]
8164#[target_feature(enable = "msa")]
8165#[cfg_attr(test, assert_instr(sra.h))]
8166#[unstable(feature = "stdarch_mips", issue = "111198")]
8167pub unsafe fn __msa_sra_h(a: v8i16, b: v8i16) -> v8i16 {
8168    msa_sra_h(a, mem::transmute(b))
8169}
8170
8171/// Vector Shift Right Arithmetic
8172///
8173/// The elements in vector `a` (four signed 32-bit integer numbers)
8174/// are shifted right arithmetic by the number of bits the elements in vector `b`
8175/// (four signed 32-bit integer numbers) specify modulo the size of the
8176/// element in bits.The result is written to vector (four signed 32-bit integer numbers).
8177///
8178#[inline]
8179#[target_feature(enable = "msa")]
8180#[cfg_attr(test, assert_instr(sra.w))]
8181#[unstable(feature = "stdarch_mips", issue = "111198")]
8182pub unsafe fn __msa_sra_w(a: v4i32, b: v4i32) -> v4i32 {
8183    msa_sra_w(a, mem::transmute(b))
8184}
8185
8186/// Vector Shift Right Arithmetic
8187///
8188/// The elements in vector `a` (two signed 64-bit integer numbers)
8189/// are shifted right arithmetic by the number of bits the elements in vector `b`
8190/// (two signed 64-bit integer numbers) specify modulo the size of the
8191/// element in bits.The result is written to vector (two signed 64-bit integer numbers).
8192///
8193#[inline]
8194#[target_feature(enable = "msa")]
8195#[cfg_attr(test, assert_instr(sra.d))]
8196#[unstable(feature = "stdarch_mips", issue = "111198")]
8197pub unsafe fn __msa_sra_d(a: v2i64, b: v2i64) -> v2i64 {
8198    msa_sra_d(a, mem::transmute(b))
8199}
8200
8201/// Immediate Shift Right Arithmetic
8202///
8203/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
8204/// are shifted right arithmetic by `imm3` bits.
8205/// The result is written to vector (sixteen signed 8-bit integer numbers).
8206///
8207#[inline]
8208#[target_feature(enable = "msa")]
8209#[cfg_attr(test, assert_instr(srai.b, IMM3 = 0b111))]
8210#[rustc_legacy_const_generics(1)]
8211#[unstable(feature = "stdarch_mips", issue = "111198")]
8212pub unsafe fn __msa_srai_b<const IMM3: i32>(a: v16i8) -> v16i8 {
8213    static_assert_uimm_bits!(IMM3, 3);
8214    msa_srai_b(a, IMM3)
8215}
8216
8217/// Immediate Shift Right Arithmetic
8218///
8219/// The elements in vector `a` (eight signed 16-bit integer numbers)
8220/// are shifted right arithmetic by `imm4` bits.
8221/// The result is written to vector (eight signed 16-bit integer numbers).
8222///
8223#[inline]
8224#[target_feature(enable = "msa")]
8225#[cfg_attr(test, assert_instr(srai.h, IMM4 = 0b1111))]
8226#[rustc_legacy_const_generics(1)]
8227#[unstable(feature = "stdarch_mips", issue = "111198")]
8228pub unsafe fn __msa_srai_h<const IMM4: i32>(a: v8i16) -> v8i16 {
8229    static_assert_uimm_bits!(IMM4, 4);
8230    msa_srai_h(a, IMM4)
8231}
8232
8233/// Immediate Shift Right Arithmetic
8234///
8235/// The elements in vector `a` (four signed 32-bit integer numbers)
8236/// are shifted right arithmetic by `imm5` bits.
8237/// The result is written to vector (four signed 32-bit integer numbers).
8238///
8239#[inline]
8240#[target_feature(enable = "msa")]
8241#[cfg_attr(test, assert_instr(srai.w, IMM5 = 0b11111))]
8242#[rustc_legacy_const_generics(1)]
8243#[unstable(feature = "stdarch_mips", issue = "111198")]
8244pub unsafe fn __msa_srai_w<const IMM5: i32>(a: v4i32) -> v4i32 {
8245    static_assert_uimm_bits!(IMM5, 5);
8246    msa_srai_w(a, IMM5)
8247}
8248
8249/// Immediate Shift Right Arithmetic
8250///
8251/// The elements in vector `a` (two signed 64-bit integer numbers)
8252/// are shifted right arithmetic by `imm6` bits.
8253/// The result is written to vector (two signed 64-bit integer numbers).
8254///
8255#[inline]
8256#[target_feature(enable = "msa")]
8257#[cfg_attr(test, assert_instr(srai.d, IMM6 = 0b111111))]
8258#[rustc_legacy_const_generics(1)]
8259#[unstable(feature = "stdarch_mips", issue = "111198")]
8260pub unsafe fn __msa_srai_d<const IMM6: i32>(a: v2i64) -> v2i64 {
8261    static_assert_uimm_bits!(IMM6, 6);
8262    msa_srai_d(a, IMM6)
8263}
8264
8265/// Vector Shift Right Arithmetic Rounded
8266///
8267/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
8268/// are shifted right arithmetic by the number of bits the elements in vector `b`
8269/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
8270/// element in bits.The most significant discarded bit is added to the shifted
8271/// value (for rounding) and the result is written to vector (sixteen signed 8-bit integer numbers).
8272///
8273#[inline]
8274#[target_feature(enable = "msa")]
8275#[cfg_attr(test, assert_instr(srar.b))]
8276#[unstable(feature = "stdarch_mips", issue = "111198")]
8277pub unsafe fn __msa_srar_b(a: v16i8, b: v16i8) -> v16i8 {
8278    msa_srar_b(a, mem::transmute(b))
8279}
8280
8281/// Vector Shift Right Arithmetic Rounded
8282///
8283/// The elements in vector `a` (eight signed 16-bit integer numbers)
8284/// are shifted right arithmetic by the number of bits the elements in vector `b`
8285/// (eight signed 16-bit integer numbers) specify modulo the size of the
8286/// element in bits.The most significant discarded bit is added to the shifted
8287/// value (for rounding) and the result is written to vector (eight signed 16-bit integer numbers).
8288///
8289#[inline]
8290#[target_feature(enable = "msa")]
8291#[cfg_attr(test, assert_instr(srar.h))]
8292#[unstable(feature = "stdarch_mips", issue = "111198")]
8293pub unsafe fn __msa_srar_h(a: v8i16, b: v8i16) -> v8i16 {
8294    msa_srar_h(a, mem::transmute(b))
8295}
8296
8297/// Vector Shift Right Arithmetic Rounded
8298///
8299/// The elements in vector `a` (four signed 32-bit integer numbers)
8300/// are shifted right arithmetic by the number of bits the elements in vector `b`
8301/// (four signed 32-bit integer numbers) specify modulo the size of the
8302/// element in bits.The most significant discarded bit is added to the shifted
8303/// value (for rounding) and the result is written to vector (four signed 32-bit integer numbers).
8304///
8305#[inline]
8306#[target_feature(enable = "msa")]
8307#[cfg_attr(test, assert_instr(srar.w))]
8308#[unstable(feature = "stdarch_mips", issue = "111198")]
8309pub unsafe fn __msa_srar_w(a: v4i32, b: v4i32) -> v4i32 {
8310    msa_srar_w(a, mem::transmute(b))
8311}
8312
8313/// Vector Shift Right Arithmetic Rounded
8314///
8315/// The elements in vector `a` (two signed 64-bit integer numbers)
8316/// are shifted right arithmetic by the number of bits the elements in vector `b`
8317/// (two signed 64-bit integer numbers) specify modulo the size of the
8318/// element in bits.The most significant discarded bit is added to the shifted
8319/// value (for rounding) and the result is written to vector (two signed 64-bit integer numbers).
8320///
8321#[inline]
8322#[target_feature(enable = "msa")]
8323#[cfg_attr(test, assert_instr(srar.d))]
8324#[unstable(feature = "stdarch_mips", issue = "111198")]
8325pub unsafe fn __msa_srar_d(a: v2i64, b: v2i64) -> v2i64 {
8326    msa_srar_d(a, mem::transmute(b))
8327}
8328
8329/// Immediate Shift Right Arithmetic Rounded
8330///
8331/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
8332/// are shifted right arithmetic by `imm3` bits.The most significant
8333/// discarded bit is added to the shifted value (for rounding) and
8334/// the result is written to vector (sixteen signed 8-bit integer numbers).
8335///
8336#[inline]
8337#[target_feature(enable = "msa")]
8338#[cfg_attr(test, assert_instr(srari.b, IMM3 = 0b111))]
8339#[rustc_legacy_const_generics(1)]
8340#[unstable(feature = "stdarch_mips", issue = "111198")]
8341pub unsafe fn __msa_srari_b<const IMM3: i32>(a: v16i8) -> v16i8 {
8342    static_assert_uimm_bits!(IMM3, 3);
8343    msa_srari_b(a, IMM3)
8344}
8345
8346/// Immediate Shift Right Arithmetic Rounded
8347///
8348/// The elements in vector `a` (eight signed 16-bit integer numbers)
8349/// are shifted right arithmetic by `imm4` bits.The most significant
8350/// discarded bit is added to the shifted value (for rounding) and
8351/// the result is written to vector (eight signed 16-bit integer numbers).
8352///
8353#[inline]
8354#[target_feature(enable = "msa")]
8355#[cfg_attr(test, assert_instr(srari.h, IMM4 = 0b1111))]
8356#[rustc_legacy_const_generics(1)]
8357#[unstable(feature = "stdarch_mips", issue = "111198")]
8358pub unsafe fn __msa_srari_h<const IMM4: i32>(a: v8i16) -> v8i16 {
8359    static_assert_uimm_bits!(IMM4, 4);
8360    msa_srari_h(a, IMM4)
8361}
8362
8363/// Immediate Shift Right Arithmetic Rounded
8364///
8365/// The elements in vector `a` (four signed 32-bit integer numbers)
8366/// are shifted right arithmetic by `imm5` bits.The most significant
8367/// discarded bit is added to the shifted value (for rounding) and
8368/// the result is written to vector (four signed 32-bit integer numbers).
8369///
8370#[inline]
8371#[target_feature(enable = "msa")]
8372#[cfg_attr(test, assert_instr(srari.w, IMM5 = 0b11111))]
8373#[rustc_legacy_const_generics(1)]
8374#[unstable(feature = "stdarch_mips", issue = "111198")]
8375pub unsafe fn __msa_srari_w<const IMM5: i32>(a: v4i32) -> v4i32 {
8376    static_assert_uimm_bits!(IMM5, 5);
8377    msa_srari_w(a, IMM5)
8378}
8379
8380/// Immediate Shift Right Arithmetic Rounded
8381///
8382/// The elements in vector `a` (two signed 64-bit integer numbers)
8383/// are shifted right arithmetic by `imm6` bits.The most significant
8384/// discarded bit is added to the shifted value (for rounding) and
8385/// the result is written to vector (two signed 64-bit integer numbers).
8386///
8387#[inline]
8388#[target_feature(enable = "msa")]
8389#[cfg_attr(test, assert_instr(srari.d, IMM6 = 0b111111))]
8390#[rustc_legacy_const_generics(1)]
8391#[unstable(feature = "stdarch_mips", issue = "111198")]
8392pub unsafe fn __msa_srari_d<const IMM6: i32>(a: v2i64) -> v2i64 {
8393    static_assert_uimm_bits!(IMM6, 6);
8394    msa_srari_d(a, IMM6)
8395}
8396
8397/// Vector Shift Right Logical
8398///
8399/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
8400/// are shifted right logical by the number of bits the elements in vector `b`
8401/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
8402/// element in bits.The result is written to vector (sixteen signed 8-bit integer numbers).
8403///
8404#[inline]
8405#[target_feature(enable = "msa")]
8406#[cfg_attr(test, assert_instr(srl.b))]
8407#[unstable(feature = "stdarch_mips", issue = "111198")]
8408pub unsafe fn __msa_srl_b(a: v16i8, b: v16i8) -> v16i8 {
8409    msa_srl_b(a, mem::transmute(b))
8410}
8411
8412/// Vector Shift Right Logical
8413///
8414/// The elements in vector `a` (eight signed 16-bit integer numbers)
8415/// are shifted right logical by the number of bits the elements in vector `b`
8416/// (eight signed 16-bit integer numbers) specify modulo the size of the
8417/// element in bits.The result is written to vector (eight signed 16-bit integer numbers).
8418///
8419#[inline]
8420#[target_feature(enable = "msa")]
8421#[cfg_attr(test, assert_instr(srl.h))]
8422#[unstable(feature = "stdarch_mips", issue = "111198")]
8423pub unsafe fn __msa_srl_h(a: v8i16, b: v8i16) -> v8i16 {
8424    msa_srl_h(a, mem::transmute(b))
8425}
8426
8427/// Vector Shift Right Logical
8428///
8429/// The elements in vector `a` (four signed 32-bit integer numbers)
8430/// are shifted right logical by the number of bits the elements in vector `b`
8431/// (four signed 32-bit integer numbers) specify modulo the size of the
8432/// element in bits.The result is written to vector (four signed 32-bit integer numbers).
8433///
8434#[inline]
8435#[target_feature(enable = "msa")]
8436#[cfg_attr(test, assert_instr(srl.w))]
8437#[unstable(feature = "stdarch_mips", issue = "111198")]
8438pub unsafe fn __msa_srl_w(a: v4i32, b: v4i32) -> v4i32 {
8439    msa_srl_w(a, mem::transmute(b))
8440}
8441
8442/// Vector Shift Right Logical
8443///
8444/// The elements in vector `a` (two signed 64-bit integer numbers)
8445/// are shifted right logical by the number of bits the elements in vector `b`
8446/// (two signed 64-bit integer numbers) specify modulo the size of the
8447/// element in bits.The result is written to vector (two signed 64-bit integer numbers).
8448///
8449#[inline]
8450#[target_feature(enable = "msa")]
8451#[cfg_attr(test, assert_instr(srl.d))]
8452#[unstable(feature = "stdarch_mips", issue = "111198")]
8453pub unsafe fn __msa_srl_d(a: v2i64, b: v2i64) -> v2i64 {
8454    msa_srl_d(a, mem::transmute(b))
8455}
8456
8457/// Immediate Shift Right Logical
8458///
8459/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
8460/// are shifted right logical by `imm4` bits.
8461/// The result is written to vector (sixteen signed 8-bit integer numbers).
8462///
8463#[inline]
8464#[target_feature(enable = "msa")]
8465#[cfg_attr(test, assert_instr(srli.b, IMM4 = 0b1111))]
8466#[rustc_legacy_const_generics(1)]
8467#[unstable(feature = "stdarch_mips", issue = "111198")]
8468pub unsafe fn __msa_srli_b<const IMM4: i32>(a: v16i8) -> v16i8 {
8469    static_assert_uimm_bits!(IMM4, 4);
8470    msa_srli_b(a, IMM4)
8471}
8472
8473/// Immediate Shift Right Logical
8474///
8475/// The elements in vector `a` (eight signed 16-bit integer numbers)
8476/// are shifted right logical by `imm3` bits.
8477/// The result is written to vector (eight signed 16-bit integer numbers).
8478///
8479#[inline]
8480#[target_feature(enable = "msa")]
8481#[cfg_attr(test, assert_instr(srli.h, IMM3 = 0b111))]
8482#[rustc_legacy_const_generics(1)]
8483#[unstable(feature = "stdarch_mips", issue = "111198")]
8484pub unsafe fn __msa_srli_h<const IMM3: i32>(a: v8i16) -> v8i16 {
8485    static_assert_uimm_bits!(IMM3, 3);
8486    msa_srli_h(a, IMM3)
8487}
8488
8489/// Immediate Shift Right Logical
8490///
8491/// The elements in vector `a` (four signed 32-bit integer numbers)
8492/// are shifted right logical by `imm2` bits.
8493/// The result is written to vector (four signed 32-bit integer numbers).
8494///
8495#[inline]
8496#[target_feature(enable = "msa")]
8497#[cfg_attr(test, assert_instr(srli.w, IMM2 = 0b11))]
8498#[rustc_legacy_const_generics(1)]
8499#[unstable(feature = "stdarch_mips", issue = "111198")]
8500pub unsafe fn __msa_srli_w<const IMM2: i32>(a: v4i32) -> v4i32 {
8501    static_assert_uimm_bits!(IMM2, 2);
8502    msa_srli_w(a, IMM2)
8503}
8504
8505/// Immediate Shift Right Logical
8506///
8507/// The elements in vector `a` (two signed 64-bit integer numbers)
8508/// are shifted right logical by `imm1` bits.
8509/// The result is written to vector (two signed 64-bit integer numbers).
8510///
8511#[inline]
8512#[target_feature(enable = "msa")]
8513#[cfg_attr(test, assert_instr(srli.d, IMM1 = 0b1))]
8514#[rustc_legacy_const_generics(1)]
8515#[unstable(feature = "stdarch_mips", issue = "111198")]
8516pub unsafe fn __msa_srli_d<const IMM1: i32>(a: v2i64) -> v2i64 {
8517    static_assert_uimm_bits!(IMM1, 1);
8518    msa_srli_d(a, IMM1)
8519}
8520
8521/// Vector Shift Right Logical Rounded
8522///
8523/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
8524/// are shifted right logical by the number of bits the elements in vector `b`
8525/// (sixteen signed 8-bit integer numbers) specify modulo the size of the
8526/// element in bits.The most significant discarded bit is added to the shifted
8527/// value (for rounding) and the result is written to vector (sixteen signed 8-bit integer numbers).
8528///
8529#[inline]
8530#[target_feature(enable = "msa")]
8531#[cfg_attr(test, assert_instr(srlr.b))]
8532#[unstable(feature = "stdarch_mips", issue = "111198")]
8533pub unsafe fn __msa_srlr_b(a: v16i8, b: v16i8) -> v16i8 {
8534    msa_srlr_b(a, mem::transmute(b))
8535}
8536
8537/// Vector Shift Right Logical Rounded
8538///
8539/// The elements in vector `a` (eight signed 16-bit integer numbers)
8540/// are shifted right logical by the number of bits the elements in vector `b`
8541/// (eight signed 16-bit integer numbers) specify modulo the size of the
8542/// element in bits.The most significant discarded bit is added to the shifted
8543/// value (for rounding) and the result is written to vector (eight signed 16-bit integer numbers).
8544///
8545#[inline]
8546#[target_feature(enable = "msa")]
8547#[cfg_attr(test, assert_instr(srlr.h))]
8548#[unstable(feature = "stdarch_mips", issue = "111198")]
8549pub unsafe fn __msa_srlr_h(a: v8i16, b: v8i16) -> v8i16 {
8550    msa_srlr_h(a, mem::transmute(b))
8551}
8552
8553/// Vector Shift Right Logical Rounded
8554///
8555/// The elements in vector `a` (four signed 32-bit integer numbers)
8556/// are shifted right logical by the number of bits the elements in vector `b`
8557/// (four signed 32-bit integer numbers) specify modulo the size of the
8558/// element in bits.The most significant discarded bit is added to the shifted
8559/// value (for rounding) and the result is written to vector (four signed 32-bit integer numbers).
8560///
8561#[inline]
8562#[target_feature(enable = "msa")]
8563#[cfg_attr(test, assert_instr(srlr.w))]
8564#[unstable(feature = "stdarch_mips", issue = "111198")]
8565pub unsafe fn __msa_srlr_w(a: v4i32, b: v4i32) -> v4i32 {
8566    msa_srlr_w(a, mem::transmute(b))
8567}
8568
8569/// Vector Shift Right Logical Rounded
8570///
8571/// The elements in vector `a` (two signed 64-bit integer numbers)
8572/// are shifted right logical by the number of bits the elements in vector `b`
8573/// (two signed 64-bit integer numbers) specify modulo the size of the
8574/// element in bits.The most significant discarded bit is added to the shifted
8575/// value (for rounding) and the result is written to vector (two signed 64-bit integer numbers).
8576///
8577#[inline]
8578#[target_feature(enable = "msa")]
8579#[cfg_attr(test, assert_instr(srlr.d))]
8580#[unstable(feature = "stdarch_mips", issue = "111198")]
8581pub unsafe fn __msa_srlr_d(a: v2i64, b: v2i64) -> v2i64 {
8582    msa_srlr_d(a, mem::transmute(b))
8583}
8584
8585/// Immediate Shift Right Logical Rounded
8586///
8587/// The elements in vector `a` (sixteen signed 8-bit integer numbers)
8588/// are shifted right logical by `imm6` bits.The most significant
8589/// discarded bit is added to the shifted value (for rounding) and
8590/// the result is written to vector (sixteen signed 8-bit integer numbers).
8591///
8592#[inline]
8593#[target_feature(enable = "msa")]
8594#[cfg_attr(test, assert_instr(srlri.b, IMM3 = 0b111))]
8595#[rustc_legacy_const_generics(1)]
8596#[unstable(feature = "stdarch_mips", issue = "111198")]
8597pub unsafe fn __msa_srlri_b<const IMM3: i32>(a: v16i8) -> v16i8 {
8598    static_assert_uimm_bits!(IMM3, 3);
8599    msa_srlri_b(a, IMM3)
8600}
8601
8602/// Immediate Shift Right Logical Rounded
8603///
8604/// The elements in vector `a` (eight signed 16-bit integer numbers)
8605/// are shifted right logical by `imm6` bits.The most significant
8606/// discarded bit is added to the shifted value (for rounding) and
8607/// the result is written to vector (eight signed 16-bit integer numbers).
8608///
8609#[inline]
8610#[target_feature(enable = "msa")]
8611#[cfg_attr(test, assert_instr(srlri.h, IMM4 = 0b1111))]
8612#[rustc_legacy_const_generics(1)]
8613#[unstable(feature = "stdarch_mips", issue = "111198")]
8614pub unsafe fn __msa_srlri_h<const IMM4: i32>(a: v8i16) -> v8i16 {
8615    static_assert_uimm_bits!(IMM4, 4);
8616    msa_srlri_h(a, IMM4)
8617}
8618
8619/// Immediate Shift Right Logical Rounded
8620///
8621/// The elements in vector `a` (four signed 32-bit integer numbers)
8622/// are shifted right logical by `imm6` bits.The most significant
8623/// discarded bit is added to the shifted value (for rounding) and
8624/// the result is written to vector (four signed 32-bit integer numbers).
8625///
8626#[inline]
8627#[target_feature(enable = "msa")]
8628#[cfg_attr(test, assert_instr(srlri.w, IMM5 = 0b11111))]
8629#[rustc_legacy_const_generics(1)]
8630#[unstable(feature = "stdarch_mips", issue = "111198")]
8631pub unsafe fn __msa_srlri_w<const IMM5: i32>(a: v4i32) -> v4i32 {
8632    static_assert_uimm_bits!(IMM5, 5);
8633    msa_srlri_w(a, IMM5)
8634}
8635
8636/// Immediate Shift Right Logical Rounded
8637///
8638/// The elements in vector `a` (two signed 64-bit integer numbers)
8639/// are shifted right logical by `imm6` bits.The most significant
8640/// discarded bit is added to the shifted value (for rounding) and
8641/// the result is written to vector (two signed 64-bit integer numbers).
8642///
8643#[inline]
8644#[target_feature(enable = "msa")]
8645#[cfg_attr(test, assert_instr(srlri.d, IMM6 = 0b111111))]
8646#[rustc_legacy_const_generics(1)]
8647#[unstable(feature = "stdarch_mips", issue = "111198")]
8648pub unsafe fn __msa_srlri_d<const IMM6: i32>(a: v2i64) -> v2i64 {
8649    static_assert_uimm_bits!(IMM6, 6);
8650    msa_srlri_d(a, IMM6)
8651}
8652
8653/// Vector Store
8654///
8655/// The WRLEN / 8 bytes in vector `a` (sixteen signed 8-bit integer numbers)
8656/// are stored as elements of data format df at the effective memory location
8657/// addressed by the base `mem_addr` and the 10-bit signed immediate offset `imm_s10`.
8658///
8659#[inline]
8660#[target_feature(enable = "msa")]
8661#[cfg_attr(test, assert_instr(st.b, IMM_S10 = -1))]
8662#[rustc_legacy_const_generics(2)]
8663#[unstable(feature = "stdarch_mips", issue = "111198")]
8664pub unsafe fn __msa_st_b<const IMM_S10: i32>(a: v16i8, mem_addr: *mut u8) -> () {
8665    static_assert_simm_bits!(IMM_S10, 10);
8666    msa_st_b(a, mem_addr, IMM_S10)
8667}
8668
8669/// Vector Store
8670///
8671/// The WRLEN / 8 bytes in vector `a` (eight signed 16-bit integer numbers)
8672/// are stored as elements of data format df at the effective memory location
8673/// addressed by the base `mem_addr` and the 11-bit signed immediate offset `imm_s11`.
8674///
8675#[inline]
8676#[target_feature(enable = "msa")]
8677#[cfg_attr(test, assert_instr(st.h, IMM_S11 = -2))]
8678#[rustc_legacy_const_generics(2)]
8679#[unstable(feature = "stdarch_mips", issue = "111198")]
8680pub unsafe fn __msa_st_h<const IMM_S11: i32>(a: v8i16, mem_addr: *mut u8) -> () {
8681    static_assert_simm_bits!(IMM_S11, 11);
8682    static_assert!(IMM_S11 % 2 == 0);
8683    msa_st_h(a, mem_addr, IMM_S11)
8684}
8685
8686/// Vector Store
8687///
8688/// The WRLEN / 8 bytes in vector `a` (four signed 32-bit integer numbers)
8689/// are stored as elements of data format df at the effective memory location
8690/// addressed by the base `mem_addr` and the 12-bit signed immediate offset `imm_s12`.
8691///
8692#[inline]
8693#[target_feature(enable = "msa")]
8694#[cfg_attr(test, assert_instr(st.w, IMM_S12 = -4))]
8695#[rustc_legacy_const_generics(2)]
8696#[unstable(feature = "stdarch_mips", issue = "111198")]
8697pub unsafe fn __msa_st_w<const IMM_S12: i32>(a: v4i32, mem_addr: *mut u8) -> () {
8698    static_assert_simm_bits!(IMM_S12, 12);
8699    static_assert!(IMM_S12 % 4 == 0);
8700    msa_st_w(a, mem_addr, IMM_S12)
8701}
8702
8703/// Vector Store
8704///
8705/// The WRLEN / 8 bytes in vector `a` (two signed 64-bit integer numbers)
8706/// are stored as elements of data format df at the effective memory location
8707/// addressed by the base `mem_addr` and the 13-bit signed immediate offset `imm_s13`.
8708///
8709#[inline]
8710#[target_feature(enable = "msa")]
8711#[cfg_attr(test, assert_instr(st.d, IMM_S13 = -8))]
8712#[rustc_legacy_const_generics(2)]
8713#[unstable(feature = "stdarch_mips", issue = "111198")]
8714pub unsafe fn __msa_st_d<const IMM_S13: i32>(a: v2i64, mem_addr: *mut u8) -> () {
8715    static_assert_simm_bits!(IMM_S13, 13);
8716    static_assert!(IMM_S13 % 8 == 0);
8717    msa_st_d(a, mem_addr, IMM_S13)
8718}
8719
8720/// Vector Signed Saturated Subtract of Signed Values
8721///
8722/// The elements in vector `b` (sixteen signed 8-bit integer numbers)
8723/// are subtracted from the elements in vector `a` (sixteen signed 8-bit integer numbers).
8724/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
8725/// representable signed values before writing the result to vector (sixteen signed 8-bit integer numbers).
8726///
8727#[inline]
8728#[target_feature(enable = "msa")]
8729#[cfg_attr(test, assert_instr(subs_s.b))]
8730#[unstable(feature = "stdarch_mips", issue = "111198")]
8731pub unsafe fn __msa_subs_s_b(a: v16i8, b: v16i8) -> v16i8 {
8732    msa_subs_s_b(a, mem::transmute(b))
8733}
8734
8735/// Vector Signed Saturated Subtract of Signed Values
8736///
8737/// The elements in vector `b` (eight signed 16-bit integer numbers)
8738/// are subtracted from the elements in vector `a` (eight signed 16-bit integer numbers).
8739/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
8740/// representable signed values before writing the result to vector (eight signed 16-bit integer numbers).
8741///
8742#[inline]
8743#[target_feature(enable = "msa")]
8744#[cfg_attr(test, assert_instr(subs_s.h))]
8745#[unstable(feature = "stdarch_mips", issue = "111198")]
8746pub unsafe fn __msa_subs_s_h(a: v8i16, b: v8i16) -> v8i16 {
8747    msa_subs_s_h(a, mem::transmute(b))
8748}
8749
8750/// Vector Signed Saturated Subtract of Signed Values
8751///
8752/// The elements in vector `b` (four signed 32-bit integer numbers)
8753/// are subtracted from the elements in vector `a` (four signed 32-bit integer numbers).
8754/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
8755/// representable signed values before writing the result to vector (four signed 32-bit integer numbers).
8756///
8757#[inline]
8758#[target_feature(enable = "msa")]
8759#[cfg_attr(test, assert_instr(subs_s.w))]
8760#[unstable(feature = "stdarch_mips", issue = "111198")]
8761pub unsafe fn __msa_subs_s_w(a: v4i32, b: v4i32) -> v4i32 {
8762    msa_subs_s_w(a, mem::transmute(b))
8763}
8764
8765/// Vector Signed Saturated Subtract of Signed Values
8766///
8767/// The elements in vector `b` (two signed 64-bit integer numbers)
8768/// are subtracted from the elements in vector `a` (two signed 64-bit integer numbers).
8769/// Signed arithmetic is performed and overflows clamp to the largest and/or smallest
8770/// representable signed values before writing the result to vector (two signed 64-bit integer numbers).
8771///
8772#[inline]
8773#[target_feature(enable = "msa")]
8774#[cfg_attr(test, assert_instr(subs_s.d))]
8775#[unstable(feature = "stdarch_mips", issue = "111198")]
8776pub unsafe fn __msa_subs_s_d(a: v2i64, b: v2i64) -> v2i64 {
8777    msa_subs_s_d(a, mem::transmute(b))
8778}
8779
8780/// Vector Unsigned Saturated Subtract of Unsigned Values
8781///
8782/// The elements in vector `b` (sixteen unsigned 8-bit integer numbers)
8783/// are subtracted from the elements in vector `a` (sixteen unsigned 8-bit integer numbers).
8784/// Unsigned arithmetic is performed and under-flows clamp to 0 before writing
8785/// the result to vector (sixteen unsigned 8-bit integer numbers).
8786///
8787#[inline]
8788#[target_feature(enable = "msa")]
8789#[cfg_attr(test, assert_instr(subs_u.b))]
8790#[unstable(feature = "stdarch_mips", issue = "111198")]
8791pub unsafe fn __msa_subs_u_b(a: v16u8, b: v16u8) -> v16u8 {
8792    msa_subs_u_b(a, mem::transmute(b))
8793}
8794
8795/// Vector Unsigned Saturated Subtract of Unsigned Values
8796///
8797/// The elements in vector `b` (eight unsigned 16-bit integer numbers)
8798/// are subtracted from the elements in vector `a` (eight unsigned 16-bit integer numbers).
8799/// Unsigned arithmetic is performed and under-flows clamp to 0 before writing
8800/// the result to vector (eight unsigned 16-bit integer numbers).
8801///
8802#[inline]
8803#[target_feature(enable = "msa")]
8804#[cfg_attr(test, assert_instr(subs_u.h))]
8805#[unstable(feature = "stdarch_mips", issue = "111198")]
8806pub unsafe fn __msa_subs_u_h(a: v8u16, b: v8u16) -> v8u16 {
8807    msa_subs_u_h(a, mem::transmute(b))
8808}
8809
8810/// Vector Unsigned Saturated Subtract of Unsigned Values
8811///
8812/// The elements in vector `b` (four unsigned 32-bit integer numbers)
8813/// are subtracted from the elements in vector `a` (four unsigned 32-bit integer numbers).
8814/// Unsigned arithmetic is performed and under-flows clamp to 0 before writing
8815/// the result to vector (four unsigned 32-bit integer numbers).
8816///
8817#[inline]
8818#[target_feature(enable = "msa")]
8819#[cfg_attr(test, assert_instr(subs_u.w))]
8820#[unstable(feature = "stdarch_mips", issue = "111198")]
8821pub unsafe fn __msa_subs_u_w(a: v4u32, b: v4u32) -> v4u32 {
8822    msa_subs_u_w(a, mem::transmute(b))
8823}
8824
8825/// Vector Unsigned Saturated Subtract of Unsigned Values
8826///
8827/// The elements in vector `b` (two unsigned 64-bit integer numbers)
8828/// are subtracted from the elements in vector `a` (two unsigned 64-bit integer numbers).
8829/// Unsigned arithmetic is performed and under-flows clamp to 0 before writing
8830/// the result to vector (two unsigned 64-bit integer numbers).
8831///
8832#[inline]
8833#[target_feature(enable = "msa")]
8834#[cfg_attr(test, assert_instr(subs_u.d))]
8835#[unstable(feature = "stdarch_mips", issue = "111198")]
8836pub unsafe fn __msa_subs_u_d(a: v2u64, b: v2u64) -> v2u64 {
8837    msa_subs_u_d(a, mem::transmute(b))
8838}
8839
8840/// Vector Unsigned Saturated Subtract of Signed from Unsigned
8841///
8842/// The signed elements in vector `b` (sixteen signed 8-bit integer numbers)
8843/// are subtracted from the unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers).
8844/// The signed result is unsigned saturated and written to
8845/// to vector (sixteen unsigned 8-bit integer numbers).
8846///
8847#[inline]
8848#[target_feature(enable = "msa")]
8849#[cfg_attr(test, assert_instr(subsus_u.b))]
8850#[unstable(feature = "stdarch_mips", issue = "111198")]
8851pub unsafe fn __msa_subsus_u_b(a: v16u8, b: v16i8) -> v16u8 {
8852    msa_subsus_u_b(a, mem::transmute(b))
8853}
8854
8855/// Vector Unsigned Saturated Subtract of Signed from Unsigned
8856///
8857/// The signed elements in vector `b` (eight signed 16-bit integer numbers)
8858/// are subtracted from the unsigned elements in vector `a` (eight unsigned 16-bit integer numbers).
8859/// The signed result is unsigned saturated and written to
8860/// to vector (eight unsigned 16-bit integer numbers).
8861///
8862#[inline]
8863#[target_feature(enable = "msa")]
8864#[cfg_attr(test, assert_instr(subsus_u.h))]
8865#[unstable(feature = "stdarch_mips", issue = "111198")]
8866pub unsafe fn __msa_subsus_u_h(a: v8u16, b: v8i16) -> v8u16 {
8867    msa_subsus_u_h(a, mem::transmute(b))
8868}
8869
8870/// Vector Unsigned Saturated Subtract of Signed from Unsigned
8871///
8872/// The signed elements in vector `b` (four signed 6432it integer numbers)
8873/// are subtracted from the unsigned elements in vector `a` (four unsigned 32-bit integer numbers).
8874/// The signed result is unsigned saturated and written to
8875/// to vector (four unsigned 32-bit integer numbers).
8876///
8877#[inline]
8878#[target_feature(enable = "msa")]
8879#[cfg_attr(test, assert_instr(subsus_u.w))]
8880#[unstable(feature = "stdarch_mips", issue = "111198")]
8881pub unsafe fn __msa_subsus_u_w(a: v4u32, b: v4i32) -> v4u32 {
8882    msa_subsus_u_w(a, mem::transmute(b))
8883}
8884
8885/// Vector Unsigned Saturated Subtract of Signed from Unsigned
8886///
8887/// The signed elements in vector `b` (two signed 64-bit integer numbers)
8888/// are subtracted from the unsigned elements in vector `a` (two unsigned 64-bit integer numbers).
8889/// The signed result is unsigned saturated and written to
8890/// to vector (two unsigned 64-bit integer numbers).
8891///
8892#[inline]
8893#[target_feature(enable = "msa")]
8894#[cfg_attr(test, assert_instr(subsus_u.d))]
8895#[unstable(feature = "stdarch_mips", issue = "111198")]
8896pub unsafe fn __msa_subsus_u_d(a: v2u64, b: v2i64) -> v2u64 {
8897    msa_subsus_u_d(a, mem::transmute(b))
8898}
8899
8900/// Vector Signed Saturated Subtract of Unsigned Values
8901///
8902/// The unsigned elements in vector `b` (sixteen unsigned 8-bit integer numbers)
8903/// are subtracted from the unsigned elements in vector `a` (sixteen unsigned 8-bit integer numbers).
8904/// The signed result is signed saturated and written to
8905/// to vector (sixteen unsigned 8-bit integer numbers).
8906///
8907#[inline]
8908#[target_feature(enable = "msa")]
8909#[cfg_attr(test, assert_instr(subsuu_s.b))]
8910#[unstable(feature = "stdarch_mips", issue = "111198")]
8911pub unsafe fn __msa_subsuu_s_b(a: v16u8, b: v16u8) -> v16i8 {
8912    msa_subsuu_s_b(a, mem::transmute(b))
8913}
8914
8915/// Vector Signed Saturated Subtract of Unsigned Values
8916///
8917/// The unsigned elements in vector `b` (eight unsigned 16-bit integer numbers)
8918/// are subtracted from the unsigned elements in vector `a` (eight unsigned 16-bit integer numbers).
8919/// The signed result is signed saturated and written to
8920/// to vector (eight unsigned 16-bit integer numbers).
8921///
8922#[inline]
8923#[target_feature(enable = "msa")]
8924#[cfg_attr(test, assert_instr(subsuu_s.h))]
8925#[unstable(feature = "stdarch_mips", issue = "111198")]
8926pub unsafe fn __msa_subsuu_s_h(a: v8u16, b: v8u16) -> v8i16 {
8927    msa_subsuu_s_h(a, mem::transmute(b))
8928}
8929
8930/// Vector Signed Saturated Subtract of Unsigned Values
8931///
8932/// The unsigned elements in vector `b` (four unsigned 32-bit integer numbers)
8933/// are subtracted from the unsigned elements in vector `a` (four unsigned 32-bit integer numbers).
8934/// The signed result is signed saturated and written to
8935/// to vector (four unsigned 32-bit integer numbers).
8936///
8937#[inline]
8938#[target_feature(enable = "msa")]
8939#[cfg_attr(test, assert_instr(subsuu_s.w))]
8940#[unstable(feature = "stdarch_mips", issue = "111198")]
8941pub unsafe fn __msa_subsuu_s_w(a: v4u32, b: v4u32) -> v4i32 {
8942    msa_subsuu_s_w(a, mem::transmute(b))
8943}
8944
8945/// Vector Signed Saturated Subtract of Unsigned Values
8946///
8947/// The unsigned elements in vector `b` (two unsigned 64-bit integer numbers)
8948/// are subtracted from the unsigned elements in vector `a` (two unsigned 64-bit integer numbers).
8949/// The signed result is signed saturated and written to
8950/// to vector (two unsigned 64-bit integer numbers).
8951///
8952#[inline]
8953#[target_feature(enable = "msa")]
8954#[cfg_attr(test, assert_instr(subsuu_s.d))]
8955#[unstable(feature = "stdarch_mips", issue = "111198")]
8956pub unsafe fn __msa_subsuu_s_d(a: v2u64, b: v2u64) -> v2i64 {
8957    msa_subsuu_s_d(a, mem::transmute(b))
8958}
8959
8960/// Vector Subtract
8961///
8962/// The elements in vector `b` (sixteen signed 8-bit integer numbers)
8963/// are subtracted from the elements in vector `a` (sixteen signed 8-bit integer numbers).
8964/// The result is written to vector (sixteen signed 8-bit integer numbers).
8965///
8966#[inline]
8967#[target_feature(enable = "msa")]
8968#[cfg_attr(test, assert_instr(subv.b))]
8969#[unstable(feature = "stdarch_mips", issue = "111198")]
8970pub unsafe fn __msa_subv_b(a: v16i8, b: v16i8) -> v16i8 {
8971    msa_subv_b(a, mem::transmute(b))
8972}
8973
8974/// Vector Subtract
8975///
8976/// The elements in vector `b` (eight signed 16-bit integer numbers)
8977/// are subtracted from the elements in vector `a` (eight signed 16-bit integer numbers).
8978/// The result is written to vector (eight signed 16-bit integer numbers).
8979///
8980#[inline]
8981#[target_feature(enable = "msa")]
8982#[cfg_attr(test, assert_instr(subv.h))]
8983#[unstable(feature = "stdarch_mips", issue = "111198")]
8984pub unsafe fn __msa_subv_h(a: v8i16, b: v8i16) -> v8i16 {
8985    msa_subv_h(a, mem::transmute(b))
8986}
8987
8988/// Vector Subtract
8989///
8990/// The elements in vector `b` (four signed 32-bit integer numbers)
8991/// are subtracted from the elements in vector `a` (four signed 32-bit integer numbers).
8992/// The result is written to vector (four signed 32-bit integer numbers).
8993///
8994#[inline]
8995#[target_feature(enable = "msa")]
8996#[cfg_attr(test, assert_instr(subv.w))]
8997#[unstable(feature = "stdarch_mips", issue = "111198")]
8998pub unsafe fn __msa_subv_w(a: v4i32, b: v4i32) -> v4i32 {
8999    msa_subv_w(a, mem::transmute(b))
9000}
9001
9002/// Vector Subtract
9003///
9004/// The elements in vector `b` (two signed 64-bit integer numbers)
9005/// are subtracted from the elements in vector `a` (two signed 64-bit integer numbers).
9006/// The result is written to vector (two signed 64-bit integer numbers).
9007///
9008#[inline]
9009#[target_feature(enable = "msa")]
9010#[cfg_attr(test, assert_instr(subv.d))]
9011#[unstable(feature = "stdarch_mips", issue = "111198")]
9012pub unsafe fn __msa_subv_d(a: v2i64, b: v2i64) -> v2i64 {
9013    msa_subv_d(a, mem::transmute(b))
9014}
9015
9016/// Immediate Subtract
9017///
9018/// The 5-bit immediate unsigned value `imm5`
9019/// are subtracted from the elements in vector `a` (sixteen signed 8-bit integer numbers).
9020/// The result is written to vector (sixteen signed 8-bit integer numbers).
9021///
9022#[inline]
9023#[target_feature(enable = "msa")]
9024#[cfg_attr(test, assert_instr(subvi.b, IMM5 = 0b10111))]
9025#[rustc_legacy_const_generics(1)]
9026#[unstable(feature = "stdarch_mips", issue = "111198")]
9027pub unsafe fn __msa_subvi_b<const IMM5: i32>(a: v16i8) -> v16i8 {
9028    static_assert_uimm_bits!(IMM5, 5);
9029    msa_subvi_b(a, IMM5)
9030}
9031
9032/// Immediate Subtract
9033///
9034/// The 5-bit immediate unsigned value `imm5`
9035/// are subtracted from the elements in vector `a` (eight signed 16-bit integer numbers).
9036/// The result is written to vector (eight signed 16-bit integer numbers).
9037///
9038#[inline]
9039#[target_feature(enable = "msa")]
9040#[cfg_attr(test, assert_instr(subvi.h, IMM5 = 0b10111))]
9041#[rustc_legacy_const_generics(1)]
9042#[unstable(feature = "stdarch_mips", issue = "111198")]
9043pub unsafe fn __msa_subvi_h<const IMM5: i32>(a: v8i16) -> v8i16 {
9044    static_assert_uimm_bits!(IMM5, 5);
9045    msa_subvi_h(a, IMM5)
9046}
9047
9048/// Immediate Subtract
9049///
9050/// The 5-bit immediate unsigned value `imm5`
9051/// are subtracted from the elements in vector `a` (four signed 32-bit integer numbers).
9052/// The result is written to vector (four signed 32-bit integer numbers).
9053///
9054#[inline]
9055#[target_feature(enable = "msa")]
9056#[cfg_attr(test, assert_instr(subvi.w, IMM5 = 0b10111))]
9057#[rustc_legacy_const_generics(1)]
9058#[unstable(feature = "stdarch_mips", issue = "111198")]
9059pub unsafe fn __msa_subvi_w<const IMM5: i32>(a: v4i32) -> v4i32 {
9060    static_assert_uimm_bits!(IMM5, 5);
9061    msa_subvi_w(a, IMM5)
9062}
9063
9064/// Immediate Subtract
9065///
9066/// The 5-bit immediate unsigned value `imm5`
9067/// are subtracted from the elements in vector `a` (two signed 64-bit integer numbers).
9068/// The result is written to vector (two signed 64-bit integer numbers).
9069///
9070#[inline]
9071#[target_feature(enable = "msa")]
9072#[cfg_attr(test, assert_instr(subvi.d, IMM5 = 0b10111))]
9073#[rustc_legacy_const_generics(1)]
9074#[unstable(feature = "stdarch_mips", issue = "111198")]
9075pub unsafe fn __msa_subvi_d<const IMM5: i32>(a: v2i64) -> v2i64 {
9076    static_assert_uimm_bits!(IMM5, 5);
9077    msa_subvi_d(a, IMM5)
9078}
9079
9080/// Vector Data Preserving Shuffle
9081///
9082/// The vector shuffle instructions selectively copy data elements from the
9083/// concatenation of vectors `b` (sixteen signed 8-bit integer numbers)
9084/// and `c` (sixteen signed 8-bit integer numbers) in to vector `a`
9085/// (sixteen signed 8-bit integer numbers) based on the corresponding control element in `a`.
9086/// The least significant 6 bits in `a` control elements modulo the number of elements in
9087/// the concatenated vectors `b`, `a` specify the index of the source element.
9088/// If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.
9089///
9090#[inline]
9091#[target_feature(enable = "msa")]
9092#[cfg_attr(test, assert_instr(vshf.b))]
9093#[unstable(feature = "stdarch_mips", issue = "111198")]
9094pub unsafe fn __msa_vshf_b(a: v16i8, b: v16i8, c: v16i8) -> v16i8 {
9095    msa_vshf_b(a, mem::transmute(b), c)
9096}
9097
9098/// Vector Data Preserving Shuffle
9099///
9100/// The vector shuffle instructions selectively copy data elements from the
9101/// concatenation of vectors `b` (eight signed 16-bit integer numbers)
9102/// and `c` (eight signed 16-bit integer numbers) in to vector `a`
9103/// (eight signed 16-bit integer numbers) based on the corresponding control element in `a`.
9104/// The least significant 6 bits in `a` control elements modulo the number of elements in
9105/// the concatenated vectors `b`, `a` specify the index of the source element.
9106/// If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.
9107///
9108#[inline]
9109#[target_feature(enable = "msa")]
9110#[cfg_attr(test, assert_instr(vshf.h))]
9111#[unstable(feature = "stdarch_mips", issue = "111198")]
9112pub unsafe fn __msa_vshf_h(a: v8i16, b: v8i16, c: v8i16) -> v8i16 {
9113    msa_vshf_h(a, mem::transmute(b), c)
9114}
9115
9116/// Vector Data Preserving Shuffle
9117///
9118/// The vector shuffle instructions selectively copy data elements from the
9119/// concatenation of vectors `b` (four signed 32-bit integer numbers)
9120/// and `c` (four signed 32-bit integer numbers) in to vector `a`
9121/// (four signed 32-bit integer numbers) based on the corresponding control element in `a`.
9122/// The least significant 6 bits in `a` control elements modulo the number of elements in
9123/// the concatenated vectors `b`, `a` specify the index of the source element.
9124/// If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.
9125///
9126#[inline]
9127#[target_feature(enable = "msa")]
9128#[cfg_attr(test, assert_instr(vshf.w))]
9129#[unstable(feature = "stdarch_mips", issue = "111198")]
9130pub unsafe fn __msa_vshf_w(a: v4i32, b: v4i32, c: v4i32) -> v4i32 {
9131    msa_vshf_w(a, mem::transmute(b), c)
9132}
9133
9134/// Vector Data Preserving Shuffle
9135///
9136/// The vector shuffle instructions selectively copy data elements from the
9137/// concatenation of vectors `b` (two signed 64-bit integer numbers)
9138/// and `c` (two signed 64-bit integer numbers) in to vector `a`
9139/// (two signed 64-bit integer numbers) based on the corresponding control element in `a`.
9140/// The least significant 6 bits in `a` control elements modulo the number of elements in
9141/// the concatenated vectors `b`, `a` specify the index of the source element.
9142/// If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.
9143///
9144#[inline]
9145#[target_feature(enable = "msa")]
9146#[cfg_attr(test, assert_instr(vshf.d))]
9147#[unstable(feature = "stdarch_mips", issue = "111198")]
9148pub unsafe fn __msa_vshf_d(a: v2i64, b: v2i64, c: v2i64) -> v2i64 {
9149    msa_vshf_d(a, mem::transmute(b), c)
9150}
9151
9152/// Vector Logical Exclusive Or
9153///
9154/// Each bit of vector `a` (sixteen unsigned 8-bit integer numbers)
9155/// is combined with the corresponding bit of vector `b` (sixteen unsigned 8-bit integer numbers)
9156/// in a bitwise logical XOR operation. The result is written to vector
9157/// (sixteen unsigned 8-bit integer numbers).
9158///
9159#[inline]
9160#[target_feature(enable = "msa")]
9161#[cfg_attr(test, assert_instr(xor.v))]
9162#[unstable(feature = "stdarch_mips", issue = "111198")]
9163pub unsafe fn __msa_xor_v(a: v16u8, b: v16u8) -> v16u8 {
9164    msa_xor_v(a, mem::transmute(b))
9165}
9166
9167/// Immediate Logical Exclusive Or
9168///
9169/// Each byte of vector `a` (sixteen unsigned 8-bit integer numbers)
9170/// is combined with the 8-bit immediate `imm8`
9171/// in a bitwise logical XOR operation. The result is written to vector
9172/// (sixteen unsigned 8-bit integer numbers).
9173///
9174#[inline]
9175#[target_feature(enable = "msa")]
9176#[cfg_attr(test, assert_instr(xori.b, IMM8 = 0b11111111))]
9177#[rustc_legacy_const_generics(1)]
9178#[unstable(feature = "stdarch_mips", issue = "111198")]
9179pub unsafe fn __msa_xori_b<const IMM8: i32>(a: v16u8) -> v16u8 {
9180    static_assert_uimm_bits!(IMM8, 8);
9181    msa_xori_b(a, IMM8)
9182}
9183
9184#[cfg(test)]
9185mod tests {
9186    use crate::{
9187        core_arch::{mips::msa::*, simd::*},
9188        mem,
9189    };
9190    use stdarch_test::simd_test;
9191
9192    #[simd_test(enable = "msa")]
9193    unsafe fn test_msa_add_a_b() {
9194        #[rustfmt::skip]
9195        let a = i8x16::new(
9196            1, 2, 3, 4,
9197            1, 2, 3, 4,
9198            1, 2, 3, 4,
9199            1, 2, 3, 4
9200        );
9201        #[rustfmt::skip]
9202        let b = i8x16::new(
9203            -4, -3, -2, -1,
9204            -4, -3, -2, -1,
9205            -4, -3, -2, -1,
9206            -4, -3, -2, -1
9207        );
9208        #[rustfmt::skip]
9209        let r = i8x16::new(
9210            5, 5, 5, 5,
9211            5, 5, 5, 5,
9212            5, 5, 5, 5,
9213            5, 5, 5, 5
9214        );
9215
9216        assert_eq!(
9217            r,
9218            mem::transmute(__msa_add_a_b(mem::transmute(a), mem::transmute(b)))
9219        );
9220    }
9221
9222    #[simd_test(enable = "msa")]
9223    unsafe fn test_msa_add_a_h() {
9224        #[rustfmt::skip]
9225        let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
9226        #[rustfmt::skip]
9227        let b = i16x8::new(-4, -3, -2, -1, -4, -3, -2, -1);
9228        #[rustfmt::skip]
9229        let r = i16x8::new(5, 5, 5, 5, 5, 5, 5, 5);
9230
9231        assert_eq!(
9232            r,
9233            mem::transmute(__msa_add_a_h(mem::transmute(a), mem::transmute(b)))
9234        );
9235    }
9236
9237    #[simd_test(enable = "msa")]
9238    unsafe fn test_msa_add_a_w() {
9239        #[rustfmt::skip]
9240        let a = i32x4::new(1, 2, 3, 4);
9241        #[rustfmt::skip]
9242        let b = i32x4::new(-4, -3, -2, -1);
9243        #[rustfmt::skip]
9244        let r = i32x4::new(5, 5, 5, 5);
9245
9246        assert_eq!(
9247            r,
9248            mem::transmute(__msa_add_a_w(mem::transmute(a), mem::transmute(b)))
9249        );
9250    }
9251
9252    #[simd_test(enable = "msa")]
9253    unsafe fn test_msa_add_a_d() {
9254        #[rustfmt::skip]
9255        let a = i64x2::new(1, 2);
9256        #[rustfmt::skip]
9257        let b = i64x2::new(-4, -3);
9258        #[rustfmt::skip]
9259        let r = i64x2::new(5, 5);
9260
9261        assert_eq!(
9262            r,
9263            mem::transmute(__msa_add_a_d(mem::transmute(a), mem::transmute(b)))
9264        );
9265    }
9266
9267    #[simd_test(enable = "msa")]
9268    unsafe fn test_msa_adds_a_b() {
9269        #[rustfmt::skip]
9270        let a = i8x16::new(
9271            100, i8::MAX, 100, i8::MAX,
9272            100, i8::MAX, 100, i8::MAX,
9273            100, i8::MAX, 100, i8::MAX,
9274            100, i8::MAX, 100, i8::MAX
9275        );
9276        #[rustfmt::skip]
9277        let b = i8x16::new(
9278            -4, -3, -2, -100,
9279            -4, -3, -2, -100,
9280            -4, -3, -2, -100,
9281            -4, -3, -2, -100
9282        );
9283        #[rustfmt::skip]
9284        let r = i8x16::new(
9285            104, 127, 102, 127,
9286            104, 127, 102, 127,
9287            104, 127, 102, 127,
9288            104, 127, 102, 127
9289        );
9290
9291        assert_eq!(
9292            r,
9293            mem::transmute(__msa_adds_a_b(mem::transmute(a), mem::transmute(b)))
9294        );
9295    }
9296
9297    #[simd_test(enable = "msa")]
9298    unsafe fn test_msa_adds_a_h() {
9299        #[rustfmt::skip]
9300        let a = i16x8::new(
9301            100, i16::MAX, 100, i16::MAX,
9302            100, i16::MAX, 100, i16::MAX
9303        );
9304        #[rustfmt::skip]
9305        let b = i16x8::new(-4, -3, -2, -1, -4, -3, -2, -1);
9306        #[rustfmt::skip]
9307        let r = i16x8::new(
9308            104, i16::MAX, 102, i16::MAX,
9309            104, i16::MAX, 102, i16::MAX
9310        );
9311
9312        assert_eq!(
9313            r,
9314            mem::transmute(__msa_adds_a_h(mem::transmute(a), mem::transmute(b)))
9315        );
9316    }
9317
9318    #[simd_test(enable = "msa")]
9319    unsafe fn test_msa_adds_a_w() {
9320        #[rustfmt::skip]
9321        let a = i32x4::new(100, i32::MAX, 100, i32::MAX);
9322        #[rustfmt::skip]
9323        let b = i32x4::new(-4, -3, -2, -1);
9324        #[rustfmt::skip]
9325        let r = i32x4::new(104, i32::MAX, 102, i32::MAX);
9326
9327        assert_eq!(
9328            r,
9329            mem::transmute(__msa_adds_a_w(mem::transmute(a), mem::transmute(b)))
9330        );
9331    }
9332
9333    #[simd_test(enable = "msa")]
9334    unsafe fn test_msa_adds_a_d() {
9335        #[rustfmt::skip]
9336        let a = i64x2::new(100, i64::MAX);
9337        #[rustfmt::skip]
9338        let b = i64x2::new(-4, -3);
9339        #[rustfmt::skip]
9340        let r = i64x2::new(104, i64::MAX);
9341
9342        assert_eq!(
9343            r,
9344            mem::transmute(__msa_adds_a_d(mem::transmute(a), mem::transmute(b)))
9345        );
9346    }
9347
9348    #[simd_test(enable = "msa")]
9349    unsafe fn test_msa_adds_s_b() {
9350        #[rustfmt::skip]
9351        let a = i8x16::new(
9352            100, i8::MIN, 100, i8::MAX,
9353            100, i8::MIN, 100, i8::MAX,
9354            100, i8::MIN, 100, i8::MAX,
9355            100, i8::MIN, 100, i8::MAX
9356        );
9357        #[rustfmt::skip]
9358        let b = i8x16::new(
9359            -4, -3, -2, 100,
9360            -4, -3, -2, 100,
9361            -4, -3, -2, 100,
9362            -4, -3, -2, 100
9363        );
9364        #[rustfmt::skip]
9365        let r = i8x16::new(
9366            96, i8::MIN, 98, i8::MAX,
9367            96, i8::MIN, 98, i8::MAX,
9368            96, i8::MIN, 98, i8::MAX,
9369            96, i8::MIN, 98, i8::MAX
9370        );
9371
9372        assert_eq!(
9373            r,
9374            mem::transmute(__msa_adds_s_b(mem::transmute(a), mem::transmute(b)))
9375        );
9376    }
9377
9378    #[simd_test(enable = "msa")]
9379    unsafe fn test_msa_adds_s_h() {
9380        #[rustfmt::skip]
9381        let a = i16x8::new(
9382            100, i16::MIN, 100, i16::MAX,
9383            100, i16::MIN, 100, i16::MAX
9384        );
9385        #[rustfmt::skip]
9386        let b = i16x8::new(-4, -3, -2, 1, -4, -3, -2, 1);
9387        #[rustfmt::skip]
9388        let r = i16x8::new(
9389            96, i16::MIN, 98, i16::MAX,
9390            96, i16::MIN, 98, i16::MAX
9391        );
9392
9393        assert_eq!(
9394            r,
9395            mem::transmute(__msa_adds_s_h(mem::transmute(a), mem::transmute(b)))
9396        );
9397    }
9398
9399    #[simd_test(enable = "msa")]
9400    unsafe fn test_msa_adds_s_w() {
9401        #[rustfmt::skip]
9402        let a = i32x4::new(100, i32::MAX, 100, i32::MIN);
9403        #[rustfmt::skip]
9404        let b = i32x4::new(-4, 3, -2, -1);
9405        #[rustfmt::skip]
9406        let r = i32x4::new(96, i32::MAX, 98, i32::MIN);
9407
9408        assert_eq!(
9409            r,
9410            mem::transmute(__msa_adds_s_w(mem::transmute(a), mem::transmute(b)))
9411        );
9412    }
9413
9414    #[simd_test(enable = "msa")]
9415    unsafe fn test_msa_adds_s_d() {
9416        #[rustfmt::skip]
9417        let a = i64x2::new(100, i64::MIN);
9418        #[rustfmt::skip]
9419        let b = i64x2::new(-4, -3);
9420        #[rustfmt::skip]
9421        let r = i64x2::new(96, i64::MIN);
9422
9423        assert_eq!(
9424            r,
9425            mem::transmute(__msa_adds_s_d(mem::transmute(a), mem::transmute(b)))
9426        );
9427    }
9428
9429    #[simd_test(enable = "msa")]
9430    unsafe fn test_msa_adds_u_b() {
9431        #[rustfmt::skip]
9432        let a = u8x16::new(
9433            100, u8::MAX, 100, u8::MAX,
9434            100, u8::MAX, 100, u8::MAX,
9435            100, u8::MAX, 100, u8::MAX,
9436            100, u8::MAX, 100, u8::MAX
9437        );
9438        #[rustfmt::skip]
9439        let b = u8x16::new(
9440            4, 3, 2, 100,
9441            4, 3, 2, 100,
9442            4, 3, 2, 100,
9443            4, 3, 2, 100
9444        );
9445        #[rustfmt::skip]
9446        let r = u8x16::new(
9447            104, u8::MAX, 102, u8::MAX,
9448            104, u8::MAX, 102, u8::MAX,
9449            104, u8::MAX, 102, u8::MAX,
9450            104, u8::MAX, 102, u8::MAX
9451        );
9452
9453        assert_eq!(
9454            r,
9455            mem::transmute(__msa_adds_u_b(mem::transmute(a), mem::transmute(b)))
9456        );
9457    }
9458
9459    #[simd_test(enable = "msa")]
9460    unsafe fn test_msa_adds_u_h() {
9461        #[rustfmt::skip]
9462        let a = u16x8::new(
9463            100, u16::MAX, 100, u16::MAX,
9464            100, u16::MAX, 100, u16::MAX
9465        );
9466        #[rustfmt::skip]
9467        let b = u16x8::new(4, 3, 2, 1, 4, 3, 2, 1);
9468        #[rustfmt::skip]
9469        let r = u16x8::new(
9470            104, u16::MAX, 102, u16::MAX,
9471            104, u16::MAX, 102, u16::MAX
9472        );
9473
9474        assert_eq!(
9475            r,
9476            mem::transmute(__msa_adds_u_h(mem::transmute(a), mem::transmute(b)))
9477        );
9478    }
9479
9480    #[simd_test(enable = "msa")]
9481    unsafe fn test_msa_adds_u_w() {
9482        #[rustfmt::skip]
9483        let a = u32x4::new(100, u32::MAX, 100, u32::MAX);
9484        #[rustfmt::skip]
9485        let b = u32x4::new(4, 3, 2, 1);
9486        #[rustfmt::skip]
9487        let r = u32x4::new(104, u32::MAX, 102, u32::MAX);
9488
9489        assert_eq!(
9490            r,
9491            mem::transmute(__msa_adds_u_w(mem::transmute(a), mem::transmute(b)))
9492        );
9493    }
9494
9495    #[simd_test(enable = "msa")]
9496    unsafe fn test_msa_adds_u_d() {
9497        #[rustfmt::skip]
9498        let a = u64x2::new(100, u64::MAX);
9499        #[rustfmt::skip]
9500        let b = u64x2::new(4, 3);
9501        #[rustfmt::skip]
9502        let r = u64x2::new(104, u64::MAX);
9503
9504        assert_eq!(
9505            r,
9506            mem::transmute(__msa_adds_u_d(mem::transmute(a), mem::transmute(b)))
9507        );
9508    }
9509
9510    #[simd_test(enable = "msa")]
9511    unsafe fn test_msa_addv_b() {
9512        #[rustfmt::skip]
9513        let a = i8x16::new(
9514            100, i8::MIN, 100, i8::MAX,
9515            100, i8::MIN, 100, i8::MAX,
9516            100, i8::MIN, 100, i8::MAX,
9517            100, i8::MIN, 100, i8::MAX
9518        );
9519        #[rustfmt::skip]
9520        let b = i8x16::new(
9521            -4, -3, -2, 100,
9522            -4, -3, -2, 100,
9523            -4, -3, -2, 100,
9524            -4, -3, -2, 100
9525        );
9526        #[rustfmt::skip]
9527        let r = i8x16::new(
9528            96, 125, 98, -29,
9529            96, 125, 98, -29,
9530            96, 125, 98, -29,
9531            96, 125, 98, -29
9532        );
9533
9534        assert_eq!(
9535            r,
9536            mem::transmute(__msa_addv_b(mem::transmute(a), mem::transmute(b)))
9537        );
9538    }
9539
9540    #[simd_test(enable = "msa")]
9541    unsafe fn test_msa_addv_h() {
9542        #[rustfmt::skip]
9543        let a = i16x8::new(
9544            100, i16::MIN, 100, i16::MAX,
9545            100, i16::MIN, 100, i16::MAX
9546        );
9547        #[rustfmt::skip]
9548        let b = i16x8::new(-4, -3, -2, 1, -4, -3, -2, 1);
9549        #[rustfmt::skip]
9550        let r = i16x8::new(96, 32765, 98, -32768, 96, 32765, 98, -32768);
9551
9552        assert_eq!(
9553            r,
9554            mem::transmute(__msa_addv_h(mem::transmute(a), mem::transmute(b)))
9555        );
9556    }
9557
9558    #[simd_test(enable = "msa")]
9559    unsafe fn test_msa_addv_w() {
9560        #[rustfmt::skip]
9561        let a = i32x4::new(100, i32::MAX, 100, i32::MIN);
9562        #[rustfmt::skip]
9563        let b = i32x4::new(-4, 3, -2, -1);
9564        #[rustfmt::skip]
9565        let r = i32x4::new(96, -2147483646, 98, 2147483647);
9566
9567        assert_eq!(
9568            r,
9569            mem::transmute(__msa_addv_w(mem::transmute(a), mem::transmute(b)))
9570        );
9571    }
9572
9573    #[simd_test(enable = "msa")]
9574    unsafe fn test_msa_addv_d() {
9575        #[rustfmt::skip]
9576        let a = i64x2::new(100, i64::MIN);
9577        #[rustfmt::skip]
9578        let b = i64x2::new(-4, -3);
9579        #[rustfmt::skip]
9580        let r = i64x2::new(96, 9223372036854775805);
9581
9582        assert_eq!(
9583            r,
9584            mem::transmute(__msa_addv_d(mem::transmute(a), mem::transmute(b)))
9585        );
9586    }
9587
9588    #[simd_test(enable = "msa")]
9589    unsafe fn test_msa_addvi_b() {
9590        #[rustfmt::skip]
9591        let a = i8x16::new(
9592            100, i8::MAX, 100, i8::MAX,
9593            100, i8::MAX, 100, i8::MAX,
9594            100, i8::MAX, 100, i8::MAX,
9595            100, i8::MAX, 100, i8::MAX
9596        );
9597        #[rustfmt::skip]
9598        let r = i8x16::new(
9599            103, -126, 103, -126,
9600            103, -126, 103, -126,
9601            103, -126, 103, -126,
9602            103, -126, 103, -126
9603        );
9604
9605        assert_eq!(r, mem::transmute(__msa_addvi_b::<3>(mem::transmute(a))));
9606    }
9607
9608    #[simd_test(enable = "msa")]
9609    unsafe fn test_msa_addvi_h() {
9610        #[rustfmt::skip]
9611        let a = i16x8::new(
9612            i16::MAX, 3276, -100, -127,
9613            i16::MAX, 3276, -100, -127
9614        );
9615        #[rustfmt::skip]
9616        let r = i16x8::new(
9617            -32766, 3279, -97, -124,
9618            -32766, 3279, -97, -124
9619        );
9620
9621        assert_eq!(r, mem::transmute(__msa_addvi_h::<3>(mem::transmute(a))));
9622    }
9623
9624    #[simd_test(enable = "msa")]
9625    unsafe fn test_msa_addvi_w() {
9626        #[rustfmt::skip]
9627        let a = i32x4::new(100, i32::MAX, 100, i32::MIN);
9628        #[rustfmt::skip]
9629        let r = i32x4::new(103, -2147483646, 103, -2147483645);
9630
9631        assert_eq!(r, mem::transmute(__msa_addvi_w::<3>(mem::transmute(a))));
9632    }
9633
9634    #[simd_test(enable = "msa")]
9635    unsafe fn test_msa_addvi_d() {
9636        #[rustfmt::skip]
9637        let a = i64x2::new(100, i64::MIN);
9638        #[rustfmt::skip]
9639        let r = i64x2::new(117, -9223372036854775791);
9640
9641        assert_eq!(r, mem::transmute(__msa_addvi_d::<17>(mem::transmute(a))));
9642    }
9643
9644    #[simd_test(enable = "msa")]
9645    unsafe fn test_msa_and_v() {
9646        #[rustfmt::skip]
9647        let a = u8x16::new(
9648            100, u8::MAX, 100, u8::MAX,
9649            100, u8::MAX, 100, u8::MAX,
9650            100, u8::MAX, 100, u8::MAX,
9651            100, u8::MAX, 100, u8::MAX
9652    );
9653        #[rustfmt::skip]
9654        let b = u8x16::new(
9655            4, 3, 2, 100,
9656            4, 3, 2, 100,
9657            4, 3, 2, 100,
9658            4, 3, 2, 100
9659        );
9660        #[rustfmt::skip]
9661        let r = u8x16::new(
9662            4, 3, 0, 100,
9663            4, 3, 0, 100,
9664            4, 3, 0, 100,
9665            4, 3, 0, 100
9666        );
9667
9668        assert_eq!(
9669            r,
9670            mem::transmute(__msa_and_v(mem::transmute(a), mem::transmute(b)))
9671        );
9672    }
9673
9674    #[simd_test(enable = "msa")]
9675    unsafe fn test_msa_andi_b() {
9676        #[rustfmt::skip]
9677        let a = u8x16::new(
9678            100, u8::MAX, 100, u8::MAX,
9679            100, u8::MAX, 100, u8::MAX,
9680            100, u8::MAX, 100, u8::MAX,
9681            100, u8::MAX, 100, u8::MAX
9682        );
9683        #[rustfmt::skip]
9684        let r = u8x16::new(
9685            4, 5, 4, 5,
9686            4, 5, 4, 5,
9687            4, 5, 4, 5,
9688            4, 5, 4, 5
9689        );
9690
9691        assert_eq!(r, mem::transmute(__msa_andi_b::<5>(mem::transmute(a))));
9692    }
9693
9694    #[simd_test(enable = "msa")]
9695    unsafe fn test_msa_asub_s_b() {
9696        #[rustfmt::skip]
9697        let a = i8x16::new(
9698            -1, -2, -3, -4,
9699            -1, -2, -3, -4,
9700            -1, -2, -3, -4,
9701            -1, -2, -3, -4
9702        );
9703        #[rustfmt::skip]
9704        let b = i8x16::new(
9705            -6, -7, -8, -9,
9706            -6, -7, -8, -9,
9707            -6, -7, -8, -9,
9708            -6, -7, -8, -9
9709        );
9710        #[rustfmt::skip]
9711        let r = i8x16::new(
9712            5, 5, 5, 5,
9713            5, 5, 5, 5,
9714            5, 5, 5, 5,
9715            5, 5, 5, 5
9716        );
9717
9718        assert_eq!(
9719            r,
9720            mem::transmute(__msa_asub_s_b(mem::transmute(a), mem::transmute(b)))
9721        );
9722    }
9723
9724    #[simd_test(enable = "msa")]
9725    unsafe fn test_msa_asub_s_h() {
9726        #[rustfmt::skip]
9727        let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, -4);
9728        #[rustfmt::skip]
9729        let b = i16x8::new(-6, -7, -8, -9, -6, -7, -8, -9);
9730        #[rustfmt::skip]
9731        let r = i16x8::new(5, 5, 5, 5, 5, 5, 5, 5);
9732
9733        assert_eq!(
9734            r,
9735            mem::transmute(__msa_asub_s_h(mem::transmute(a), mem::transmute(b)))
9736        );
9737    }
9738
9739    #[simd_test(enable = "msa")]
9740    unsafe fn test_msa_asub_s_w() {
9741        #[rustfmt::skip]
9742        let a = i32x4::new(-1, -2, -3, -4);
9743        #[rustfmt::skip]
9744        let b = i32x4::new(-6, -7, -8, -9);
9745        #[rustfmt::skip]
9746        let r = i32x4::new(5, 5, 5, 5);
9747
9748        assert_eq!(
9749            r,
9750            mem::transmute(__msa_asub_s_w(mem::transmute(a), mem::transmute(b)))
9751        );
9752    }
9753
9754    #[simd_test(enable = "msa")]
9755    unsafe fn test_msa_asub_s_d() {
9756        #[rustfmt::skip]
9757        let a = i64x2::new(-1, -2);
9758        #[rustfmt::skip]
9759        let b = i64x2::new(-6, -7);
9760        #[rustfmt::skip]
9761        let r = i64x2::new(5, 5);
9762
9763        assert_eq!(
9764            r,
9765            mem::transmute(__msa_asub_s_d(mem::transmute(a), mem::transmute(b)))
9766        );
9767    }
9768
9769    #[simd_test(enable = "msa")]
9770    unsafe fn test_msa_asub_u_b() {
9771        #[rustfmt::skip]
9772        let a = u8x16::new(
9773            1, 2, 3, 4,
9774            1, 2, 3, 4,
9775            1, 2, 3, 4,
9776            1, 2, 3, 4
9777        );
9778        #[rustfmt::skip]
9779        let b = u8x16::new(
9780            6, 7, 8, 9,
9781            6, 7, 8, 9,
9782            6, 7, 8, 9,
9783            6, 7, 8, 9
9784        );
9785        #[rustfmt::skip]
9786        let r = u8x16::new(
9787            5, 5, 5, 5,
9788            5, 5, 5, 5,
9789            5, 5, 5, 5,
9790            5, 5, 5, 5
9791        );
9792
9793        assert_eq!(
9794            r,
9795            mem::transmute(__msa_asub_u_b(mem::transmute(a), mem::transmute(b)))
9796        );
9797    }
9798
9799    #[simd_test(enable = "msa")]
9800    unsafe fn test_msa_asub_u_h() {
9801        #[rustfmt::skip]
9802        let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
9803        #[rustfmt::skip]
9804        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
9805        #[rustfmt::skip]
9806        let r = u16x8::new(5, 5, 5, 5, 5, 5, 5, 5);
9807
9808        assert_eq!(
9809            r,
9810            mem::transmute(__msa_asub_u_h(mem::transmute(a), mem::transmute(b)))
9811        );
9812    }
9813
9814    #[simd_test(enable = "msa")]
9815    unsafe fn test_msa_asub_u_w() {
9816        #[rustfmt::skip]
9817        let a = u32x4::new(1, 2, 3, 4);
9818        #[rustfmt::skip]
9819        let b = u32x4::new(6, 7, 8, 9);
9820        #[rustfmt::skip]
9821        let r = u32x4::new(5, 5, 5, 5);
9822
9823        assert_eq!(
9824            r,
9825            mem::transmute(__msa_asub_u_w(mem::transmute(a), mem::transmute(b)))
9826        );
9827    }
9828
9829    #[simd_test(enable = "msa")]
9830    unsafe fn test_msa_asub_u_d() {
9831        #[rustfmt::skip]
9832        let a = u64x2::new(1, 2);
9833        #[rustfmt::skip]
9834        let b = u64x2::new(6, 7);
9835        #[rustfmt::skip]
9836        let r = u64x2::new(5, 5);
9837
9838        assert_eq!(
9839            r,
9840            mem::transmute(__msa_asub_u_d(mem::transmute(a), mem::transmute(b)))
9841        );
9842    }
9843
9844    #[simd_test(enable = "msa")]
9845    unsafe fn test_msa_ave_s_b() {
9846        #[rustfmt::skip]
9847        let a = i8x16::new(
9848            -1, -2, -3, -4,
9849            -1, -2, -3, -4,
9850            -1, -2, -3, -4,
9851            -1, -2, -3, -4
9852        );
9853        #[rustfmt::skip]
9854        let b = i8x16::new(
9855            6, -7, 8, -9,
9856            6, -7, 8, -9,
9857            6, -7, 8, -9,
9858            6, -7, 8, -9
9859        );
9860        #[rustfmt::skip]
9861        let r = i8x16::new(
9862            2, -5, 2, -7,
9863            2, -5, 2, -7,
9864            2, -5, 2, -7,
9865            2, -5, 2, -7
9866        );
9867
9868        assert_eq!(
9869            r,
9870            mem::transmute(__msa_ave_s_b(mem::transmute(a), mem::transmute(b)))
9871        );
9872    }
9873
9874    #[simd_test(enable = "msa")]
9875    unsafe fn test_msa_ave_s_h() {
9876        #[rustfmt::skip]
9877        let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, -4);
9878        #[rustfmt::skip]
9879        let b = i16x8::new(6, -7, 8, -9, 6, -7, 8, -9);
9880        #[rustfmt::skip]
9881        let r = i16x8::new(2, -5, 2, -7, 2, -5, 2, -7);
9882
9883        assert_eq!(
9884            r,
9885            mem::transmute(__msa_ave_s_h(mem::transmute(a), mem::transmute(b)))
9886        );
9887    }
9888
9889    #[simd_test(enable = "msa")]
9890    unsafe fn test_msa_ave_s_w() {
9891        #[rustfmt::skip]
9892        let a = i32x4::new(-1, -2, -3, -4);
9893        #[rustfmt::skip]
9894        let b = i32x4::new(6, -7, 8, -9);
9895        #[rustfmt::skip]
9896        let r = i32x4::new(2, -5, 2, -7);
9897
9898        assert_eq!(
9899            r,
9900            mem::transmute(__msa_ave_s_w(mem::transmute(a), mem::transmute(b)))
9901        );
9902    }
9903
9904    #[simd_test(enable = "msa")]
9905    unsafe fn test_msa_ave_s_d() {
9906        #[rustfmt::skip]
9907        let a = i64x2::new(-1, -2);
9908        #[rustfmt::skip]
9909        let b = i64x2::new(-6, -7);
9910        #[rustfmt::skip]
9911        let r = i64x2::new(-4, -5);
9912
9913        assert_eq!(
9914            r,
9915            mem::transmute(__msa_ave_s_d(mem::transmute(a), mem::transmute(b)))
9916        );
9917    }
9918
9919    #[simd_test(enable = "msa")]
9920    unsafe fn test_msa_ave_u_b() {
9921        #[rustfmt::skip]
9922        let a = u8x16::new(
9923            1, 2, 3, 4,
9924            1, 2, 3, 4,
9925            1, 2, 3, 4,
9926            1, 2, 3, 4
9927        );
9928        #[rustfmt::skip]
9929        let b = u8x16::new(
9930            6, 7, 8, 9,
9931            6, 7, 8, 9,
9932            6, 7, 8, 9,
9933            6, 7, 8, 9
9934        );
9935        #[rustfmt::skip]
9936        let r = u8x16::new(
9937            3, 4, 5, 6,
9938            3, 4, 5, 6,
9939            3, 4, 5, 6,
9940            3, 4, 5, 6
9941        );
9942
9943        assert_eq!(
9944            r,
9945            mem::transmute(__msa_ave_u_b(mem::transmute(a), mem::transmute(b)))
9946        );
9947    }
9948
9949    #[simd_test(enable = "msa")]
9950    unsafe fn test_msa_ave_u_h() {
9951        #[rustfmt::skip]
9952        let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
9953        #[rustfmt::skip]
9954        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
9955        #[rustfmt::skip]
9956        let r = u16x8::new(3, 4, 5, 6, 3, 4, 5, 6);
9957
9958        assert_eq!(
9959            r,
9960            mem::transmute(__msa_ave_u_h(mem::transmute(a), mem::transmute(b)))
9961        );
9962    }
9963
9964    #[simd_test(enable = "msa")]
9965    unsafe fn test_msa_ave_u_w() {
9966        #[rustfmt::skip]
9967        let a = u32x4::new(1, 2, 3, 4);
9968        #[rustfmt::skip]
9969        let b = u32x4::new(6, 7, 8, 9);
9970        #[rustfmt::skip]
9971        let r = u32x4::new(3, 4, 5, 6);
9972
9973        assert_eq!(
9974            r,
9975            mem::transmute(__msa_ave_u_w(mem::transmute(a), mem::transmute(b)))
9976        );
9977    }
9978
9979    #[simd_test(enable = "msa")]
9980    unsafe fn test_msa_ave_u_d() {
9981        #[rustfmt::skip]
9982        let a = u64x2::new(1, 2);
9983        #[rustfmt::skip]
9984        let b = u64x2::new(6, 7);
9985        #[rustfmt::skip]
9986        let r = u64x2::new(3, 4);
9987
9988        assert_eq!(
9989            r,
9990            mem::transmute(__msa_ave_u_d(mem::transmute(a), mem::transmute(b)))
9991        );
9992    }
9993
9994    #[simd_test(enable = "msa")]
9995    unsafe fn test_msa_aver_s_b() {
9996        #[rustfmt::skip]
9997        let a = i8x16::new(
9998            -1, -2, 3, -4,
9999            -1, -2, 3, -4,
10000            -1, -2, 3, -4,
10001            -1, -2, 3, -4
10002        );
10003        #[rustfmt::skip]
10004        let b = i8x16::new(
10005            -6, 7, -8, -9,
10006            -6, 7, -8, -9,
10007            -6, 7, -8, -9,
10008            -6, 7, -8, -9
10009        );
10010        #[rustfmt::skip]
10011        let r = i8x16::new(
10012            -3, 3, -2, -6,
10013            -3, 3, -2, -6,
10014            -3, 3, -2, -6,
10015            -3, 3, -2, -6
10016        );
10017
10018        assert_eq!(
10019            r,
10020            mem::transmute(__msa_aver_s_b(mem::transmute(a), mem::transmute(b)))
10021        );
10022    }
10023
10024    #[simd_test(enable = "msa")]
10025    unsafe fn test_msa_aver_s_h() {
10026        #[rustfmt::skip]
10027        let a = i16x8::new(-1, -2, 3, -4, -1, -2, 3, -4);
10028        #[rustfmt::skip]
10029        let b = i16x8::new(-6, 7, -8, -9, -6, 7, -8, -9);
10030        #[rustfmt::skip]
10031        let r = i16x8::new(-3, 3, -2, -6, -3, 3, -2, -6);
10032
10033        assert_eq!(
10034            r,
10035            mem::transmute(__msa_aver_s_h(mem::transmute(a), mem::transmute(b)))
10036        );
10037    }
10038
10039    #[simd_test(enable = "msa")]
10040    unsafe fn test_msa_aver_s_w() {
10041        #[rustfmt::skip]
10042        let a = i32x4::new(-1, -2, 3, -4);
10043        #[rustfmt::skip]
10044        let b = i32x4::new(-6, 7, -8, -9);
10045        #[rustfmt::skip]
10046        let r = i32x4::new(-3, 3, -2, -6);
10047
10048        assert_eq!(
10049            r,
10050            mem::transmute(__msa_aver_s_w(mem::transmute(a), mem::transmute(b)))
10051        );
10052    }
10053
10054    #[simd_test(enable = "msa")]
10055    unsafe fn test_msa_aver_s_d() {
10056        #[rustfmt::skip]
10057        let a = i64x2::new(-1, -2);
10058        #[rustfmt::skip]
10059        let b = i64x2::new(-6, -7);
10060        #[rustfmt::skip]
10061        let r = i64x2::new(-3, -4);
10062
10063        assert_eq!(
10064            r,
10065            mem::transmute(__msa_aver_s_d(mem::transmute(a), mem::transmute(b)))
10066        );
10067    }
10068
10069    #[simd_test(enable = "msa")]
10070    unsafe fn test_msa_aver_u_b() {
10071        #[rustfmt::skip]
10072        let a = u8x16::new(
10073            1, 2, 3, 4,
10074            1, 2, 3, 4,
10075            1, 2, 3, 4,
10076            1, 2, 3, 4
10077        );
10078        #[rustfmt::skip]
10079        let b = u8x16::new(
10080            6, 7, 8, 9,
10081            6, 7, 8, 9,
10082            6, 7, 8, 9,
10083            6, 7, 8, 9
10084        );
10085        #[rustfmt::skip]
10086        let r = u8x16::new(
10087            4, 5, 6, 7,
10088            4, 5, 6, 7,
10089            4, 5, 6, 7,
10090            4, 5, 6, 7
10091        );
10092
10093        assert_eq!(
10094            r,
10095            mem::transmute(__msa_aver_u_b(mem::transmute(a), mem::transmute(b)))
10096        );
10097    }
10098
10099    #[simd_test(enable = "msa")]
10100    unsafe fn test_msa_aver_u_h() {
10101        #[rustfmt::skip]
10102        let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
10103        #[rustfmt::skip]
10104        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
10105        #[rustfmt::skip]
10106        let r = u16x8::new(4, 5, 6, 7, 4, 5, 6, 7);
10107
10108        assert_eq!(
10109            r,
10110            mem::transmute(__msa_aver_u_h(mem::transmute(a), mem::transmute(b)))
10111        );
10112    }
10113
10114    #[simd_test(enable = "msa")]
10115    unsafe fn test_msa_aver_u_w() {
10116        #[rustfmt::skip]
10117        let a = u32x4::new(1, 2, 3, 4);
10118        #[rustfmt::skip]
10119        let b = u32x4::new(6, 7, 8, 9);
10120        #[rustfmt::skip]
10121        let r = u32x4::new(4, 5, 6, 7);
10122
10123        assert_eq!(
10124            r,
10125            mem::transmute(__msa_aver_u_w(mem::transmute(a), mem::transmute(b)))
10126        );
10127    }
10128
10129    #[simd_test(enable = "msa")]
10130    unsafe fn test_msa_aver_u_d() {
10131        #[rustfmt::skip]
10132        let a = u64x2::new(1, 2);
10133        #[rustfmt::skip]
10134        let b = u64x2::new(6, 7);
10135        #[rustfmt::skip]
10136        let r = u64x2::new(4, 5);
10137
10138        assert_eq!(
10139            r,
10140            mem::transmute(__msa_aver_u_d(mem::transmute(a), mem::transmute(b)))
10141        );
10142    }
10143
10144    #[simd_test(enable = "msa")]
10145    unsafe fn test_msa_bclr_b() {
10146        #[rustfmt::skip]
10147        let a = u8x16::new(
10148            255, 155, 55, 1,
10149            255, 155, 55, 1,
10150            255, 155, 55, 1,
10151            255, 155, 55, 1
10152        );
10153        #[rustfmt::skip]
10154        let b = u8x16::new(
10155            6, 7, 8, 9,
10156            6, 7, 8, 9,
10157            6, 7, 8, 9,
10158            6, 7, 8, 9
10159        );
10160        #[rustfmt::skip]
10161        let r = u8x16::new(
10162            191, 27, 54, 1,
10163            191, 27, 54, 1,
10164            191, 27, 54, 1,
10165            191, 27, 54, 1
10166        );
10167
10168        assert_eq!(
10169            r,
10170            mem::transmute(__msa_bclr_b(mem::transmute(a), mem::transmute(b)))
10171        );
10172    }
10173
10174    #[simd_test(enable = "msa")]
10175    unsafe fn test_msa_bclr_h() {
10176        #[rustfmt::skip]
10177        let a = u16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
10178        #[rustfmt::skip]
10179        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
10180        #[rustfmt::skip]
10181        let r = u16x8::new(191, 27, 55, 1, 191, 27, 55, 1);
10182
10183        assert_eq!(
10184            r,
10185            mem::transmute(__msa_bclr_h(mem::transmute(a), mem::transmute(b)))
10186        );
10187    }
10188
10189    #[simd_test(enable = "msa")]
10190    unsafe fn test_msa_bclr_w() {
10191        #[rustfmt::skip]
10192        let a = u32x4::new(255, 155, 55, 1);
10193        #[rustfmt::skip]
10194        let b = u32x4::new(6, 7, 8, 9);
10195        #[rustfmt::skip]
10196        let r = u32x4::new(191, 27, 55, 1);
10197
10198        assert_eq!(
10199            r,
10200            mem::transmute(__msa_bclr_w(mem::transmute(a), mem::transmute(b)))
10201        );
10202    }
10203
10204    #[simd_test(enable = "msa")]
10205    unsafe fn test_msa_bclr_d() {
10206        #[rustfmt::skip]
10207        let a = u64x2::new(255, 155);
10208        #[rustfmt::skip]
10209        let b = u64x2::new(6, 7);
10210        #[rustfmt::skip]
10211        let r = u64x2::new(191, 27);
10212
10213        assert_eq!(
10214            r,
10215            mem::transmute(__msa_bclr_d(mem::transmute(a), mem::transmute(b)))
10216        );
10217    }
10218
10219    #[simd_test(enable = "msa")]
10220    unsafe fn test_msa_bclri_b() {
10221        #[rustfmt::skip]
10222        let a = u8x16::new(
10223            255, 155, 55, 1,
10224            255, 155, 55, 1,
10225            255, 155, 55, 1,
10226            255, 155, 55, 1
10227        );
10228        #[rustfmt::skip]
10229        let r = u8x16::new(
10230            247, 147, 55, 1,
10231            247, 147, 55, 1,
10232            247, 147, 55, 1,
10233            247, 147, 55, 1
10234        );
10235
10236        assert_eq!(r, mem::transmute(__msa_bclri_b::<3>(mem::transmute(a))));
10237    }
10238
10239    #[simd_test(enable = "msa")]
10240    unsafe fn test_msa_bclri_h() {
10241        #[rustfmt::skip]
10242        let a = u16x8::new(2155, 1155, 155, 1, 2155, 1155, 155, 1);
10243        #[rustfmt::skip]
10244        let r = u16x8::new(107, 1155, 155, 1, 107, 1155, 155, 1);
10245
10246        assert_eq!(r, mem::transmute(__msa_bclri_h::<11>(mem::transmute(a))));
10247    }
10248
10249    #[simd_test(enable = "msa")]
10250    unsafe fn test_msa_bclri_w() {
10251        #[rustfmt::skip]
10252        let a = u32x4::new(211111155, 111111155, 11111155, 1);
10253        #[rustfmt::skip]
10254        let r = u32x4::new(202722547, 102722547, 2722547, 1);
10255
10256        assert_eq!(r, mem::transmute(__msa_bclri_w::<23>(mem::transmute(a))));
10257    }
10258
10259    #[simd_test(enable = "msa")]
10260    unsafe fn test_msa_bclri_d() {
10261        #[rustfmt::skip]
10262        let a = u64x2::new(211111111155, 11111111111111155);
10263        #[rustfmt::skip]
10264        let r = u64x2::new(73672157683, 11110973672157683);
10265
10266        assert_eq!(r, mem::transmute(__msa_bclri_d::<37>(mem::transmute(a))));
10267    }
10268
10269    #[simd_test(enable = "msa")]
10270    unsafe fn test_msa_binsl_b() {
10271        #[rustfmt::skip]
10272        let a = u8x16::new(
10273            255, 155, 55, 1,
10274            255, 155, 55, 1,
10275            255, 155, 55, 1,
10276            255, 155, 55, 1
10277        );
10278        #[rustfmt::skip]
10279        let b = u8x16::new(
10280            6, 7, 8, 9,
10281            6, 7, 8, 9,
10282            6, 7, 8, 9,
10283            6, 7, 8, 9
10284        );
10285        #[rustfmt::skip]
10286        let c = u8x16::new(
10287            1, 3, 5, 9,
10288            1, 3, 5, 9,
10289            1, 3, 5, 9,
10290            1, 3, 5, 9
10291        );
10292        #[rustfmt::skip]
10293        let r = u8x16::new(
10294            63, 11, 11, 1,
10295            63, 11, 11, 1,
10296            63, 11, 11, 1,
10297            63, 11, 11, 1
10298        );
10299
10300        assert_eq!(
10301            r,
10302            mem::transmute(__msa_binsl_b(
10303                mem::transmute(a),
10304                mem::transmute(b),
10305                mem::transmute(c)
10306            ))
10307        );
10308    }
10309
10310    #[simd_test(enable = "msa")]
10311    unsafe fn test_msa_binsl_h() {
10312        #[rustfmt::skip]
10313        let a = u16x8::new(
10314            32767, 16384, 8192, 4096,
10315            32767, 16384, 8192, 4096
10316        );
10317        #[rustfmt::skip]
10318        let b = u16x8::new(
10319            21656, 5273, 7081, 2985,
10320            21656, 5273, 7081, 2985
10321        );
10322        #[rustfmt::skip]
10323        let c = u16x8::new(
10324            3, 7, 9, 13,
10325            15, 17, 21, 23
10326        );
10327        #[rustfmt::skip]
10328        let r = u16x8::new(
10329            24575, 5120, 7040, 2984,
10330            21656, 0, 6144, 2816
10331        );
10332
10333        assert_eq!(
10334            r,
10335            mem::transmute(__msa_binsl_h(
10336                mem::transmute(a),
10337                mem::transmute(b),
10338                mem::transmute(c)
10339            ))
10340        );
10341    }
10342
10343    #[simd_test(enable = "msa")]
10344    unsafe fn test_msa_binsl_w() {
10345        #[rustfmt::skip]
10346        let a = u32x4::new(2147483647, 536870912, 67108864, 8388608);
10347        #[rustfmt::skip]
10348        let b = u32x4::new(1036372536, 259093134, 78219975, 1119499719);
10349        #[rustfmt::skip]
10350        let c = u32x4::new(11, 15, 31, 37);
10351        #[rustfmt::skip]
10352        let r = u32x4::new(1037041663, 259063808, 78219975, 1082130432);
10353
10354        assert_eq!(
10355            r,
10356            mem::transmute(__msa_binsl_w(
10357                mem::transmute(a),
10358                mem::transmute(b),
10359                mem::transmute(c)
10360            ))
10361        );
10362    }
10363
10364    #[simd_test(enable = "msa")]
10365    unsafe fn test_msa_binsl_d() {
10366        #[rustfmt::skip]
10367        let a = u64x2::new(8006399338, 2882303762);
10368        #[rustfmt::skip]
10369        let b = u64x2::new(9223372036854775805, 536870912);
10370        #[rustfmt::skip]
10371        let c = u64x2::new(12, 48);
10372        #[rustfmt::skip]
10373        let r = u64x2::new(9221120245047489898, 536901394);
10374
10375        assert_eq!(
10376            r,
10377            mem::transmute(__msa_binsl_d(
10378                mem::transmute(a),
10379                mem::transmute(b),
10380                mem::transmute(c)
10381            ))
10382        );
10383    }
10384
10385    #[simd_test(enable = "msa")]
10386    unsafe fn test_msa_binsli_b() {
10387        #[rustfmt::skip]
10388        let a = u8x16::new(
10389            u8::MAX, 155, 55, 1,
10390            u8::MAX, 155, 55, 1,
10391            u8::MAX, 155, 55, 1,
10392            u8::MAX, 155, 55, 1
10393        );
10394        #[rustfmt::skip]
10395        let b = u8x16::new(
10396            6, 7, 8, 9,
10397            6, 7, 8, 9,
10398            6, 7, 8, 9,
10399            6, 7, 8, 9
10400        );
10401        #[rustfmt::skip]
10402        let r = u8x16::new(
10403            7, 7, 11, 9,
10404            7, 7, 11, 9,
10405            7, 7, 11, 9,
10406            7, 7, 11, 9
10407        );
10408
10409        assert_eq!(
10410            r,
10411            mem::transmute(__msa_binsli_b::<5>(mem::transmute(a), mem::transmute(b)))
10412        );
10413    }
10414
10415    #[simd_test(enable = "msa")]
10416    unsafe fn test_msa_binsli_h() {
10417        #[rustfmt::skip]
10418        let a = u16x8::new(
10419            32767, 16384, 8192, 4096,
10420            32767, 16384, 8192, 4096
10421        );
10422        #[rustfmt::skip]
10423        let b = u16x8::new(
10424            21656, 5273, 7081, 2985,
10425            21656, 5273, 7081, 2985
10426        );
10427        #[rustfmt::skip]
10428        let r = u16x8::new(
10429            21659, 5272, 7080, 2984,
10430            21659, 5272, 7080, 2984
10431        );
10432
10433        assert_eq!(
10434            r,
10435            mem::transmute(__msa_binsli_h::<13>(mem::transmute(a), mem::transmute(b)))
10436        );
10437    }
10438
10439    #[simd_test(enable = "msa")]
10440    unsafe fn test_msa_binsli_w() {
10441        #[rustfmt::skip]
10442        let a = u32x4::new(2147483647, 536870912, 67108864, 8388608);
10443        #[rustfmt::skip]
10444        let b = u32x4::new(1036372536, 259093134, 78219975, 1119499719);
10445        #[rustfmt::skip]
10446        let r = u32x4::new(1036386303, 259080192, 78217216, 1119485952);
10447
10448        assert_eq!(
10449            r,
10450            mem::transmute(__msa_binsli_w::<17>(mem::transmute(a), mem::transmute(b)))
10451        );
10452    }
10453
10454    #[simd_test(enable = "msa")]
10455    unsafe fn test_msa_binsli_d() {
10456        #[rustfmt::skip]
10457        let a = u64x2::new(8006399338, 2882303762);
10458        #[rustfmt::skip]
10459        let b = u64x2::new(9223372036854775805, 536870912);
10460        #[rustfmt::skip]
10461        let r = u64x2::new(9223372036854773098, 536901394);
10462
10463        assert_eq!(
10464            r,
10465            mem::transmute(__msa_binsli_d::<48>(mem::transmute(a), mem::transmute(b)))
10466        );
10467    }
10468
10469    #[simd_test(enable = "msa")]
10470    unsafe fn test_msa_binsr_b() {
10471        #[rustfmt::skip]
10472        let a = u8x16::new(
10473            255, 155, 55, 1,
10474            255, 155, 55, 1,
10475            255, 155, 55, 1,
10476            255, 155, 55, 1
10477        );
10478        #[rustfmt::skip]
10479        let b = u8x16::new(
10480            6, 7, 8, 9,
10481            6, 7, 8, 9,
10482            6, 7, 8, 9,
10483            6, 7, 8, 9
10484        );
10485        #[rustfmt::skip]
10486        let c = u8x16::new(
10487            1, 3, 5, 9,
10488            1, 3, 5, 9,
10489            1, 3, 5, 9,
10490            1, 3, 5, 9
10491        );
10492        #[rustfmt::skip]
10493        let r = u8x16::new(
10494            254, 151, 8, 1,
10495            254, 151, 8, 1,
10496            254, 151, 8, 1,
10497            254, 151, 8, 1
10498        );
10499
10500        assert_eq!(
10501            r,
10502            mem::transmute(__msa_binsr_b(
10503                mem::transmute(a),
10504                mem::transmute(b),
10505                mem::transmute(c)
10506            ))
10507        );
10508    }
10509
10510    #[simd_test(enable = "msa")]
10511    unsafe fn test_msa_binsr_h() {
10512        #[rustfmt::skip]
10513        let a = u16x8::new(
10514            32767, 16384, 8192, 4096,
10515            32767, 16384, 8192, 4096
10516        );
10517        #[rustfmt::skip]
10518        let b = u16x8::new(
10519            21656, 5273, 7081, 2985,
10520            21656, 5273, 7081, 2985
10521        );
10522        #[rustfmt::skip]
10523        let c = u16x8::new(
10524            3, 7, 9, 13,
10525            15, 17, 21, 23
10526        );
10527        #[rustfmt::skip]
10528        let r = u16x8::new(
10529            32760, 16537, 9129, 2985,
10530            21656, 16385, 8233, 4265
10531        );
10532
10533        assert_eq!(
10534            r,
10535            mem::transmute(__msa_binsr_h(
10536                mem::transmute(a),
10537                mem::transmute(b),
10538                mem::transmute(c)
10539            ))
10540        );
10541    }
10542
10543    #[simd_test(enable = "msa")]
10544    unsafe fn test_msa_binsr_w() {
10545        #[rustfmt::skip]
10546        let a = u32x4::new(2147483647, 536870912, 67108864, 8388608);
10547        #[rustfmt::skip]
10548        let b = u32x4::new(1036372536, 259093134, 78219975, 1119499719);
10549        #[rustfmt::skip]
10550        let c = u32x4::new(11, 15, 31, 37);
10551        #[rustfmt::skip]
10552        let r = u32x4::new(2147482168, 536900238, 78219975, 8388615);
10553
10554        assert_eq!(
10555            r,
10556            mem::transmute(__msa_binsr_w(
10557                mem::transmute(a),
10558                mem::transmute(b),
10559                mem::transmute(c)
10560            ))
10561        );
10562    }
10563
10564    #[simd_test(enable = "msa")]
10565    unsafe fn test_msa_binsr_d() {
10566        #[rustfmt::skip]
10567        let a = u64x2::new(8006399338, 2882303762);
10568        #[rustfmt::skip]
10569        let b = u64x2::new(9223372036854775805, 536870912);
10570        #[rustfmt::skip]
10571        let c = u64x2::new(12, 48);
10572        #[rustfmt::skip]
10573        let r = u64x2::new(8006402045, 536870912);
10574
10575        assert_eq!(
10576            r,
10577            mem::transmute(__msa_binsr_d(
10578                mem::transmute(a),
10579                mem::transmute(b),
10580                mem::transmute(c)
10581            ))
10582        );
10583    }
10584
10585    #[simd_test(enable = "msa")]
10586    unsafe fn test_msa_binsri_b() {
10587        #[rustfmt::skip]
10588        let a = u8x16::new(
10589            255, 155, 55, 1,
10590            255, 155, 55, 1,
10591            255, 155, 55, 1,
10592            255, 155, 55, 1
10593        );
10594        #[rustfmt::skip]
10595        let b = u8x16::new(
10596            6, 7, 8, 9,
10597            6, 7, 8, 9,
10598            6, 7, 8, 9,
10599            6, 7, 8, 9
10600        );
10601        #[rustfmt::skip]
10602        let r = u8x16::new(
10603            198, 135, 8, 9,
10604            198, 135, 8, 9,
10605            198, 135, 8, 9,
10606            198, 135, 8, 9
10607        );
10608
10609        assert_eq!(
10610            r,
10611            mem::transmute(__msa_binsri_b::<5>(mem::transmute(a), mem::transmute(b)))
10612        );
10613    }
10614
10615    #[simd_test(enable = "msa")]
10616    unsafe fn test_msa_binsri_h() {
10617        #[rustfmt::skip]
10618        let a = u16x8::new(
10619            32767, 16384, 8192, 4096,
10620            32767, 16384, 8192, 4096
10621        );
10622        #[rustfmt::skip]
10623        let b = u16x8::new(
10624            21656, 5273, 7081, 2985,
10625            21656, 5273, 7081, 2985
10626        );
10627        #[rustfmt::skip]
10628        let r = u16x8::new(
10629            21656, 21657, 7081, 2985,
10630            21656, 21657, 7081, 2985
10631        );
10632
10633        assert_eq!(
10634            r,
10635            mem::transmute(__msa_binsri_h::<13>(mem::transmute(a), mem::transmute(b)))
10636        );
10637    }
10638
10639    #[simd_test(enable = "msa")]
10640    unsafe fn test_msa_binsri_w() {
10641        #[rustfmt::skip]
10642        let a = u32x4::new(2147483647, 536870912, 67108864, 8388608);
10643        #[rustfmt::skip]
10644        let b = u32x4::new(1036372536, 259093134, 78219975, 1119499719);
10645        #[rustfmt::skip]
10646        let r = u32x4::new(2147338808, 536965774, 67209927, 8533447);
10647
10648        assert_eq!(
10649            r,
10650            mem::transmute(__msa_binsri_w::<17>(mem::transmute(a), mem::transmute(b)))
10651        );
10652    }
10653
10654    #[simd_test(enable = "msa")]
10655    unsafe fn test_msa_binsri_d() {
10656        #[rustfmt::skip]
10657        let a = u64x2::new(8006399338, 2882303762);
10658        #[rustfmt::skip]
10659        let b = u64x2::new(9223372036854775805, 536870912);
10660        #[rustfmt::skip]
10661        let r = u64x2::new(562949953421309, 536870912);
10662
10663        assert_eq!(
10664            r,
10665            mem::transmute(__msa_binsri_d::<48>(mem::transmute(a), mem::transmute(b)))
10666        );
10667    }
10668
10669    #[simd_test(enable = "msa")]
10670    unsafe fn test_msa_bmnz_v() {
10671        #[rustfmt::skip]
10672        let a = u8x16::new(
10673            u8::MAX, 155, 55, 1,
10674            u8::MAX, 155, 55, 1,
10675            u8::MAX, 155, 55, 1,
10676            u8::MAX, 155, 55, 1
10677        );
10678        #[rustfmt::skip]
10679        let b = u8x16::new(
10680            6, 7, 8, 9,
10681            6, 7, 8, 9,
10682            6, 7, 8, 9,
10683            6, 7, 8, 9,
10684        );
10685        #[rustfmt::skip]
10686        let c = u8x16::new(
10687            3, 5, 7, 1,
10688            3, 5, 7, 1,
10689            3, 5, 7, 1,
10690            3, 5, 7, 1
10691        );
10692        #[rustfmt::skip]
10693        let r = u8x16::new(
10694            254, 159, 48, 1,
10695            254, 159, 48, 1,
10696            254, 159, 48, 1,
10697            254, 159, 48, 1
10698        );
10699
10700        assert_eq!(
10701            r,
10702            mem::transmute(__msa_bmnz_v(
10703                mem::transmute(a),
10704                mem::transmute(b),
10705                mem::transmute(c)
10706            ))
10707        );
10708    }
10709
10710    #[simd_test(enable = "msa")]
10711    unsafe fn test_msa_bmnzi_b() {
10712        #[rustfmt::skip]
10713        let a = u8x16::new(
10714            u8::MAX, 155, 55, 1,
10715            u8::MAX, 155, 55, 1,
10716            u8::MAX, 155, 55, 1,
10717            u8::MAX, 155, 55, 1
10718        );
10719        #[rustfmt::skip]
10720        let b = u8x16::new(
10721            1, u8::MAX, 155, 55,
10722            1, u8::MAX, 155, 55,
10723            1, u8::MAX, 155, 55,
10724            1, u8::MAX, 155, 55
10725        );
10726        #[rustfmt::skip]
10727        let r = u8x16::new(
10728            249, 159, 51, 7,
10729            249, 159, 51, 7,
10730            249, 159, 51, 7,
10731            249, 159, 51, 7
10732        );
10733
10734        assert_eq!(
10735            r,
10736            mem::transmute(__msa_bmnzi_b::<7>(mem::transmute(a), mem::transmute(b)))
10737        );
10738    }
10739
10740    #[simd_test(enable = "msa")]
10741    unsafe fn test_msa_bmz_v() {
10742        #[rustfmt::skip]
10743        let a = u8x16::new(
10744            u8::MAX, 155, 55, 1,
10745            u8::MAX, 155, 55, 1,
10746            u8::MAX, 155, 55, 1,
10747            u8::MAX, 155, 55, 1
10748        );
10749        #[rustfmt::skip]
10750        let b = u8x16::new(
10751            6, 7, 8, 9,
10752            6, 7, 8, 9,
10753            6, 7, 8, 9,
10754            6, 7, 8, 9
10755        );
10756        #[rustfmt::skip]
10757        let c = u8x16::new(
10758            3, 5, 7, 1,
10759            3, 5, 7, 1,
10760            3, 5, 7, 1,
10761            3, 5, 7, 1
10762        );
10763        #[rustfmt::skip]
10764        let r = u8x16::new(
10765            7, 3, 15, 9,
10766            7, 3, 15, 9,
10767            7, 3, 15, 9,
10768            7, 3, 15, 9
10769        );
10770
10771        assert_eq!(
10772            r,
10773            mem::transmute(__msa_bmz_v(
10774                mem::transmute(a),
10775                mem::transmute(b),
10776                mem::transmute(c)
10777            ))
10778        );
10779    }
10780
10781    #[simd_test(enable = "msa")]
10782    unsafe fn test_msa_bmzi_b() {
10783        #[rustfmt::skip]
10784        let a = u8x16::new(
10785            u8::MAX, 155, 55, 1,
10786            u8::MAX, 155, 55, 1,
10787            u8::MAX, 155, 55, 1,
10788            u8::MAX, 155, 55, 1
10789        );
10790        #[rustfmt::skip]
10791        let b = u8x16::new(
10792            1, 255, 155, 55,
10793            1, 255, 155, 55,
10794            1, 255, 155, 55,
10795            1, 255, 155, 55
10796        );
10797        #[rustfmt::skip]
10798        let r = u8x16::new(
10799            7, 251, 159, 49,
10800            7, 251, 159, 49,
10801            7, 251, 159, 49,
10802            7, 251, 159, 49
10803        );
10804
10805        assert_eq!(
10806            r,
10807            mem::transmute(__msa_bmzi_b::<7>(mem::transmute(a), mem::transmute(b)))
10808        );
10809    }
10810
10811    #[simd_test(enable = "msa")]
10812    unsafe fn test_msa_bneg_b() {
10813        #[rustfmt::skip]
10814        let a = u8x16::new(
10815            255, 155, 55, 1,
10816            255, 155, 55, 1,
10817            255, 155, 55, 1,
10818            255, 155, 55, 1
10819        );
10820        #[rustfmt::skip]
10821        let b = u8x16::new(
10822            6, 7, 8, 9,
10823            6, 7, 8, 9,
10824            6, 7, 8, 9,
10825            6, 7, 8, 9
10826        );
10827        #[rustfmt::skip]
10828        let r = u8x16::new(
10829            191, 27, 54, 3,
10830            191, 27, 54, 3,
10831            191, 27, 54, 3,
10832            191, 27, 54, 3
10833        );
10834
10835        assert_eq!(
10836            r,
10837            mem::transmute(__msa_bneg_b(mem::transmute(a), mem::transmute(b)))
10838        );
10839    }
10840
10841    #[simd_test(enable = "msa")]
10842    unsafe fn test_msa_bneg_h() {
10843        #[rustfmt::skip]
10844        let a = u16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
10845        #[rustfmt::skip]
10846        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
10847        #[rustfmt::skip]
10848        let r = u16x8::new(191, 27, 311, 513, 191, 27, 311, 513);
10849
10850        assert_eq!(
10851            r,
10852            mem::transmute(__msa_bneg_h(mem::transmute(a), mem::transmute(b)))
10853        );
10854    }
10855
10856    #[simd_test(enable = "msa")]
10857    unsafe fn test_msa_bneg_w() {
10858        #[rustfmt::skip]
10859        let a = u32x4::new(255, 155, 55, 1);
10860        #[rustfmt::skip]
10861        let b = u32x4::new(6, 7, 8, 9);
10862        #[rustfmt::skip]
10863        let r = u32x4::new(191, 27, 311, 513);
10864
10865        assert_eq!(
10866            r,
10867            mem::transmute(__msa_bneg_w(mem::transmute(a), mem::transmute(b)))
10868        );
10869    }
10870
10871    #[simd_test(enable = "msa")]
10872    unsafe fn test_msa_bneg_d() {
10873        #[rustfmt::skip]
10874        let a = u64x2::new(255, 155);
10875        #[rustfmt::skip]
10876        let b = u64x2::new(6, 7);
10877        #[rustfmt::skip]
10878        let r = u64x2::new(191, 27);
10879
10880        assert_eq!(
10881            r,
10882            mem::transmute(__msa_bneg_d(mem::transmute(a), mem::transmute(b)))
10883        );
10884    }
10885
10886    #[simd_test(enable = "msa")]
10887    unsafe fn test_msa_bnegi_b() {
10888        #[rustfmt::skip]
10889        let a = u8x16::new(
10890            50, 100, 127, u8::MAX,
10891            50, 100, 127, u8::MAX,
10892            50, 100, 127, u8::MAX,
10893            50, 100, 127, u8::MAX
10894        );
10895        #[rustfmt::skip]
10896        let r = u8x16::new(
10897            34, 116, 111, 239,
10898            34, 116, 111, 239,
10899            34, 116, 111, 239,
10900            34, 116, 111, 239
10901        );
10902
10903        assert_eq!(r, mem::transmute(__msa_bnegi_b::<4>(mem::transmute(a))));
10904    }
10905
10906    #[simd_test(enable = "msa")]
10907    unsafe fn test_msa_bnegi_h() {
10908        #[rustfmt::skip]
10909        let a = u16x8::new(
10910            32767, 3276, 100, 127,
10911            32767, 3276, 100, 127
10912        );
10913        #[rustfmt::skip]
10914        let r = u16x8::new(
10915            30719, 1228, 2148, 2175,
10916            30719, 1228, 2148, 2175
10917        );
10918
10919        assert_eq!(r, mem::transmute(__msa_bnegi_h::<11>(mem::transmute(a))));
10920    }
10921
10922    #[simd_test(enable = "msa")]
10923    unsafe fn test_msa_bnegi_w() {
10924        #[rustfmt::skip]
10925        let a = u32x4::new(100, 2147483647, 100, 2147483648);
10926        #[rustfmt::skip]
10927        let r = u32x4::new(16777316, 2130706431, 16777316, 2164260864);
10928
10929        assert_eq!(r, mem::transmute(__msa_bnegi_w::<24>(mem::transmute(a))));
10930    }
10931
10932    #[simd_test(enable = "msa")]
10933    unsafe fn test_msa_bnegi_d() {
10934        #[rustfmt::skip]
10935        let a = u64x2::new(100, 9223372036854775808);
10936        #[rustfmt::skip]
10937        let r = u64x2::new(4398046511204, 9223376434901286912);
10938
10939        assert_eq!(r, mem::transmute(__msa_bnegi_d::<42>(mem::transmute(a))));
10940    }
10941
10942    #[simd_test(enable = "msa")]
10943    unsafe fn test_msa_bnz_b() {
10944        #[rustfmt::skip]
10945        let a = u8x16::new(
10946            1, 1, 1, 1,
10947            1, 1, 1, 1,
10948            2, 2, 2, 2,
10949            4, 4, 0, 4,
10950        );
10951        let r = 0 as i32;
10952
10953        assert_eq!(r, mem::transmute(__msa_bnz_b(mem::transmute(a))));
10954    }
10955
10956    #[simd_test(enable = "msa")]
10957    unsafe fn test_msa_bnz_h() {
10958        #[rustfmt::skip]
10959        let a = u16x8::new(
10960            32767, 3276, 100, 127,
10961            32767, 0, 100, 127
10962        );
10963        let r = 0 as i32;
10964
10965        assert_eq!(r, mem::transmute(__msa_bnz_h(mem::transmute(a))));
10966    }
10967
10968    #[simd_test(enable = "msa")]
10969    unsafe fn test_msa_bnz_w() {
10970        #[rustfmt::skip]
10971        let a = u32x4::new(100, 2147483647, 0, 2147483648);
10972        let r = 0 as i32;
10973
10974        assert_eq!(r, mem::transmute(__msa_bnz_w(mem::transmute(a))));
10975    }
10976
10977    #[simd_test(enable = "msa")]
10978    unsafe fn test_msa_bnz_d() {
10979        #[rustfmt::skip]
10980        let a = u64x2::new(100, 9223372036854775808);
10981        #[rustfmt::skip]
10982        let r = 1 as i32;
10983
10984        assert_eq!(r, mem::transmute(__msa_bnz_d(mem::transmute(a))));
10985    }
10986
10987    #[simd_test(enable = "msa")]
10988    unsafe fn test_msa_bnz_v() {
10989        #[rustfmt::skip]
10990        let a = u8x16::new(
10991            0, 0, 0, 1,
10992            0, 0, 0, 0,
10993            0, 0, 0, 0,
10994            0, 0, 0, 0,
10995        );
10996        let r = 1 as i32;
10997
10998        assert_eq!(r, mem::transmute(__msa_bnz_v(mem::transmute(a))));
10999    }
11000
11001    #[simd_test(enable = "msa")]
11002    unsafe fn test_msa_bsel_v() {
11003        #[rustfmt::skip]
11004        let a = u8x16::new(
11005            3, 5, 7, 1,
11006            3, 5, 7, 1,
11007            3, 5, 7, 1,
11008            3, 5, 7, 1
11009        );
11010        #[rustfmt::skip]
11011        let b = u8x16::new(
11012            6, 7, 8, 9,
11013            6, 7, 8, 9,
11014            6, 7, 8, 9,
11015            6, 7, 8, 9
11016        );
11017        #[rustfmt::skip]
11018        let c = u8x16::new(
11019            255, 155, 55, 1,
11020            255, 155, 55, 1,
11021            255, 155, 55, 1,
11022            255, 155, 55, 1
11023        );
11024        #[rustfmt::skip]
11025        let r = u8x16::new(
11026            7, 3, 15, 9,
11027            7, 3, 15, 9,
11028            7, 3, 15, 9,
11029            7, 3, 15, 9
11030        );
11031
11032        assert_eq!(
11033            r,
11034            mem::transmute(__msa_bsel_v(
11035                mem::transmute(a),
11036                mem::transmute(b),
11037                mem::transmute(c)
11038            ))
11039        );
11040    }
11041
11042    #[simd_test(enable = "msa")]
11043    unsafe fn test_msa_bseli_b() {
11044        #[rustfmt::skip]
11045        let a = u8x16::new(
11046            255, 155, 55, 1,
11047            255, 155, 55, 1,
11048            255, 155, 55, 1,
11049            255, 155, 55, 1
11050        );
11051        #[rustfmt::skip]
11052        let b = u8x16::new(
11053            6, 7, 8, 9,
11054            6, 7, 8, 9,
11055            6, 7, 8, 9,
11056            6, 7, 8, 9
11057        );
11058        #[rustfmt::skip]
11059        let r = u8x16::new(
11060            121, 29, 57, 9,
11061            121, 29, 57, 9,
11062            121, 29, 57, 9,
11063            121, 29, 57, 9
11064        );
11065
11066        assert_eq!(
11067            r,
11068            mem::transmute(__msa_bseli_b::<121>(mem::transmute(a), mem::transmute(b)))
11069        );
11070    }
11071
11072    #[simd_test(enable = "msa")]
11073    unsafe fn test_msa_bset_b() {
11074        #[rustfmt::skip]
11075        let a = u8x16::new(
11076            255, 155, 55, 1,
11077            255, 155, 55, 1,
11078            255, 155, 55, 1,
11079            255, 155, 55, 1
11080        );
11081        #[rustfmt::skip]
11082        let b = u8x16::new(
11083            6, 7, 8, 9,
11084            6, 7, 8, 9,
11085            6, 7, 8, 9,
11086            6, 7, 8, 9
11087        );
11088        #[rustfmt::skip]
11089        let r = u8x16::new(
11090            255, 155, 55, 3,
11091            255, 155, 55, 3,
11092            255, 155, 55, 3,
11093            255, 155, 55, 3
11094        );
11095
11096        assert_eq!(
11097            r,
11098            mem::transmute(__msa_bset_b(mem::transmute(a), mem::transmute(b)))
11099        );
11100    }
11101
11102    #[simd_test(enable = "msa")]
11103    unsafe fn test_msa_bset_h() {
11104        #[rustfmt::skip]
11105        let a = u16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
11106        #[rustfmt::skip]
11107        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
11108        #[rustfmt::skip]
11109        let r = u16x8::new(255, 155, 311, 513, 255, 155, 311, 513);
11110
11111        assert_eq!(
11112            r,
11113            mem::transmute(__msa_bset_h(mem::transmute(a), mem::transmute(b)))
11114        );
11115    }
11116
11117    #[simd_test(enable = "msa")]
11118    unsafe fn test_msa_bset_w() {
11119        #[rustfmt::skip]
11120        let a = u32x4::new(255, 155, 55, 1);
11121        #[rustfmt::skip]
11122        let b = u32x4::new(6, 7, 8, 9);
11123        #[rustfmt::skip]
11124        let r = u32x4::new(255, 155, 311, 513);
11125
11126        assert_eq!(
11127            r,
11128            mem::transmute(__msa_bset_w(mem::transmute(a), mem::transmute(b)))
11129        );
11130    }
11131
11132    #[simd_test(enable = "msa")]
11133    unsafe fn test_msa_bset_d() {
11134        #[rustfmt::skip]
11135        let a = u64x2::new(255, 155);
11136        #[rustfmt::skip]
11137        let b = u64x2::new(6, 7);
11138        #[rustfmt::skip]
11139        let r = u64x2::new(255, 155);
11140
11141        assert_eq!(
11142            r,
11143            mem::transmute(__msa_bset_d(mem::transmute(a), mem::transmute(b)))
11144        );
11145    }
11146
11147    #[simd_test(enable = "msa")]
11148    unsafe fn test_msa_bseti_b() {
11149        #[rustfmt::skip]
11150        let a = u8x16::new(
11151            255, 155, 55, 1,
11152            255, 155, 55, 1,
11153            255, 155, 55, 1,
11154            255, 155, 55, 1
11155        );
11156        #[rustfmt::skip]
11157        let r = u8x16::new(
11158            255, 159, 55, 5,
11159            255, 159, 55, 5,
11160            255, 159, 55, 5,
11161            255, 159, 55, 5
11162        );
11163
11164        assert_eq!(r, mem::transmute(__msa_bseti_b::<2>(mem::transmute(a))));
11165    }
11166
11167    #[simd_test(enable = "msa")]
11168    unsafe fn test_msa_bseti_h() {
11169        #[rustfmt::skip]
11170        let a = u16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
11171        #[rustfmt::skip]
11172        let r = u16x8::new(255, 159, 55, 5, 255, 159, 55, 5);
11173
11174        assert_eq!(r, mem::transmute(__msa_bseti_h::<2>(mem::transmute(a))));
11175    }
11176
11177    #[simd_test(enable = "msa")]
11178    unsafe fn test_msa_bseti_w() {
11179        #[rustfmt::skip]
11180        let a = u32x4::new(255, 155, 55, 1);
11181        #[rustfmt::skip]
11182        let r = u32x4::new(255, 159, 55, 5);
11183
11184        assert_eq!(r, mem::transmute(__msa_bseti_w::<2>(mem::transmute(a))));
11185    }
11186
11187    #[simd_test(enable = "msa")]
11188    unsafe fn test_msa_bseti_d() {
11189        #[rustfmt::skip]
11190        let a = u64x2::new(255, 155);
11191        #[rustfmt::skip]
11192        let r = u64x2::new(255, 159);
11193
11194        assert_eq!(r, mem::transmute(__msa_bseti_d::<2>(mem::transmute(a))));
11195    }
11196
11197    #[simd_test(enable = "msa")]
11198    unsafe fn test_msa_bz_b() {
11199        #[rustfmt::skip]
11200        let a = u8x16::new(
11201            255, 155, 55, 1,
11202            255, 155, 55, 1,
11203            255, 155, 55, 1,
11204            255, 155, 55, 1
11205        );
11206        let r = 0 as i32;
11207
11208        assert_eq!(r, mem::transmute(__msa_bz_b(mem::transmute(a))));
11209    }
11210
11211    #[simd_test(enable = "msa")]
11212    unsafe fn test_msa_bz_h() {
11213        #[rustfmt::skip]
11214        let a = u16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
11215        let r = 1 as i32;
11216
11217        assert_eq!(r, mem::transmute(__msa_bz_h(mem::transmute(a))));
11218    }
11219
11220    #[simd_test(enable = "msa")]
11221    unsafe fn test_msa_bz_w() {
11222        #[rustfmt::skip]
11223        let a = u32x4::new(255, 0, 55, 1);
11224        let r = 1 as i32;
11225
11226        assert_eq!(r, mem::transmute(__msa_bz_w(mem::transmute(a))));
11227    }
11228
11229    #[simd_test(enable = "msa")]
11230    unsafe fn test_msa_bz_d() {
11231        #[rustfmt::skip]
11232        let a = u64x2::new(255, 0);
11233        let r = 1 as i32;
11234
11235        assert_eq!(r, mem::transmute(__msa_bz_d(mem::transmute(a))));
11236    }
11237
11238    #[simd_test(enable = "msa")]
11239    unsafe fn test_msa_bz_v() {
11240        #[rustfmt::skip]
11241        let a = u8x16::new(
11242            0, 0, 0, 0,
11243            0, 0, 0, 0,
11244            0, 0, 0, 0,
11245            0, 0, 0, 0
11246        );
11247        let r = 1 as i32;
11248
11249        assert_eq!(r, mem::transmute(__msa_bz_v(mem::transmute(a))));
11250    }
11251
11252    #[simd_test(enable = "msa")]
11253    unsafe fn test_msa_ceq_b() {
11254        #[rustfmt::skip]
11255        let a = i8x16::new(
11256            -128, 127, 55, 1,
11257            -128, 127, 55, 1,
11258            -128, 127, 55, 1,
11259            -128, 127, 55, 1
11260        );
11261        #[rustfmt::skip]
11262        let b = i8x16::new(
11263            -128, 126, 55, 1,
11264            -128, 126, 55, 1,
11265            -128, 126, 55, 1,
11266            -128, 126, 55, 1
11267        );
11268        #[rustfmt::skip]
11269        let r = i8x16::new(
11270            -1, 0, -1, -1,
11271            -1, 0, -1, -1,
11272            -1, 0, -1, -1,
11273            -1, 0, -1, -1
11274        );
11275
11276        assert_eq!(
11277            r,
11278            mem::transmute(__msa_ceq_b(mem::transmute(a), mem::transmute(b)))
11279        );
11280    }
11281
11282    #[simd_test(enable = "msa")]
11283    unsafe fn test_msa_ceq_h() {
11284        #[rustfmt::skip]
11285        let a = i16x8::new(255, 155, 55, 1, 255, 155, 55, 1);
11286        #[rustfmt::skip]
11287        let b = i16x8::new(255, 155, 56, 1, 255, 155, 56, 1);
11288        #[rustfmt::skip]
11289        let r = i16x8::new(-1, -1, 0, -1, -1, -1, 0, -1);
11290
11291        assert_eq!(
11292            r,
11293            mem::transmute(__msa_ceq_h(mem::transmute(a), mem::transmute(b)))
11294        );
11295    }
11296
11297    #[simd_test(enable = "msa")]
11298    unsafe fn test_msa_ceq_w() {
11299        #[rustfmt::skip]
11300        let a = i32x4::new(255, 155, 55, 1);
11301        #[rustfmt::skip]
11302        let b = i32x4::new(255, 156, 55, 1);
11303        #[rustfmt::skip]
11304        let r = i32x4::new(-1, 0, -1, -1);
11305
11306        assert_eq!(
11307            r,
11308            mem::transmute(__msa_ceq_w(mem::transmute(a), mem::transmute(b)))
11309        );
11310    }
11311
11312    #[simd_test(enable = "msa")]
11313    unsafe fn test_msa_ceq_d() {
11314        #[rustfmt::skip]
11315        let a = i64x2::new(255, 155);
11316        #[rustfmt::skip]
11317        let b = i64x2::new(255, 156);
11318        #[rustfmt::skip]
11319        let r = i64x2::new(-1, 0);
11320
11321        assert_eq!(
11322            r,
11323            mem::transmute(__msa_ceq_d(mem::transmute(a), mem::transmute(b)))
11324        );
11325    }
11326
11327    #[simd_test(enable = "msa")]
11328    unsafe fn test_msa_ceqi_b() {
11329        #[rustfmt::skip]
11330        let a = i8x16::new(
11331            100, -1, -4, 15,
11332            100, -1, -4, 15,
11333            100, -1, -4, 15,
11334            100, -1, -4, 15
11335        );
11336        #[rustfmt::skip]
11337        let r = i8x16::new(
11338            0, 0, -1, 0,
11339            0, 0, -1, 0,
11340            0, 0, -1, 0,
11341            0, 0, -1, 0
11342        );
11343
11344        assert_eq!(r, mem::transmute(__msa_ceqi_b::<-4>(mem::transmute(a))));
11345    }
11346
11347    #[simd_test(enable = "msa")]
11348    unsafe fn test_msa_ceqi_h() {
11349        #[rustfmt::skip]
11350        let a = i16x8::new(
11351            32767, 3276, 100, -11,
11352            32767, 3276, 100, -11
11353        );
11354        #[rustfmt::skip]
11355        let r = i16x8::new(0, 0, 0, -1, 0, 0, 0, -1);
11356
11357        assert_eq!(r, mem::transmute(__msa_ceqi_h::<-11>(mem::transmute(a))));
11358    }
11359
11360    #[simd_test(enable = "msa")]
11361    unsafe fn test_msa_ceqi_w() {
11362        #[rustfmt::skip]
11363        let a = i32x4::new(1, 3, 5, -3);
11364        #[rustfmt::skip]
11365        let r = i32x4::new(0, 0, -1, 0);
11366
11367        assert_eq!(r, mem::transmute(__msa_ceqi_w::<5>(mem::transmute(a))));
11368    }
11369
11370    // FIXME: https://reviews.llvm.org/D59884
11371    // If target type is i64, negative immediate loses the sign
11372    // Test passes if 4294967293 is used instead -3 in vector `a`
11373    // #[simd_test(enable = "msa")]
11374    // unsafe fn test_msa_ceqi_d() {
11375    //     #[rustfmt::skip]
11376    //     let a = i64x2::new(-3, 2);
11377    //     #[rustfmt::skip]
11378    //     let r = i64x2::new(-1, 0);
11379
11380    //     assert_eq!(r, mem::transmute(__msa_ceqi_d(mem::transmute(a), -3)));
11381    // }
11382
11383    // Can not be tested in user mode
11384    // #[simd_test(enable = "msa")]
11385    // unsafe fn test_msa_cfcmsa() {
11386    //     let r = 5;
11387
11388    //     assert_eq!(r, mem::transmute(__msa_cfcmsa(5));
11389    // }
11390
11391    #[simd_test(enable = "msa")]
11392    unsafe fn test_msa_cle_s_b() {
11393        #[rustfmt::skip]
11394        let a = i8x16::new(
11395            -128, 127, 55, 2,
11396            -128, 127, 55, 2,
11397            -128, 127, 55, 2,
11398            -128, 127, 55, 2
11399        );
11400        #[rustfmt::skip]
11401        let b = i8x16::new(
11402            -128, 126, 55, 1,
11403            -128, 126, 55, 1,
11404            -128, 126, 55, 1,
11405            -128, 126, 55, 1
11406        );
11407        #[rustfmt::skip]
11408        let r = i8x16::new(
11409            -1, 0, -1, 0,
11410            -1, 0, -1, 0,
11411            -1, 0, -1, 0,
11412            -1, 0, -1, 0
11413        );
11414
11415        assert_eq!(
11416            r,
11417            mem::transmute(__msa_cle_s_b(mem::transmute(a), mem::transmute(b)))
11418        );
11419    }
11420
11421    #[simd_test(enable = "msa")]
11422    unsafe fn test_msa_cle_s_h() {
11423        #[rustfmt::skip]
11424        let a = i16x8::new(255, 155, 55, 2, 255, 155, 55, 2);
11425        #[rustfmt::skip]
11426        let b = i16x8::new(255, 155, 56, 1, 255, 155, 56, 1);
11427        #[rustfmt::skip]
11428        let r = i16x8::new(-1, -1, -1, 0, -1, -1, -1, 0);
11429
11430        assert_eq!(
11431            r,
11432            mem::transmute(__msa_cle_s_h(mem::transmute(a), mem::transmute(b)))
11433        );
11434    }
11435
11436    #[simd_test(enable = "msa")]
11437    unsafe fn test_msa_cle_s_w() {
11438        #[rustfmt::skip]
11439        let a = i32x4::new(255, 155, 55, 2);
11440        #[rustfmt::skip]
11441        let b = i32x4::new(255, 156, 55, 1);
11442        #[rustfmt::skip]
11443        let r = i32x4::new(-1, -1, -1, 0);
11444
11445        assert_eq!(
11446            r,
11447            mem::transmute(__msa_cle_s_w(mem::transmute(a), mem::transmute(b)))
11448        );
11449    }
11450
11451    #[simd_test(enable = "msa")]
11452    unsafe fn test_msa_cle_s_d() {
11453        #[rustfmt::skip]
11454        let a = i64x2::new(255, 155);
11455        #[rustfmt::skip]
11456        let b = i64x2::new(255, 156);
11457        #[rustfmt::skip]
11458        let r = i64x2::new(-1, -1);
11459
11460        assert_eq!(
11461            r,
11462            mem::transmute(__msa_cle_s_d(mem::transmute(a), mem::transmute(b)))
11463        );
11464    }
11465
11466    #[simd_test(enable = "msa")]
11467    unsafe fn test_msa_cle_u_b() {
11468        #[rustfmt::skip]
11469        let a = u8x16::new(
11470            u8::MAX, 127, 55, 2,
11471            u8::MAX, 127, 55, 2,
11472            u8::MAX, 127, 55, 2,
11473            u8::MAX, 127, 55, 2
11474        );
11475        #[rustfmt::skip]
11476        let b = u8x16::new(
11477            u8::MAX, 126, 55, 1,
11478            u8::MAX, 126, 55, 1,
11479            u8::MAX, 126, 55, 1,
11480            u8::MAX, 126, 55, 1
11481        );
11482        #[rustfmt::skip]
11483        let r = i8x16::new(-1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0);
11484
11485        assert_eq!(
11486            r,
11487            mem::transmute(__msa_cle_u_b(mem::transmute(a), mem::transmute(b)))
11488        );
11489    }
11490
11491    #[simd_test(enable = "msa")]
11492    unsafe fn test_msa_cle_u_h() {
11493        #[rustfmt::skip]
11494        let a = u16x8::new(
11495            u16::MAX, 155, 55, 2,
11496            u16::MAX, 155, 55, 2
11497        );
11498        #[rustfmt::skip]
11499        let b = u16x8::new(
11500            u16::MAX, 155, 56, 1,
11501            u16::MAX, 155, 56, 1
11502        );
11503        #[rustfmt::skip]
11504        let r = i16x8::new(-1, -1, -1, 0, -1, -1, -1, 0);
11505
11506        assert_eq!(
11507            r,
11508            mem::transmute(__msa_cle_u_h(mem::transmute(a), mem::transmute(b)))
11509        );
11510    }
11511
11512    #[simd_test(enable = "msa")]
11513    unsafe fn test_msa_cle_u_w() {
11514        #[rustfmt::skip]
11515        let a = u32x4::new(u32::MAX, 155, 55, 2);
11516        #[rustfmt::skip]
11517        let b = u32x4::new(u32::MAX, 156, 55, 1);
11518        #[rustfmt::skip]
11519        let r = i32x4::new(-1, -1, -1, 0);
11520
11521        assert_eq!(
11522            r,
11523            mem::transmute(__msa_cle_u_w(mem::transmute(a), mem::transmute(b)))
11524        );
11525    }
11526
11527    #[simd_test(enable = "msa")]
11528    unsafe fn test_msa_cle_u_d() {
11529        #[rustfmt::skip]
11530        let a = u64x2::new(u64::MAX, 155);
11531        #[rustfmt::skip]
11532        let b = u64x2::new(u64::MAX, 156);
11533        #[rustfmt::skip]
11534        let r = i64x2::new(-1, -1);
11535
11536        assert_eq!(
11537            r,
11538            mem::transmute(__msa_cle_u_d(mem::transmute(a), mem::transmute(b)))
11539        );
11540    }
11541
11542    #[simd_test(enable = "msa")]
11543    unsafe fn test_msa_clei_s_b() {
11544        #[rustfmt::skip]
11545        let a = i8x16::new(
11546            -2, -127, 100, -127,
11547            -2, -127, 100, -127,
11548            -2, -127, 100, -127,
11549            -2, -127, 100, -127
11550        );
11551        #[rustfmt::skip]
11552        let r = i8x16::new(-1, -1, 0, -1, -1, -1, 0, -1, -1, -1, 0, -1, -1, -1, 0, -1);
11553
11554        assert_eq!(r, mem::transmute(__msa_clei_s_b::<-2>(mem::transmute(a))));
11555    }
11556
11557    #[simd_test(enable = "msa")]
11558    unsafe fn test_msa_clei_s_h() {
11559        #[rustfmt::skip]
11560        let a = i16x8::new(
11561            32767, 3276, 10, -1,
11562            32767, 3276, 10, -1,
11563        );
11564        #[rustfmt::skip]
11565        let r = i16x8::new(0, 0, 0, -1, 0, 0, 0, -1);
11566
11567        assert_eq!(r, mem::transmute(__msa_clei_s_h::<-1>(mem::transmute(a))));
11568    }
11569
11570    #[simd_test(enable = "msa")]
11571    unsafe fn test_msa_clei_s_w() {
11572        #[rustfmt::skip]
11573        let a = i32x4::new(100, 2147483647, 6, 2147483647);
11574        #[rustfmt::skip]
11575        let r = i32x4::new(0, 0, -1, 0);
11576
11577        assert_eq!(r, mem::transmute(__msa_clei_s_w::<6>(mem::transmute(a))));
11578    }
11579
11580    // FIXME: https://reviews.llvm.org/D59884
11581    // If target type is i64, negative immediate loses the sign
11582    // -3 is represented as 4294967293
11583    // #[simd_test(enable = "msa")]
11584    // unsafe fn test_msa_clei_s_d() {
11585    //     #[rustfmt::skip]
11586    //     let a = i64x2::new(-3, 11);
11587    //     #[rustfmt::skip]
11588    //     let r = i64x2::new(-1, 0);
11589
11590    //     assert_eq!(r, mem::transmute(__msa_clei_s_d(mem::transmute(a), -3)));
11591    // }
11592
11593    #[simd_test(enable = "msa")]
11594    unsafe fn test_msa_clei_u_b() {
11595        #[rustfmt::skip]
11596        let a = u8x16::new(
11597            2, 127, 100, 127,
11598            2, 127, 100, 127,
11599            2, 127, 100, 127,
11600            2, 127, 100, 127,
11601        );
11602        #[rustfmt::skip]
11603        let r = i8x16::new(
11604            -1, 0, 0, 0,
11605            -1, 0, 0, 0,
11606            -1, 0, 0, 0,
11607            -1, 0, 0, 0
11608        );
11609
11610        assert_eq!(r, mem::transmute(__msa_clei_u_b::<25>(mem::transmute(a))));
11611    }
11612
11613    #[simd_test(enable = "msa")]
11614    unsafe fn test_msa_clei_u_h() {
11615        #[rustfmt::skip]
11616        let a = u16x8::new(
11617            1, 26, 15, 36,
11618            1, 26, 15, 36
11619        );
11620        #[rustfmt::skip]
11621        let r = i16x8::new(-1, 0, -1, 0, -1, 0, -1, 0);
11622
11623        assert_eq!(r, mem::transmute(__msa_clei_u_h::<25>(mem::transmute(a))));
11624    }
11625
11626    #[simd_test(enable = "msa")]
11627    unsafe fn test_msa_clei_u_w() {
11628        #[rustfmt::skip]
11629        let a = u32x4::new(25, 32, 25, 32);
11630        #[rustfmt::skip]
11631        let r = i32x4::new(-1, 0, -1, 0);
11632
11633        assert_eq!(r, mem::transmute(__msa_clei_u_w::<31>(mem::transmute(a))));
11634    }
11635
11636    #[simd_test(enable = "msa")]
11637    unsafe fn test_msa_clei_u_d() {
11638        #[rustfmt::skip]
11639        let a = u64x2::new(10, 26);
11640        #[rustfmt::skip]
11641        let r = i64x2::new(-1, 0);
11642
11643        assert_eq!(r, mem::transmute(__msa_clei_u_d::<25>(mem::transmute(a))));
11644    }
11645
11646    #[simd_test(enable = "msa")]
11647    unsafe fn test_msa_clt_s_b() {
11648        #[rustfmt::skip]
11649        let a = i8x16::new(
11650            -128, 127, 55, 2,
11651            -128, 127, 55, 2,
11652            -128, 127, 55, 2,
11653            -128, 127, 55, 2
11654        );
11655        #[rustfmt::skip]
11656        let b = i8x16::new(
11657            -127, 126, 56, 1,
11658            -127, 126, 56, 1,
11659            -127, 126, 56, 1,
11660            -127, 126, 56, 1
11661        );
11662        #[rustfmt::skip]
11663        let r = i8x16::new(
11664            -1, 0, -1, 0,
11665            -1, 0, -1, 0,
11666            -1, 0, -1, 0,
11667            -1, 0, -1, 0
11668        );
11669
11670        assert_eq!(
11671            r,
11672            mem::transmute(__msa_clt_s_b(mem::transmute(a), mem::transmute(b)))
11673        );
11674    }
11675
11676    #[simd_test(enable = "msa")]
11677    unsafe fn test_msa_clt_s_h() {
11678        #[rustfmt::skip]
11679        let a = i16x8::new(-255, 155, 55, 2, -255, 155, 55, 2);
11680        #[rustfmt::skip]
11681        let b = i16x8::new(255, 156, 56, 1, 255, 156, 56, 1);
11682        #[rustfmt::skip]
11683        let r = i16x8::new(-1, -1, -1, 0, -1, -1, -1, 0);
11684
11685        assert_eq!(
11686            r,
11687            mem::transmute(__msa_clt_s_h(mem::transmute(a), mem::transmute(b)))
11688        );
11689    }
11690
11691    #[simd_test(enable = "msa")]
11692    unsafe fn test_msa_clt_s_w() {
11693        #[rustfmt::skip]
11694        let a = i32x4::new(-255, 155, 55, 2);
11695        #[rustfmt::skip]
11696        let b = i32x4::new(255, 156, 55, 1);
11697        #[rustfmt::skip]
11698        let r = i32x4::new(-1, -1, 0, 0);
11699
11700        assert_eq!(
11701            r,
11702            mem::transmute(__msa_clt_s_w(mem::transmute(a), mem::transmute(b)))
11703        );
11704    }
11705
11706    #[simd_test(enable = "msa")]
11707    unsafe fn test_msa_clt_s_d() {
11708        #[rustfmt::skip]
11709        let a = i64x2::new(-255, 155);
11710        #[rustfmt::skip]
11711        let b = i64x2::new(255, 156);
11712        #[rustfmt::skip]
11713        let r = i64x2::new(-1, -1);
11714
11715        assert_eq!(
11716            r,
11717            mem::transmute(__msa_clt_s_d(mem::transmute(a), mem::transmute(b)))
11718        );
11719    }
11720
11721    #[simd_test(enable = "msa")]
11722    unsafe fn test_msa_clt_u_b() {
11723        #[rustfmt::skip]
11724        let a = u8x16::new(
11725            128, 127, 55, 2,
11726            128, 127, 55, 2,
11727            128, 127, 55, 2,
11728            128, 127, 55, 2
11729        );
11730        #[rustfmt::skip]
11731        let b = u8x16::new(
11732            127, 126, 56, 1,
11733            127, 126, 56, 1,
11734            127, 126, 56, 1,
11735            127, 126, 56, 1
11736        );
11737        #[rustfmt::skip]
11738        let r = i8x16::new(
11739            0, 0, -1, 0,
11740            0, 0, -1, 0,
11741            0, 0, -1, 0,
11742            0, 0, -1, 0
11743        );
11744
11745        assert_eq!(
11746            r,
11747            mem::transmute(__msa_clt_u_b(mem::transmute(a), mem::transmute(b)))
11748        );
11749    }
11750
11751    #[simd_test(enable = "msa")]
11752    unsafe fn test_msa_clt_u_h() {
11753        #[rustfmt::skip]
11754        let a = u16x8::new(255, 155, 55, 2, 255, 155, 55, 2);
11755        #[rustfmt::skip]
11756        let b = u16x8::new(255, 156, 56, 1, 255, 156, 56, 1);
11757        #[rustfmt::skip]
11758        let r = i16x8::new(0, -1, -1, 0, 0, -1, -1, 0);
11759
11760        assert_eq!(
11761            r,
11762            mem::transmute(__msa_clt_u_h(mem::transmute(a), mem::transmute(b)))
11763        );
11764    }
11765
11766    #[simd_test(enable = "msa")]
11767    unsafe fn test_msa_clt_u_w() {
11768        #[rustfmt::skip]
11769        let a = u32x4::new(255, 155, 55, 2);
11770        #[rustfmt::skip]
11771        let b = u32x4::new(255, 156, 55, 1);
11772        #[rustfmt::skip]
11773        let r = i32x4::new(0, -1, 0, 0);
11774
11775        assert_eq!(
11776            r,
11777            mem::transmute(__msa_clt_u_w(mem::transmute(a), mem::transmute(b)))
11778        );
11779    }
11780
11781    #[simd_test(enable = "msa")]
11782    unsafe fn test_msa_clt_u_d() {
11783        #[rustfmt::skip]
11784        let a = u64x2::new(255, 155);
11785        #[rustfmt::skip]
11786        let b = u64x2::new(255, 156);
11787        #[rustfmt::skip]
11788        let r = i64x2::new(0, -1);
11789
11790        assert_eq!(
11791            r,
11792            mem::transmute(__msa_clt_u_d(mem::transmute(a), mem::transmute(b)))
11793        );
11794    }
11795
11796    #[simd_test(enable = "msa")]
11797    unsafe fn test_msa_clti_s_b() {
11798        #[rustfmt::skip]
11799        let a = i8x16::new(
11800            2, -127, -5, 127,
11801            2, -127, -5, 127,
11802            2, -127, -5, 127,
11803            2, -127, -5, 127
11804        );
11805        #[rustfmt::skip]
11806        let r = i8x16::new(
11807            0, -1, 0, 0,
11808            0, -1, 0, 0,
11809            0, -1, 0, 0,
11810            0, -1, 0, 0
11811        );
11812
11813        assert_eq!(r, mem::transmute(__msa_clti_s_b::<-5>(mem::transmute(a))));
11814    }
11815
11816    #[simd_test(enable = "msa")]
11817    unsafe fn test_msa_clti_s_h() {
11818        #[rustfmt::skip]
11819        let a = i16x8::new(
11820            -1024, 3276, 15, 127,
11821            -1024, 3276, 15, 127
11822        );
11823        #[rustfmt::skip]
11824        let r = i16x8::new(-1, 0, 0, 0, -1, 0, 0, 0);
11825
11826        assert_eq!(r, mem::transmute(__msa_clti_s_h::<15>(mem::transmute(a))));
11827    }
11828
11829    #[simd_test(enable = "msa")]
11830    unsafe fn test_msa_clti_s_w() {
11831        #[rustfmt::skip]
11832        let a = i32x4::new(-15, 2147483647, -15, 2147483647);
11833        #[rustfmt::skip]
11834        let r = i32x4::new(-1, 0, -1, 0);
11835
11836        assert_eq!(r, mem::transmute(__msa_clti_s_w::<-10>(mem::transmute(a))));
11837    }
11838
11839    // FIXME: https://reviews.llvm.org/D59884
11840    // If target type is i64, negative immediate loses the sign
11841    // -3 is represented as 4294967293
11842    // #[simd_test(enable = "msa")]
11843    // unsafe fn test_msa_clti_s_d() {
11844    //     #[rustfmt::skip]
11845    //     let a = i64x2::new(-5, -2);
11846    //     #[rustfmt::skip]
11847    //     let r = i64x2::new(-1, 0);
11848
11849    //     assert_eq!(r, mem::transmute(__msa_clti_s_d(mem::transmute(a), -3)));
11850    // }
11851
11852    #[simd_test(enable = "msa")]
11853    unsafe fn test_msa_clti_u_b() {
11854        #[rustfmt::skip]
11855        let a = u8x16::new(
11856            2, 127, 49, 127,
11857            2, 127, 49, 127,
11858            2, 127, 49, 127,
11859            2, 127, 49, 127,
11860        );
11861        #[rustfmt::skip]
11862        let r = i8x16::new(
11863            -1, 0, 0, 0,
11864            -1, 0, 0, 0,
11865            -1, 0, 0, 0,
11866            -1, 0, 0, 0
11867        );
11868
11869        assert_eq!(r, mem::transmute(__msa_clti_u_b::<3>(mem::transmute(a))));
11870    }
11871
11872    #[simd_test(enable = "msa")]
11873    unsafe fn test_msa_clti_u_h() {
11874        #[rustfmt::skip]
11875        let a = u16x8::new(
11876            327, 3276, 100, 127,
11877            327, 3276, 100, 127
11878        );
11879        #[rustfmt::skip]
11880        let r = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
11881
11882        assert_eq!(r, mem::transmute(__msa_clti_u_h::<30>(mem::transmute(a))));
11883    }
11884
11885    #[simd_test(enable = "msa")]
11886    unsafe fn test_msa_clti_u_w() {
11887        #[rustfmt::skip]
11888        let a = u32x4::new(100, 2147483647, 100, 2147483647);
11889        #[rustfmt::skip]
11890        let r = i32x4::new(0, 0, 0, 0);
11891
11892        assert_eq!(r, mem::transmute(__msa_clti_u_w::<10>(mem::transmute(a))));
11893    }
11894
11895    #[simd_test(enable = "msa")]
11896    unsafe fn test_msa_clti_u_d() {
11897        #[rustfmt::skip]
11898        let a = u64x2::new(1, 9223372036854775807);
11899        #[rustfmt::skip]
11900        let r = i64x2::new(-1, 0);
11901
11902        assert_eq!(r, mem::transmute(__msa_clti_u_d::<10>(mem::transmute(a))));
11903    }
11904
11905    #[simd_test(enable = "msa")]
11906    unsafe fn test_msa_copy_s_b() {
11907        #[rustfmt::skip]
11908        let a = i8x16::new(
11909            -100, 127, 4, 127,
11910            -100, 127, 4, 127,
11911            -100, 127, 4, 127,
11912            -100, 127, 4, 127
11913        );
11914        #[rustfmt::skip]
11915        let r = -100 as i32;
11916
11917        assert_eq!(r, mem::transmute(__msa_copy_s_b::<12>(mem::transmute(a))));
11918    }
11919
11920    #[simd_test(enable = "msa")]
11921    unsafe fn test_msa_copy_s_h() {
11922        #[rustfmt::skip]
11923        let a = i16x8::new(
11924            32767, 3276, 100, 11,
11925            32767, 3276, 100, 11
11926        );
11927        #[rustfmt::skip]
11928        let r = 32767 as i32;
11929
11930        assert_eq!(r, mem::transmute(__msa_copy_s_h::<4>(mem::transmute(a))));
11931    }
11932
11933    #[simd_test(enable = "msa")]
11934    unsafe fn test_msa_copy_s_w() {
11935        #[rustfmt::skip]
11936        let a = i32x4::new(100, 2147483647, 5, -2147483647);
11937        let r = 2147483647 as i32;
11938
11939        assert_eq!(r, mem::transmute(__msa_copy_s_w::<1>(mem::transmute(a))));
11940    }
11941
11942    #[simd_test(enable = "msa")]
11943    unsafe fn test_msa_copy_s_d() {
11944        #[rustfmt::skip]
11945        let a = i64x2::new(3, 9223372036854775807);
11946        #[rustfmt::skip]
11947        let r = 9223372036854775807 as i64;
11948
11949        assert_eq!(r, mem::transmute(__msa_copy_s_d::<1>(mem::transmute(a))));
11950    }
11951
11952    #[simd_test(enable = "msa")]
11953    unsafe fn test_msa_copy_u_b() {
11954        #[rustfmt::skip]
11955        let a = i8x16::new(
11956            100, 127, 4, 127,
11957            100, 127, 4, 127,
11958            100, 127, 4, 127,
11959            100, 127, 4, 127
11960        );
11961        #[rustfmt::skip]
11962        let r = 100 as u32;
11963
11964        assert_eq!(r, mem::transmute(__msa_copy_u_b::<12>(mem::transmute(a))));
11965    }
11966
11967    #[simd_test(enable = "msa")]
11968    unsafe fn test_msa_copy_u_h() {
11969        #[rustfmt::skip]
11970        let a = i16x8::new(
11971            32767, 3276, 100, 11,
11972            32767, 3276, 100, 11
11973        );
11974        #[rustfmt::skip]
11975        let r = 32767 as u32;
11976
11977        assert_eq!(r, mem::transmute(__msa_copy_u_h::<4>(mem::transmute(a))));
11978    }
11979
11980    #[simd_test(enable = "msa")]
11981    unsafe fn test_msa_copy_u_w() {
11982        #[rustfmt::skip]
11983        let a = i32x4::new(100, 2147483647, 5, 2147483647);
11984        #[rustfmt::skip]
11985        let r = 2147483647 as u32;
11986
11987        assert_eq!(r, mem::transmute(__msa_copy_u_w::<1>(mem::transmute(a))));
11988    }
11989
11990    #[simd_test(enable = "msa")]
11991    unsafe fn test_msa_copy_u_d() {
11992        #[rustfmt::skip]
11993        let a = i64x2::new(3, i64::MAX);
11994        #[rustfmt::skip]
11995        let r = 9223372036854775807 as u64;
11996
11997        assert_eq!(r, mem::transmute(__msa_copy_u_d::<1>(mem::transmute(a))));
11998    }
11999
12000    // Can not be tested in user mode
12001    // #[simd_test(enable = "msa")]
12002    // unsafe fn test_msa_ctcmsa() {
12003    // }
12004
12005    #[simd_test(enable = "msa")]
12006    unsafe fn test_msa_div_s_b() {
12007        #[rustfmt::skip]
12008        let a = i8x16::new(
12009            -6, -7, -8, -9,
12010            -6, -7, -8, -9,
12011            -6, -7, -8, -9,
12012            -6, -7, -8, -9
12013        );
12014        #[rustfmt::skip]
12015        let b = i8x16::new(
12016            -1, -2, -3, -4,
12017            -1, -2, -3, -4,
12018            -1, -2, -3, -4,
12019            -1, -2, -3, -4
12020        );
12021        #[rustfmt::skip]
12022        let r = i8x16::new(
12023            6, 3, 2, 2,
12024            6, 3, 2, 2,
12025            6, 3, 2, 2,
12026            6, 3, 2, 2
12027        );
12028
12029        assert_eq!(
12030            r,
12031            mem::transmute(__msa_div_s_b(mem::transmute(a), mem::transmute(b)))
12032        );
12033    }
12034
12035    #[simd_test(enable = "msa")]
12036    unsafe fn test_msa_div_s_h() {
12037        #[rustfmt::skip]
12038        let a = i16x8::new(-6, -7, -8, -9, 6, 7, 8, 9);
12039        #[rustfmt::skip]
12040        let b = i16x8::new(-1, -2, -3, -4, -1, -2, -3, -4);
12041        #[rustfmt::skip]
12042        let r = i16x8::new(6, 3, 2, 2, -6, -3, -2, -2);
12043
12044        assert_eq!(
12045            r,
12046            mem::transmute(__msa_div_s_h(mem::transmute(a), mem::transmute(b)))
12047        );
12048    }
12049
12050    #[simd_test(enable = "msa")]
12051    unsafe fn test_msa_div_s_w() {
12052        #[rustfmt::skip]
12053        let a = i32x4::new(-6, -7, 8, 9);
12054        #[rustfmt::skip]
12055        let b = i32x4::new(-1, -2, -3, -4);
12056        #[rustfmt::skip]
12057        let r = i32x4::new(6, 3, -2, -2);
12058
12059        assert_eq!(
12060            r,
12061            mem::transmute(__msa_div_s_w(mem::transmute(a), mem::transmute(b)))
12062        );
12063    }
12064
12065    #[simd_test(enable = "msa")]
12066    unsafe fn test_msa_div_s_d() {
12067        #[rustfmt::skip]
12068        let a = i64x2::new(-6, 7);
12069        #[rustfmt::skip]
12070        let b = i64x2::new(-1, -2);
12071        #[rustfmt::skip]
12072        let r = i64x2::new(6, -3);
12073
12074        assert_eq!(
12075            r,
12076            mem::transmute(__msa_div_s_d(mem::transmute(a), mem::transmute(b)))
12077        );
12078    }
12079
12080    #[simd_test(enable = "msa")]
12081    unsafe fn test_msa_div_u_b() {
12082        #[rustfmt::skip]
12083        let a = u8x16::new(
12084            6, 7, 8, 9,
12085            6, 7, 8, 9,
12086            6, 7, 8, 9,
12087            6, 7, 8, 9
12088        );
12089        #[rustfmt::skip]
12090        let b = u8x16::new(
12091            1, 2, 3, 4,
12092            1, 2, 3, 4,
12093            1, 2, 3, 4,
12094            1, 2, 3, 4
12095        );
12096        #[rustfmt::skip]
12097        let r = u8x16::new(
12098            6, 3, 2, 2,
12099            6, 3, 2, 2,
12100            6, 3, 2, 2,
12101            6, 3, 2, 2
12102        );
12103
12104        assert_eq!(
12105            r,
12106            mem::transmute(__msa_div_u_b(mem::transmute(a), mem::transmute(b)))
12107        );
12108    }
12109
12110    #[simd_test(enable = "msa")]
12111    unsafe fn test_msa_div_u_h() {
12112        #[rustfmt::skip]
12113        let a = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
12114        #[rustfmt::skip]
12115        let b = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
12116        #[rustfmt::skip]
12117        let r = u16x8::new(6, 3, 2, 2, 6, 3, 2, 2);
12118
12119        assert_eq!(
12120            r,
12121            mem::transmute(__msa_div_u_h(mem::transmute(a), mem::transmute(b)))
12122        );
12123    }
12124
12125    #[simd_test(enable = "msa")]
12126    unsafe fn test_msa_div_u_w() {
12127        #[rustfmt::skip]
12128        let a = u32x4::new(6, 7, 8, 9);
12129        #[rustfmt::skip]
12130        let b = u32x4::new(1, 2, 3, 4);
12131        #[rustfmt::skip]
12132        let r = u32x4::new(6, 3, 2, 2);
12133
12134        assert_eq!(
12135            r,
12136            mem::transmute(__msa_div_u_w(mem::transmute(a), mem::transmute(b)))
12137        );
12138    }
12139
12140    #[simd_test(enable = "msa")]
12141    unsafe fn test_msa_div_u_d() {
12142        #[rustfmt::skip]
12143        let a = u64x2::new(6, 7);
12144        #[rustfmt::skip]
12145        let b = u64x2::new(1, 2);
12146        #[rustfmt::skip]
12147        let r = u64x2::new(6, 3);
12148
12149        assert_eq!(
12150            r,
12151            mem::transmute(__msa_div_u_d(mem::transmute(a), mem::transmute(b)))
12152        );
12153    }
12154
12155    #[simd_test(enable = "msa")]
12156    unsafe fn test_msa_dotp_s_h() {
12157        #[rustfmt::skip]
12158        let a = i8x16::new(
12159            -1, -2, -3, 4,
12160            -1, -2, -3, -4,
12161            -1, -2, -3, 4,
12162            -1, -2, -3, -4
12163        );
12164        #[rustfmt::skip]
12165        let b = i8x16::new(
12166            -6, -7, -8, -9,
12167            -6, -7, -8, -9,
12168            -6, -7, -8, -9,
12169            -6, -7, -8, -9
12170        );
12171        #[rustfmt::skip]
12172        let r = i16x8::new(20, -12, 20, 60, 20, -12, 20, 60);
12173
12174        assert_eq!(
12175            r,
12176            mem::transmute(__msa_dotp_s_h(mem::transmute(a), mem::transmute(b)))
12177        );
12178    }
12179
12180    #[simd_test(enable = "msa")]
12181    unsafe fn test_msa_dotp_s_w() {
12182        #[rustfmt::skip]
12183        let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, 4);
12184        #[rustfmt::skip]
12185        let b = i16x8::new(-6, -7, -8, -9, -6, -7, -8, -9);
12186        #[rustfmt::skip]
12187        let r = i32x4::new(20, 60, 20, -12);
12188
12189        assert_eq!(
12190            r,
12191            mem::transmute(__msa_dotp_s_w(mem::transmute(a), mem::transmute(b)))
12192        );
12193    }
12194
12195    #[simd_test(enable = "msa")]
12196    unsafe fn test_msa_dotp_s_d() {
12197        #[rustfmt::skip]
12198        let a = i32x4::new(-1, -2, -3, 4);
12199        #[rustfmt::skip]
12200        let b = i32x4::new(-6, -7, -8, -9);
12201        #[rustfmt::skip]
12202        let r = i64x2::new(20, -12);
12203
12204        assert_eq!(
12205            r,
12206            mem::transmute(__msa_dotp_s_d(mem::transmute(a), mem::transmute(b)))
12207        );
12208    }
12209
12210    #[simd_test(enable = "msa")]
12211    unsafe fn test_msa_dotp_u_h() {
12212        #[rustfmt::skip]
12213        let a = u8x16::new(
12214            1, 2, 3, 4,
12215            1, 2, 3, 4,
12216            1, 2, 3, 4,
12217            1, 2, 3, 4
12218        );
12219        #[rustfmt::skip]
12220        let b = u8x16::new(
12221            6, 7, 8, 9,
12222            6, 7, 8, 9,
12223            6, 7, 8, 9,
12224            6, 7, 8, 9
12225        );
12226        #[rustfmt::skip]
12227        let r = u16x8::new(20, 60, 20, 60, 20, 60, 20, 60);
12228
12229        assert_eq!(
12230            r,
12231            mem::transmute(__msa_dotp_u_h(mem::transmute(a), mem::transmute(b)))
12232        );
12233    }
12234
12235    #[simd_test(enable = "msa")]
12236    unsafe fn test_msa_dotp_u_w() {
12237        #[rustfmt::skip]
12238        let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
12239        #[rustfmt::skip]
12240        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
12241        #[rustfmt::skip]
12242        let r = u32x4::new(20, 60, 20, 60);
12243
12244        assert_eq!(
12245            r,
12246            mem::transmute(__msa_dotp_u_w(mem::transmute(a), mem::transmute(b)))
12247        );
12248    }
12249
12250    #[simd_test(enable = "msa")]
12251    unsafe fn test_msa_dotp_u_d() {
12252        #[rustfmt::skip]
12253        let a = u32x4::new(1, 2, 3, 4);
12254        #[rustfmt::skip]
12255        let b = u32x4::new(6, 7, 8, 9);
12256        #[rustfmt::skip]
12257        let r = u64x2::new(20, 60);
12258
12259        assert_eq!(
12260            r,
12261            mem::transmute(__msa_dotp_u_d(mem::transmute(a), mem::transmute(b)))
12262        );
12263    }
12264
12265    #[simd_test(enable = "msa")]
12266    unsafe fn test_msa_dpadd_s_h() {
12267        #[rustfmt::skip]
12268        let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, 4);
12269        #[rustfmt::skip]
12270        let b = i8x16::new(
12271            -1, -2, -3, 4,
12272            -1, -2, -3, -4,
12273            -1, -2, -3, 4,
12274            -1, -2, -3, -4
12275        );
12276        #[rustfmt::skip]
12277        let c = i8x16::new(
12278            -6, -7, -8, -9,
12279            -6, -7, -8, -9,
12280            -6, -7, -8, -9,
12281            -6, -7, -8, -9
12282        );
12283        #[rustfmt::skip]
12284        let r = i16x8::new(19, -14, 17, 56, 19, -14, 17, 64);
12285
12286        assert_eq!(
12287            r,
12288            mem::transmute(__msa_dpadd_s_h(
12289                mem::transmute(a),
12290                mem::transmute(b),
12291                mem::transmute(c)
12292            ))
12293        );
12294    }
12295
12296    #[simd_test(enable = "msa")]
12297    unsafe fn test_msa_dpadd_s_w() {
12298        #[rustfmt::skip]
12299        let a = i32x4::new(-1, -2, -3, -4);
12300        #[rustfmt::skip]
12301        let b = i16x8::new(
12302            -1, -2, -3, 4,
12303            -1, -2, -3, -4
12304        );
12305        #[rustfmt::skip]
12306        let c = i16x8::new(
12307            -6, -7, -8, -9,
12308            -6, -7, -8, -9
12309        );
12310        #[rustfmt::skip]
12311        let r = i32x4::new(19, -14, 17, 56);
12312
12313        assert_eq!(
12314            r,
12315            mem::transmute(__msa_dpadd_s_w(
12316                mem::transmute(a),
12317                mem::transmute(b),
12318                mem::transmute(c)
12319            ))
12320        );
12321    }
12322
12323    #[simd_test(enable = "msa")]
12324    unsafe fn test_msa_dpadd_s_d() {
12325        #[rustfmt::skip]
12326        let a = i64x2::new(-1, -2);
12327        #[rustfmt::skip]
12328        let b = i32x4::new(-1, -2, -3, 4);
12329        #[rustfmt::skip]
12330        let c = i32x4::new(-6, -7, -8, -9);
12331        #[rustfmt::skip]
12332        let r = i64x2::new(19, -14);
12333
12334        assert_eq!(
12335            r,
12336            mem::transmute(__msa_dpadd_s_d(
12337                mem::transmute(a),
12338                mem::transmute(b),
12339                mem::transmute(c)
12340            ))
12341        );
12342    }
12343
12344    #[simd_test(enable = "msa")]
12345    unsafe fn test_msa_dpadd_u_h() {
12346        #[rustfmt::skip]
12347        let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
12348        #[rustfmt::skip]
12349        let b = u8x16::new(
12350            1, 2, 3, 4,
12351            1, 2, 3, 4,
12352            1, 2, 3, 4,
12353            1, 2, 3, 4
12354        );
12355        #[rustfmt::skip]
12356        let c = u8x16::new(
12357            6, 7, 8, 9,
12358            6, 7, 8, 9,
12359            6, 7, 8, 9,
12360            6, 7, 8, 9
12361        );
12362        #[rustfmt::skip]
12363        let r = u16x8::new(21, 62, 23, 64, 21, 62, 23, 64);
12364
12365        assert_eq!(
12366            r,
12367            mem::transmute(__msa_dpadd_u_h(
12368                mem::transmute(a),
12369                mem::transmute(b),
12370                mem::transmute(c)
12371            ))
12372        );
12373    }
12374
12375    #[simd_test(enable = "msa")]
12376    unsafe fn test_msa_dpadd_u_w() {
12377        #[rustfmt::skip]
12378        let a = u32x4::new(1, 2, 3, 4);
12379        #[rustfmt::skip]
12380        let b = u16x8::new(
12381            1, 2, 3, 4,
12382            1, 2, 3, 4
12383        );
12384        #[rustfmt::skip]
12385        let c = u16x8::new(
12386            6, 7, 8, 9,
12387            6, 7, 8, 9
12388        );
12389        #[rustfmt::skip]
12390        let r = u32x4::new(21, 62, 23, 64);
12391
12392        assert_eq!(
12393            r,
12394            mem::transmute(__msa_dpadd_u_w(
12395                mem::transmute(a),
12396                mem::transmute(b),
12397                mem::transmute(c)
12398            ))
12399        );
12400    }
12401
12402    #[simd_test(enable = "msa")]
12403    unsafe fn test_msa_dpadd_u_d() {
12404        #[rustfmt::skip]
12405        let a = u64x2::new(1, 2);
12406        #[rustfmt::skip]
12407        let b = u32x4::new(1, 2, 3, 4);
12408        #[rustfmt::skip]
12409        let c = u32x4::new(6, 7, 8, 9);
12410        #[rustfmt::skip]
12411        let r = u64x2::new(21, 62);
12412
12413        assert_eq!(
12414            r,
12415            mem::transmute(__msa_dpadd_u_d(
12416                mem::transmute(a),
12417                mem::transmute(b),
12418                mem::transmute(c)
12419            ))
12420        );
12421    }
12422
12423    #[simd_test(enable = "msa")]
12424    unsafe fn test_msa_dpsub_s_h() {
12425        #[rustfmt::skip]
12426        let a = i16x8::new(-1, -2, -3, -4, -1, -2, -3, 4);
12427        #[rustfmt::skip]
12428        let b = i8x16::new(
12429            -1, -2, -3, 4,
12430            -1, -2, -3, -4,
12431            -1, -2, -3, 4,
12432            -1, -2, -3, -4
12433        );
12434        #[rustfmt::skip]
12435        let c = i8x16::new(
12436            -6, -7, -8, -9,
12437            -6, -7, -8, -9,
12438            -6, -7, -8, -9,
12439            -6, -7, -8, -9
12440        );
12441        #[rustfmt::skip]
12442        let r = i16x8::new(-21, 10, -23, -64, -21, 10, -23, -56);
12443
12444        assert_eq!(
12445            r,
12446            mem::transmute(__msa_dpsub_s_h(
12447                mem::transmute(a),
12448                mem::transmute(b),
12449                mem::transmute(c)
12450            ))
12451        );
12452    }
12453
12454    #[simd_test(enable = "msa")]
12455    unsafe fn test_msa_dpsub_s_w() {
12456        #[rustfmt::skip]
12457        let a = i32x4::new(-1, -2, -3, -4);
12458        #[rustfmt::skip]
12459        let b = i16x8::new(
12460            -1, -2, -3, 4,
12461            -1, -2, -3, -4
12462        );
12463        #[rustfmt::skip]
12464        let c = i16x8::new(
12465            -6, -7, -8, -9,
12466            -6, -7, -8, -9
12467        );
12468        #[rustfmt::skip]
12469        let r = i32x4::new(-21, 10, -23, -64);
12470
12471        assert_eq!(
12472            r,
12473            mem::transmute(__msa_dpsub_s_w(
12474                mem::transmute(a),
12475                mem::transmute(b),
12476                mem::transmute(c)
12477            ))
12478        );
12479    }
12480
12481    #[simd_test(enable = "msa")]
12482    unsafe fn test_msa_dpsub_s_d() {
12483        #[rustfmt::skip]
12484        let a = i64x2::new(-1, -2);
12485        #[rustfmt::skip]
12486        let b = i32x4::new(-1, -2, -3, 4);
12487        #[rustfmt::skip]
12488        let c = i32x4::new(-6, -7, -8, -9);
12489        #[rustfmt::skip]
12490        let r = i64x2::new(-21, 10);
12491
12492        assert_eq!(
12493            r,
12494            mem::transmute(__msa_dpsub_s_d(
12495                mem::transmute(a),
12496                mem::transmute(b),
12497                mem::transmute(c)
12498            ))
12499        );
12500    }
12501
12502    #[simd_test(enable = "msa")]
12503    unsafe fn test_msa_dpsub_u_h() {
12504        #[rustfmt::skip]
12505        let a = i16x8::new(1, -2, 3, -4, -1, 2,-3, 4);
12506        #[rustfmt::skip]
12507        let b = u8x16::new(
12508            1, 2, 3, 4,
12509            1, 2, 3, 4,
12510            1, 2, 3, 4,
12511            1, 2, 3, 4
12512        );
12513        #[rustfmt::skip]
12514        let c = u8x16::new(
12515            6, 7, 8, 9,
12516            6, 7, 8, 9,
12517            6, 7, 8, 9,
12518            6, 7, 8, 9
12519        );
12520        #[rustfmt::skip]
12521        let r = i16x8::new(-19, -62, -17, -64, -21, -58, -23, -56);
12522
12523        assert_eq!(
12524            r,
12525            mem::transmute(__msa_dpsub_u_h(
12526                mem::transmute(a),
12527                mem::transmute(b),
12528                mem::transmute(c)
12529            ))
12530        );
12531    }
12532
12533    #[simd_test(enable = "msa")]
12534    unsafe fn test_msa_dpsub_u_w() {
12535        #[rustfmt::skip]
12536        let a = i32x4::new(1, -2, 3, -4);
12537        #[rustfmt::skip]
12538        let b = u16x8::new(
12539            1, 2, 3, 4,
12540            1, 2, 3, 4
12541        );
12542        #[rustfmt::skip]
12543        let c = u16x8::new(
12544            6, 7, 8, 9,
12545            6, 7, 8, 9
12546        );
12547        #[rustfmt::skip]
12548        let r = i32x4::new(-19, -62, -17, -64);
12549
12550        assert_eq!(
12551            r,
12552            mem::transmute(__msa_dpsub_u_w(
12553                mem::transmute(a),
12554                mem::transmute(b),
12555                mem::transmute(c)
12556            ))
12557        );
12558    }
12559
12560    #[simd_test(enable = "msa")]
12561    unsafe fn test_msa_dpsub_u_d() {
12562        #[rustfmt::skip]
12563        let a = i64x2::new(1, -2);
12564        #[rustfmt::skip]
12565        let b = u32x4::new(1, 2, 3, 4);
12566        #[rustfmt::skip]
12567        let c = u32x4::new(6, 7, 8, 9);
12568        #[rustfmt::skip]
12569        let r = i64x2::new(-19, -62);
12570
12571        assert_eq!(
12572            r,
12573            mem::transmute(__msa_dpsub_u_d(
12574                mem::transmute(a),
12575                mem::transmute(b),
12576                mem::transmute(c)
12577            ))
12578        );
12579    }
12580
12581    #[simd_test(enable = "msa")]
12582    unsafe fn test_msa_fadd_w() {
12583        #[rustfmt::skip]
12584        let a = f32x4::new(1.1, -2.2, 3.3, -4.4);
12585        #[rustfmt::skip]
12586        let b = f32x4::new(4.4, -3.3, 2.2, -1.1);
12587        #[rustfmt::skip]
12588        let r = f32x4::new(5.5, -5.5, 5.5, -5.5);
12589
12590        assert_eq!(
12591            r,
12592            mem::transmute(__msa_fadd_w(mem::transmute(a), mem::transmute(b)))
12593        );
12594    }
12595
12596    #[simd_test(enable = "msa")]
12597    unsafe fn test_msa_fadd_d() {
12598        #[rustfmt::skip]
12599        let a = f64x2::new(1.1, -2.2);
12600        #[rustfmt::skip]
12601        let b = f64x2::new(4.4, -3.3);
12602        #[rustfmt::skip]
12603        let r = f64x2::new(5.5, -5.5);
12604
12605        assert_eq!(
12606            r,
12607            mem::transmute(__msa_fadd_d(mem::transmute(a), mem::transmute(b)))
12608        );
12609    }
12610
12611    // Only observed beahiour should be SIGFPE signal
12612    // Can not be tested
12613    #[simd_test(enable = "msa")]
12614    unsafe fn test_msa_fcaf_w() {
12615        #[rustfmt::skip]
12616        let a = f32x4::new(1.1, -2.2, 3.3, -4.4);
12617        #[rustfmt::skip]
12618        let b = f32x4::new(0.0, -1.2, 3.3, f32::NAN);
12619        #[rustfmt::skip]
12620        let r = i32x4::new(0, 0, 0, 0);
12621
12622        assert_eq!(
12623            r,
12624            mem::transmute(__msa_fcaf_w(mem::transmute(a), mem::transmute(b)))
12625        );
12626    }
12627
12628    // Only observed beahiour should be SIGFPE signal
12629    // Can not be tested
12630    #[simd_test(enable = "msa")]
12631    unsafe fn test_msa_fcaf_d() {
12632        #[rustfmt::skip]
12633        let a = f64x2::new(1.1, -2.2);
12634        #[rustfmt::skip]
12635        let b = f64x2::new(-2.2, 1.1);
12636        #[rustfmt::skip]
12637        let r = i64x2::new(0, 0);
12638
12639        assert_eq!(
12640            r,
12641            mem::transmute(__msa_fcaf_d(mem::transmute(a), mem::transmute(b)))
12642        );
12643    }
12644
12645    #[simd_test(enable = "msa")]
12646    unsafe fn test_msa_fceq_w() {
12647        #[rustfmt::skip]
12648        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12649        #[rustfmt::skip]
12650        let b = f32x4::new(-4.4, -2.2, 3.3, f32::NAN);
12651        #[rustfmt::skip]
12652        let r = i32x4::new(0, -1, -1, 0);
12653
12654        assert_eq!(
12655            r,
12656            mem::transmute(__msa_fceq_w(mem::transmute(a), mem::transmute(b)))
12657        );
12658    }
12659
12660    #[simd_test(enable = "msa")]
12661    unsafe fn test_msa_fceq_d() {
12662        #[rustfmt::skip]
12663        let a = f64x2::new(1.1, -2.2);
12664        #[rustfmt::skip]
12665        let b = f64x2::new(1.1, 1.1);
12666        #[rustfmt::skip]
12667        let r = i64x2::new(-1, 0);
12668
12669        assert_eq!(
12670            r,
12671            mem::transmute(__msa_fceq_d(mem::transmute(a), mem::transmute(b)))
12672        );
12673    }
12674
12675    #[simd_test(enable = "msa")]
12676    unsafe fn test_msa_fclass_w() {
12677        #[rustfmt::skip]
12678        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12679        #[rustfmt::skip]
12680        let r = i32x4::new(128, 8, 128, 2);
12681
12682        assert_eq!(r, mem::transmute(__msa_fclass_w(mem::transmute(a))));
12683    }
12684
12685    #[simd_test(enable = "msa")]
12686    unsafe fn test_msa_fclass_d() {
12687        #[rustfmt::skip]
12688        let a = f64x2::new(1.1, -2.2);
12689        #[rustfmt::skip]
12690        let r = i64x2::new(128, 8);
12691
12692        assert_eq!(r, mem::transmute(__msa_fclass_d(mem::transmute(a))));
12693    }
12694
12695    #[simd_test(enable = "msa")]
12696    unsafe fn test_msa_fcle_w() {
12697        #[rustfmt::skip]
12698        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12699        #[rustfmt::skip]
12700        let b = f32x4::new(-4.4, -1.2, 3.3, f32::NAN);
12701        #[rustfmt::skip]
12702        let r = i32x4::new(0, -1, -1, 0);
12703
12704        assert_eq!(
12705            r,
12706            mem::transmute(__msa_fcle_w(mem::transmute(a), mem::transmute(b)))
12707        );
12708    }
12709
12710    #[simd_test(enable = "msa")]
12711    unsafe fn test_msa_fcle_d() {
12712        #[rustfmt::skip]
12713        let a = f64x2::new(1.1, -2.2);
12714        #[rustfmt::skip]
12715        let b = f64x2::new(1.1, 1.1);
12716        #[rustfmt::skip]
12717        let r = i64x2::new(-1, -1);
12718
12719        assert_eq!(
12720            r,
12721            mem::transmute(__msa_fcle_d(mem::transmute(a), mem::transmute(b)))
12722        );
12723    }
12724
12725    #[simd_test(enable = "msa")]
12726    unsafe fn test_msa_fclt_w() {
12727        #[rustfmt::skip]
12728        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12729        #[rustfmt::skip]
12730        let b = f32x4::new(-4.4, -1.2, 3.3, f32::NAN);
12731        #[rustfmt::skip]
12732        let r = i32x4::new(0, -1, 0, 0);
12733
12734        assert_eq!(
12735            r,
12736            mem::transmute(__msa_fclt_w(mem::transmute(a), mem::transmute(b)))
12737        );
12738    }
12739
12740    #[simd_test(enable = "msa")]
12741    unsafe fn test_msa_fclt_d() {
12742        #[rustfmt::skip]
12743        let a = f64x2::new(1.1, -2.2);
12744        #[rustfmt::skip]
12745        let b = f64x2::new(1.1, 1.1);
12746        #[rustfmt::skip]
12747        let r = i64x2::new(0, -1);
12748
12749        assert_eq!(
12750            r,
12751            mem::transmute(__msa_fclt_d(mem::transmute(a), mem::transmute(b)))
12752        );
12753    }
12754
12755    #[simd_test(enable = "msa")]
12756    unsafe fn test_msa_fcne_w() {
12757        #[rustfmt::skip]
12758        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12759        #[rustfmt::skip]
12760        let b = f32x4::new(-4.4, -1.2, 3.3, f32::NAN);
12761        #[rustfmt::skip]
12762        let r = i32x4::new(-1, -1, 0, 0);
12763
12764        assert_eq!(
12765            r,
12766            mem::transmute(__msa_fcne_w(mem::transmute(a), mem::transmute(b)))
12767        );
12768    }
12769
12770    #[simd_test(enable = "msa")]
12771    unsafe fn test_msa_fcne_d() {
12772        #[rustfmt::skip]
12773        let a = f64x2::new(1.1, -2.2);
12774        #[rustfmt::skip]
12775        let b = f64x2::new(1.1, 1.1);
12776        #[rustfmt::skip]
12777        let r = i64x2::new(0, -1);
12778
12779        assert_eq!(
12780            r,
12781            mem::transmute(__msa_fcne_d(mem::transmute(a), mem::transmute(b)))
12782        );
12783    }
12784
12785    #[simd_test(enable = "msa")]
12786    unsafe fn test_msa_fcor_w() {
12787        #[rustfmt::skip]
12788        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12789        #[rustfmt::skip]
12790        let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
12791        #[rustfmt::skip]
12792        let r = i32x4::new(0, -1, -1, 0);
12793
12794        assert_eq!(
12795            r,
12796            mem::transmute(__msa_fcor_w(mem::transmute(a), mem::transmute(b)))
12797        );
12798    }
12799
12800    #[simd_test(enable = "msa")]
12801    unsafe fn test_msa_fcor_d() {
12802        #[rustfmt::skip]
12803        let a = f64x2::new(1.1, f64::NAN);
12804        #[rustfmt::skip]
12805        let b = f64x2::new(1.1, 1.1);
12806        #[rustfmt::skip]
12807        let r = i64x2::new(-1, 0);
12808
12809        assert_eq!(
12810            r,
12811            mem::transmute(__msa_fcor_d(mem::transmute(a), mem::transmute(b)))
12812        );
12813    }
12814
12815    #[simd_test(enable = "msa")]
12816    unsafe fn test_msa_fcueq_w() {
12817        #[rustfmt::skip]
12818        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12819        #[rustfmt::skip]
12820        let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
12821        #[rustfmt::skip]
12822        let r = i32x4::new(-1, 0, -1, -1);
12823
12824        assert_eq!(
12825            r,
12826            mem::transmute(__msa_fcueq_w(mem::transmute(a), mem::transmute(b)))
12827        );
12828    }
12829
12830    #[simd_test(enable = "msa")]
12831    unsafe fn test_msa_fcueq_d() {
12832        #[rustfmt::skip]
12833        let a = f64x2::new(1.1, f64::NAN);
12834        #[rustfmt::skip]
12835        let b = f64x2::new(1.1, 1.1);
12836        #[rustfmt::skip]
12837        let r = i64x2::new(-1, -1);
12838
12839        assert_eq!(
12840            r,
12841            mem::transmute(__msa_fcueq_d(mem::transmute(a), mem::transmute(b)))
12842        );
12843    }
12844
12845    #[simd_test(enable = "msa")]
12846    unsafe fn test_msa_fcule_w() {
12847        #[rustfmt::skip]
12848        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12849        #[rustfmt::skip]
12850        let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
12851        #[rustfmt::skip]
12852        let r = i32x4::new(-1, -1, -1, -1);
12853
12854        assert_eq!(
12855            r,
12856            mem::transmute(__msa_fcule_w(mem::transmute(a), mem::transmute(b)))
12857        );
12858    }
12859
12860    #[simd_test(enable = "msa")]
12861    unsafe fn test_msa_fcule_d() {
12862        #[rustfmt::skip]
12863        let a = f64x2::new(1.1, f64::NAN);
12864        #[rustfmt::skip]
12865        let b = f64x2::new(1.1, 1.1);
12866        #[rustfmt::skip]
12867        let r = i64x2::new(-1, -1);
12868
12869        assert_eq!(
12870            r,
12871            mem::transmute(__msa_fcule_d(mem::transmute(a), mem::transmute(b)))
12872        );
12873    }
12874
12875    #[simd_test(enable = "msa")]
12876    unsafe fn test_msa_fcult_w() {
12877        #[rustfmt::skip]
12878        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12879        #[rustfmt::skip]
12880        let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
12881        #[rustfmt::skip]
12882        let r = i32x4::new(-1, -1, 0, -1);
12883
12884        assert_eq!(
12885            r,
12886            mem::transmute(__msa_fcult_w(mem::transmute(a), mem::transmute(b)))
12887        );
12888    }
12889
12890    #[simd_test(enable = "msa")]
12891    unsafe fn test_msa_fcult_d() {
12892        #[rustfmt::skip]
12893        let a = f64x2::new(1.1, f64::NAN);
12894        #[rustfmt::skip]
12895        let b = f64x2::new(1.1, 1.1);
12896        #[rustfmt::skip]
12897        let r = i64x2::new(0, -1);
12898
12899        assert_eq!(
12900            r,
12901            mem::transmute(__msa_fcult_d(mem::transmute(a), mem::transmute(b)))
12902        );
12903    }
12904
12905    #[simd_test(enable = "msa")]
12906    unsafe fn test_msa_fcun_w() {
12907        #[rustfmt::skip]
12908        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12909        #[rustfmt::skip]
12910        let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
12911        #[rustfmt::skip]
12912        let r = i32x4::new(-1, 0, 0, -1);
12913
12914        assert_eq!(
12915            r,
12916            mem::transmute(__msa_fcun_w(mem::transmute(a), mem::transmute(b)))
12917        );
12918    }
12919
12920    #[simd_test(enable = "msa")]
12921    unsafe fn test_msa_fcun_d() {
12922        #[rustfmt::skip]
12923        let a = f64x2::new(1.1, f64::NAN);
12924        #[rustfmt::skip]
12925        let b = f64x2::new(1.1, 1.1);
12926        #[rustfmt::skip]
12927        let r = i64x2::new(0, -1);
12928
12929        assert_eq!(
12930            r,
12931            mem::transmute(__msa_fcun_d(mem::transmute(a), mem::transmute(b)))
12932        );
12933    }
12934
12935    #[simd_test(enable = "msa")]
12936    unsafe fn test_msa_fcune_w() {
12937        #[rustfmt::skip]
12938        let a = f32x4::new(1.1, -2.2, 3.3, f32::NAN);
12939        #[rustfmt::skip]
12940        let b = f32x4::new(f32::NAN, -1.2, 3.3, f32::NAN);
12941        #[rustfmt::skip]
12942        let r = i32x4::new(-1, -1, 0, -1);
12943
12944        assert_eq!(
12945            r,
12946            mem::transmute(__msa_fcune_w(mem::transmute(a), mem::transmute(b)))
12947        );
12948    }
12949
12950    #[simd_test(enable = "msa")]
12951    unsafe fn test_msa_fcune_d() {
12952        #[rustfmt::skip]
12953        let a = f64x2::new(1.1, f64::NAN);
12954        #[rustfmt::skip]
12955        let b = f64x2::new(1.1, 1.1);
12956        #[rustfmt::skip]
12957        let r = i64x2::new(0, -1);
12958
12959        assert_eq!(
12960            r,
12961            mem::transmute(__msa_fcune_d(mem::transmute(a), mem::transmute(b)))
12962        );
12963    }
12964
12965    #[simd_test(enable = "msa")]
12966    unsafe fn test_msa_fdiv_w() {
12967        #[rustfmt::skip]
12968        let a = f32x4::new(5.25, -20.2, 333.333, -425.0);
12969        #[rustfmt::skip]
12970        let b = f32x4::new(4.0, -2.1, 11.11, 8.2);
12971        #[rustfmt::skip]
12972        let r = f32x4::new(1.3125, 9.619048, 30.002972, -51.82927);
12973
12974        assert_eq!(
12975            r,
12976            mem::transmute(__msa_fdiv_w(mem::transmute(a), mem::transmute(b)))
12977        );
12978    }
12979
12980    #[simd_test(enable = "msa")]
12981    unsafe fn test_msa_fdiv_d() {
12982        #[rustfmt::skip]
12983        let a = f64x2::new(1111.11, -222222.2);
12984        #[rustfmt::skip]
12985        let b = f64x2::new(-4.85, 3.33);
12986        #[rustfmt::skip]
12987        let r = f64x2::new(-229.09484536082473, -66733.3933933934);
12988
12989        assert_eq!(
12990            r,
12991            mem::transmute(__msa_fdiv_d(mem::transmute(a), mem::transmute(b)))
12992        );
12993    }
12994
12995    /*// FIXME: 16-bit floats
12996    #[simd_test(enable = "msa")]
12997    unsafe fn test_msa_fexdo_h() {
12998        #[rustfmt::skip]
12999        let a = f32x4::new(20.5, 2.3, 4.5, 5.4);
13000        #[rustfmt::skip]
13001        let b = f32x4::new(1.1, 1.0, 1.0, 1.0);
13002        let r = i16x8::new(1, 9, 30, 51, 1, 9, 30, 51);
13003
13004        assert_eq!(r, mem::transmute(__msa_fexdo_h(mem::transmute(a), mem::transmute(b))));
13005    }*/
13006
13007    #[simd_test(enable = "msa")]
13008    unsafe fn test_msa_fexdo_w() {
13009        #[rustfmt::skip]
13010        let a = f64x2::new(2000005.5, 2.3);
13011        #[rustfmt::skip]
13012        let b = f64x2::new(1235689784512.1, 2147483649998.5);
13013        #[rustfmt::skip]
13014        let r = f32x4::new(
13015            1235689800000.0, 2147483600000.0,
13016            2000005.5, 2.3
13017        );
13018
13019        assert_eq!(
13020            r,
13021            mem::transmute(__msa_fexdo_w(mem::transmute(a), mem::transmute(b)))
13022        );
13023    }
13024
13025    #[simd_test(enable = "msa")]
13026    unsafe fn test_msa_fexp2_w() {
13027        #[rustfmt::skip]
13028        let a = f32x4::new(1.1, -2.2, 3.3, -4.4);
13029        #[rustfmt::skip]
13030        let b = i32x4::new(4, -3, 2, 1);
13031        #[rustfmt::skip]
13032        let r = f32x4::new(17.6, -0.275, 13.2, -8.8);
13033
13034        assert_eq!(
13035            r,
13036            mem::transmute(__msa_fexp2_w(mem::transmute(a), mem::transmute(b)))
13037        );
13038    }
13039
13040    #[simd_test(enable = "msa")]
13041    unsafe fn test_msa_fexp2_d() {
13042        #[rustfmt::skip]
13043        let a = f64x2::new(1.1, -2.2);
13044        #[rustfmt::skip]
13045        let b = i64x2::new(-4, 3);
13046        #[rustfmt::skip]
13047        let r = f64x2::new(0.06875, -17.6);
13048
13049        assert_eq!(
13050            r,
13051            mem::transmute(__msa_fexp2_d(mem::transmute(a), mem::transmute(b)))
13052        );
13053    }
13054
13055    // FIXME: 16-bit floats
13056    // #[simd_test(enable = "msa")]
13057    // unsafe fn test_msa_fexupl_w() {
13058    //     #[rustfmt::skip]
13059    //     let a = f16x8(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5);
13060    //     #[rustfmt::skip]
13061    //     let r = f32x4::new(5.5, 6.5, 7.5, 8.5);
13062
13063    //     assert_eq!(r, mem::transmute(__msa_fexupl_w(mem::transmute(a))));
13064    // }
13065
13066    #[simd_test(enable = "msa")]
13067    unsafe fn test_msa_fexupl_d() {
13068        #[rustfmt::skip]
13069        let a = f32x4::new(5.5, 6.5, 7.5, 8.5);
13070        #[rustfmt::skip]
13071        let r = f64x2::new(7.5, 8.5);
13072
13073        assert_eq!(r, mem::transmute(__msa_fexupl_d(mem::transmute(a))));
13074    }
13075
13076    // FIXME: 16-bit floats
13077    //     #[simd_test(enable = "msa")]
13078    // unsafe fn test_msa_fexupr_w() {
13079    //     #[rustfmt::skip]
13080    //     let a = f16x8(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5);
13081    //     #[rustfmt::skip]
13082    //     let r = f32x4::new(1.5, 2.5, 3.5, 4.5);
13083
13084    //     assert_eq!(r, mem::transmute(__msa_fexupr_w(mem::transmute(a))));
13085    // }
13086
13087    #[simd_test(enable = "msa")]
13088    unsafe fn test_msa_fexupr_d() {
13089        #[rustfmt::skip]
13090        let a = f32x4::new(5.5, 6.5, 7.5, 8.5);
13091        #[rustfmt::skip]
13092        let r = f64x2::new(5.5, 6.5);
13093
13094        assert_eq!(r, mem::transmute(__msa_fexupr_d(mem::transmute(a))));
13095    }
13096
13097    #[simd_test(enable = "msa")]
13098    unsafe fn test_msa_ffint_s_w() {
13099        #[rustfmt::skip]
13100        let a = i32x4::new(-1, 2, -3, 4);
13101        #[rustfmt::skip]
13102        let r = f32x4::new(-1.0, 2.0, -3.0, 4.0);
13103
13104        assert_eq!(r, mem::transmute(__msa_ffint_s_w(mem::transmute(a))));
13105    }
13106
13107    #[simd_test(enable = "msa")]
13108    unsafe fn test_msa_ffint_s_d() {
13109        #[rustfmt::skip]
13110        let a = i64x2::new(-1, 2);
13111        #[rustfmt::skip]
13112        let r = f64x2::new(-1.0,     2.0);
13113
13114        assert_eq!(r, mem::transmute(__msa_ffint_s_d(mem::transmute(a))));
13115    }
13116
13117    #[simd_test(enable = "msa")]
13118    unsafe fn test_msa_ffint_u_w() {
13119        #[rustfmt::skip]
13120        let a = u32x4::new(1, 2, 3, 4);
13121        #[rustfmt::skip]
13122        let r = f32x4::new(1.0, 2.0, 3.0, 4.0);
13123
13124        assert_eq!(r, mem::transmute(__msa_ffint_u_w(mem::transmute(a))));
13125    }
13126
13127    #[simd_test(enable = "msa")]
13128    unsafe fn test_msa_ffint_u_d() {
13129        #[rustfmt::skip]
13130        let a = u64x2::new(1, 2);
13131        #[rustfmt::skip]
13132        let r = f64x2::new(1.0, 2.0);
13133
13134        assert_eq!(r, mem::transmute(__msa_ffint_u_d(mem::transmute(a))));
13135    }
13136
13137    #[simd_test(enable = "msa")]
13138    unsafe fn test_msa_ffql_w() {
13139        #[rustfmt::skip]
13140        let a = i16x8::new(11, 25, 33, 47, 11, 25, 33, 47);
13141        #[rustfmt::skip]
13142        let r = f32x4::new(
13143            0.00033569336, 0.00076293945,
13144            0.0010070801, 0.0014343262
13145        );
13146
13147        assert_eq!(r, mem::transmute(__msa_ffql_w(mem::transmute(a))));
13148    }
13149
13150    #[simd_test(enable = "msa")]
13151    unsafe fn test_msa_ffql_d() {
13152        #[rustfmt::skip]
13153        let a = i32x4::new(1111, 2222, 3333, 4444);
13154        #[rustfmt::skip]
13155        let r = f64x2::new(
13156            0.000001552049070596695,
13157            0.0000020693987607955933
13158        );
13159
13160        assert_eq!(r, mem::transmute(__msa_ffql_d(mem::transmute(a))));
13161    }
13162
13163    #[simd_test(enable = "msa")]
13164    unsafe fn test_msa_ffqr_w() {
13165        #[rustfmt::skip]
13166        let a = i16x8::new(12, 26, 34, 48, 11, 25, 33, 47);
13167        #[rustfmt::skip]
13168        let r = f32x4::new(
13169            0.00036621094, 0.00079345703,
13170            0.0010375977, 0.0014648438
13171        );
13172
13173        assert_eq!(r, mem::transmute(__msa_ffqr_w(mem::transmute(a))));
13174    }
13175
13176    #[simd_test(enable = "msa")]
13177    unsafe fn test_msa_ffqr_d() {
13178        #[rustfmt::skip]
13179        let a = i32x4::new(1111, 2555, 3333, 475);
13180        #[rustfmt::skip]
13181        let r = f64x2::new(
13182            0.0000005173496901988983,
13183            0.0000011897645890712738
13184        );
13185
13186        assert_eq!(r, mem::transmute(__msa_ffqr_d(mem::transmute(a))));
13187    }
13188
13189    #[simd_test(enable = "msa")]
13190    unsafe fn test_msa_fill_b() {
13191        #[rustfmt::skip]
13192        let r = i8x16::new(
13193            2, 2, 2, 2,
13194            2, 2, 2, 2,
13195            2, 2, 2, 2,
13196            2, 2, 2, 2
13197        );
13198
13199        assert_eq!(r, mem::transmute(__msa_fill_b(2)));
13200    }
13201
13202    #[simd_test(enable = "msa")]
13203    unsafe fn test_msa_fill_h() {
13204        #[rustfmt::skip]
13205        let r = i16x8::new(2, 2, 2, 2, 2, 2, 2, 2);
13206
13207        assert_eq!(r, mem::transmute(__msa_fill_h(2)));
13208    }
13209
13210    #[simd_test(enable = "msa")]
13211    unsafe fn test_msa_fill_w() {
13212        #[rustfmt::skip]
13213        let r = i32x4::new(2, 2, 2, 2);
13214
13215        assert_eq!(r, mem::transmute(__msa_fill_w(2)));
13216    }
13217
13218    #[simd_test(enable = "msa")]
13219    unsafe fn test_msa_fill_d() {
13220        #[rustfmt::skip]
13221        let r = i64x2::new(2, 2);
13222
13223        assert_eq!(r, mem::transmute(__msa_fill_d(2)));
13224    }
13225
13226    #[simd_test(enable = "msa")]
13227    unsafe fn test_msa_flog2_w() {
13228        #[rustfmt::skip]
13229        let a = f32x4::new(8.0, 16.0, 32.0, 64.0);
13230        #[rustfmt::skip]
13231        let r = f32x4::new(3.0, 4.0, 5.0, 6.0);
13232
13233        assert_eq!(r, mem::transmute(__msa_flog2_w(mem::transmute(a))));
13234    }
13235
13236    #[simd_test(enable = "msa")]
13237    unsafe fn test_msa_flog2_d() {
13238        #[rustfmt::skip]
13239        let a = f64x2::new(8.0, 16.0);
13240        #[rustfmt::skip]
13241        let r = f64x2::new(3.0, 4.0);
13242
13243        assert_eq!(r, mem::transmute(__msa_flog2_d(mem::transmute(a))));
13244    }
13245
13246    #[simd_test(enable = "msa")]
13247    unsafe fn test_msa_fmadd_w() {
13248        #[rustfmt::skip]
13249        let a = f32x4::new(1.0, 2.0, 3.0, 4.0);
13250        #[rustfmt::skip]
13251        let b = f32x4::new(5.0, 6.0, 7.0, 8.0);
13252        #[rustfmt::skip]
13253        let c = f32x4::new(9.0, 10.0, 11.0, 12.0);
13254        #[rustfmt::skip]
13255        let r = f32x4::new(46.0, 62.0, 80.0, 100.0);
13256
13257        assert_eq!(
13258            r,
13259            mem::transmute(__msa_fmadd_w(
13260                mem::transmute(a),
13261                mem::transmute(b),
13262                mem::transmute(c)
13263            ))
13264        );
13265    }
13266
13267    #[simd_test(enable = "msa")]
13268    unsafe fn test_msa_fmadd_d() {
13269        #[rustfmt::skip]
13270        let a = f64x2::new(1.0, 2.0);
13271        #[rustfmt::skip]
13272        let b = f64x2::new(3.0, 4.0);
13273        #[rustfmt::skip]
13274        let c = f64x2::new(5.0, 6.0);
13275        #[rustfmt::skip]
13276        let r = f64x2::new(16.0, 26.0);
13277
13278        assert_eq!(
13279            r,
13280            mem::transmute(__msa_fmadd_d(
13281                mem::transmute(a),
13282                mem::transmute(b),
13283                mem::transmute(c)
13284            ))
13285        );
13286    }
13287
13288    #[simd_test(enable = "msa")]
13289    unsafe fn test_msa_fmax_w() {
13290        #[rustfmt::skip]
13291        let a = f32x4::new(1.0, -6.0, 7.0, 8.0);
13292        #[rustfmt::skip]
13293        let b = f32x4::new(5.0, -2.0, 3.0, 4.0);
13294        #[rustfmt::skip]
13295        let r = f32x4::new(5.0, -2.0, 7.0, 8.0);
13296
13297        assert_eq!(
13298            r,
13299            mem::transmute(__msa_fmax_w(mem::transmute(a), mem::transmute(b)))
13300        );
13301    }
13302
13303    #[simd_test(enable = "msa")]
13304    unsafe fn test_msa_fmax_d() {
13305        #[rustfmt::skip]
13306        let a = f64x2::new(1.0, 4.0);
13307        #[rustfmt::skip]
13308        let b = f64x2::new(3.0, 2.0);
13309        #[rustfmt::skip]
13310        let r = f64x2::new(3.0, 4.0);
13311
13312        assert_eq!(
13313            r,
13314            mem::transmute(__msa_fmax_d(mem::transmute(a), mem::transmute(b)))
13315        );
13316    }
13317
13318    #[simd_test(enable = "msa")]
13319    unsafe fn test_msa_fmax_a_w() {
13320        #[rustfmt::skip]
13321        let a = f32x4::new(1.0, -6.0, -7.0, -8.0);
13322        #[rustfmt::skip]
13323        let b = f32x4::new(5.0, -2.0, 3.0, 4.0);
13324        #[rustfmt::skip]
13325        let r = f32x4::new(5.0, -6.0, -7.0, -8.0);
13326
13327        assert_eq!(
13328            r,
13329            mem::transmute(__msa_fmax_a_w(mem::transmute(a), mem::transmute(b)))
13330        );
13331    }
13332
13333    #[simd_test(enable = "msa")]
13334    unsafe fn test_msa_fmax_a_d() {
13335        #[rustfmt::skip]
13336        let a = f64x2::new(1.0, -4.0);
13337        #[rustfmt::skip]
13338        let b = f64x2::new(3.0, 2.0);
13339        #[rustfmt::skip]
13340        let r = f64x2::new(3.0, -4.0);
13341
13342        assert_eq!(
13343            r,
13344            mem::transmute(__msa_fmax_a_d(mem::transmute(a), mem::transmute(b)))
13345        );
13346    }
13347
13348    #[simd_test(enable = "msa")]
13349    unsafe fn test_msa_fmin_w() {
13350        #[rustfmt::skip]
13351        let a = f32x4::new(1.0, -6.0, 7.0, 8.0);
13352        #[rustfmt::skip]
13353        let b = f32x4::new(5.0, -2.0, 3.0, 4.0);
13354        #[rustfmt::skip]
13355        let r = f32x4::new(1.0, -6.0, 3.0, 4.0);
13356
13357        assert_eq!(
13358            r,
13359            mem::transmute(__msa_fmin_w(mem::transmute(a), mem::transmute(b)))
13360        );
13361    }
13362
13363    #[simd_test(enable = "msa")]
13364    unsafe fn test_msa_fmin_d() {
13365        #[rustfmt::skip]
13366        let a = f64x2::new(1.0, 4.0);
13367        #[rustfmt::skip]
13368        let b = f64x2::new(3.0, 2.0);
13369        #[rustfmt::skip]
13370        let r = f64x2::new(1.0, 2.0);
13371
13372        assert_eq!(
13373            r,
13374            mem::transmute(__msa_fmin_d(mem::transmute(a), mem::transmute(b)))
13375        );
13376    }
13377
13378    #[simd_test(enable = "msa")]
13379    unsafe fn test_msa_fmin_a_w() {
13380        #[rustfmt::skip]
13381        let a = f32x4::new(1.0, -6.0, -7.0, -8.0);
13382        #[rustfmt::skip]
13383        let b = f32x4::new(5.0, -2.0, 3.0, 4.0);
13384        #[rustfmt::skip]
13385        let r = f32x4::new(1.0, -2.0, 3.0, 4.0);
13386
13387        assert_eq!(
13388            r,
13389            mem::transmute(__msa_fmin_a_w(mem::transmute(a), mem::transmute(b)))
13390        );
13391    }
13392
13393    #[simd_test(enable = "msa")]
13394    unsafe fn test_msa_fmin_a_d() {
13395        #[rustfmt::skip]
13396        let a = f64x2::new(1.0, -4.0);
13397        #[rustfmt::skip]
13398        let b = f64x2::new(3.0, 2.0);
13399        #[rustfmt::skip]
13400        let r = f64x2::new(1.0, 2.0);
13401
13402        assert_eq!(
13403            r,
13404            mem::transmute(__msa_fmin_a_d(mem::transmute(a), mem::transmute(b)))
13405        );
13406    }
13407
13408    #[simd_test(enable = "msa")]
13409    unsafe fn test_msa_fmsub_w() {
13410        #[rustfmt::skip]
13411        let a = f32x4::new(1.0, 2.0, 3.0, 4.0);
13412        #[rustfmt::skip]
13413        let b = f32x4::new(5.0, 6.0, 7.0, 8.0);
13414        #[rustfmt::skip]
13415        let c = f32x4::new(9.0, 10.0, 11.0, 12.0);
13416        #[rustfmt::skip]
13417        let r = f32x4::new(-44.0, -58.0, -74.0, -92.0);
13418
13419        assert_eq!(
13420            r,
13421            mem::transmute(__msa_fmsub_w(
13422                mem::transmute(a),
13423                mem::transmute(b),
13424                mem::transmute(c)
13425            ))
13426        );
13427    }
13428
13429    #[simd_test(enable = "msa")]
13430    unsafe fn test_msa_fmsub_d() {
13431        #[rustfmt::skip]
13432        let a = f64x2::new(1.0, 2.0);
13433        #[rustfmt::skip]
13434        let b = f64x2::new(3.0, 4.0);
13435        #[rustfmt::skip]
13436        let c = f64x2::new(5.0, 6.0);
13437        #[rustfmt::skip]
13438        let r = f64x2::new(-14.0, -22.0);
13439
13440        assert_eq!(
13441            r,
13442            mem::transmute(__msa_fmsub_d(
13443                mem::transmute(a),
13444                mem::transmute(b),
13445                mem::transmute(c)
13446            ))
13447        );
13448    }
13449
13450    #[simd_test(enable = "msa")]
13451    unsafe fn test_msa_fmul_w() {
13452        #[rustfmt::skip]
13453        let a = f32x4::new(1.1, -2.2, 3.3, 4.4);
13454        #[rustfmt::skip]
13455        let b = f32x4::new(4.4, 3.3, 2.2, -1.1);
13456        #[rustfmt::skip]
13457        let r = f32x4::new(4.84, -7.26, 7.26, -4.84);
13458
13459        assert_eq!(
13460            r,
13461            mem::transmute(__msa_fmul_w(mem::transmute(a), mem::transmute(b)))
13462        );
13463    }
13464
13465    #[simd_test(enable = "msa")]
13466    unsafe fn test_msa_fmul_d() {
13467        #[rustfmt::skip]
13468        let a = f64x2::new(1.1, -2.2);
13469        #[rustfmt::skip]
13470        let b = f64x2::new(4.0, -3.3);
13471        #[rustfmt::skip]
13472        let r = f64x2::new(4.4, 7.26);
13473
13474        assert_eq!(
13475            r,
13476            mem::transmute(__msa_fmul_d(mem::transmute(a), mem::transmute(b)))
13477        );
13478    }
13479
13480    #[simd_test(enable = "msa")]
13481    unsafe fn test_msa_frint_w() {
13482        #[rustfmt::skip]
13483        let a = f32x4::new(2.6, -2.7, 1.3, -1.7);
13484        #[rustfmt::skip]
13485        let r = f32x4::new(3.0, -3.0, 1.0, -2.0);
13486
13487        assert_eq!(r, mem::transmute(__msa_frint_w(mem::transmute(a))));
13488    }
13489
13490    #[simd_test(enable = "msa")]
13491    unsafe fn test_msa_frint_d() {
13492        #[rustfmt::skip]
13493        let a = f64x2::new(2.6, 1.3);
13494        #[rustfmt::skip]
13495        let r = f64x2::new(3.0, 1.0);
13496
13497        assert_eq!(r, mem::transmute(__msa_frint_d(mem::transmute(a))));
13498    }
13499
13500    #[simd_test(enable = "msa")]
13501    unsafe fn test_msa_frcp_w() {
13502        #[rustfmt::skip]
13503        let a = f32x4::new(2.6, -2.7, 1.3, -1.7);
13504        #[rustfmt::skip]
13505        let r = f32x4::new(
13506            0.3846154, -0.37037036,
13507            0.7692308, -0.58823526
13508        );
13509
13510        assert_eq!(r, mem::transmute(__msa_frcp_w(mem::transmute(a))));
13511    }
13512
13513    #[simd_test(enable = "msa")]
13514    unsafe fn test_msa_frcp_d() {
13515        #[rustfmt::skip]
13516        let a = f64x2::new(2.6, 1.3);
13517        #[rustfmt::skip]
13518        let r = f64x2::new(0.3846153846153846, 0.7692307692307692);
13519
13520        assert_eq!(r, mem::transmute(__msa_frcp_d(mem::transmute(a))));
13521    }
13522
13523    #[simd_test(enable = "msa")]
13524    unsafe fn test_msa_frsqrt_w() {
13525        #[rustfmt::skip]
13526        let a = f32x4::new(2.6, 2.7, 1.3, 1.7);
13527        #[rustfmt::skip]
13528        let r = f32x4::new(
13529            0.6201737, 0.6085806,
13530            0.87705797, 0.766965
13531        );
13532
13533        assert_eq!(r, mem::transmute(__msa_frsqrt_w(mem::transmute(a))));
13534    }
13535
13536    #[simd_test(enable = "msa")]
13537    unsafe fn test_msa_frsqrt_d() {
13538        #[rustfmt::skip]
13539        let a = f64x2::new(2.6, 1.3);
13540        #[rustfmt::skip]
13541        let r = f64x2::new(0.6201736729460422, 0.8770580193070292);
13542
13543        assert_eq!(r, mem::transmute(__msa_frsqrt_d(mem::transmute(a))));
13544    }
13545
13546    #[simd_test(enable = "msa")]
13547    unsafe fn test_msa_fsaf_w() {
13548        #[rustfmt::skip]
13549        let a = f32x4::new(-5.5, 5.5, 5.5, 5.5);
13550        #[rustfmt::skip]
13551        let b = f32x4::new(-5.5, 5.5, 5.5, 5.5);
13552        #[rustfmt::skip]
13553        let r = i32x4::new(0, 0, 0, 0);
13554
13555        assert_eq!(
13556            r,
13557            mem::transmute(__msa_fsaf_w(mem::transmute(a), mem::transmute(b)))
13558        );
13559    }
13560
13561    #[simd_test(enable = "msa")]
13562    unsafe fn test_msa_fsaf_d() {
13563        #[rustfmt::skip]
13564        let a = f64x2::new(-125.5, 5.5);
13565        #[rustfmt::skip]
13566        let b = f64x2::new(125.5, 3.3);
13567        #[rustfmt::skip]
13568        let r = i64x2::new(0, 0);
13569
13570        assert_eq!(
13571            r,
13572            mem::transmute(__msa_fsaf_d(mem::transmute(a), mem::transmute(b)))
13573        );
13574    }
13575
13576    #[simd_test(enable = "msa")]
13577    unsafe fn test_msa_fseq_w() {
13578        #[rustfmt::skip]
13579        let a = f32x4::new(-5.5, -3.3, f32::NAN, f32::NAN);
13580        #[rustfmt::skip]
13581        let b = f32x4::new(5.5, -3.3, f32::NAN, 1.1);
13582        #[rustfmt::skip]
13583        let r = i32x4::new(0, -1, 0, 0);
13584
13585        assert_eq!(
13586            r,
13587            mem::transmute(__msa_fseq_w(mem::transmute(a), mem::transmute(b)))
13588        );
13589    }
13590
13591    #[simd_test(enable = "msa")]
13592    unsafe fn test_msa_fseq_d() {
13593        #[rustfmt::skip]
13594        let a = f64x2::new(-125.5, 5.5);
13595        #[rustfmt::skip]
13596        let b = f64x2::new(125.5, 5.5);
13597        #[rustfmt::skip]
13598        let r = i64x2::new(0, -1);
13599
13600        assert_eq!(
13601            r,
13602            mem::transmute(__msa_fseq_d(mem::transmute(a), mem::transmute(b)))
13603        );
13604    }
13605
13606    #[simd_test(enable = "msa")]
13607    unsafe fn test_msa_fsle_w() {
13608        #[rustfmt::skip]
13609        let a = f32x4::new(5.5, 5.5, 5.5, f32::NAN);
13610        #[rustfmt::skip]
13611        let b = f32x4::new(-5.5, 3.3, 5.5, f32::NAN);
13612        #[rustfmt::skip]
13613        let r = i32x4::new(0, 0, -1, 0);
13614
13615        assert_eq!(
13616            r,
13617            mem::transmute(__msa_fsle_w(mem::transmute(a), mem::transmute(b)))
13618        );
13619    }
13620
13621    #[simd_test(enable = "msa")]
13622    unsafe fn test_msa_fsle_d() {
13623        #[rustfmt::skip]
13624        let a = f64x2::new(-125.5, 5.5);
13625        #[rustfmt::skip]
13626        let b = f64x2::new(125.5, 3.3);
13627        #[rustfmt::skip]
13628        let r = i64x2::new(-1, 0);
13629
13630        assert_eq!(
13631            r,
13632            mem::transmute(__msa_fsle_d(mem::transmute(a), mem::transmute(b)))
13633        );
13634    }
13635
13636    #[simd_test(enable = "msa")]
13637    unsafe fn test_msa_fslt_w() {
13638        #[rustfmt::skip]
13639        let a = f32x4::new(-5.5, 5.5, 5.5, 5.5);
13640        #[rustfmt::skip]
13641        let b = f32x4::new(5.5, 3.3, 5.5, 1.1);
13642        #[rustfmt::skip]
13643        let r = i32x4::new(-1, 0, 0, 0);
13644
13645        assert_eq!(
13646            r,
13647            mem::transmute(__msa_fslt_w(mem::transmute(a), mem::transmute(b)))
13648        );
13649    }
13650
13651    #[simd_test(enable = "msa")]
13652    unsafe fn test_msa_fslt_d() {
13653        #[rustfmt::skip]
13654        let a = f64x2::new(-125.5, 5.5);
13655        #[rustfmt::skip]
13656        let b = f64x2::new(125.5, 3.3);
13657        #[rustfmt::skip]
13658        let r = i64x2::new(-1, 0);
13659
13660        assert_eq!(
13661            r,
13662            mem::transmute(__msa_fslt_d(mem::transmute(a), mem::transmute(b)))
13663        );
13664    }
13665
13666    #[simd_test(enable = "msa")]
13667    unsafe fn test_msa_fsne_w() {
13668        #[rustfmt::skip]
13669        let a = f32x4::new(-5.5, 5.5, 5.5, 5.5);
13670        #[rustfmt::skip]
13671        let b = f32x4::new(5.5, 3.3, 5.5, 1.1);
13672        #[rustfmt::skip]
13673        let r = i32x4::new(-1, -1, 0, -1);
13674
13675        assert_eq!(
13676            r,
13677            mem::transmute(__msa_fsne_w(mem::transmute(a), mem::transmute(b)))
13678        );
13679    }
13680
13681    #[simd_test(enable = "msa")]
13682    unsafe fn test_msa_fsne_d() {
13683        #[rustfmt::skip]
13684        let a = f64x2::new(-125.5, 5.5);
13685        #[rustfmt::skip]
13686        let b = f64x2::new(125.5, 5.5);
13687        #[rustfmt::skip]
13688        let r = i64x2::new(-1, 0);
13689
13690        assert_eq!(
13691            r,
13692            mem::transmute(__msa_fsne_d(mem::transmute(a), mem::transmute(b)))
13693        );
13694    }
13695
13696    #[simd_test(enable = "msa")]
13697    unsafe fn test_msa_fsor_w() {
13698        #[rustfmt::skip]
13699        let a = f32x4::new(-5.5, f32::NAN, 5.5, 5.5);
13700        #[rustfmt::skip]
13701        let b = f32x4::new(5.5, 3.3, 5.5, 1.1);
13702        #[rustfmt::skip]
13703        let r = i32x4::new(-1, 0, -1, -1);
13704
13705        assert_eq!(
13706            r,
13707            mem::transmute(__msa_fsor_w(mem::transmute(a), mem::transmute(b)))
13708        );
13709    }
13710
13711    #[simd_test(enable = "msa")]
13712    unsafe fn test_msa_fsor_d() {
13713        #[rustfmt::skip]
13714        let a = f64x2::new(-125.5, 5.5);
13715        #[rustfmt::skip]
13716        let b = f64x2::new(125.5, f64::NAN);
13717        #[rustfmt::skip]
13718        let r = i64x2::new(-1, 0);
13719
13720        assert_eq!(
13721            r,
13722            mem::transmute(__msa_fsor_d(mem::transmute(a), mem::transmute(b)))
13723        );
13724    }
13725
13726    #[simd_test(enable = "msa")]
13727    unsafe fn test_msa_fsqrt_w() {
13728        #[rustfmt::skip]
13729        let a = f32x4::new(9.0, 81.0, 1089.0, 10000.0);
13730        #[rustfmt::skip]
13731        let r = f32x4::new(3.0, 9.0, 33.0, 100.0);
13732
13733        assert_eq!(r, mem::transmute(__msa_fsqrt_w(mem::transmute(a))));
13734    }
13735
13736    #[simd_test(enable = "msa")]
13737    unsafe fn test_msa_fsqrt_d() {
13738        #[rustfmt::skip]
13739        let a = f64x2::new(81.0, 10000.0);
13740        #[rustfmt::skip]
13741        let r = f64x2::new(9.0, 100.0);
13742
13743        assert_eq!(r, mem::transmute(__msa_fsqrt_d(mem::transmute(a))));
13744    }
13745
13746    #[simd_test(enable = "msa")]
13747    unsafe fn test_msa_fsub_w() {
13748        #[rustfmt::skip]
13749        let a = f32x4::new(5.5, 6.5, 7.5, 8.5);
13750        #[rustfmt::skip]
13751        let b = f32x4::new(1.25, 1.75, 2.25, 2.75);
13752        #[rustfmt::skip]
13753        let r = f32x4::new(4.25, 4.75, 5.25, 5.75);
13754
13755        assert_eq!(
13756            r,
13757            mem::transmute(__msa_fsub_w(mem::transmute(a), mem::transmute(b)))
13758        );
13759    }
13760
13761    #[simd_test(enable = "msa")]
13762    unsafe fn test_msa_fsub_d() {
13763        #[rustfmt::skip]
13764        let a = f64x2::new(555.5, 55.5);
13765        #[rustfmt::skip]
13766        let b = f64x2::new(4.25, 3.25);
13767        #[rustfmt::skip]
13768        let r = f64x2::new(551.25, 52.25);
13769
13770        assert_eq!(
13771            r,
13772            mem::transmute(__msa_fsub_d(mem::transmute(a), mem::transmute(b)))
13773        );
13774    }
13775
13776    #[simd_test(enable = "msa")]
13777    unsafe fn test_msa_fsueq_w() {
13778        #[rustfmt::skip]
13779        let a = f32x4::new(5.5, f32::NAN, 5.5, 5.5);
13780        #[rustfmt::skip]
13781        let b = f32x4::new(5.5, 5.5, -5.5, 5.5);
13782        #[rustfmt::skip]
13783        let r = i32x4::new(-1, -1, 0, -1);
13784
13785        assert_eq!(
13786            r,
13787            mem::transmute(__msa_fsueq_w(mem::transmute(a), mem::transmute(b)))
13788        );
13789    }
13790
13791    #[simd_test(enable = "msa")]
13792    unsafe fn test_msa_fsueq_d() {
13793        #[rustfmt::skip]
13794        let a = f64x2::new(-5.5, 5.5);
13795        #[rustfmt::skip]
13796        let b = f64x2::new(5.5, f64::NAN);
13797        #[rustfmt::skip]
13798        let r = i64x2::new(0, -1);
13799
13800        assert_eq!(
13801            r,
13802            mem::transmute(__msa_fsueq_d(mem::transmute(a), mem::transmute(b)))
13803        );
13804    }
13805
13806    #[simd_test(enable = "msa")]
13807    unsafe fn test_msa_fsule_w() {
13808        #[rustfmt::skip]
13809        let a = f32x4::new(5.7, 5.8, 5.9, f32::NAN);
13810        #[rustfmt::skip]
13811        let b = f32x4::new(5.6, 5.9, 5.9, f32::NAN);
13812        #[rustfmt::skip]
13813        let r = i32x4::new(0, -1, -1, -1);
13814
13815        assert_eq!(
13816            r,
13817            mem::transmute(__msa_fsule_w(mem::transmute(a), mem::transmute(b)))
13818        );
13819    }
13820
13821    #[simd_test(enable = "msa")]
13822    unsafe fn test_msa_fsule_d() {
13823        #[rustfmt::skip]
13824        let a = f64x2::new(5.5, 5.5);
13825        #[rustfmt::skip]
13826        let b = f64x2::new(5.5, 5.5);
13827        #[rustfmt::skip]
13828        let r = i64x2::new(-1, -1);
13829
13830        assert_eq!(
13831            r,
13832            mem::transmute(__msa_fsule_d(mem::transmute(a), mem::transmute(b)))
13833        );
13834    }
13835
13836    #[simd_test(enable = "msa")]
13837    unsafe fn test_msa_fsult_w() {
13838        #[rustfmt::skip]
13839        let a = f32x4::new(5.5, 5.5, 5.5, 5.5);
13840        #[rustfmt::skip]
13841        let b = f32x4::new(5.6, f32::NAN, 2.2, 1.1);
13842        #[rustfmt::skip]
13843        let r = i32x4::new(-1, -1, 0, 0);
13844
13845        assert_eq!(
13846            r,
13847            mem::transmute(__msa_fsult_w(mem::transmute(a), mem::transmute(b)))
13848        );
13849    }
13850
13851    #[simd_test(enable = "msa")]
13852    unsafe fn test_msa_fsult_d() {
13853        #[rustfmt::skip]
13854        let a = f64x2::new(5.5, f64::NAN);
13855        #[rustfmt::skip]
13856        let b = f64x2::new(4.4, 3.3);
13857        #[rustfmt::skip]
13858        let r = i64x2::new(0, -1);
13859
13860        assert_eq!(
13861            r,
13862            mem::transmute(__msa_fsult_d(mem::transmute(a), mem::transmute(b)))
13863        );
13864    }
13865
13866    #[simd_test(enable = "msa")]
13867    unsafe fn test_msa_fsun_w() {
13868        #[rustfmt::skip]
13869        let a = f32x4::new(5.5, 5.5, f32::NAN, 5.5);
13870        #[rustfmt::skip]
13871        let b = f32x4::new(4.4, 3.3, 2.2, f32::NAN);
13872        #[rustfmt::skip]
13873        let r = i32x4::new(0, 0, -1, -1);
13874
13875        assert_eq!(
13876            r,
13877            mem::transmute(__msa_fsun_w(mem::transmute(a), mem::transmute(b)))
13878        );
13879    }
13880
13881    #[simd_test(enable = "msa")]
13882    unsafe fn test_msa_fsun_d() {
13883        #[rustfmt::skip]
13884        let a = f64x2::new(5.5, f64::NAN);
13885        #[rustfmt::skip]
13886        let b = f64x2::new(4.4, 3.3);
13887        #[rustfmt::skip]
13888        let r = i64x2::new(0, -1);
13889
13890        assert_eq!(
13891            r,
13892            mem::transmute(__msa_fsun_d(mem::transmute(a), mem::transmute(b)))
13893        );
13894    }
13895
13896    #[simd_test(enable = "msa")]
13897    unsafe fn test_msa_fsune_w() {
13898        #[rustfmt::skip]
13899        let a = f32x4::new(5.5, 5.5, f32::NAN, 5.5);
13900        #[rustfmt::skip]
13901        let b = f32x4::new(4.4, 3.3, 2.2, 5.5);
13902        #[rustfmt::skip]
13903        let r = i32x4::new(-1, -1, -1, 0);
13904
13905        assert_eq!(
13906            r,
13907            mem::transmute(__msa_fsune_w(mem::transmute(a), mem::transmute(b)))
13908        );
13909    }
13910
13911    #[simd_test(enable = "msa")]
13912    unsafe fn test_msa_fsune_d() {
13913        #[rustfmt::skip]
13914        let a = f64x2::new(5.5, f64::NAN);
13915        #[rustfmt::skip]
13916        let b = f64x2::new(5.5, 3.3);
13917        #[rustfmt::skip]
13918        let r = i64x2::new(0, -1);
13919
13920        assert_eq!(
13921            r,
13922            mem::transmute(__msa_fsune_d(mem::transmute(a), mem::transmute(b)))
13923        );
13924    }
13925
13926    #[simd_test(enable = "msa")]
13927    unsafe fn test_msa_ftint_s_w() {
13928        #[rustfmt::skip]
13929        let a = f32x4::new(-5.5, 75.6, -1000.7, 1219.3);
13930        #[rustfmt::skip]
13931        let r = i32x4::new(-6, 76, -1001, 1219);
13932
13933        assert_eq!(r, mem::transmute(__msa_ftint_s_w(mem::transmute(a))));
13934    }
13935
13936    #[simd_test(enable = "msa")]
13937    unsafe fn test_msa_ftint_s_d() {
13938        #[rustfmt::skip]
13939        let a = f64x2::new(-5.5, 25656.4);
13940        #[rustfmt::skip]
13941        let r = i64x2::new(-6, 25656);
13942
13943        assert_eq!(r, mem::transmute(__msa_ftint_s_d(mem::transmute(a))));
13944    }
13945
13946    #[simd_test(enable = "msa")]
13947    unsafe fn test_msa_ftint_u_w() {
13948        #[rustfmt::skip]
13949        let a = f32x4::new(-5.5, 75.6, -1000.7, 1219.3);
13950        #[rustfmt::skip]
13951        let r = u32x4::new(0, 76, 0, 1219);
13952
13953        assert_eq!(r, mem::transmute(__msa_ftint_u_w(mem::transmute(a))));
13954    }
13955
13956    #[simd_test(enable = "msa")]
13957    unsafe fn test_msa_ftint_u_d() {
13958        #[rustfmt::skip]
13959        let a = f64x2::new(5.5, -25656.4);
13960        #[rustfmt::skip]
13961        let r = u64x2::new(6, 0);
13962
13963        assert_eq!(r, mem::transmute(__msa_ftint_u_d(mem::transmute(a))));
13964    }
13965
13966    #[simd_test(enable = "msa")]
13967    unsafe fn test_msa_ftq_h() {
13968        #[rustfmt::skip]
13969        let a = f32x4::new(0.00001, 0.0002, 0.00001, -0.0002);
13970        #[rustfmt::skip]
13971        let b = f32x4::new(0.0001, -0.002, 0.0001, 0.002);
13972        #[rustfmt::skip]
13973        let r = i16x8::new(3, -66, 3, 66, 0, 7, 0, -7);
13974
13975        assert_eq!(
13976            r,
13977            mem::transmute(__msa_ftq_h(mem::transmute(a), mem::transmute(b)))
13978        );
13979    }
13980
13981    #[simd_test(enable = "msa")]
13982    unsafe fn test_msa_ftq_w() {
13983        #[rustfmt::skip]
13984        let a = f64x2::new(0.00001, -0.0002);
13985        #[rustfmt::skip]
13986        let b = f64x2::new(0.00000045, 0.000015);
13987        #[rustfmt::skip]
13988        let r = i32x4::new(966, 32212, 21475, -429497);
13989
13990        assert_eq!(
13991            r,
13992            mem::transmute(__msa_ftq_w(mem::transmute(a), mem::transmute(b)))
13993        );
13994    }
13995
13996    #[simd_test(enable = "msa")]
13997    unsafe fn test_msa_ftrunc_s_w() {
13998        #[rustfmt::skip]
13999        let a = f32x4::new(-5.5, 75.6, -1000.7, 1219.3);
14000        #[rustfmt::skip]
14001        let r = i32x4::new(-5, 75, -1000, 1219);
14002
14003        assert_eq!(r, mem::transmute(__msa_ftrunc_s_w(mem::transmute(a))));
14004    }
14005
14006    #[simd_test(enable = "msa")]
14007    unsafe fn test_msa_ftrunc_s_d() {
14008        #[rustfmt::skip]
14009        let a = f64x2::new(-5.5, 25656.4);
14010        #[rustfmt::skip]
14011        let r = i64x2::new(-5, 25656);
14012
14013        assert_eq!(r, mem::transmute(__msa_ftrunc_s_d(mem::transmute(a))));
14014    }
14015
14016    #[simd_test(enable = "msa")]
14017    unsafe fn test_msa_ftrunc_u_w() {
14018        #[rustfmt::skip]
14019        let a = f32x4::new(-5.5, 75.6, -1000.7, 1219.3);
14020        #[rustfmt::skip]
14021        let r = u32x4::new(0, 75, 0, 1219);
14022
14023        assert_eq!(r, mem::transmute(__msa_ftrunc_u_w(mem::transmute(a))));
14024    }
14025
14026    #[simd_test(enable = "msa")]
14027    unsafe fn test_msa_ftrunc_u_d() {
14028        #[rustfmt::skip]
14029        let a = f64x2::new(5.5, -25656.4);
14030        #[rustfmt::skip]
14031        let r = u64x2::new(5, 0);
14032
14033        assert_eq!(r, mem::transmute(__msa_ftrunc_u_d(mem::transmute(a))));
14034    }
14035
14036    #[simd_test(enable = "msa")]
14037    unsafe fn test_msa_hadd_s_h() {
14038        #[rustfmt::skip]
14039        let a = i8x16::new(
14040            1, 2, 3, 4,
14041            -1, -2, -3, -4,
14042            1, 2, 3, 4,
14043            -1, -2, -3, -4
14044        );
14045        #[rustfmt::skip]
14046        let b = i8x16::new(
14047            4, 3, 2, 1,
14048            4, 3, 2, 1,
14049            4, 3, 2, 1,
14050            4, 3, 2, 1
14051        );
14052        #[rustfmt::skip]
14053        let r = i16x8::new(6, 6, 2, -2, 6, 6, 2, -2);
14054
14055        assert_eq!(
14056            r,
14057            mem::transmute(__msa_hadd_s_h(mem::transmute(a), mem::transmute(b)))
14058        );
14059    }
14060
14061    #[simd_test(enable = "msa")]
14062    unsafe fn test_msa_hadd_s_w() {
14063        #[rustfmt::skip]
14064        let a = i16x8::new(
14065            1, 2, 3, 4,
14066            -1, -2, -3, -4
14067        );
14068        #[rustfmt::skip]
14069        let b = i16x8::new(
14070            4, 3, 2, 1,
14071            4, 3, 2, 1
14072        );
14073        #[rustfmt::skip]
14074        let r = i32x4::new(6, 6, 2, -2);
14075
14076        assert_eq!(
14077            r,
14078            mem::transmute(__msa_hadd_s_w(mem::transmute(a), mem::transmute(b)))
14079        );
14080    }
14081
14082    #[simd_test(enable = "msa")]
14083    unsafe fn test_msa_hadd_s_d() {
14084        #[rustfmt::skip]
14085        let a = i32x4::new(1, -2, 3, -4);
14086        #[rustfmt::skip]
14087        let b = i32x4::new(4, 3, 2, 1);
14088        #[rustfmt::skip]
14089        let r = i64x2::new(2, -2);
14090
14091        assert_eq!(
14092            r,
14093            mem::transmute(__msa_hadd_s_d(mem::transmute(a), mem::transmute(b)))
14094        );
14095    }
14096
14097    #[simd_test(enable = "msa")]
14098    unsafe fn test_msa_hadd_u_h() {
14099        #[rustfmt::skip]
14100        let a = u8x16::new(
14101            1, 2, 3, 4,
14102            1, 2, 3, 4,
14103            1, 2, 3, 4,
14104            1, 2, 3, 4
14105        );
14106        #[rustfmt::skip]
14107        let b = u8x16::new(
14108            4, 3, 2, 1,
14109            4, 3, 2, 1,
14110            4, 3, 2, 1,
14111            4, 3, 2, 1
14112        );
14113        #[rustfmt::skip]
14114        let r = u16x8::new(6, 6, 6, 6, 6, 6, 6, 6);
14115
14116        assert_eq!(
14117            r,
14118            mem::transmute(__msa_hadd_u_h(mem::transmute(a), mem::transmute(b)))
14119        );
14120    }
14121
14122    #[simd_test(enable = "msa")]
14123    unsafe fn test_msa_hadd_u_w() {
14124        #[rustfmt::skip]
14125        let a = u16x8::new(
14126            1, 2, 3, 4,
14127            1, 2, 3, 4
14128        );
14129        #[rustfmt::skip]
14130        let b = u16x8::new(
14131            4, 3, 2, 1,
14132            4, 3, 2, 1
14133        );
14134        #[rustfmt::skip]
14135        let r = u32x4::new(6, 6, 6, 6);
14136
14137        assert_eq!(
14138            r,
14139            mem::transmute(__msa_hadd_u_w(mem::transmute(a), mem::transmute(b)))
14140        );
14141    }
14142
14143    #[simd_test(enable = "msa")]
14144    unsafe fn test_msa_hadd_u_d() {
14145        #[rustfmt::skip]
14146        let a = u32x4::new(1, 2, 3, 4);
14147        #[rustfmt::skip]
14148        let b = u32x4::new(4, 3, 2, 1);
14149        #[rustfmt::skip]
14150        let r = u64x2::new(6, 6);
14151
14152        assert_eq!(
14153            r,
14154            mem::transmute(__msa_hadd_u_d(mem::transmute(a), mem::transmute(b)))
14155        );
14156    }
14157
14158    #[simd_test(enable = "msa")]
14159    unsafe fn test_msa_hsub_s_h() {
14160        #[rustfmt::skip]
14161        let a = i8x16::new(
14162            1, 2, 3, 4,
14163            -1, -2, -3, -4,
14164            1, 2, 3, 4,
14165            -1, -2, -3, -4
14166        );
14167        #[rustfmt::skip]
14168        let b = i8x16::new(
14169            4, 3, 2, 1,
14170            4, 3, 2, 1,
14171            4, 3, 2, 1,
14172            4, 3, 2, 1
14173        );
14174        #[rustfmt::skip]
14175        let r = i16x8::new(-2, 2, -6, -6, -2, 2, -6, -6);
14176
14177        assert_eq!(
14178            r,
14179            mem::transmute(__msa_hsub_s_h(mem::transmute(a), mem::transmute(b)))
14180        );
14181    }
14182
14183    #[simd_test(enable = "msa")]
14184    unsafe fn test_msa_hsub_s_w() {
14185        #[rustfmt::skip]
14186        let a = i16x8::new(
14187            1, 2, 3, 4,
14188            -1, -2, -3, -4
14189        );
14190        #[rustfmt::skip]
14191        let b = i16x8::new(
14192            4, 3, 2, 1,
14193            4, 3, 2, 1
14194        );
14195        #[rustfmt::skip]
14196        let r = i32x4::new(-2, 2, -6, -6);
14197
14198        assert_eq!(
14199            r,
14200            mem::transmute(__msa_hsub_s_w(mem::transmute(a), mem::transmute(b)))
14201        );
14202    }
14203
14204    #[simd_test(enable = "msa")]
14205    unsafe fn test_msa_hsub_s_d() {
14206        #[rustfmt::skip]
14207        let a = i32x4::new(1, -2, 3, -4);
14208        #[rustfmt::skip]
14209        let b = i32x4::new(4, 3, 2, 1);
14210        #[rustfmt::skip]
14211        let r = i64x2::new(-6, -6);
14212
14213        assert_eq!(
14214            r,
14215            mem::transmute(__msa_hsub_s_d(mem::transmute(a), mem::transmute(b)))
14216        );
14217    }
14218
14219    #[simd_test(enable = "msa")]
14220    unsafe fn test_msa_hsub_u_h() {
14221        #[rustfmt::skip]
14222        let a = u8x16::new(
14223            1, 2, 3, 4,
14224            1, 2, 3, 4,
14225            1, 2, 3, 4,
14226            1, 2, 3, 4
14227        );
14228        #[rustfmt::skip]
14229        let b = u8x16::new(
14230            4, 3, 2, 1,
14231            4, 3, 2, 1,
14232            4, 3, 2, 1,
14233            4, 3, 2, 1
14234        );
14235        #[rustfmt::skip]
14236        let r = i16x8::new(-2, 2, -2, 2, -2, 2, -2, 2);
14237
14238        assert_eq!(
14239            r,
14240            mem::transmute(__msa_hsub_u_h(mem::transmute(a), mem::transmute(b)))
14241        );
14242    }
14243
14244    #[simd_test(enable = "msa")]
14245    unsafe fn test_msa_hsub_u_w() {
14246        #[rustfmt::skip]
14247        let a = u16x8::new(
14248            1, 2, 3, 4,
14249            1, 2, 3, 4
14250        );
14251        #[rustfmt::skip]
14252        let b = u16x8::new(
14253            4, 3, 2, 1,
14254            4, 3, 2, 1
14255        );
14256        #[rustfmt::skip]
14257        let r = i32x4::new(-2, 2, -2, 2);
14258
14259        assert_eq!(
14260            r,
14261            mem::transmute(__msa_hsub_u_w(mem::transmute(a), mem::transmute(b)))
14262        );
14263    }
14264
14265    #[simd_test(enable = "msa")]
14266    unsafe fn test_msa_hsub_u_d() {
14267        #[rustfmt::skip]
14268        let a = u32x4::new(1, 2, 3, 4);
14269        #[rustfmt::skip]
14270        let b = u32x4::new(4, 3, 2, 1);
14271        #[rustfmt::skip]
14272        let r = i64x2::new(-2, 2);
14273
14274        assert_eq!(
14275            r,
14276            mem::transmute(__msa_hsub_u_d(mem::transmute(a), mem::transmute(b)))
14277        );
14278    }
14279
14280    #[simd_test(enable = "msa")]
14281    unsafe fn test_msa_ilvev_b() {
14282        #[rustfmt::skip]
14283        let a = i8x16::new(
14284            1, 2, 3, 4,
14285            1, 2, 3, 4,
14286            1, 2, 3, 4,
14287            1, 2, 3, 4
14288        );
14289        #[rustfmt::skip]
14290        let b = i8x16::new(
14291            4, 3, 2, 1,
14292            4, 3, 2, 1,
14293            4, 3, 2, 1,
14294            4, 3, 2, 1
14295        );
14296        #[rustfmt::skip]
14297        let r = i8x16::new(
14298            4, 1, 2, 3,
14299            4, 1, 2, 3,
14300            4, 1, 2, 3,
14301            4, 1, 2, 3
14302        );
14303
14304        assert_eq!(
14305            r,
14306            mem::transmute(__msa_ilvev_b(mem::transmute(a), mem::transmute(b)))
14307        );
14308    }
14309
14310    #[simd_test(enable = "msa")]
14311    unsafe fn test_msa_ilvev_h() {
14312        #[rustfmt::skip]
14313        let a = i16x8::new(
14314            1, 2, 3, 4,
14315            1, 2, 3, 4
14316        );
14317        #[rustfmt::skip]
14318        let b = i16x8::new(
14319            4, 3, 2, 1,
14320            4, 3, 2, 1
14321        );
14322        #[rustfmt::skip]
14323        let r = i16x8::new(4, 1, 2, 3, 4, 1, 2, 3);
14324
14325        assert_eq!(
14326            r,
14327            mem::transmute(__msa_ilvev_h(mem::transmute(a), mem::transmute(b)))
14328        );
14329    }
14330
14331    #[simd_test(enable = "msa")]
14332    unsafe fn test_msa_ilvev_w() {
14333        #[rustfmt::skip]
14334        let a = i32x4::new(1, 2, 3, 4);
14335        #[rustfmt::skip]
14336        let b = i32x4::new(4, 3, 2, 1);
14337        #[rustfmt::skip]
14338        let r = i32x4::new(4, 1, 2, 3);
14339
14340        assert_eq!(
14341            r,
14342            mem::transmute(__msa_ilvev_w(mem::transmute(a), mem::transmute(b)))
14343        );
14344    }
14345
14346    #[simd_test(enable = "msa")]
14347    unsafe fn test_msa_ilvev_d() {
14348        #[rustfmt::skip]
14349        let a = i64x2::new(1, 2);
14350        #[rustfmt::skip]
14351        let b = i64x2::new(4, 3);
14352        #[rustfmt::skip]
14353        let r = i64x2::new(4, 1);
14354
14355        assert_eq!(
14356            r,
14357            mem::transmute(__msa_ilvev_d(mem::transmute(a), mem::transmute(b)))
14358        );
14359    }
14360
14361    #[simd_test(enable = "msa")]
14362    unsafe fn test_msa_ilvl_b() {
14363        #[rustfmt::skip]
14364        let a = i8x16::new(
14365            1, 2, 3, 4,
14366            5, 6, 7, 8,
14367            9, 10, 11, 12,
14368            13, 14, 15, 16
14369        );
14370        #[rustfmt::skip]
14371        let b = i8x16::new(
14372            16, 15, 14, 13,
14373            12, 11, 10, 9,
14374            8, 7, 6, 5,
14375            4, 3, 2, 1
14376        );
14377        #[rustfmt::skip]
14378        let r = i8x16::new(
14379            8, 9, 7, 10,
14380            6, 11, 5, 12,
14381            4, 13, 3, 14,
14382            2, 15, 1, 16
14383        );
14384
14385        assert_eq!(
14386            r,
14387            mem::transmute(__msa_ilvl_b(mem::transmute(a), mem::transmute(b)))
14388        );
14389    }
14390
14391    #[simd_test(enable = "msa")]
14392    unsafe fn test_msa_ilvl_h() {
14393        #[rustfmt::skip]
14394        let a = i16x8::new(
14395            1, 2, 3, 4,
14396            5, 6, 7, 8
14397        );
14398        #[rustfmt::skip]
14399        let b = i16x8::new(
14400            8, 7, 6, 5,
14401            4, 3, 2, 1
14402        );
14403        #[rustfmt::skip]
14404        let r = i16x8::new(4, 5, 3, 6, 2, 7, 1, 8);
14405
14406        assert_eq!(
14407            r,
14408            mem::transmute(__msa_ilvl_h(mem::transmute(a), mem::transmute(b)))
14409        );
14410    }
14411
14412    #[simd_test(enable = "msa")]
14413    unsafe fn test_msa_ilvl_w() {
14414        #[rustfmt::skip]
14415        let a = i32x4::new(1, 2, 3, 4);
14416        #[rustfmt::skip]
14417        let b = i32x4::new(4, 3, 2, 1);
14418        #[rustfmt::skip]
14419        let r = i32x4::new(2, 3, 1, 4);
14420
14421        assert_eq!(
14422            r,
14423            mem::transmute(__msa_ilvl_w(mem::transmute(a), mem::transmute(b)))
14424        );
14425    }
14426
14427    #[simd_test(enable = "msa")]
14428    unsafe fn test_msa_ilvl_d() {
14429        #[rustfmt::skip]
14430        let a = i64x2::new(1, 2);
14431        #[rustfmt::skip]
14432        let b = i64x2::new(2, 1);
14433        #[rustfmt::skip]
14434        let r = i64x2::new(1, 2);
14435
14436        assert_eq!(
14437            r,
14438            mem::transmute(__msa_ilvl_d(mem::transmute(a), mem::transmute(b)))
14439        );
14440    }
14441
14442    #[simd_test(enable = "msa")]
14443    unsafe fn test_msa_ilvod_b() {
14444        #[rustfmt::skip]
14445        let a = i8x16::new(
14446            1, 2, 3, 4,
14447            5, 6, 7, 8,
14448            9, 10, 11, 12,
14449            13, 14, 15, 16
14450        );
14451        #[rustfmt::skip]
14452        let b = i8x16::new(
14453            16, 15, 14, 13,
14454            12, 11, 10, 9,
14455            8, 7, 6, 5,
14456            4, 3, 2, 1
14457        );
14458        #[rustfmt::skip]
14459        let r = i8x16::new(
14460            15, 2, 13, 4,
14461            11, 6, 9, 8,
14462            7, 10, 5, 12,
14463            3, 14, 1, 16
14464        );
14465
14466        assert_eq!(
14467            r,
14468            mem::transmute(__msa_ilvod_b(mem::transmute(a), mem::transmute(b)))
14469        );
14470    }
14471
14472    #[simd_test(enable = "msa")]
14473    unsafe fn test_msa_ilvod_h() {
14474        #[rustfmt::skip]
14475        let a = i16x8::new(
14476            1, 2, 3, 4,
14477            5, 6, 7, 8
14478        );
14479        #[rustfmt::skip]
14480        let b = i16x8::new(
14481            8, 7, 6, 5,
14482            4, 3, 2, 1
14483        );
14484        #[rustfmt::skip]
14485        let r = i16x8::new(7, 2, 5, 4, 3, 6, 1, 8);
14486
14487        assert_eq!(
14488            r,
14489            mem::transmute(__msa_ilvod_h(mem::transmute(a), mem::transmute(b)))
14490        );
14491    }
14492
14493    #[simd_test(enable = "msa")]
14494    unsafe fn test_msa_ilvod_w() {
14495        #[rustfmt::skip]
14496        let a = i32x4::new(1, 2, 3, 4);
14497        #[rustfmt::skip]
14498        let b = i32x4::new(4, 3, 2, 1);
14499        #[rustfmt::skip]
14500        let r = i32x4::new(3, 2, 1, 4);
14501
14502        assert_eq!(
14503            r,
14504            mem::transmute(__msa_ilvod_w(mem::transmute(a), mem::transmute(b)))
14505        );
14506    }
14507
14508    #[simd_test(enable = "msa")]
14509    unsafe fn test_msa_ilvod_d() {
14510        #[rustfmt::skip]
14511        let a = i64x2::new(1, 2);
14512        #[rustfmt::skip]
14513        let b = i64x2::new(2, 1);
14514        #[rustfmt::skip]
14515        let r = i64x2::new(1, 2);
14516
14517        assert_eq!(
14518            r,
14519            mem::transmute(__msa_ilvod_d(mem::transmute(a), mem::transmute(b)))
14520        );
14521    }
14522
14523    #[simd_test(enable = "msa")]
14524    unsafe fn test_msa_ilvr_b() {
14525        #[rustfmt::skip]
14526        let a = i8x16::new(
14527            1, 2, 3, 4,
14528            5, 6, 7, 8,
14529            9, 10, 11, 12,
14530            13, 14, 15, 16
14531        );
14532        #[rustfmt::skip]
14533        let b = i8x16::new(
14534            16, 15, 14, 13,
14535            12, 11, 10, 9,
14536            8, 7, 6, 5,
14537            4, 3, 2, 1
14538        );
14539        #[rustfmt::skip]
14540        let r = i8x16::new(
14541            16, 1, 15, 2,
14542            14, 3, 13, 4,
14543            12, 5, 11, 6,
14544            10, 7, 9, 8
14545        );
14546
14547        assert_eq!(
14548            r,
14549            mem::transmute(__msa_ilvr_b(mem::transmute(a), mem::transmute(b)))
14550        );
14551    }
14552
14553    #[simd_test(enable = "msa")]
14554    unsafe fn test_msa_ilvr_h() {
14555        #[rustfmt::skip]
14556        let a = i16x8::new(
14557            1, 2, 3, 4,
14558            5, 6, 7, 8,
14559        );
14560        #[rustfmt::skip]
14561        let b = i16x8::new(
14562            8, 7, 6, 5,
14563            4, 3, 2, 1,
14564        );
14565        #[rustfmt::skip]
14566        let r = i16x8::new(8, 1, 7, 2, 6, 3, 5, 4);
14567
14568        assert_eq!(
14569            r,
14570            mem::transmute(__msa_ilvr_h(mem::transmute(a), mem::transmute(b)))
14571        );
14572    }
14573
14574    #[simd_test(enable = "msa")]
14575    unsafe fn test_msa_ilvr_w() {
14576        #[rustfmt::skip]
14577        let a = i32x4::new(1, 2, 3, 4);
14578        #[rustfmt::skip]
14579        let b = i32x4::new(4, 3, 2, 1);
14580        #[rustfmt::skip]
14581        let r = i32x4::new(4, 1, 3, 2);
14582
14583        assert_eq!(
14584            r,
14585            mem::transmute(__msa_ilvr_w(mem::transmute(a), mem::transmute(b)))
14586        );
14587    }
14588
14589    #[simd_test(enable = "msa")]
14590    unsafe fn test_msa_ilvr_d() {
14591        #[rustfmt::skip]
14592        let a = i64x2::new(1, 2);
14593        #[rustfmt::skip]
14594        let b = i64x2::new(2, 1);
14595        #[rustfmt::skip]
14596        let r = i64x2::new(2, 1);
14597
14598        assert_eq!(
14599            r,
14600            mem::transmute(__msa_ilvr_d(mem::transmute(a), mem::transmute(b)))
14601        );
14602    }
14603
14604    #[simd_test(enable = "msa")]
14605    unsafe fn test_msa_insert_b() {
14606        #[rustfmt::skip]
14607        let a = i8x16::new(
14608            -100, 127, 4, 127,
14609            -100, 127, 4, 127,
14610            -100, 127, 4, 127,
14611            -100, 127, 4, 127
14612        );
14613        #[rustfmt::skip]
14614        let r = i8x16::new(
14615            -100, 127, 4, 127,
14616            -100, 127, 4, 127,
14617            -100, 127, 4, 127,
14618            5, 127, 4, 127
14619        );
14620
14621        assert_eq!(
14622            r,
14623            mem::transmute(__msa_insert_b::<12>(mem::transmute(a), 5))
14624        );
14625    }
14626
14627    #[simd_test(enable = "msa")]
14628    unsafe fn test_msa_insert_h() {
14629        #[rustfmt::skip]
14630        let a = i16x8::new(
14631            32767, 3276, 100, 11,
14632            32767, 3276, 100, 11
14633        );
14634        #[rustfmt::skip]
14635        let r = i16x8::new(
14636            32767, 3276, 100, 11,
14637            5, 3276, 100, 11
14638        );
14639
14640        assert_eq!(r, mem::transmute(__msa_insert_h::<4>(mem::transmute(a), 5)));
14641    }
14642
14643    #[simd_test(enable = "msa")]
14644    unsafe fn test_msa_insert_w() {
14645        #[rustfmt::skip]
14646        let a = i32x4::new(100, 2147483647, 5, -2147483647);
14647        #[rustfmt::skip]
14648        let r = i32x4::new(100, 7, 5, -2147483647);
14649
14650        assert_eq!(r, mem::transmute(__msa_insert_w::<1>(mem::transmute(a), 7)));
14651    }
14652
14653    #[simd_test(enable = "msa")]
14654    unsafe fn test_msa_insert_d() {
14655        #[rustfmt::skip]
14656        let a = i64x2::new(3, i64::MAX);
14657        #[rustfmt::skip]
14658        let r = i64x2::new(3, 100);
14659
14660        assert_eq!(
14661            r,
14662            mem::transmute(__msa_insert_d::<1>(mem::transmute(a), 100))
14663        );
14664    }
14665
14666    #[simd_test(enable = "msa")]
14667    unsafe fn test_msa_insve_b() {
14668        #[rustfmt::skip]
14669        let a = i8x16::new(
14670            -100, i8::MAX, 4, i8::MAX,
14671            -100, i8::MAX, 4, i8::MAX,
14672            -100, i8::MAX, 4, i8::MAX,
14673            -100, i8::MAX, 4, i8::MAX
14674        );
14675        #[rustfmt::skip]
14676        let b = i8x16::new(
14677            5, 2, 3, 4,
14678            1, 2, 3, 4,
14679            1, 2, 3, 4,
14680            1, 2, 3, 4
14681        );
14682        #[rustfmt::skip]
14683        let r = i8x16::new(
14684            -100, 127, 4, 127,
14685            -100, 127, 4, 127,
14686            -100, 127, 4, 127,
14687            5, 127, 4, 127
14688        );
14689
14690        assert_eq!(
14691            r,
14692            mem::transmute(__msa_insve_b::<12>(mem::transmute(a), mem::transmute(b)))
14693        );
14694    }
14695
14696    #[simd_test(enable = "msa")]
14697    unsafe fn test_msa_insve_h() {
14698        #[rustfmt::skip]
14699        let a = i16x8::new(
14700            i16::MAX, 3276, 100, 11,
14701            i16::MAX, 3276, 100, 11
14702        );
14703        #[rustfmt::skip]
14704        let b = i16x8::new(
14705            1, 2, 3, 4,
14706            1, 2, 3, 4
14707        );
14708        #[rustfmt::skip]
14709        let r = i16x8::new(
14710            32767, 3276, 100, 11,
14711            1, 3276, 100, 11
14712        );
14713
14714        assert_eq!(
14715            r,
14716            mem::transmute(__msa_insve_h::<4>(mem::transmute(a), mem::transmute(b)))
14717        );
14718    }
14719
14720    #[simd_test(enable = "msa")]
14721    unsafe fn test_msa_insve_w() {
14722        #[rustfmt::skip]
14723        let a = i32x4::new(100, 2147483647, 5, -2147483647);
14724        #[rustfmt::skip]
14725        let b = i32x4::new(1, 2, 3, 4);
14726        #[rustfmt::skip]
14727        let r = i32x4::new(100, 2147483647, 5, 1);
14728
14729        assert_eq!(
14730            r,
14731            mem::transmute(__msa_insve_w::<3>(mem::transmute(a), mem::transmute(b)))
14732        );
14733    }
14734
14735    #[simd_test(enable = "msa")]
14736    unsafe fn test_msa_insve_d() {
14737        #[rustfmt::skip]
14738        let a = i64x2::new(3, i64::MAX);
14739        #[rustfmt::skip]
14740        let b = i64x2::new(1, 2);
14741        #[rustfmt::skip]
14742        let r = i64x2::new(3, 1);
14743
14744        assert_eq!(
14745            r,
14746            mem::transmute(__msa_insve_d::<1>(mem::transmute(a), mem::transmute(b)))
14747        );
14748    }
14749
14750    #[simd_test(enable = "msa")]
14751    unsafe fn test_msa_ld_b() {
14752        #[rustfmt::skip]
14753        let mut a : [i8; 32] = [
14754            0, 1, 2, 3, 4, 5, 6, 7,
14755            8, 9, 10, 11, 12, 13, 14, 15,
14756            16, 17, 18, 19, 20, 21, 22, 23,
14757            24, 25, 26, 27, 28, 29, 30, 31
14758        ];
14759        let p = &mut a[4] as *mut _ as *mut u8;
14760        #[rustfmt::skip]
14761        let r = i8x16::new(
14762            13, 14, 15, 16,
14763            17, 18, 19, 20,
14764            21, 22, 23, 24,
14765            25, 26, 27, 28
14766        );
14767
14768        assert_eq!(r, mem::transmute(__msa_ld_b::<9>(p)));
14769    }
14770
14771    #[simd_test(enable = "msa")]
14772    unsafe fn test_msa_ld_h() {
14773        #[rustfmt::skip]
14774        let mut a : [i16; 16] = [
14775            0, 1, 2, 3, 4, 5, 6, 7,
14776            8, 9, 10, 11, 12, 13, 14, 15
14777        ];
14778        let p = &mut a[4] as *mut _ as *mut u8;
14779        #[rustfmt::skip]
14780        let r = i16x8::new(3, 4, 5, 6, 7, 8, 9, 10);
14781
14782        assert_eq!(r, mem::transmute(__msa_ld_h::<-2>(p)));
14783    }
14784
14785    #[simd_test(enable = "msa")]
14786    unsafe fn test_msa_ld_w() {
14787        #[rustfmt::skip]
14788        let mut a : [i32; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
14789        let p = &mut a[3] as *mut _ as *mut u8;
14790        #[rustfmt::skip]
14791        let r = i32x4::new(2, 3, 4, 5);
14792
14793        assert_eq!(r, mem::transmute(__msa_ld_w::<-4>(p)));
14794    }
14795
14796    #[simd_test(enable = "msa")]
14797    unsafe fn test_msa_ld_d() {
14798        #[rustfmt::skip]
14799        let mut a : [i64; 8] = [0, 1, 2, 3, 4, 5, 6, 7];
14800        let p = &mut a[4] as *mut _ as *mut u8;
14801        #[rustfmt::skip]
14802        let r = i64x2::new(0, 1);
14803
14804        assert_eq!(r, mem::transmute(__msa_ld_d::<-32>(p)));
14805    }
14806
14807    #[simd_test(enable = "msa")]
14808    unsafe fn test_msa_ldi_b() {
14809        #[rustfmt::skip]
14810        let r = i8x16::new(
14811            -20, -20, -20, -20,
14812            -20, -20, -20, -20,
14813            -20, -20, -20, -20,
14814            -20, -20, -20, -20
14815        );
14816
14817        assert_eq!(r, mem::transmute(__msa_ldi_b::<-20>()));
14818    }
14819
14820    #[simd_test(enable = "msa")]
14821    unsafe fn test_msa_ldi_h() {
14822        #[rustfmt::skip]
14823        let r = i16x8::new(
14824            255, 255, 255, 255,
14825            255, 255, 255, 255
14826        );
14827
14828        assert_eq!(r, mem::transmute(__msa_ldi_h::<255>()));
14829    }
14830
14831    #[simd_test(enable = "msa")]
14832    unsafe fn test_msa_ldi_w() {
14833        #[rustfmt::skip]
14834        let r = i32x4::new(-509, -509, -509, -509);
14835
14836        assert_eq!(r, mem::transmute(__msa_ldi_w::<-509>()));
14837    }
14838
14839    // FIXME: https://reviews.llvm.org/D59884
14840    // If target type is i64, negative immediate loses the sign
14841    // Test passes if 4294967185 is used instead -111 in vector `r`
14842    // #[simd_test(enable = "msa")]
14843    // unsafe fn test_msa_ldi_d() {
14844    //     let r = i64x2::new(-111, -111);
14845
14846    //     assert_eq!(r, mem::transmute(__msa_ldi_d(-111)));
14847    // }
14848
14849    #[simd_test(enable = "msa")]
14850    unsafe fn test_msa_madd_q_h() {
14851        #[rustfmt::skip]
14852        let a = i16x8::new(
14853            i16::MAX, 1024, i16::MIN, -1024,
14854            1, 2, 3, 4
14855        );
14856        #[rustfmt::skip]
14857        let b = i16x8::new(
14858            1024, 1024, 1024, 1024,
14859            1024, 1024, 1024, 1024
14860        );
14861        #[rustfmt::skip]
14862        let c = i16x8::new(
14863            i16::MAX, i16::MAX, 1, -1,
14864            33, 66, 99, 132
14865        );
14866        #[rustfmt::skip]
14867        let r = i16x8::new(32767, 2047, -32768, -1025, 2, 4, 6, 8);
14868
14869        assert_eq!(
14870            r,
14871            mem::transmute(__msa_madd_q_h(
14872                mem::transmute(a),
14873                mem::transmute(b),
14874                mem::transmute(c)
14875            ))
14876        );
14877    }
14878
14879    #[simd_test(enable = "msa")]
14880    unsafe fn test_msa_madd_q_w() {
14881        #[rustfmt::skip]
14882        let a = i32x4::new(i32::MAX, i32::MIN, 1, 2);
14883        #[rustfmt::skip]
14884        let b = i32x4::new(102401, 102401, 102401, 102401);
14885        #[rustfmt::skip]
14886        let c = i32x4::new(10240, 20480, 30720, 40960);
14887        #[rustfmt::skip]
14888        let r = i32x4::new(2147483647, -2147483648, 2, 3);
14889
14890        assert_eq!(
14891            r,
14892            mem::transmute(__msa_madd_q_w(
14893                mem::transmute(a),
14894                mem::transmute(b),
14895                mem::transmute(c)
14896            ))
14897        );
14898    }
14899
14900    #[simd_test(enable = "msa")]
14901    unsafe fn test_msa_maddr_q_h() {
14902        #[rustfmt::skip]
14903        let a = i16x8::new(
14904            32767, 1024, -32768, -1024,
14905            1, 2, 3, 4
14906        );
14907        #[rustfmt::skip]
14908        let b = i16x8::new(
14909            1024, 1024, 1024, 1024,
14910            1024, 1024, 1024, 1024
14911        );
14912        #[rustfmt::skip]
14913        let c = i16x8::new(
14914            32767, 32767, 32767, 32767,
14915            33, 66, 99, 132
14916        );
14917        #[rustfmt::skip]
14918        let r = i16x8::new(32767, 2048, -31744, 0, 2, 4, 6, 8);
14919
14920        assert_eq!(
14921            r,
14922            mem::transmute(__msa_maddr_q_h(
14923                mem::transmute(a),
14924                mem::transmute(b),
14925                mem::transmute(c)
14926            ))
14927        );
14928    }
14929
14930    #[simd_test(enable = "msa")]
14931    unsafe fn test_msa_maddr_q_w() {
14932        #[rustfmt::skip]
14933        let a = i32x4::new(i32::MAX, i32::MIN, 1, 2);
14934        #[rustfmt::skip]
14935        let b = i32x4::new(102401, 102401, 102401, 102401);
14936        #[rustfmt::skip]
14937        let c = i32x4::new(10240, 20480, 30720, 40960);
14938        #[rustfmt::skip]
14939        let r = i32x4::new(2147483647, -2147483647, 2, 4);
14940
14941        assert_eq!(
14942            r,
14943            mem::transmute(__msa_maddr_q_w(
14944                mem::transmute(a),
14945                mem::transmute(b),
14946                mem::transmute(c)
14947            ))
14948        );
14949    }
14950
14951    #[simd_test(enable = "msa")]
14952    unsafe fn test_msa_maddv_b() {
14953        #[rustfmt::skip]
14954        let a = i8x16::new(
14955            1, 2, 3, 4,
14956            1, 2, 3, 4,
14957            1, 2, 3, 4,
14958            1, 2, 3, 4
14959        );
14960        #[rustfmt::skip]
14961        let b = i8x16::new(
14962            5, 6, 7, 8,
14963            5, 6, 7, 8,
14964            5, 6, 7, 8,
14965            5, 6, 7, 8
14966        );
14967        #[rustfmt::skip]
14968        let c = i8x16::new(
14969            9, 10, 11, 12,
14970            9, 10, 11, 12,
14971            9, 10, 11, 12,
14972            9, 10, 11, 12
14973        );
14974        #[rustfmt::skip]
14975        let r = i8x16::new(
14976            46, 62, 80, 100,
14977            46, 62, 80, 100,
14978            46, 62, 80, 100,
14979            46, 62, 80, 100
14980        );
14981
14982        assert_eq!(
14983            r,
14984            mem::transmute(__msa_maddv_b(
14985                mem::transmute(a),
14986                mem::transmute(b),
14987                mem::transmute(c)
14988            ))
14989        );
14990    }
14991
14992    #[simd_test(enable = "msa")]
14993    unsafe fn test_msa_maddv_h() {
14994        #[rustfmt::skip]
14995        let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
14996        #[rustfmt::skip]
14997        let b = i16x8::new(5, 6, 7, 8, 5, 6, 7, 8);
14998        #[rustfmt::skip]
14999        let c = i16x8::new(9, 10, 11, 12, 9, 10, 11, 12);
15000        #[rustfmt::skip]
15001        let r = i16x8::new(46, 62, 80, 100, 46, 62, 80, 100);
15002
15003        assert_eq!(
15004            r,
15005            mem::transmute(__msa_maddv_h(
15006                mem::transmute(a),
15007                mem::transmute(b),
15008                mem::transmute(c)
15009            ))
15010        );
15011    }
15012
15013    #[simd_test(enable = "msa")]
15014    unsafe fn test_msa_maddv_w() {
15015        #[rustfmt::skip]
15016        let a = i32x4::new(1, 2, 1, 2);
15017        #[rustfmt::skip]
15018        let b = i32x4::new(3, 4, 3, 4);
15019        #[rustfmt::skip]
15020        let c = i32x4::new(5, 6, 5, 6);
15021        #[rustfmt::skip]
15022        let r = i32x4::new(16, 26, 16, 26);
15023
15024        assert_eq!(
15025            r,
15026            mem::transmute(__msa_maddv_w(
15027                mem::transmute(a),
15028                mem::transmute(b),
15029                mem::transmute(c)
15030            ))
15031        );
15032    }
15033
15034    #[simd_test(enable = "msa")]
15035    unsafe fn test_msa_maddv_d() {
15036        #[rustfmt::skip]
15037        let a = i64x2::new(1, 2);
15038        #[rustfmt::skip]
15039        let b = i64x2::new(3, 4);
15040        #[rustfmt::skip]
15041        let c = i64x2::new(5, 6);
15042        #[rustfmt::skip]
15043        let r = i64x2::new(16, 26);
15044
15045        assert_eq!(
15046            r,
15047            mem::transmute(__msa_maddv_d(
15048                mem::transmute(a),
15049                mem::transmute(b),
15050                mem::transmute(c)
15051            ))
15052        );
15053    }
15054
15055    #[simd_test(enable = "msa")]
15056    unsafe fn test_msa_max_a_b() {
15057        #[rustfmt::skip]
15058        let a = i8x16::new(
15059            1, 2, 3, 4,
15060            -1, -2, -3, -4,
15061            1, 2, 3, 4,
15062            -1, -2, -3, -4
15063        );
15064        #[rustfmt::skip]
15065        let b = i8x16::new(
15066            -6, -7, -8, -9,
15067            6, 7, 8, 9,
15068            -6, -7, -8, -9,
15069            6, 7, 8, 9
15070        );
15071        #[rustfmt::skip]
15072        let r = i8x16::new(
15073            -6, -7, -8, -9,
15074            6, 7, 8, 9,
15075            -6, -7, -8, -9,
15076            6, 7, 8, 9
15077        );
15078
15079        assert_eq!(
15080            r,
15081            mem::transmute(__msa_max_a_b(mem::transmute(a), mem::transmute(b)))
15082        );
15083    }
15084
15085    #[simd_test(enable = "msa")]
15086    unsafe fn test_msa_max_a_h() {
15087        #[rustfmt::skip]
15088        let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
15089        #[rustfmt::skip]
15090        let b = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
15091        #[rustfmt::skip]
15092        let r = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
15093
15094        assert_eq!(
15095            r,
15096            mem::transmute(__msa_max_a_h(mem::transmute(a), mem::transmute(b)))
15097        );
15098    }
15099
15100    #[simd_test(enable = "msa")]
15101    unsafe fn test_msa_max_a_w() {
15102        #[rustfmt::skip]
15103        let a = i32x4::new(1, -2, 3, -4);
15104        #[rustfmt::skip]
15105        let b = i32x4::new(6, 7, 8, 9);
15106        #[rustfmt::skip]
15107        let r = i32x4::new(6, 7, 8, 9);
15108
15109        assert_eq!(
15110            r,
15111            mem::transmute(__msa_max_a_w(mem::transmute(a), mem::transmute(b)))
15112        );
15113    }
15114
15115    #[simd_test(enable = "msa")]
15116    unsafe fn test_msa_max_a_d() {
15117        #[rustfmt::skip]
15118        let a = i64x2::new(-1, 2);
15119        #[rustfmt::skip]
15120        let b = i64x2::new(6, -7);
15121        #[rustfmt::skip]
15122        let r = i64x2::new(6, -7);
15123
15124        assert_eq!(
15125            r,
15126            mem::transmute(__msa_max_a_d(mem::transmute(a), mem::transmute(b)))
15127        );
15128    }
15129
15130    #[simd_test(enable = "msa")]
15131    unsafe fn test_msa_max_s_b() {
15132        #[rustfmt::skip]
15133        let a = i8x16::new(
15134            1, 2, 3, 4,
15135            -1, -2, -3, -4,
15136            1, 2, 3, 4,
15137            -1, -2, -3, -4
15138        );
15139        #[rustfmt::skip]
15140        let b = i8x16::new(
15141            -6, -7, -8, -9,
15142            6, 7, 8, 9,
15143            -6, -7, -8, -9,
15144            6, 7, 8, 9
15145        );
15146        #[rustfmt::skip]
15147        let r = i8x16::new(
15148            1, 2, 3, 4,
15149            6, 7, 8, 9,
15150            1, 2, 3, 4,
15151            6, 7, 8, 9
15152        );
15153
15154        assert_eq!(
15155            r,
15156            mem::transmute(__msa_max_s_b(mem::transmute(a), mem::transmute(b)))
15157        );
15158    }
15159
15160    #[simd_test(enable = "msa")]
15161    unsafe fn test_msa_max_s_h() {
15162        #[rustfmt::skip]
15163        let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
15164        #[rustfmt::skip]
15165        let b = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
15166        #[rustfmt::skip]
15167        let r = i16x8::new(1, 7, 3, 9, 1, 7, 3, 9);
15168
15169        assert_eq!(
15170            r,
15171            mem::transmute(__msa_max_s_h(mem::transmute(a), mem::transmute(b)))
15172        );
15173    }
15174
15175    #[simd_test(enable = "msa")]
15176    unsafe fn test_msa_max_s_w() {
15177        #[rustfmt::skip]
15178        let a = i32x4::new(1, -2, 3, -4);
15179        #[rustfmt::skip]
15180        let b = i32x4::new(6, 7, 8, 9);
15181        #[rustfmt::skip]
15182        let r = i32x4::new(6, 7, 8, 9);
15183
15184        assert_eq!(
15185            r,
15186            mem::transmute(__msa_max_s_w(mem::transmute(a), mem::transmute(b)))
15187        );
15188    }
15189
15190    #[simd_test(enable = "msa")]
15191    unsafe fn test_msa_max_s_d() {
15192        #[rustfmt::skip]
15193        let a = i64x2::new(-1, 2);
15194        #[rustfmt::skip]
15195        let b = i64x2::new(6, -7);
15196        #[rustfmt::skip]
15197        let r = i64x2::new(6, 2);
15198
15199        assert_eq!(
15200            r,
15201            mem::transmute(__msa_max_s_d(mem::transmute(a), mem::transmute(b)))
15202        );
15203    }
15204
15205    #[simd_test(enable = "msa")]
15206    unsafe fn test_msa_max_u_b() {
15207        #[rustfmt::skip]
15208        let a = u8x16::new(
15209            1, 2, 3, 4,
15210            1, 2, 3, 4,
15211            1, 2, 3, 4,
15212            1, 2, 3, 4
15213        );
15214        #[rustfmt::skip]
15215        let b = u8x16::new(
15216            6, 7, 8, 9,
15217            6, 7, 8, 9,
15218            6, 7, 8, 9,
15219            6, 7, 8, 9
15220        );
15221        #[rustfmt::skip]
15222        let r = u8x16::new(
15223            6, 7, 8, 9,
15224            6, 7, 8, 9,
15225            6, 7, 8, 9,
15226            6, 7, 8, 9
15227        );
15228
15229        assert_eq!(
15230            r,
15231            mem::transmute(__msa_max_u_b(mem::transmute(a), mem::transmute(b)))
15232        );
15233    }
15234
15235    #[simd_test(enable = "msa")]
15236    unsafe fn test_msa_max_u_h() {
15237        #[rustfmt::skip]
15238        let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
15239        #[rustfmt::skip]
15240        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
15241        #[rustfmt::skip]
15242        let r = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
15243
15244        assert_eq!(
15245            r,
15246            mem::transmute(__msa_max_u_h(mem::transmute(a), mem::transmute(b)))
15247        );
15248    }
15249
15250    #[simd_test(enable = "msa")]
15251    unsafe fn test_msa_max_u_w() {
15252        #[rustfmt::skip]
15253        let a = u32x4::new(1, 2, 3, 4);
15254        #[rustfmt::skip]
15255        let b = u32x4::new(6, 7, 8, 9);
15256        #[rustfmt::skip]
15257        let r = u32x4::new(6, 7, 8, 9);
15258
15259        assert_eq!(
15260            r,
15261            mem::transmute(__msa_max_u_w(mem::transmute(a), mem::transmute(b)))
15262        );
15263    }
15264
15265    #[simd_test(enable = "msa")]
15266    unsafe fn test_msa_max_u_d() {
15267        #[rustfmt::skip]
15268        let a = u64x2::new(1, 2);
15269        #[rustfmt::skip]
15270        let b = u64x2::new(6, 7);
15271        #[rustfmt::skip]
15272        let r = u64x2::new(6, 7);
15273
15274        assert_eq!(
15275            r,
15276            mem::transmute(__msa_max_u_d(mem::transmute(a), mem::transmute(b)))
15277        );
15278    }
15279
15280    #[simd_test(enable = "msa")]
15281    unsafe fn test_msa_maxi_s_b() {
15282        #[rustfmt::skip]
15283        let a = i8x16::new(
15284            1, -20, -6, 8,
15285            1, -20, -6, 8,
15286            1, -20, -6, 8,
15287            1, -20, -6, 8
15288        );
15289        #[rustfmt::skip]
15290        let r = i8x16::new(
15291            1, -16, -6, 8,
15292            1, -16, -6, 8,
15293            1, -16, -6, 8,
15294            1, -16, -6, 8
15295        );
15296
15297        assert_eq!(r, mem::transmute(__msa_maxi_s_b::<-16>(mem::transmute(a))));
15298    }
15299
15300    #[simd_test(enable = "msa")]
15301    unsafe fn test_msa_maxi_s_h() {
15302        #[rustfmt::skip]
15303        let a = i16x8::new(1, 3, -60, -8, 1, 3, -6, -8);
15304        #[rustfmt::skip]
15305        let r = i16x8::new(15, 15, 15, 15, 15, 15, 15, 15);
15306
15307        assert_eq!(r, mem::transmute(__msa_maxi_s_h::<15>(mem::transmute(a))));
15308    }
15309
15310    #[simd_test(enable = "msa")]
15311    unsafe fn test_msa_maxi_s_w() {
15312        #[rustfmt::skip]
15313        let a = i32x4::new(1, 3, -6, -8);
15314        #[rustfmt::skip]
15315        let r = i32x4::new(1, 3, -5, -5);
15316
15317        assert_eq!(r, mem::transmute(__msa_maxi_s_w::<-5>(mem::transmute(a))));
15318    }
15319
15320    // FIXME: https://reviews.llvm.org/D59884
15321    // If target type is i64, negative immediate loses the sign
15322    // Test passes if 4294967293 is used instead -3 in vector `r`
15323    // #[simd_test(enable = "msa")]
15324    // unsafe fn test_msa_maxi_s_d() {
15325    //     #[rustfmt::skip]
15326    //     let a = i64x2::new(1, -8);
15327    //     #[rustfmt::skip]
15328    //     let r = i64x2::new(-3, -3);
15329
15330    //     assert_eq!(r, mem::transmute(__msa_maxi_s_d(mem::transmute(a), -3)));
15331    // }
15332
15333    #[simd_test(enable = "msa")]
15334    unsafe fn test_msa_maxi_u_b() {
15335        #[rustfmt::skip]
15336        let a = u8x16::new(
15337            1, 3, 6, 8,
15338            1, 3, 6, 8,
15339            1, 3, 6, 8,
15340            1, 3, 6, 8
15341        );
15342        #[rustfmt::skip]
15343        let r = u8x16::new(
15344            5, 5, 6, 8,
15345            5, 5, 6, 8,
15346            5, 5, 6, 8,
15347            5, 5, 6, 8
15348        );
15349
15350        assert_eq!(r, mem::transmute(__msa_maxi_u_b::<5>(mem::transmute(a))));
15351    }
15352
15353    #[simd_test(enable = "msa")]
15354    unsafe fn test_msa_maxi_u_h() {
15355        #[rustfmt::skip]
15356        let a = u16x8::new(1, 3, 6, 8, 1, 3, 6, 8);
15357        #[rustfmt::skip]
15358        let r = u16x8::new(5, 5, 6, 8, 5, 5, 6, 8);
15359
15360        assert_eq!(r, mem::transmute(__msa_maxi_u_h::<5>(mem::transmute(a))));
15361    }
15362
15363    #[simd_test(enable = "msa")]
15364    unsafe fn test_msa_maxi_u_w() {
15365        #[rustfmt::skip]
15366        let a = u32x4::new(1, 3, 6, 8);
15367        #[rustfmt::skip]
15368        let r = u32x4::new(5, 5, 6, 8);
15369
15370        assert_eq!(r, mem::transmute(__msa_maxi_u_w::<5>(mem::transmute(a))));
15371    }
15372
15373    #[simd_test(enable = "msa")]
15374    unsafe fn test_msa_maxi_u_d() {
15375        #[rustfmt::skip]
15376        let a = u64x2::new(1, 8);
15377        #[rustfmt::skip]
15378        let r = u64x2::new(5, 8);
15379
15380        assert_eq!(r, mem::transmute(__msa_maxi_u_d::<5>(mem::transmute(a))));
15381    }
15382
15383    #[simd_test(enable = "msa")]
15384    unsafe fn test_msa_min_a_b() {
15385        #[rustfmt::skip]
15386        let a = i8x16::new(
15387            1, 2, 3, 4,
15388            -1, -2, -3, -4,
15389            1, 2, 3, 4,
15390            -1, -2, -3, -4
15391        );
15392        #[rustfmt::skip]
15393        let b = i8x16::new(
15394            -6, -7, -8, -9,
15395            6, 7, 8, 9,
15396            -6, -7, -8, -9,
15397            6, 7, 8, 9
15398        );
15399        #[rustfmt::skip]
15400        let r = i8x16::new(
15401            1, 2, 3, 4,
15402            -1, -2, -3, -4,
15403            1, 2, 3, 4,
15404            -1, -2, -3, -4
15405        );
15406
15407        assert_eq!(
15408            r,
15409            mem::transmute(__msa_min_a_b(mem::transmute(a), mem::transmute(b)))
15410        );
15411    }
15412
15413    #[simd_test(enable = "msa")]
15414    unsafe fn test_msa_min_a_h() {
15415        #[rustfmt::skip]
15416        let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
15417        #[rustfmt::skip]
15418        let b = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
15419        #[rustfmt::skip]
15420        let r = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
15421
15422        assert_eq!(
15423            r,
15424            mem::transmute(__msa_min_a_h(mem::transmute(a), mem::transmute(b)))
15425        );
15426    }
15427
15428    #[simd_test(enable = "msa")]
15429    unsafe fn test_msa_min_a_w() {
15430        #[rustfmt::skip]
15431        let a = i32x4::new(1, -2, 3, -4);
15432        #[rustfmt::skip]
15433        let b = i32x4::new(6, 7, 8, 9);
15434        #[rustfmt::skip]
15435        let r = i32x4::new(1, -2, 3, -4);
15436
15437        assert_eq!(
15438            r,
15439            mem::transmute(__msa_min_a_w(mem::transmute(a), mem::transmute(b)))
15440        );
15441    }
15442
15443    #[simd_test(enable = "msa")]
15444    unsafe fn test_msa_min_a_d() {
15445        #[rustfmt::skip]
15446        let a = i64x2::new(-1, 2);
15447        #[rustfmt::skip]
15448        let b = i64x2::new(6, -7);
15449        #[rustfmt::skip]
15450        let r = i64x2::new(-1, 2);
15451
15452        assert_eq!(
15453            r,
15454            mem::transmute(__msa_min_a_d(mem::transmute(a), mem::transmute(b)))
15455        );
15456    }
15457
15458    #[simd_test(enable = "msa")]
15459    unsafe fn test_msa_min_s_b() {
15460        #[rustfmt::skip]
15461        let a = i8x16::new(
15462            1, 2, 3, 4,
15463            -1, -2, -3, -4,
15464            1, 2, 3, 4,
15465            -1, -2, -3, -4
15466        );
15467        #[rustfmt::skip]
15468        let b = i8x16::new(
15469            -6, -7, -8, -9,
15470            6, 7, 8, 9,
15471            -6, -7, -8, -9,
15472            6, 7, 8, 9
15473        );
15474        #[rustfmt::skip]
15475        let r = i8x16::new(
15476            -6, -7, -8, -9,
15477            -1, -2, -3, -4,
15478            -6, -7, -8, -9,
15479            -1, -2, -3, -4
15480        );
15481
15482        assert_eq!(
15483            r,
15484            mem::transmute(__msa_min_s_b(mem::transmute(a), mem::transmute(b)))
15485        );
15486    }
15487
15488    #[simd_test(enable = "msa")]
15489    unsafe fn test_msa_min_s_h() {
15490        #[rustfmt::skip]
15491        let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
15492        #[rustfmt::skip]
15493        let b = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
15494        #[rustfmt::skip]
15495        let r = i16x8::new(-6, -2, -8, -4, -6, -2, -8, -4);
15496
15497        assert_eq!(
15498            r,
15499            mem::transmute(__msa_min_s_h(mem::transmute(a), mem::transmute(b)))
15500        );
15501    }
15502
15503    #[simd_test(enable = "msa")]
15504    unsafe fn test_msa_min_s_w() {
15505        #[rustfmt::skip]
15506        let a = i32x4::new(1, -2, 3, -4);
15507        #[rustfmt::skip]
15508        let b = i32x4::new(6, 7, 8, 9);
15509        #[rustfmt::skip]
15510        let r = i32x4::new(1, -2, 3, -4);
15511
15512        assert_eq!(
15513            r,
15514            mem::transmute(__msa_min_s_w(mem::transmute(a), mem::transmute(b)))
15515        );
15516    }
15517
15518    #[simd_test(enable = "msa")]
15519    unsafe fn test_msa_min_s_d() {
15520        #[rustfmt::skip]
15521        let a = i64x2::new(-1, 2);
15522        #[rustfmt::skip]
15523        let b = i64x2::new(6, -7);
15524        #[rustfmt::skip]
15525        let r = i64x2::new(-1, -7);
15526
15527        assert_eq!(
15528            r,
15529            mem::transmute(__msa_min_s_d(mem::transmute(a), mem::transmute(b)))
15530        );
15531    }
15532
15533    #[simd_test(enable = "msa")]
15534    unsafe fn test_msa_mini_s_b() {
15535        #[rustfmt::skip]
15536        let a = i8x16::new(
15537            1, 2, 3, 4,
15538            -1, -2, -3, -4,
15539            1, 2, 3, 4,
15540            -1, -2, -3, -4
15541        );
15542        #[rustfmt::skip]
15543        let r = i8x16::new(
15544            -10, -10, -10, -10,
15545            -10, -10, -10, -10,
15546            -10, -10, -10, -10,
15547            -10, -10, -10, -10
15548        );
15549
15550        assert_eq!(r, mem::transmute(__msa_mini_s_b::<-10>(mem::transmute(a))));
15551    }
15552
15553    #[simd_test(enable = "msa")]
15554    unsafe fn test_msa_mini_s_h() {
15555        #[rustfmt::skip]
15556        let a = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
15557        #[rustfmt::skip]
15558        let r = i16x8::new(-3, -3, -3, -4, -3, -3, -3, -4);
15559
15560        assert_eq!(r, mem::transmute(__msa_mini_s_h::<-3>(mem::transmute(a))));
15561    }
15562
15563    #[simd_test(enable = "msa")]
15564    unsafe fn test_msa_mini_s_w() {
15565        #[rustfmt::skip]
15566        let a = i32x4::new(1, -2, 3, -4);
15567        #[rustfmt::skip]
15568        let r = i32x4::new(-3, -3, -3, -4);
15569
15570        assert_eq!(r, mem::transmute(__msa_mini_s_w::<-3>(mem::transmute(a))));
15571    }
15572
15573    // FIXME: https://reviews.llvm.org/D59884
15574    // If target type is i64, negative immediate loses the sign
15575    // -3 is represented as 4294967293
15576    // #[simd_test(enable = "msa")]
15577    // unsafe fn test_msa_mini_s_d() {
15578    //     #[rustfmt::skip]
15579    //     let a = i64x2::new(-3, 2);
15580    //     #[rustfmt::skip]
15581    //     let r = i64x2::new(-1, -3);
15582
15583    //     assert_eq!(r, mem::transmute(__msa_mini_s_d(mem::transmute(a), -3)));
15584    // }
15585
15586    #[simd_test(enable = "msa")]
15587    unsafe fn test_msa_min_u_b() {
15588        #[rustfmt::skip]
15589        let a = u8x16::new(
15590            1, 2, 3, 4,
15591            1, 2, 3, 4,
15592            1, 2, 3, 4,
15593            1, 2, 3, 4
15594        );
15595        #[rustfmt::skip]
15596        let b = u8x16::new(
15597            6, 7, 8, 9,
15598            6, 7, 8, 9,
15599            6, 7, 8, 9,
15600            6, 7, 8, 9
15601        );
15602        #[rustfmt::skip]
15603        let r = u8x16::new(
15604            1, 2, 3, 4,
15605            1, 2, 3, 4,
15606            1, 2, 3, 4,
15607            1, 2, 3, 4
15608        );
15609
15610        assert_eq!(
15611            r,
15612            mem::transmute(__msa_min_u_b(mem::transmute(a), mem::transmute(b)))
15613        );
15614    }
15615
15616    #[simd_test(enable = "msa")]
15617    unsafe fn test_msa_min_u_h() {
15618        #[rustfmt::skip]
15619        let a = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
15620        #[rustfmt::skip]
15621        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
15622        #[rustfmt::skip]
15623        let r = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4,);
15624
15625        assert_eq!(
15626            r,
15627            mem::transmute(__msa_min_u_h(mem::transmute(a), mem::transmute(b)))
15628        );
15629    }
15630
15631    #[simd_test(enable = "msa")]
15632    unsafe fn test_msa_min_u_w() {
15633        #[rustfmt::skip]
15634        let a = u32x4::new(1, 2, 3, 4);
15635        #[rustfmt::skip]
15636        let b = u32x4::new(6, 7, 8, 9);
15637        #[rustfmt::skip]
15638        let r = u32x4::new(1, 2, 3, 4,);
15639
15640        assert_eq!(
15641            r,
15642            mem::transmute(__msa_min_u_w(mem::transmute(a), mem::transmute(b)))
15643        );
15644    }
15645
15646    #[simd_test(enable = "msa")]
15647    unsafe fn test_msa_min_u_d() {
15648        #[rustfmt::skip]
15649        let a = u64x2::new(1, 2);
15650        #[rustfmt::skip]
15651        let b = u64x2::new(6, 7);
15652        #[rustfmt::skip]
15653        let r = u64x2::new(1, 2,);
15654
15655        assert_eq!(
15656            r,
15657            mem::transmute(__msa_min_u_d(mem::transmute(a), mem::transmute(b)))
15658        );
15659    }
15660
15661    #[simd_test(enable = "msa")]
15662    unsafe fn test_msa_mini_u_b() {
15663        #[rustfmt::skip]
15664        let a = u8x16::new(
15665            1, 3, 6, 8,
15666            1, 3, 6, 8,
15667            1, 3, 6, 8,
15668            1, 3, 6, 8
15669        );
15670        #[rustfmt::skip]
15671        let r = u8x16::new(
15672            1, 3, 5, 5,
15673            1, 3, 5, 5,
15674            1, 3, 5, 5,
15675            1, 3, 5, 5
15676        );
15677
15678        assert_eq!(r, mem::transmute(__msa_mini_u_b::<5>(mem::transmute(a))));
15679    }
15680
15681    #[simd_test(enable = "msa")]
15682    unsafe fn test_msa_mini_u_h() {
15683        #[rustfmt::skip]
15684        let a = u16x8::new(1, 3, 6, 8, 1, 3, 6, 8);
15685        #[rustfmt::skip]
15686        let r = u16x8::new(1, 3, 5, 5, 1, 3, 5, 5);
15687
15688        assert_eq!(r, mem::transmute(__msa_mini_u_h::<5>(mem::transmute(a))));
15689    }
15690
15691    #[simd_test(enable = "msa")]
15692    unsafe fn test_msa_mini_u_w() {
15693        #[rustfmt::skip]
15694        let a = u32x4::new(1, 3, 6, 8);
15695        #[rustfmt::skip]
15696        let r = u32x4::new(1, 3, 5, 5);
15697
15698        assert_eq!(r, mem::transmute(__msa_mini_u_w::<5>(mem::transmute(a))));
15699    }
15700
15701    #[simd_test(enable = "msa")]
15702    unsafe fn test_msa_mini_u_d() {
15703        #[rustfmt::skip]
15704        let a = u64x2::new(1, 8);
15705        #[rustfmt::skip]
15706        let r = u64x2::new(1, 5);
15707
15708        assert_eq!(r, mem::transmute(__msa_mini_u_d::<5>(mem::transmute(a))));
15709    }
15710
15711    #[simd_test(enable = "msa")]
15712    unsafe fn test_msa_mod_s_b() {
15713        #[rustfmt::skip]
15714        let a = i8x16::new(
15715            -6, -7, -8, -9,
15716            6, 7, 8, 9,
15717            -6, -7, -8, -9,
15718            6, 7, 8, 9
15719        );
15720        #[rustfmt::skip]
15721        let b = i8x16::new(
15722            1, 2, 3, 4,
15723            -1, -2, -3, -4,
15724            1, 2, 3, 4,
15725            -1, -2, -3, -4
15726        );
15727        #[rustfmt::skip]
15728        let r = i8x16::new(
15729            0, -1, -2, -1,
15730            0, 1, 2, 1,
15731            0, -1, -2, -1,
15732            0, 1, 2, 1
15733        );
15734
15735        assert_eq!(
15736            r,
15737            mem::transmute(__msa_mod_s_b(mem::transmute(a), mem::transmute(b)))
15738        );
15739    }
15740
15741    #[simd_test(enable = "msa")]
15742    unsafe fn test_msa_mod_s_h() {
15743        #[rustfmt::skip]
15744        let a = i16x8::new(-6, 7, -8, 9, -6, 7, -8, 9);
15745        #[rustfmt::skip]
15746        let b = i16x8::new(1, -2, 3, -4, 1, -2, 3, -4);
15747        #[rustfmt::skip]
15748        let r = i16x8::new(0, 1, -2, 1, 0, 1, -2, 1);
15749
15750        assert_eq!(
15751            r,
15752            mem::transmute(__msa_mod_s_h(mem::transmute(a), mem::transmute(b)))
15753        );
15754    }
15755
15756    #[simd_test(enable = "msa")]
15757    unsafe fn test_msa_mod_s_w() {
15758        #[rustfmt::skip]
15759        let a = i32x4::new(6, 7, 8, 9);
15760        #[rustfmt::skip]
15761        let b = i32x4::new(1, -2, 3, -4);
15762        #[rustfmt::skip]
15763        let r = i32x4::new(0, 1, 2, 1);
15764
15765        assert_eq!(
15766            r,
15767            mem::transmute(__msa_mod_s_w(mem::transmute(a), mem::transmute(b)))
15768        );
15769    }
15770
15771    #[simd_test(enable = "msa")]
15772    unsafe fn test_msa_mod_s_d() {
15773        #[rustfmt::skip]
15774        let a = i64x2::new(6, -7);
15775        #[rustfmt::skip]
15776        let b = i64x2::new(-1, 2);
15777        #[rustfmt::skip]
15778        let r = i64x2::new(0, -1);
15779
15780        assert_eq!(
15781            r,
15782            mem::transmute(__msa_mod_s_d(mem::transmute(a), mem::transmute(b)))
15783        );
15784    }
15785
15786    #[simd_test(enable = "msa")]
15787    unsafe fn test_msa_mod_u_b() {
15788        #[rustfmt::skip]
15789        let a = u8x16::new(
15790            6, 7, 8, 9,
15791            6, 7, 8, 9,
15792            6, 7, 8, 9,
15793            6, 7, 8, 9
15794        );
15795        #[rustfmt::skip]
15796        let b = u8x16::new(
15797            1, 2, 3, 4,
15798            1, 2, 3, 4,
15799            1, 2, 3, 4,
15800            1, 2, 3, 4
15801        );
15802        #[rustfmt::skip]
15803        let r = u8x16::new(
15804            0, 1, 2, 1,
15805            0, 1, 2, 1,
15806            0, 1, 2, 1,
15807            0, 1, 2, 1
15808        );
15809
15810        assert_eq!(
15811            r,
15812            mem::transmute(__msa_mod_u_b(mem::transmute(a), mem::transmute(b)))
15813        );
15814    }
15815
15816    #[simd_test(enable = "msa")]
15817    unsafe fn test_msa_mod_u_h() {
15818        #[rustfmt::skip]
15819        let a = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
15820        #[rustfmt::skip]
15821        let b = u16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
15822        #[rustfmt::skip]
15823        let r = u16x8::new(0, 1, 2, 1, 0, 1, 2, 1);
15824
15825        assert_eq!(
15826            r,
15827            mem::transmute(__msa_mod_u_h(mem::transmute(a), mem::transmute(b)))
15828        );
15829    }
15830
15831    #[simd_test(enable = "msa")]
15832    unsafe fn test_msa_mod_u_w() {
15833        #[rustfmt::skip]
15834        let a = u32x4::new(6, 7, 8, 9);
15835        #[rustfmt::skip]
15836        let b = u32x4::new(1, 2, 3, 4);
15837        #[rustfmt::skip]
15838        let r = u32x4::new(0, 1, 2, 1);
15839
15840        assert_eq!(
15841            r,
15842            mem::transmute(__msa_mod_u_w(mem::transmute(a), mem::transmute(b)))
15843        );
15844    }
15845
15846    #[simd_test(enable = "msa")]
15847    unsafe fn test_msa_mod_u_d() {
15848        #[rustfmt::skip]
15849        let a = u64x2::new(6, 7);
15850        #[rustfmt::skip]
15851        let b = u64x2::new(1, 2);
15852        #[rustfmt::skip]
15853        let r = u64x2::new(0, 1);
15854
15855        assert_eq!(
15856            r,
15857            mem::transmute(__msa_mod_u_d(mem::transmute(a), mem::transmute(b)))
15858        );
15859    }
15860
15861    #[simd_test(enable = "msa")]
15862    unsafe fn test_msa_move_v() {
15863        #[rustfmt::skip]
15864        let a = i8x16::new(
15865            1, 2, 3, 4,
15866            5, 6, 7, 8,
15867            1, 2, 3, 4,
15868            5, 6, 7, 8
15869            );
15870        #[rustfmt::skip]
15871        let r = i8x16::new(
15872            1, 2, 3, 4,
15873            5, 6, 7, 8,
15874            1, 2, 3, 4,
15875            5, 6, 7, 8
15876            );
15877
15878        assert_eq!(r, mem::transmute(__msa_move_v(mem::transmute(a))));
15879    }
15880
15881    #[simd_test(enable = "msa")]
15882    unsafe fn test_msa_msub_q_h() {
15883        #[rustfmt::skip]
15884        let a = i16x8::new(
15885            1024, -1024, 1024, -1024,
15886            1, 2, 3, 4
15887        );
15888        #[rustfmt::skip]
15889        let b = i16x8::new(
15890            1025, 1025, 1025, 1025,
15891            1025, 1025, 1025, 1025
15892        );
15893        #[rustfmt::skip]
15894        let c = i16x8::new(
15895            1024, 2048, 3072, 4096,
15896            1024, 2048, 3072, 4096
15897        );
15898        #[rustfmt::skip]
15899        let r = i16x8::new(991, -1089, 927, -1153, -32, -63, -94, -125);
15900
15901        assert_eq!(
15902            r,
15903            mem::transmute(__msa_msub_q_h(
15904                mem::transmute(a),
15905                mem::transmute(b),
15906                mem::transmute(c)
15907            ))
15908        );
15909    }
15910
15911    #[simd_test(enable = "msa")]
15912    unsafe fn test_msa_msub_q_w() {
15913        #[rustfmt::skip]
15914        let a = i32x4::new(2147483647, -2147483647, 1, 2);
15915        #[rustfmt::skip]
15916        let b = i32x4::new(10240, 10240, 10240, 10240);
15917        #[rustfmt::skip]
15918        let c = i32x4::new(10240, 20480, 30720, 40960);
15919        #[rustfmt::skip]
15920        let r = i32x4::new(2147483646, -2147483648, 0, 1);
15921
15922        assert_eq!(
15923            r,
15924            mem::transmute(__msa_msub_q_w(
15925                mem::transmute(a),
15926                mem::transmute(b),
15927                mem::transmute(c)
15928            ))
15929        );
15930    }
15931
15932    #[simd_test(enable = "msa")]
15933    unsafe fn test_msa_msubr_q_h() {
15934        #[rustfmt::skip]
15935        let a = i16x8::new(
15936            1024, -1024, 1024, -1024,
15937            1, 2, 3, 4
15938        );
15939        #[rustfmt::skip]
15940        let b = i16x8::new(
15941            1025, 1025, 1025, 1025,
15942            1025, 1025, 1025, 1025
15943        );
15944        #[rustfmt::skip]
15945        let c = i16x8::new(
15946            1024, 2048, 3072, 4096,
15947            1024, 2048, 3072, 4096
15948        );
15949        #[rustfmt::skip]
15950        let r = i16x8::new(992, -1088, 928, -1152, -31, -62, -93, -124);
15951
15952        assert_eq!(
15953            r,
15954            mem::transmute(__msa_msubr_q_h(
15955                mem::transmute(a),
15956                mem::transmute(b),
15957                mem::transmute(c)
15958            ))
15959        );
15960    }
15961
15962    #[simd_test(enable = "msa")]
15963    unsafe fn test_msa_msubr_q_w() {
15964        #[rustfmt::skip]
15965        let a = i32x4::new(i32::MAX, -2147483647, 1, 2);
15966        #[rustfmt::skip]
15967        let b = i32x4::new(10240, 10240, 10240, 10240);
15968        #[rustfmt::skip]
15969        let c = i32x4::new(10240, 20480, 30720, 40960);
15970        #[rustfmt::skip]
15971        let r = i32x4::new(2147483647, -2147483647, 1, 2);
15972
15973        assert_eq!(
15974            r,
15975            mem::transmute(__msa_msubr_q_w(
15976                mem::transmute(a),
15977                mem::transmute(b),
15978                mem::transmute(c)
15979            ))
15980        );
15981    }
15982
15983    #[simd_test(enable = "msa")]
15984    unsafe fn test_msa_msubv_b() {
15985        #[rustfmt::skip]
15986        let a = i8x16::new(
15987            1, 2, 3, 4,
15988            1, 2, 3, 4,
15989            1, 2, 3, 4,
15990            1, 2, 3, 4
15991        );
15992        #[rustfmt::skip]
15993        let b = i8x16::new(
15994            5, 6, 7, 8,
15995            5, 6, 7, 8,
15996            5, 6, 7, 8,
15997            5, 6, 7, 8
15998        );
15999        #[rustfmt::skip]
16000        let c = i8x16::new(
16001            9, 10, 11, 12,
16002            9, 10, 11, 12,
16003            9, 10, 11, 12,
16004            9, 10, 11, 12
16005        );
16006        #[rustfmt::skip]
16007        let r = i8x16::new(
16008            -44, -58, -74, -92,
16009            -44, -58, -74, -92,
16010            -44, -58, -74, -92,
16011            -44, -58, -74, -92
16012        );
16013
16014        assert_eq!(
16015            r,
16016            mem::transmute(__msa_msubv_b(
16017                mem::transmute(a),
16018                mem::transmute(b),
16019                mem::transmute(c)
16020            ))
16021        );
16022    }
16023
16024    #[simd_test(enable = "msa")]
16025    unsafe fn test_msa_msubv_h() {
16026        #[rustfmt::skip]
16027        let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
16028        #[rustfmt::skip]
16029        let b = i16x8::new(5, 6, 7, 8, 5, 6, 7, 8);
16030        #[rustfmt::skip]
16031        let c = i16x8::new(9, 10, 11, 12, 9, 10, 11, 12);
16032        #[rustfmt::skip]
16033        let r = i16x8::new(-44, -58, -74, -92, -44, -58, -74, -92);
16034
16035        assert_eq!(
16036            r,
16037            mem::transmute(__msa_msubv_h(
16038                mem::transmute(a),
16039                mem::transmute(b),
16040                mem::transmute(c)
16041            ))
16042        );
16043    }
16044
16045    #[simd_test(enable = "msa")]
16046    unsafe fn test_msa_msubv_w() {
16047        #[rustfmt::skip]
16048        let a = i32x4::new(1, 2, 1, 2);
16049        #[rustfmt::skip]
16050        let b = i32x4::new(3, 4, 3, 4);
16051        #[rustfmt::skip]
16052        let c = i32x4::new(5, 6, 5, 6);
16053        #[rustfmt::skip]
16054        let r = i32x4::new(-14, -22, -14, -22);
16055
16056        assert_eq!(
16057            r,
16058            mem::transmute(__msa_msubv_w(
16059                mem::transmute(a),
16060                mem::transmute(b),
16061                mem::transmute(c)
16062            ))
16063        );
16064    }
16065
16066    #[simd_test(enable = "msa")]
16067    unsafe fn test_msa_msubv_d() {
16068        #[rustfmt::skip]
16069        let a = i64x2::new(1, 2);
16070        #[rustfmt::skip]
16071        let b = i64x2::new(3, 4);
16072        #[rustfmt::skip]
16073        let c = i64x2::new(5, 6);
16074        #[rustfmt::skip]
16075        let r = i64x2::new(-14, -22);
16076
16077        assert_eq!(
16078            r,
16079            mem::transmute(__msa_msubv_d(
16080                mem::transmute(a),
16081                mem::transmute(b),
16082                mem::transmute(c)
16083            ))
16084        );
16085    }
16086
16087    #[simd_test(enable = "msa")]
16088    unsafe fn test_msa_mul_q_h() {
16089        #[rustfmt::skip]
16090        let a = i16x8::new(
16091            12500, -20, -300, 400,
16092            12500, 20, 300, 400
16093        );
16094        #[rustfmt::skip]
16095        let b = i16x8::new(
16096            1250, 10240, -7585, 8456,
16097            1250, 10240, -7585, 8456
16098        );
16099        #[rustfmt::skip]
16100        let r = i16x8::new(476, -7, 69, 103, 476, 6, -70, 103);
16101
16102        assert_eq!(
16103            r,
16104            mem::transmute(__msa_mul_q_h(mem::transmute(a), mem::transmute(b)))
16105        );
16106    }
16107
16108    #[simd_test(enable = "msa")]
16109    unsafe fn test_msa_mul_q_w() {
16110        #[rustfmt::skip]
16111        let a = i32x4::new(
16112            i32::MAX, i32::MAX,
16113            i32::MIN, i32::MIN
16114        );
16115        #[rustfmt::skip]
16116        let b = i32x4::new(30, 60, 30, 60);
16117        #[rustfmt::skip]
16118        let r = i32x4::new(29, 59, -30, -60);
16119
16120        assert_eq!(
16121            r,
16122            mem::transmute(__msa_mul_q_w(mem::transmute(a), mem::transmute(b)))
16123        );
16124    }
16125
16126    #[simd_test(enable = "msa")]
16127    unsafe fn test_msa_mulr_q_h() {
16128        #[rustfmt::skip]
16129        let a = i16x8::new(
16130            12500, -20, -300, 400,
16131            12500, 20, 300, 400
16132        );
16133        #[rustfmt::skip]
16134        let b = i16x8::new(
16135            1250, 10240, -7585, 8456,
16136            1250, 10240, -7585, 8456
16137        );
16138        #[rustfmt::skip]
16139        let r = i16x8::new(477, -6, 69, 103, 477, 6, -69, 103);
16140
16141        assert_eq!(
16142            r,
16143            mem::transmute(__msa_mulr_q_h(mem::transmute(a), mem::transmute(b)))
16144        );
16145    }
16146
16147    #[simd_test(enable = "msa")]
16148    unsafe fn test_msa_mulr_q_w() {
16149        #[rustfmt::skip]
16150        let a = i32x4::new(
16151            i32::MAX, i32::MAX,
16152            i32::MIN, i32::MIN
16153        );
16154        #[rustfmt::skip]
16155        let b = i32x4::new(30, 60, 30, 60);
16156        #[rustfmt::skip]
16157        let r = i32x4::new(30, 60, -30, -60);
16158
16159        assert_eq!(
16160            r,
16161            mem::transmute(__msa_mulr_q_w(mem::transmute(a), mem::transmute(b)))
16162        );
16163    }
16164
16165    #[simd_test(enable = "msa")]
16166    unsafe fn test_msa_mulv_b() {
16167        #[rustfmt::skip]
16168        let a = i8x16::new(
16169            1, 2, 3, 4,
16170            5, 6, 7, 8,
16171            9, 10, 11, 12,
16172            13, 14, 15, 16
16173        );
16174        #[rustfmt::skip]
16175        let b = i8x16::new(
16176            16, 15, 14, 13,
16177            12, 11, 10, 9,
16178            8, 7, 6, 5,
16179            4, 3, 2, 1
16180        );
16181        #[rustfmt::skip]
16182        let r = i8x16::new(
16183            16, 30, 42, 52,
16184            60, 66, 70, 72,
16185            72, 70, 66, 60,
16186            52, 42, 30, 16
16187        );
16188
16189        assert_eq!(
16190            r,
16191            mem::transmute(__msa_mulv_b(mem::transmute(a), mem::transmute(b)))
16192        );
16193    }
16194
16195    #[simd_test(enable = "msa")]
16196    unsafe fn test_msa_mulv_h() {
16197        #[rustfmt::skip]
16198        let a = i16x8::new(
16199            1, 2, 3, 4,
16200            5, 6, 7, 8
16201        );
16202        #[rustfmt::skip]
16203        let b = i16x8::new(
16204            8, 7, 6, 5,
16205            4, 3, 2, 1
16206        );
16207        #[rustfmt::skip]
16208        let r = i16x8::new(8, 14, 18, 20, 20, 18, 14, 8);
16209
16210        assert_eq!(
16211            r,
16212            mem::transmute(__msa_mulv_h(mem::transmute(a), mem::transmute(b)))
16213        );
16214    }
16215
16216    #[simd_test(enable = "msa")]
16217    unsafe fn test_msa_mulv_w() {
16218        #[rustfmt::skip]
16219        let a = i32x4::new(1, 2, 3, 4);
16220        #[rustfmt::skip]
16221        let b = i32x4::new(4, 3, 2, 1);
16222        #[rustfmt::skip]
16223        let r = i32x4::new(4, 6, 6, 4);
16224
16225        assert_eq!(
16226            r,
16227            mem::transmute(__msa_mulv_w(mem::transmute(a), mem::transmute(b)))
16228        );
16229    }
16230
16231    #[simd_test(enable = "msa")]
16232    unsafe fn test_msa_mulv_d() {
16233        #[rustfmt::skip]
16234        let a = i64x2::new(1, 2);
16235        #[rustfmt::skip]
16236        let b = i64x2::new(2, 1);
16237        #[rustfmt::skip]
16238        let r = i64x2::new(2, 2);
16239
16240        assert_eq!(
16241            r,
16242            mem::transmute(__msa_mulv_d(mem::transmute(a), mem::transmute(b)))
16243        );
16244    }
16245
16246    #[simd_test(enable = "msa")]
16247    unsafe fn test_msa_nloc_b() {
16248        #[rustfmt::skip]
16249        let a = i8x16::new(
16250            -128, -64, -32, -16,
16251            -8, -4, -2, -1,
16252            1, 2, 4, 8,
16253            16, 32, 64, 127
16254        );
16255        #[rustfmt::skip]
16256        let r = i8x16::new(
16257            1, 2, 3, 4,
16258            5, 6, 7, 8,
16259            0, 0, 0, 0,
16260            0, 0, 0, 0
16261        );
16262
16263        assert_eq!(r, mem::transmute(__msa_nloc_b(mem::transmute(a))));
16264    }
16265
16266    #[simd_test(enable = "msa")]
16267    unsafe fn test_msa_nloc_h() {
16268        #[rustfmt::skip]
16269        let a = i16x8::new(
16270            -32768, -16384, -8192, -4096,
16271            4096, 8192, 16384, 32767
16272        );
16273        #[rustfmt::skip]
16274        let r = i16x8::new(1, 2, 3, 4, 0, 0, 0, 0);
16275
16276        assert_eq!(r, mem::transmute(__msa_nloc_h(mem::transmute(a))));
16277    }
16278
16279    #[simd_test(enable = "msa")]
16280    unsafe fn test_msa_nloc_w() {
16281        #[rustfmt::skip]
16282        let a = i32x4::new(
16283            i32::MIN, -1073741824,
16284            1073741824, i32::MAX
16285        );
16286        #[rustfmt::skip]
16287        let r = i32x4::new(1, 2, 0, 0);
16288
16289        assert_eq!(r, mem::transmute(__msa_nloc_w(mem::transmute(a))));
16290    }
16291
16292    #[simd_test(enable = "msa")]
16293    unsafe fn test_msa_nloc_d() {
16294        #[rustfmt::skip]
16295        let a = i64x2::new(i64::MIN, i64::MAX);
16296        #[rustfmt::skip]
16297        let r = i64x2::new(1, 0);
16298
16299        assert_eq!(r, mem::transmute(__msa_nloc_d(mem::transmute(a))));
16300    }
16301
16302    #[simd_test(enable = "msa")]
16303    unsafe fn test_msa_nlzc_b() {
16304        #[rustfmt::skip]
16305        let a = i8x16::new(
16306            1, 2, 3, 4,
16307            5, 6, 7, 8,
16308            9, 10, 11, 12,
16309            13, 14, 15, 16
16310        );
16311        #[rustfmt::skip]
16312        let r = i8x16::new(
16313            7, 6, 6, 5,
16314            5, 5, 5, 4,
16315            4, 4, 4, 4,
16316            4, 4, 4, 3
16317        );
16318
16319        assert_eq!(r, mem::transmute(__msa_nlzc_b(mem::transmute(a))));
16320    }
16321
16322    #[simd_test(enable = "msa")]
16323    unsafe fn test_msa_nlzc_h() {
16324        #[rustfmt::skip]
16325        let a = i16x8::new(
16326            1, 2, 3, 4,
16327            5, 6, 7, 8
16328        );
16329        #[rustfmt::skip]
16330        let r = i16x8::new(15, 14, 14, 13, 13, 13, 13, 12);
16331
16332        assert_eq!(r, mem::transmute(__msa_nlzc_h(mem::transmute(a))));
16333    }
16334
16335    #[simd_test(enable = "msa")]
16336    unsafe fn test_msa_nlzc_w() {
16337        #[rustfmt::skip]
16338        let a = i32x4::new(1, 2, 3, 4);
16339        #[rustfmt::skip]
16340        let r = i32x4::new(31, 30, 30, 29);
16341
16342        assert_eq!(r, mem::transmute(__msa_nlzc_w(mem::transmute(a))));
16343    }
16344
16345    #[simd_test(enable = "msa")]
16346    unsafe fn test_msa_nlzc_d() {
16347        #[rustfmt::skip]
16348        let a = i64x2::new(1, 2);
16349        #[rustfmt::skip]
16350        let r = i64x2::new(63, 62);
16351
16352        assert_eq!(r, mem::transmute(__msa_nlzc_d(mem::transmute(a))));
16353    }
16354
16355    #[simd_test(enable = "msa")]
16356    unsafe fn test_msa_nor_v() {
16357        #[rustfmt::skip]
16358        let a = u8x16::new(
16359            1, 2, 3, 4,
16360            5, 6, 7, 8,
16361            9, 10, 11, 12,
16362            13, 14, 15, 16
16363        );
16364        #[rustfmt::skip]
16365        let b = u8x16::new(
16366            1, 2, 3, 4,
16367            5, 6, 7, 8,
16368            9, 10, 11, 12,
16369            13, 14, 15, 16
16370        );
16371        #[rustfmt::skip]
16372        let r = u8x16::new(
16373            254, 253, 252, 251,
16374            250, 249, 248, 247,
16375            246, 245, 244, 243,
16376            242, 241, 240, 239
16377        );
16378
16379        assert_eq!(
16380            r,
16381            mem::transmute(__msa_nor_v(mem::transmute(a), mem::transmute(b)))
16382        );
16383    }
16384
16385    #[simd_test(enable = "msa")]
16386    unsafe fn test_msa_nori_b() {
16387        #[rustfmt::skip]
16388        let a = u8x16::new(
16389            1, 2, 3, 4,
16390            5, 6, 7, 8,
16391            9, 10, 11, 12,
16392            13, 14, 15, 16
16393        );
16394        #[rustfmt::skip]
16395        let r = u8x16::new(
16396            250, 249, 248, 251,
16397            250, 249, 248, 243,
16398            242, 241, 240, 243,
16399            242, 241, 240, 235
16400        );
16401
16402        assert_eq!(r, mem::transmute(__msa_nori_b::<4>(mem::transmute(a))));
16403    }
16404
16405    #[simd_test(enable = "msa")]
16406    unsafe fn test_msa_or_v() {
16407        #[rustfmt::skip]
16408        let a = u8x16::new(
16409            1, 2, 3, 4,
16410            5, 6, 7, 8,
16411            9, 10, 11, 12,
16412            13, 14, 15, 16
16413        );
16414        #[rustfmt::skip]
16415        let b = u8x16::new(
16416            1, 2, 3, 4,
16417            5, 6, 7, 8,
16418            9, 10, 11, 12,
16419            13, 14, 15, 16
16420        );
16421        #[rustfmt::skip]
16422        let r = u8x16::new(
16423            1, 2, 3, 4,
16424            5, 6, 7, 8,
16425            9, 10, 11, 12,
16426            13, 14, 15, 16
16427        );
16428
16429        assert_eq!(
16430            r,
16431            mem::transmute(__msa_or_v(mem::transmute(a), mem::transmute(b)))
16432        );
16433    }
16434
16435    #[simd_test(enable = "msa")]
16436    unsafe fn test_msa_ori_b() {
16437        #[rustfmt::skip]
16438        let a = u8x16::new(
16439            1, 2, 3, 4,
16440            5, 6, 7, 8,
16441            9, 10, 11, 12,
16442            13, 14, 15, 16
16443        );
16444        #[rustfmt::skip]
16445        let r = u8x16::new(
16446            5, 6, 7, 4,
16447            5, 6, 7, 12,
16448            13, 14, 15, 12,
16449            13, 14, 15, 20
16450        );
16451
16452        assert_eq!(r, mem::transmute(__msa_ori_b::<4>(mem::transmute(a))));
16453    }
16454
16455    #[simd_test(enable = "msa")]
16456    unsafe fn test_msa_pckev_b() {
16457        #[rustfmt::skip]
16458        let a = i8x16::new(
16459            1, 2, 3, 4,
16460            1, 2, 3, 4,
16461            1, 2, 3, 4,
16462            1, 2, 3, 4
16463        );
16464        #[rustfmt::skip]
16465        let b = i8x16::new(
16466            4, 3, 2, 1,
16467            4, 3, 2, 1,
16468            4, 3, 2, 1,
16469            4, 3, 2, 1
16470        );
16471        #[rustfmt::skip]
16472        let r = i8x16::new(
16473            4, 2, 4, 2,
16474            4, 2, 4, 2,
16475            1, 3, 1, 3,
16476            1, 3, 1, 3
16477        );
16478
16479        assert_eq!(
16480            r,
16481            mem::transmute(__msa_pckev_b(mem::transmute(a), mem::transmute(b)))
16482        );
16483    }
16484
16485    #[simd_test(enable = "msa")]
16486    unsafe fn test_msa_pckev_h() {
16487        #[rustfmt::skip]
16488        let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
16489        #[rustfmt::skip]
16490        let b = i16x8::new(4, 3, 2, 1, 4, 3, 2, 1);
16491        #[rustfmt::skip]
16492        let r = i16x8::new(4, 2, 4, 2, 1, 3, 1, 3);
16493
16494        assert_eq!(
16495            r,
16496            mem::transmute(__msa_pckev_h(mem::transmute(a), mem::transmute(b)))
16497        );
16498    }
16499
16500    #[simd_test(enable = "msa")]
16501    unsafe fn test_msa_pckev_w() {
16502        #[rustfmt::skip]
16503        let a = i32x4::new(1, 2, 3, 4);
16504        #[rustfmt::skip]
16505        let b = i32x4::new(4, 3, 2, 1);
16506        #[rustfmt::skip]
16507        let r = i32x4::new(4, 2, 1, 3);
16508
16509        assert_eq!(
16510            r,
16511            mem::transmute(__msa_pckev_w(mem::transmute(a), mem::transmute(b)))
16512        );
16513    }
16514
16515    #[simd_test(enable = "msa")]
16516    unsafe fn test_msa_pckev_d() {
16517        #[rustfmt::skip]
16518        let a = i64x2::new(1, 2);
16519        #[rustfmt::skip]
16520        let b = i64x2::new(4, 3);
16521        #[rustfmt::skip]
16522        let r = i64x2::new(4, 1);
16523
16524        assert_eq!(
16525            r,
16526            mem::transmute(__msa_pckev_d(mem::transmute(a), mem::transmute(b)))
16527        );
16528    }
16529
16530    #[simd_test(enable = "msa")]
16531    unsafe fn test_msa_pckod_b() {
16532        #[rustfmt::skip]
16533        let a = i8x16::new(
16534            1, 2, 3, 4,
16535            1, 2, 3, 4,
16536            1, 2, 3, 4,
16537            1, 2, 3, 4
16538        );
16539        #[rustfmt::skip]
16540        let b = i8x16::new(
16541            4, 3, 2, 1,
16542            4, 3, 2, 1,
16543            4, 3, 2, 1,
16544            4, 3, 2, 1
16545        );
16546        #[rustfmt::skip]
16547        let r = i8x16::new(
16548            3, 1, 3, 1,
16549            3, 1, 3, 1,
16550            2, 4, 2, 4,
16551            2, 4, 2, 4
16552        );
16553
16554        assert_eq!(
16555            r,
16556            mem::transmute(__msa_pckod_b(mem::transmute(a), mem::transmute(b)))
16557        );
16558    }
16559
16560    #[simd_test(enable = "msa")]
16561    unsafe fn test_msa_pckod_h() {
16562        #[rustfmt::skip]
16563        let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
16564        #[rustfmt::skip]
16565        let b = i16x8::new(4, 3, 2, 1, 4, 3, 2, 1);
16566        #[rustfmt::skip]
16567        let r = i16x8::new(3, 1, 3, 1, 2, 4, 2, 4);
16568
16569        assert_eq!(
16570            r,
16571            mem::transmute(__msa_pckod_h(mem::transmute(a), mem::transmute(b)))
16572        );
16573    }
16574
16575    #[simd_test(enable = "msa")]
16576    unsafe fn test_msa_pckod_w() {
16577        #[rustfmt::skip]
16578        let a = i32x4::new(1, 2, 3, 4);
16579        #[rustfmt::skip]
16580        let b = i32x4::new(4, 3, 2, 1);
16581        #[rustfmt::skip]
16582        let r = i32x4::new(3, 1, 2, 4);
16583
16584        assert_eq!(
16585            r,
16586            mem::transmute(__msa_pckod_w(mem::transmute(a), mem::transmute(b)))
16587        );
16588    }
16589
16590    #[simd_test(enable = "msa")]
16591    unsafe fn test_msa_pckod_d() {
16592        #[rustfmt::skip]
16593        let a = i64x2::new(1, 2);
16594        #[rustfmt::skip]
16595        let b = i64x2::new(4, 3);
16596        #[rustfmt::skip]
16597        let r = i64x2::new(3, 2);
16598
16599        assert_eq!(
16600            r,
16601            mem::transmute(__msa_pckod_d(mem::transmute(a), mem::transmute(b)))
16602        );
16603    }
16604
16605    #[simd_test(enable = "msa")]
16606    unsafe fn test_msa_pcnt_b() {
16607        #[rustfmt::skip]
16608        let a = i8x16::new(
16609            -128, -64, -32, -16,
16610            -8, -4, -2, -1,
16611            1, 2, 4, 8,
16612            16, 32, 64, 127
16613        );
16614        #[rustfmt::skip]
16615        let r = i8x16::new(
16616            1, 2, 3, 4,
16617            5, 6, 7, 8,
16618            1, 1, 1, 1,
16619            1, 1, 1, 7
16620        );
16621
16622        assert_eq!(r, mem::transmute(__msa_pcnt_b(mem::transmute(a))));
16623    }
16624
16625    #[simd_test(enable = "msa")]
16626    unsafe fn test_msa_pcnt_h() {
16627        #[rustfmt::skip]
16628        let a = i16x8::new(
16629            -32768, -16384, -8192, -4096,
16630            4096, 8192, 16384, 32767
16631        );
16632        #[rustfmt::skip]
16633        let r = i16x8::new(1, 2, 3, 4, 1, 1, 1, 15);
16634
16635        assert_eq!(r, mem::transmute(__msa_pcnt_h(mem::transmute(a))));
16636    }
16637
16638    #[simd_test(enable = "msa")]
16639    unsafe fn test_msa_pcnt_w() {
16640        #[rustfmt::skip]
16641        let a = i32x4::new(
16642            i32::MIN, -1073741824,
16643            1073741824, i32::MAX
16644        );
16645        #[rustfmt::skip]
16646        let r = i32x4::new(1, 2, 1, 31);
16647
16648        assert_eq!(r, mem::transmute(__msa_pcnt_w(mem::transmute(a))));
16649    }
16650
16651    #[simd_test(enable = "msa")]
16652    unsafe fn test_msa_pcnt_d() {
16653        #[rustfmt::skip]
16654        let a = i64x2::new(-2147483648, 2147483647);
16655        #[rustfmt::skip]
16656        let r = i64x2::new(33, 31);
16657
16658        assert_eq!(r, mem::transmute(__msa_pcnt_d(mem::transmute(a))));
16659    }
16660
16661    #[simd_test(enable = "msa")]
16662    unsafe fn test_msa_sat_s_b() {
16663        #[rustfmt::skip]
16664        let a = i8x16::new(
16665            i8::MAX, 105, 30, 1,
16666            i8::MAX, 105, 30, 1,
16667            i8::MAX, 105, 30, 1,
16668            i8::MAX, 105, 30, 1
16669        );
16670        #[rustfmt::skip]
16671        let r = i8x16::new(
16672            3, 3, 3, 1,
16673            3, 3, 3, 1,
16674            3, 3, 3, 1,
16675            3, 3, 3, 1
16676        );
16677
16678        assert_eq!(r, mem::transmute(__msa_sat_s_b::<2>(mem::transmute(a))));
16679    }
16680
16681    #[simd_test(enable = "msa")]
16682    unsafe fn test_msa_sat_s_h() {
16683        #[rustfmt::skip]
16684        let a = i16x8::new(
16685            i16::MAX, 1155, 155, 1,
16686            i16::MAX, 1155, 155, 1
16687        );
16688        #[rustfmt::skip]
16689        let r = i16x8::new(127, 127, 127, 1, 127, 127, 127, 1);
16690
16691        assert_eq!(r, mem::transmute(__msa_sat_s_h::<7>(mem::transmute(a))));
16692    }
16693
16694    #[simd_test(enable = "msa")]
16695    unsafe fn test_msa_sat_s_w() {
16696        #[rustfmt::skip]
16697        let a = i32x4::new(i32::MAX, 111111155, i32::MAX, 1);
16698        #[rustfmt::skip]
16699        let r = i32x4::new(131071, 131071, 131071, 1);
16700
16701        assert_eq!(r, mem::transmute(__msa_sat_s_w::<17>(mem::transmute(a))));
16702    }
16703
16704    #[simd_test(enable = "msa")]
16705    unsafe fn test_msa_sat_s_d() {
16706        #[rustfmt::skip]
16707        let a = i64x2::new(i64::MAX, 1);
16708        #[rustfmt::skip]
16709        let r = i64x2::new(137438953471, 1);
16710
16711        assert_eq!(r, mem::transmute(__msa_sat_s_d::<37>(mem::transmute(a))));
16712    }
16713
16714    #[simd_test(enable = "msa")]
16715    unsafe fn test_msa_sat_u_b() {
16716        #[rustfmt::skip]
16717        let a = u8x16::new(
16718            u8::MAX, 105, 30, 1,
16719            u8::MAX, 105, 30, 1,
16720            u8::MAX, 105, 30, 1,
16721            u8::MAX, 105, 30, 1
16722        );
16723        #[rustfmt::skip]
16724        let r = u8x16::new(
16725            7, 7, 7, 1,
16726            7, 7, 7, 1,
16727            7, 7, 7, 1,
16728            7, 7, 7, 1
16729        );
16730
16731        assert_eq!(r, mem::transmute(__msa_sat_u_b::<2>(mem::transmute(a))));
16732    }
16733
16734    #[simd_test(enable = "msa")]
16735    unsafe fn test_msa_sat_u_h() {
16736        #[rustfmt::skip]
16737        let a = u16x8::new(
16738            u16::MAX, 1155, 155, 1,
16739            u16::MAX, 1155, 155, 1
16740        );
16741        #[rustfmt::skip]
16742        let r = u16x8::new(255, 255, 155, 1, 255, 255, 155, 1);
16743
16744        assert_eq!(r, mem::transmute(__msa_sat_u_h::<7>(mem::transmute(a))));
16745    }
16746
16747    #[simd_test(enable = "msa")]
16748    unsafe fn test_msa_sat_u_w() {
16749        #[rustfmt::skip]
16750        let a = u32x4::new(u32::MAX, 111111155, u32::MAX, 1);
16751        #[rustfmt::skip]
16752        let r = u32x4::new(262143, 262143, 262143, 1);
16753
16754        assert_eq!(r, mem::transmute(__msa_sat_u_w::<17>(mem::transmute(a))));
16755    }
16756
16757    #[simd_test(enable = "msa")]
16758    unsafe fn test_msa_sat_u_d() {
16759        #[rustfmt::skip]
16760        let a = u64x2::new(u64::MAX, 1);
16761        #[rustfmt::skip]
16762        let r = u64x2::new(274877906943, 1);
16763
16764        assert_eq!(r, mem::transmute(__msa_sat_u_d::<37>(mem::transmute(a))));
16765    }
16766
16767    #[simd_test(enable = "msa")]
16768    unsafe fn test_msa_shf_b() {
16769        #[rustfmt::skip]
16770        let a = i8x16::new(
16771            11, 12, 3, 4,
16772            11, 12, 3, 4,
16773            11, 12, 3, 4,
16774            11, 12, 3, 4
16775        );
16776        #[rustfmt::skip]
16777        let r = i8x16::new(
16778            11, 3, 4, 12,
16779            11, 3, 4, 12,
16780            11, 3, 4, 12,
16781            11, 3, 4, 12
16782        );
16783
16784        assert_eq!(r, mem::transmute(__msa_shf_b::<120>(mem::transmute(a))));
16785    }
16786
16787    #[simd_test(enable = "msa")]
16788    unsafe fn test_msa_shf_h() {
16789        #[rustfmt::skip]
16790        let a = i16x8::new(
16791            11, 12, 13, 14,
16792            11, 12, 13, 14
16793        );
16794        #[rustfmt::skip]
16795        let r = i16x8::new(11, 14, 12, 13, 11, 14, 12, 13);
16796
16797        assert_eq!(r, mem::transmute(__msa_shf_h::<156>(mem::transmute(a))));
16798    }
16799
16800    #[simd_test(enable = "msa")]
16801    unsafe fn test_msa_shf_w() {
16802        #[rustfmt::skip]
16803        let a = i32x4::new(1, 2, 3, 4);
16804        #[rustfmt::skip]
16805        let r = i32x4::new(1, 3, 2, 4);
16806
16807        assert_eq!(r, mem::transmute(__msa_shf_w::<216>(mem::transmute(a))));
16808    }
16809
16810    #[simd_test(enable = "msa")]
16811    unsafe fn test_msa_sld_b() {
16812        #[rustfmt::skip]
16813        let a = i8x16::new(
16814            0, 1, 2, 3,
16815            4, 5, 6, 7,
16816            8, 9, 10, 11,
16817            12, 13, 14, 15
16818        );
16819        #[rustfmt::skip]
16820        let b = i8x16::new(
16821            16, 17, 18, 19,
16822            20, 21, 22, 23,
16823            24, 25, 26, 27,
16824            28, 29, 30, 31
16825        );
16826        #[rustfmt::skip]
16827        let r = i8x16::new(
16828            21, 22, 23, 24,
16829            25, 26, 27, 28,
16830            29, 30, 31, 0,
16831            1, 2, 3, 4
16832        );
16833
16834        assert_eq!(
16835            r,
16836            mem::transmute(__msa_sld_b(mem::transmute(a), mem::transmute(b), 5))
16837        );
16838    }
16839
16840    #[simd_test(enable = "msa")]
16841    unsafe fn test_msa_sld_h() {
16842        #[rustfmt::skip]
16843        let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
16844        #[rustfmt::skip]
16845        let b = i16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
16846        // let c = 5 as i32;
16847        let r = i16x8::new(9, 10, 11, 0, 13, 14, 15, 4);
16848
16849        assert_eq!(
16850            r,
16851            mem::transmute(__msa_sld_h(mem::transmute(a), mem::transmute(b), 2))
16852        );
16853    }
16854
16855    #[simd_test(enable = "msa")]
16856    unsafe fn test_msa_sld_w() {
16857        #[rustfmt::skip]
16858        let a = i32x4::new(0, 1, 2, 3);
16859        #[rustfmt::skip]
16860        let b = i32x4::new(4, 5, 6, 7);
16861        #[rustfmt::skip]
16862        let r = i32x4::new(4, 5, 6, 7);
16863
16864        assert_eq!(
16865            r,
16866            mem::transmute(__msa_sld_w(mem::transmute(a), mem::transmute(b), 4))
16867        );
16868    }
16869
16870    #[simd_test(enable = "msa")]
16871    unsafe fn test_msa_sld_d() {
16872        #[rustfmt::skip]
16873        let a = i64x2::new(0, 1);
16874        #[rustfmt::skip]
16875        let b = i64x2::new(2, 3);
16876        #[rustfmt::skip]
16877        let r = i64x2::new(2, 3);
16878
16879        assert_eq!(
16880            r,
16881            mem::transmute(__msa_sld_d(mem::transmute(a), mem::transmute(b), 2))
16882        );
16883    }
16884
16885    #[simd_test(enable = "msa")]
16886    unsafe fn test_msa_sldi_b() {
16887        #[rustfmt::skip]
16888        let a = i8x16::new(
16889            0, 1, 2, 3,
16890            4, 5, 6, 7,
16891            8, 9, 10, 11,
16892            12, 13, 14, 15
16893        );
16894        #[rustfmt::skip]
16895        let b = i8x16::new(
16896            16, 17, 18, 19,
16897            20, 21, 22, 23,
16898            24, 25, 26, 27,
16899            28, 29, 30, 31
16900        );
16901        #[rustfmt::skip]
16902        let r = i8x16::new(
16903            21, 22, 23, 24,
16904            25, 26, 27, 28,
16905            29, 30, 31, 0,
16906            1, 2, 3, 4
16907        );
16908
16909        assert_eq!(
16910            r,
16911            mem::transmute(__msa_sldi_b::<5>(mem::transmute(a), mem::transmute(b)))
16912        );
16913    }
16914
16915    #[simd_test(enable = "msa")]
16916    unsafe fn test_msa_sldi_h() {
16917        #[rustfmt::skip]
16918        let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7);
16919        #[rustfmt::skip]
16920        let b = i16x8::new(8, 9, 10, 11, 12, 13, 14, 15);
16921        // let c = 5 as i32;
16922        let r = i16x8::new(9, 10, 11, 0, 13, 14, 15, 4);
16923
16924        assert_eq!(
16925            r,
16926            mem::transmute(__msa_sldi_h::<2>(mem::transmute(a), mem::transmute(b)))
16927        );
16928    }
16929
16930    #[simd_test(enable = "msa")]
16931    unsafe fn test_msa_sldi_w() {
16932        #[rustfmt::skip]
16933        let a = i32x4::new(0, 1, 2, 3);
16934        #[rustfmt::skip]
16935        let b = i32x4::new(4, 5, 6, 7);
16936        #[rustfmt::skip]
16937        let r = i32x4::new(4, 5, 6, 7);
16938
16939        assert_eq!(
16940            r,
16941            mem::transmute(__msa_sldi_w::<0>(mem::transmute(a), mem::transmute(b)))
16942        );
16943    }
16944
16945    #[simd_test(enable = "msa")]
16946    unsafe fn test_msa_sldi_d() {
16947        #[rustfmt::skip]
16948        let a = i64x2::new(0, 1);
16949        #[rustfmt::skip]
16950        let b = i64x2::new(2, 3);
16951        #[rustfmt::skip]
16952        let r = i64x2::new(2, 3);
16953
16954        assert_eq!(
16955            r,
16956            mem::transmute(__msa_sldi_d::<0>(mem::transmute(a), mem::transmute(b)))
16957        );
16958    }
16959
16960    #[simd_test(enable = "msa")]
16961    unsafe fn test_msa_sll_b() {
16962        #[rustfmt::skip]
16963        let a = i8x16::new(
16964            1, 2, 3, 4,
16965            1, 2, 3, 4,
16966            1, 2, 3, 4,
16967            1, 2, 3, 4
16968        );
16969        #[rustfmt::skip]
16970        let b = i8x16::new(
16971            4, 3, 2, 1,
16972            4, 3, 2, 1,
16973            4, 3, 2, 1,
16974            4, 3, 2, 1
16975        );
16976        #[rustfmt::skip]
16977        let r = i8x16::new(
16978            16, 16, 12, 8,
16979            16, 16, 12, 8,
16980            16, 16, 12, 8,
16981            16, 16, 12, 8
16982        );
16983
16984        assert_eq!(
16985            r,
16986            mem::transmute(__msa_sll_b(mem::transmute(a), mem::transmute(b)))
16987        );
16988    }
16989
16990    #[simd_test(enable = "msa")]
16991    unsafe fn test_msa_sll_h() {
16992        #[rustfmt::skip]
16993        let a = i16x8::new(1, 2, 3, 4, 1, 2, 3, 4);
16994        #[rustfmt::skip]
16995        let b = i16x8::new(4, 3, 2, 1, 4, 3, 2, 1);
16996        #[rustfmt::skip]
16997        let r = i16x8::new(16, 16, 12, 8, 16, 16, 12, 8);
16998
16999        assert_eq!(
17000            r,
17001            mem::transmute(__msa_sll_h(mem::transmute(a), mem::transmute(b)))
17002        );
17003    }
17004
17005    #[simd_test(enable = "msa")]
17006    unsafe fn test_msa_sll_w() {
17007        #[rustfmt::skip]
17008        let a = i32x4::new(1, 2, 3, 4);
17009        #[rustfmt::skip]
17010        let b = i32x4::new(4, 3, 2, 1);
17011        #[rustfmt::skip]
17012        let r = i32x4::new(16, 16, 12, 8);
17013
17014        assert_eq!(
17015            r,
17016            mem::transmute(__msa_sll_w(mem::transmute(a), mem::transmute(b)))
17017        );
17018    }
17019
17020    #[simd_test(enable = "msa")]
17021    unsafe fn test_msa_sll_d() {
17022        #[rustfmt::skip]
17023        let a = i64x2::new(1, 2);
17024        #[rustfmt::skip]
17025        let b = i64x2::new(4, 3);
17026        #[rustfmt::skip]
17027        let r = i64x2::new(16, 16);
17028
17029        assert_eq!(
17030            r,
17031            mem::transmute(__msa_sll_d(mem::transmute(a), mem::transmute(b)))
17032        );
17033    }
17034
17035    #[simd_test(enable = "msa")]
17036    unsafe fn test_msa_slli_b() {
17037        #[rustfmt::skip]
17038        let a = i8x16::new(
17039            1, 2, 3, 4,
17040            1, 2, 3, 4,
17041            1, 2, 3, 4,
17042            1, 2, 3, 4
17043        );
17044        #[rustfmt::skip]
17045        let r = i8x16::new(
17046            4, 8, 12, 16,
17047            4, 8, 12, 16,
17048            4, 8, 12, 16,
17049            4, 8, 12, 16
17050        );
17051
17052        assert_eq!(r, mem::transmute(__msa_slli_b::<2>(mem::transmute(a))));
17053    }
17054
17055    #[simd_test(enable = "msa")]
17056    unsafe fn test_msa_slli_h() {
17057        #[rustfmt::skip]
17058        let a = i16x8::new(
17059            1, 2, 3, 4,
17060            1, 2, 3, 4
17061        );
17062        #[rustfmt::skip]
17063        let r = i16x8::new(4, 8, 12, 16, 4, 8, 12, 16);
17064
17065        assert_eq!(r, mem::transmute(__msa_slli_h::<2>(mem::transmute(a))));
17066    }
17067
17068    #[simd_test(enable = "msa")]
17069    unsafe fn test_msa_slli_w() {
17070        #[rustfmt::skip]
17071        let a = i32x4::new(1, 2, 3, 4);
17072        #[rustfmt::skip]
17073        let r = i32x4::new(4, 8, 12, 16);
17074
17075        assert_eq!(r, mem::transmute(__msa_slli_w::<2>(mem::transmute(a))));
17076    }
17077
17078    #[simd_test(enable = "msa")]
17079    unsafe fn test_msa_slli_d() {
17080        #[rustfmt::skip]
17081        let a = i64x2::new(1, 2);
17082        #[rustfmt::skip]
17083        let r = i64x2::new(2, 4);
17084
17085        assert_eq!(r, mem::transmute(__msa_slli_d::<1>(mem::transmute(a))));
17086    }
17087
17088    #[simd_test(enable = "msa")]
17089    unsafe fn test_msa_splat_b() {
17090        #[rustfmt::skip]
17091        let a = i8x16::new(
17092            1, 2, 3, 4,
17093            1, 2, 3, 4,
17094            1, 2, 3, 4,
17095            1, 2, 3, 4
17096        );
17097        #[rustfmt::skip]
17098        let r = i8x16::new(
17099            4, 4, 4, 4,
17100            4, 4, 4, 4,
17101            4, 4, 4, 4,
17102            4, 4, 4, 4
17103        );
17104
17105        assert_eq!(r, mem::transmute(__msa_splat_b(mem::transmute(a), 3)));
17106    }
17107
17108    #[simd_test(enable = "msa")]
17109    unsafe fn test_msa_splat_h() {
17110        #[rustfmt::skip]
17111        let a = i16x8::new(
17112            1, 2, 3, 4,
17113            1, 2, 3, 4,
17114        );
17115        #[rustfmt::skip]
17116        let r = i16x8::new(4, 4, 4, 4, 4, 4, 4, 4);
17117
17118        assert_eq!(r, mem::transmute(__msa_splat_h(mem::transmute(a), 3)));
17119    }
17120
17121    #[simd_test(enable = "msa")]
17122    unsafe fn test_msa_splat_w() {
17123        #[rustfmt::skip]
17124        let a = i32x4::new(1, 2, 3, 4);
17125        #[rustfmt::skip]
17126        let r = i32x4::new(4, 4, 4, 4);
17127
17128        assert_eq!(r, mem::transmute(__msa_splat_w(mem::transmute(a), 3)));
17129    }
17130
17131    #[simd_test(enable = "msa")]
17132    unsafe fn test_msa_splat_d() {
17133        #[rustfmt::skip]
17134        let a = i64x2::new(1, 2);
17135        #[rustfmt::skip]
17136        let r = i64x2::new(2, 2);
17137
17138        assert_eq!(r, mem::transmute(__msa_splat_d(mem::transmute(a), 3)));
17139    }
17140
17141    #[simd_test(enable = "msa")]
17142    unsafe fn test_msa_splati_b() {
17143        #[rustfmt::skip]
17144        let a = i8x16::new(
17145            1, 2, 3, 4,
17146            1, 2, 3, 4,
17147            1, 2, 3, 4,
17148            1, 2, 3, 4
17149        );
17150        #[rustfmt::skip]
17151        let r = i8x16::new(
17152            3, 3, 3, 3,
17153            3, 3, 3, 3,
17154            3, 3, 3, 3,
17155            3, 3, 3, 3
17156        );
17157
17158        assert_eq!(r, mem::transmute(__msa_splati_b::<2>(mem::transmute(a))));
17159    }
17160
17161    #[simd_test(enable = "msa")]
17162    unsafe fn test_msa_splati_h() {
17163        #[rustfmt::skip]
17164        let a = i16x8::new(
17165            1, 2, 3, 4,
17166            1, 2, 3, 4,
17167        );
17168        #[rustfmt::skip]
17169        let r = i16x8::new(3, 3, 3, 3, 3, 3, 3, 3);
17170
17171        assert_eq!(r, mem::transmute(__msa_splati_h::<2>(mem::transmute(a))));
17172    }
17173
17174    #[simd_test(enable = "msa")]
17175    unsafe fn test_msa_splati_w() {
17176        #[rustfmt::skip]
17177        let a = i32x4::new(1, 2, 3, 4);
17178        #[rustfmt::skip]
17179        let r = i32x4::new(3, 3, 3, 3);
17180
17181        assert_eq!(r, mem::transmute(__msa_splati_w::<2>(mem::transmute(a))));
17182    }
17183
17184    #[simd_test(enable = "msa")]
17185    unsafe fn test_msa_splati_d() {
17186        #[rustfmt::skip]
17187        let a = i64x2::new(1, 2);
17188        #[rustfmt::skip]
17189        let r = i64x2::new(2, 2);
17190
17191        assert_eq!(r, mem::transmute(__msa_splati_d::<1>(mem::transmute(a))));
17192    }
17193
17194    #[simd_test(enable = "msa")]
17195    unsafe fn test_msa_sra_b() {
17196        #[rustfmt::skip]
17197        let a = i8x16::new(
17198            -128, -64, -32, -16,
17199            -8, -4, -2, -1,
17200            1, 2, 4, 8,
17201            16, 32, 64, 127
17202        );
17203        #[rustfmt::skip]
17204        let b = i8x16::new(
17205            8, 7, 6, 5,
17206            4, 3, 2, 1,
17207            8, 7, 6, 5,
17208            4, 3, 2, 1
17209        );
17210        #[rustfmt::skip]
17211        let r = i8x16::new(
17212            -128, -1, -1, -1,
17213            -1, -1, -1, -1,
17214            1, 0, 0, 0,
17215            1, 4, 16, 63
17216        );
17217
17218        assert_eq!(
17219            r,
17220            mem::transmute(__msa_sra_b(mem::transmute(a), mem::transmute(b)))
17221        );
17222    }
17223
17224    #[simd_test(enable = "msa")]
17225    unsafe fn test_msa_sra_h() {
17226        #[rustfmt::skip]
17227        let a = i16x8::new(
17228            -32768, -16384, -8192, -4096,
17229            1, 2, 3, 4
17230        );
17231        #[rustfmt::skip]
17232        let b = i16x8::new(
17233            15, 14, 13, 12,
17234            12, 13, 14, 15
17235        );
17236        #[rustfmt::skip]
17237        let r = i16x8::new(
17238            -1, -1, -1, -1,
17239            0, 0, 0, 0
17240        );
17241
17242        assert_eq!(
17243            r,
17244            mem::transmute(__msa_sra_h(mem::transmute(a), mem::transmute(b)))
17245        );
17246    }
17247
17248    #[simd_test(enable = "msa")]
17249    unsafe fn test_msa_sra_w() {
17250        #[rustfmt::skip]
17251        let a = i32x4::new(i32::MIN, -1073741824, 1, 2);
17252        #[rustfmt::skip]
17253        let b = i32x4::new(16, 15, 16, 15);
17254        #[rustfmt::skip]
17255        let r = i32x4::new(-32768, -32768, 0, 0);
17256
17257        assert_eq!(
17258            r,
17259            mem::transmute(__msa_sra_w(mem::transmute(a), mem::transmute(b)))
17260        );
17261    }
17262
17263    #[simd_test(enable = "msa")]
17264    unsafe fn test_msa_sra_d() {
17265        #[rustfmt::skip]
17266        let a = i64x2::new(i64::MIN, i64::MAX);
17267        #[rustfmt::skip]
17268        let b = i64x2::new(32, 31);
17269        #[rustfmt::skip]
17270        let r = i64x2::new(-2147483648, 4294967295);
17271
17272        assert_eq!(
17273            r,
17274            mem::transmute(__msa_sra_d(mem::transmute(a), mem::transmute(b)))
17275        );
17276    }
17277
17278    #[simd_test(enable = "msa")]
17279    unsafe fn test_msa_srai_b() {
17280        #[rustfmt::skip]
17281        let a = i8x16::new(
17282            i8::MAX, 125, 55, 1,
17283            i8::MAX, 125, 55, 1,
17284            i8::MAX, 125, 55, 1,
17285            i8::MAX, 125, 55, 1
17286        );
17287        #[rustfmt::skip]
17288        let r = i8x16::new(
17289            31, 31, 13, 0,
17290            31, 31, 13, 0,
17291            31, 31, 13, 0,
17292            31, 31, 13, 0
17293        );
17294
17295        assert_eq!(r, mem::transmute(__msa_srai_b::<2>(mem::transmute(a))));
17296    }
17297
17298    #[simd_test(enable = "msa")]
17299    unsafe fn test_msa_srai_h() {
17300        #[rustfmt::skip]
17301        let a = i16x8::new(
17302            i16::MAX, 125, 55, 1,
17303            i16::MAX, 125, 55, 1
17304        );
17305        #[rustfmt::skip]
17306        let r = i16x8::new(8191, 31, 13, 0, 8191, 31, 13, 0);
17307
17308        assert_eq!(r, mem::transmute(__msa_srai_h::<2>(mem::transmute(a))));
17309    }
17310
17311    #[simd_test(enable = "msa")]
17312    unsafe fn test_msa_srai_w() {
17313        #[rustfmt::skip]
17314        let a = i32x4::new(i32::MAX, 125, 55, 1);
17315        let r = i32x4::new(536870911, 31, 13, 0);
17316
17317        assert_eq!(r, mem::transmute(__msa_srai_w::<2>(mem::transmute(a))));
17318    }
17319
17320    #[simd_test(enable = "msa")]
17321    unsafe fn test_msa_srai_d() {
17322        #[rustfmt::skip]
17323        let a = i64x2::new(i64::MAX, 55);
17324        #[rustfmt::skip]
17325        let r = i64x2::new(2305843009213693951, 13);
17326
17327        assert_eq!(r, mem::transmute(__msa_srai_d::<2>(mem::transmute(a))));
17328    }
17329
17330    #[simd_test(enable = "msa")]
17331    unsafe fn test_msa_srar_b() {
17332        #[rustfmt::skip]
17333        let a = i8x16::new(
17334            -128, -64, -32, -16,
17335            -8, -4, -2, -1,
17336            1, 2, 4, 8,
17337            16, 32, 64, 127
17338        );
17339        #[rustfmt::skip]
17340        let b = i8x16::new(
17341            4, 3, 2, 1,
17342            4, 3, 2, 1,
17343            8, 7, 6, 5,
17344            4, 3, 2, 1
17345        );
17346        #[rustfmt::skip]
17347        let r = i8x16::new(
17348            -8, -8, -8, -8,
17349            0, 0, 0, 0,
17350            1, 0, 0, 0,
17351            1, 4, 16, 64
17352        );
17353
17354        assert_eq!(
17355            r,
17356            mem::transmute(__msa_srar_b(mem::transmute(a), mem::transmute(b)))
17357        );
17358    }
17359
17360    #[simd_test(enable = "msa")]
17361    unsafe fn test_msa_srar_h() {
17362        #[rustfmt::skip]
17363        let a = i16x8::new(
17364            i16::MIN, -16384, -8192, -4096,
17365            150, 50, 25, 15
17366        );
17367        #[rustfmt::skip]
17368        let b = i16x8::new(
17369            4, 3, 2, 1,
17370            1, 2, 3, 4
17371        );
17372        #[rustfmt::skip]
17373        let r = i16x8::new(
17374            -2048, -2048, -2048, -2048,
17375            75, 13, 3, 1
17376        );
17377
17378        assert_eq!(
17379            r,
17380            mem::transmute(__msa_srar_h(mem::transmute(a), mem::transmute(b)))
17381        );
17382    }
17383
17384    #[simd_test(enable = "msa")]
17385    unsafe fn test_msa_srar_w() {
17386        #[rustfmt::skip]
17387        let a = i32x4::new(i32::MIN, -1073741824, 100, 50);
17388        #[rustfmt::skip]
17389        let b = i32x4::new(16, 15, 1, 2);
17390        #[rustfmt::skip]
17391        let r = i32x4::new(-32768, -32768, 50, 13);
17392
17393        assert_eq!(
17394            r,
17395            mem::transmute(__msa_srar_w(mem::transmute(a), mem::transmute(b)))
17396        );
17397    }
17398
17399    #[simd_test(enable = "msa")]
17400    unsafe fn test_msa_srar_d() {
17401        #[rustfmt::skip]
17402        let a = i64x2::new(i64::MIN, i64::MAX);
17403        #[rustfmt::skip]
17404        let b = i64x2::new(32, 31);
17405        #[rustfmt::skip]
17406        let r = i64x2::new(-2147483648, 4294967296);
17407
17408        assert_eq!(
17409            r,
17410            mem::transmute(__msa_srar_d(mem::transmute(a), mem::transmute(b)))
17411        );
17412    }
17413
17414    #[simd_test(enable = "msa")]
17415    unsafe fn test_msa_srari_b() {
17416        #[rustfmt::skip]
17417        let a = i8x16::new(
17418            125, i8::MAX, 55, 1,
17419            125, i8::MAX, 55, 1,
17420            125, i8::MAX, 55, 1,
17421            125, i8::MAX, 55, 1
17422        );
17423        #[rustfmt::skip]
17424        let r = i8x16::new(
17425            31, 32, 14, 0,
17426            31, 32, 14, 0,
17427            31, 32, 14, 0,
17428            31, 32, 14, 0
17429        );
17430
17431        assert_eq!(r, mem::transmute(__msa_srari_b::<2>(mem::transmute(a))));
17432    }
17433
17434    #[simd_test(enable = "msa")]
17435    unsafe fn test_msa_srari_h() {
17436        #[rustfmt::skip]
17437        let a = i16x8::new(2155, 1155, 155, 1, 2155, 1155, 155, 1);
17438        #[rustfmt::skip]
17439        let r = i16x8::new(539, 289, 39, 0, 539, 289, 39, 0);
17440
17441        assert_eq!(r, mem::transmute(__msa_srari_h::<2>(mem::transmute(a))));
17442    }
17443
17444    #[simd_test(enable = "msa")]
17445    unsafe fn test_msa_srari_w() {
17446        #[rustfmt::skip]
17447        let a = i32x4::new(211111155, 111111155, 11111155, 1);
17448        #[rustfmt::skip]
17449        let r = i32x4::new(52777789, 27777789, 2777789, 0);
17450
17451        assert_eq!(r, mem::transmute(__msa_srari_w::<2>(mem::transmute(a))));
17452    }
17453
17454    #[simd_test(enable = "msa")]
17455    unsafe fn test_msa_srari_d() {
17456        #[rustfmt::skip]
17457        let a = i64x2::new(211111111155, 111111111155);
17458        #[rustfmt::skip]
17459        let r = i64x2::new(52777777789, 27777777789);
17460
17461        assert_eq!(r, mem::transmute(__msa_srari_d::<2>(mem::transmute(a))));
17462    }
17463
17464    #[simd_test(enable = "msa")]
17465    unsafe fn test_msa_srl_b() {
17466        #[rustfmt::skip]
17467        let a = i8x16::new(
17468            -128, -64, -32, -16,
17469            -8, -4, -2, -1,
17470            1, 2, 4, 8,
17471            16, 32, 64, 127
17472        );
17473        #[rustfmt::skip]
17474        let b = i8x16::new(
17475            8, 7, 6, 5,
17476            4, 3, 2, 1,
17477            8, 7, 6, 5,
17478            4, 3, 2, 1
17479        );
17480        #[rustfmt::skip]
17481        let r = i8x16::new(
17482            -128, 1, 3, 7,
17483            15, 31, 63, 127,
17484            1, 0, 0, 0,
17485            1, 4, 16, 63
17486        );
17487
17488        assert_eq!(
17489            r,
17490            mem::transmute(__msa_srl_b(mem::transmute(a), mem::transmute(b)))
17491        );
17492    }
17493
17494    #[simd_test(enable = "msa")]
17495    unsafe fn test_msa_srl_h() {
17496        #[rustfmt::skip]
17497        let a = i16x8::new(
17498            -32768, -16384, -8192, -4096,
17499            1, 2, 3, 4
17500        );
17501        #[rustfmt::skip]
17502        let b = i16x8::new(
17503            15, 14, 13, 12,
17504            4, 3, 2, 1
17505        );
17506        #[rustfmt::skip]
17507        let r = i16x8::new(1, 3, 7, 15, 0, 0, 0, 2);
17508
17509        assert_eq!(
17510            r,
17511            mem::transmute(__msa_srl_h(mem::transmute(a), mem::transmute(b)))
17512        );
17513    }
17514
17515    #[simd_test(enable = "msa")]
17516    unsafe fn test_msa_srl_w() {
17517        #[rustfmt::skip]
17518        let a = i32x4::new(i32::MIN, -1073741824, 1, 2);
17519        #[rustfmt::skip]
17520        let b = i32x4::new(16, 15, 16, 15);
17521        #[rustfmt::skip]
17522        let r = i32x4::new(32768, 98304, 0, 0);
17523
17524        assert_eq!(
17525            r,
17526            mem::transmute(__msa_srl_w(mem::transmute(a), mem::transmute(b)))
17527        );
17528    }
17529
17530    #[simd_test(enable = "msa")]
17531    unsafe fn test_msa_srl_d() {
17532        #[rustfmt::skip]
17533        let a = i64x2::new(i64::MIN, i64::MAX);
17534        #[rustfmt::skip]
17535        let b = i64x2::new(32, 31);
17536        #[rustfmt::skip]
17537        let r = i64x2::new(2147483648, 4294967295);
17538
17539        assert_eq!(
17540            r,
17541            mem::transmute(__msa_srl_d(mem::transmute(a), mem::transmute(b)))
17542        );
17543    }
17544
17545    #[simd_test(enable = "msa")]
17546    unsafe fn test_msa_srli_b() {
17547        #[rustfmt::skip]
17548        let a = i8x16::new(
17549            25, 50, 100, 127,
17550            25, 50, 100, 127,
17551            25, 50, 100, 127,
17552            25, 50, 100, 127
17553        );
17554        #[rustfmt::skip]
17555        let r = i8x16::new(
17556            6, 12, 25, 31,
17557            6, 12, 25, 31,
17558            6, 12, 25, 31,
17559            6, 12, 25, 31
17560        );
17561
17562        assert_eq!(r, mem::transmute(__msa_srli_b::<2>(mem::transmute(a))));
17563    }
17564
17565    #[simd_test(enable = "msa")]
17566    unsafe fn test_msa_srli_h() {
17567        #[rustfmt::skip]
17568        let a = i16x8::new(
17569            i16::MAX, 3276, 100, 127,
17570            i16::MAX, 3276, 100, 127
17571        );
17572        #[rustfmt::skip]
17573        let r = i16x8::new(
17574            8191, 819, 25, 31,
17575            8191, 819, 25, 31
17576        );
17577
17578        assert_eq!(r, mem::transmute(__msa_srli_h::<2>(mem::transmute(a))));
17579    }
17580
17581    #[simd_test(enable = "msa")]
17582    unsafe fn test_msa_srli_w() {
17583        #[rustfmt::skip]
17584        let a = i32x4::new(100, i32::MAX, 100, i32::MAX);
17585        #[rustfmt::skip]
17586        let r = i32x4::new(25, 536870911, 25, 536870911);
17587
17588        assert_eq!(r, mem::transmute(__msa_srli_w::<2>(mem::transmute(a))));
17589    }
17590
17591    #[simd_test(enable = "msa")]
17592    unsafe fn test_msa_srli_d() {
17593        #[rustfmt::skip]
17594        let a = i64x2::new(100, i64::MAX);
17595        #[rustfmt::skip]
17596        let r = i64x2::new(50, 4611686018427387903);
17597
17598        assert_eq!(r, mem::transmute(__msa_srli_d::<1>(mem::transmute(a))));
17599    }
17600
17601    #[simd_test(enable = "msa")]
17602    unsafe fn test_msa_srlr_b() {
17603        #[rustfmt::skip]
17604        let a = i8x16::new(
17605            -128, -64, -32, -16,
17606            -8, -4, -2, -1,
17607            1, 2, 4, 8,
17608            16, 32, 64, 127
17609        );
17610        #[rustfmt::skip]
17611        let b = i8x16::new(
17612            8, 7, 6, 5,
17613            4, 3, 2, 1,
17614            8, 7, 6, 5,
17615            4, 3, 2, 1
17616        );
17617        #[rustfmt::skip]
17618        let r = i8x16::new(
17619            -128, 2, 4, 8,
17620            16, 32, 64, -128,
17621            1, 0, 0, 0,
17622            1, 4, 16, 64
17623        );
17624
17625        assert_eq!(
17626            r,
17627            mem::transmute(__msa_srlr_b(mem::transmute(a), mem::transmute(b)))
17628        );
17629    }
17630
17631    #[simd_test(enable = "msa")]
17632    unsafe fn test_msa_srlr_h() {
17633        #[rustfmt::skip]
17634        let a = i16x8::new(
17635            -32768, -16384, -8192, -4096,
17636            1, 2, 3, 4
17637        );
17638        #[rustfmt::skip]
17639        let b = i16x8::new(
17640            15, 14, 13, 12,
17641            4, 3, 2, 1
17642        );
17643        #[rustfmt::skip]
17644        let r = i16x8::new(1, 3, 7, 15, 0, 0, 1, 2);
17645
17646        assert_eq!(
17647            r,
17648            mem::transmute(__msa_srlr_h(mem::transmute(a), mem::transmute(b)))
17649        );
17650    }
17651
17652    #[simd_test(enable = "msa")]
17653    unsafe fn test_msa_srlr_w() {
17654        #[rustfmt::skip]
17655        let a = i32x4::new(i32::MIN, -1073741824, 1, 2);
17656        #[rustfmt::skip]
17657        let b = i32x4::new(16, 15, 16, 15);
17658        let r = i32x4::new(32768, 98304, 0, 0);
17659
17660        assert_eq!(
17661            r,
17662            mem::transmute(__msa_srlr_w(mem::transmute(a), mem::transmute(b)))
17663        );
17664    }
17665
17666    #[simd_test(enable = "msa")]
17667    unsafe fn test_msa_srlr_d() {
17668        #[rustfmt::skip]
17669        let a = i64x2::new(i64::MIN, i64::MAX);
17670        #[rustfmt::skip]
17671        let b = i64x2::new(32, 31);
17672        #[rustfmt::skip]
17673        let r = i64x2::new(2147483648, 4294967296);
17674
17675        assert_eq!(
17676            r,
17677            mem::transmute(__msa_srlr_d(mem::transmute(a), mem::transmute(b)))
17678        );
17679    }
17680
17681    #[simd_test(enable = "msa")]
17682    unsafe fn test_msa_srlri_b() {
17683        #[rustfmt::skip]
17684        let a = i8x16::new(
17685            25, 50, 100, i8::MAX,
17686            25, 50, 100, i8::MAX,
17687            25, 50, 100, i8::MAX,
17688            25, 50, 100, i8::MAX
17689        );
17690        #[rustfmt::skip]
17691        let r = i8x16::new(
17692            6, 13, 25, 32,
17693            6, 13, 25, 32,
17694            6, 13, 25, 32,
17695            6, 13, 25, 32
17696        );
17697
17698        assert_eq!(r, mem::transmute(__msa_srlri_b::<2>(mem::transmute(a))));
17699    }
17700
17701    #[simd_test(enable = "msa")]
17702    unsafe fn test_msa_srlri_h() {
17703        #[rustfmt::skip]
17704        let a = i16x8::new(
17705            i16::MAX, 3276, 100, 127,
17706            i16::MAX, 3276, 100, 127
17707        );
17708        let r = i16x8::new(8192, 819, 25, 32, 8192, 819, 25, 32);
17709
17710        assert_eq!(r, mem::transmute(__msa_srlri_h::<2>(mem::transmute(a))));
17711    }
17712
17713    #[simd_test(enable = "msa")]
17714    unsafe fn test_msa_srlri_w() {
17715        #[rustfmt::skip]
17716        let a = i32x4::new(100, 150, 200, i32::MAX);
17717        #[rustfmt::skip]
17718        let r = i32x4::new(25, 38, 50, 536870912);
17719
17720        assert_eq!(r, mem::transmute(__msa_srlri_w::<2>(mem::transmute(a))));
17721    }
17722
17723    #[simd_test(enable = "msa")]
17724    unsafe fn test_msa_srlri_d() {
17725        #[rustfmt::skip]
17726        let a = i64x2::new(100, i64::MAX);
17727        #[rustfmt::skip]
17728        let r = i64x2::new(50, 4611686018427387904);
17729
17730        assert_eq!(r, mem::transmute(__msa_srlri_d::<1>(mem::transmute(a))));
17731    }
17732
17733    #[simd_test(enable = "msa")]
17734    unsafe fn test_msa_st_b() {
17735        #[rustfmt::skip]
17736        let a = i8x16::new(
17737            13, 14, 15, 16,
17738            17, 18, 19, 20,
17739            21, 22, 23, 24,
17740            25, 26, 27, 28
17741        );
17742        #[rustfmt::skip]
17743        let mut arr : [i8; 16] = [
17744            0, 0, 0, 0,
17745            0, 0, 0, 0,
17746            0, 0, 0, 0,
17747            0, 0, 0, 0
17748        ];
17749        #[rustfmt::skip]
17750        let r : [i8; 16] = [
17751            13, 14, 15, 16,
17752            17, 18, 19, 20,
17753            21, 22, 23, 24,
17754            25, 26, 27, 28
17755        ];
17756        __msa_st_b::<0>(mem::transmute(a), arr.as_mut_ptr() as *mut u8);
17757        assert_eq!(arr, r);
17758    }
17759
17760    #[simd_test(enable = "msa")]
17761    unsafe fn test_msa_st_h() {
17762        #[rustfmt::skip]
17763        let a = i16x8::new(13, 14, 15, 16, 17, 18, 19, 20);
17764        let mut arr: [i16; 8] = [0, 0, 0, 0, 0, 0, 0, 0];
17765        #[rustfmt::skip]
17766        let r  : [i16; 8] = [13, 14, 15, 16, 17, 18, 19, 20];
17767        __msa_st_h::<0>(mem::transmute(a), arr.as_mut_ptr() as *mut u8);
17768        assert_eq!(arr, r);
17769    }
17770
17771    #[simd_test(enable = "msa")]
17772    unsafe fn test_msa_st_w() {
17773        #[rustfmt::skip]
17774        let a = i32x4::new(13, 14, 15, 16);
17775        let mut arr: [i32; 4] = [0, 0, 0, 0];
17776        #[rustfmt::skip]
17777        let r  : [i32; 4] = [13, 14, 15, 16];
17778        __msa_st_w::<0>(mem::transmute(a), arr.as_mut_ptr() as *mut u8);
17779        assert_eq!(arr, r);
17780    }
17781
17782    #[simd_test(enable = "msa")]
17783    unsafe fn test_msa_st_d() {
17784        #[rustfmt::skip]
17785        let a = i64x2::new(13, 14);
17786        let mut arr: [i64; 2] = [0, 0];
17787        #[rustfmt::skip]
17788        let r : [i64; 2] = [13, 14];
17789        __msa_st_d::<0>(mem::transmute(a), arr.as_mut_ptr() as *mut u8);
17790        assert_eq!(arr, r);
17791    }
17792
17793    #[simd_test(enable = "msa")]
17794    unsafe fn test_msa_subs_s_b() {
17795        #[rustfmt::skip]
17796        let a = i8x16::new(
17797            i8::MIN, -2, -3, -4,
17798            i8::MIN, -2, -3, -4,
17799            i8::MIN, -2, -3, -4,
17800            i8::MIN, -2, -3, -4
17801        );
17802        #[rustfmt::skip]
17803        let b = i8x16::new(
17804            6, -7, 8, -9,
17805            6, -7, 8, -9,
17806            6, -7, 8, -9,
17807            6, -7, 8, -9
17808        );
17809        #[rustfmt::skip]
17810        let r = i8x16::new(
17811            i8::MIN, 5, -11, 5,
17812            i8::MIN, 5, -11, 5,
17813            i8::MIN, 5, -11, 5,
17814            i8::MIN, 5, -11, 5
17815        );
17816
17817        assert_eq!(
17818            r,
17819            mem::transmute(__msa_subs_s_b(mem::transmute(a), mem::transmute(b)))
17820        );
17821    }
17822
17823    #[simd_test(enable = "msa")]
17824    unsafe fn test_msa_subs_s_h() {
17825        #[rustfmt::skip]
17826        let a = i16x8::new(
17827            i16::MIN, -2, -3, -4,
17828            i16::MIN, -2, -3, -4
17829        );
17830        #[rustfmt::skip]
17831        let b = i16x8::new(6, -7, 8, -9, 6, -7, 8, -9);
17832        #[rustfmt::skip]
17833        let r = i16x8::new(
17834            i16::MIN, 5, -11, 5,
17835            i16::MIN, 5, -11, 5
17836        );
17837
17838        assert_eq!(
17839            r,
17840            mem::transmute(__msa_subs_s_h(mem::transmute(a), mem::transmute(b)))
17841        );
17842    }
17843
17844    #[simd_test(enable = "msa")]
17845    unsafe fn test_msa_subs_s_w() {
17846        #[rustfmt::skip]
17847        let a = i32x4::new(i32::MIN, -2, -3, -4);
17848        #[rustfmt::skip]
17849        let b = i32x4::new(6, -7, 8, -9);
17850        #[rustfmt::skip]
17851        let r = i32x4::new(i32::MIN, 5, -11, 5);
17852
17853        assert_eq!(
17854            r,
17855            mem::transmute(__msa_subs_s_w(mem::transmute(a), mem::transmute(b)))
17856        );
17857    }
17858
17859    #[simd_test(enable = "msa")]
17860    unsafe fn test_msa_subs_s_d() {
17861        #[rustfmt::skip]
17862        let a = i64x2::new(i64::MIN, -2);
17863        #[rustfmt::skip]
17864        let b = i64x2::new(6, -7);
17865        #[rustfmt::skip]
17866        let r = i64x2::new(i64::MIN, 5);
17867
17868        assert_eq!(
17869            r,
17870            mem::transmute(__msa_subs_s_d(mem::transmute(a), mem::transmute(b)))
17871        );
17872    }
17873
17874    #[simd_test(enable = "msa")]
17875    unsafe fn test_msa_subs_u_b() {
17876        #[rustfmt::skip]
17877        let a = u8x16::new(
17878            u8::MAX, 2, 3, 4,
17879            u8::MAX, 2, 3, 4,
17880            u8::MAX, 2, 3, 4,
17881            u8::MAX, 2, 3, 4
17882        );
17883        #[rustfmt::skip]
17884        let b = u8x16::new(
17885            6, 7, 8, 9,
17886            6, 7, 8, 9,
17887            6, 7, 8, 9,
17888            6, 7, 8, 9
17889        );
17890        #[rustfmt::skip]
17891        let r = u8x16::new(
17892            249, 0, 0, 0,
17893            249, 0, 0, 0,
17894            249, 0, 0, 0,
17895            249, 0, 0, 0
17896        );
17897
17898        assert_eq!(
17899            r,
17900            mem::transmute(__msa_subs_u_b(mem::transmute(a), mem::transmute(b)))
17901        );
17902    }
17903
17904    #[simd_test(enable = "msa")]
17905    unsafe fn test_msa_subs_u_h() {
17906        #[rustfmt::skip]
17907        let a = u16x8::new(
17908            u16::MAX, 2, 3, 4,
17909            u16::MAX, 2, 3, 4
17910        );
17911        #[rustfmt::skip]
17912        let b = u16x8::new(6, 7, 8, 9, 6, 7, 8, 9);
17913        #[rustfmt::skip]
17914        let r = u16x8::new(65529, 0, 0, 0, 65529, 0, 0, 0);
17915
17916        assert_eq!(
17917            r,
17918            mem::transmute(__msa_subs_u_h(mem::transmute(a), mem::transmute(b)))
17919        );
17920    }
17921
17922    #[simd_test(enable = "msa")]
17923    unsafe fn test_msa_subs_u_w() {
17924        #[rustfmt::skip]
17925        let a = u32x4::new(u32::MAX, 2, 3, 4);
17926        #[rustfmt::skip]
17927        let b = u32x4::new(6, 7, 8, 9);
17928        #[rustfmt::skip]
17929        let r = u32x4::new(4294967289, 0, 0, 0);
17930
17931        assert_eq!(
17932            r,
17933            mem::transmute(__msa_subs_u_w(mem::transmute(a), mem::transmute(b)))
17934        );
17935    }
17936
17937    #[simd_test(enable = "msa")]
17938    unsafe fn test_msa_subs_u_d() {
17939        #[rustfmt::skip]
17940        let a = u64x2::new(u64::MAX, 2);
17941        #[rustfmt::skip]
17942        let b = u64x2::new(6, 7);
17943        #[rustfmt::skip]
17944        let r = u64x2::new(18446744073709551609, 0);
17945
17946        assert_eq!(
17947            r,
17948            mem::transmute(__msa_subs_u_d(mem::transmute(a), mem::transmute(b)))
17949        );
17950    }
17951
17952    #[simd_test(enable = "msa")]
17953    unsafe fn test_msa_subsus_u_b() {
17954        #[rustfmt::skip]
17955        let a = u8x16::new(
17956            u8::MAX, 2, 3, 4,
17957            u8::MAX, 2, 3, 4,
17958            u8::MAX, 2, 3, 4,
17959            u8::MAX, 2, 3, 4
17960        );
17961        #[rustfmt::skip]
17962        let b = i8x16::new(
17963            -6, -7, -8, -9,
17964            -6, -7, -8, -9,
17965            -6, -7, -8, -9,
17966            -6, -7, -8, -9
17967        );
17968        #[rustfmt::skip]
17969        let r = u8x16::new(
17970            255, 9, 11, 13,
17971            255, 9, 11, 13,
17972            255, 9, 11, 13,
17973            255, 9, 11, 13
17974        );
17975
17976        assert_eq!(
17977            r,
17978            mem::transmute(__msa_subsus_u_b(mem::transmute(a), mem::transmute(b)))
17979        );
17980    }
17981
17982    #[simd_test(enable = "msa")]
17983    unsafe fn test_msa_subsus_u_h() {
17984        #[rustfmt::skip]
17985        let a = u16x8::new(
17986            u16::MAX, 2, 3, 4,
17987            u16::MAX, 2, 3, 4
17988        );
17989        #[rustfmt::skip]
17990        let b = i16x8::new(-6, -7, -8, -9, -6, -7, -8, -9);
17991        #[rustfmt::skip]
17992        let r = u16x8::new(65535, 9, 11, 13, 65535, 9, 11, 13);
17993
17994        assert_eq!(
17995            r,
17996            mem::transmute(__msa_subsus_u_h(mem::transmute(a), mem::transmute(b)))
17997        );
17998    }
17999
18000    #[simd_test(enable = "msa")]
18001    unsafe fn test_msa_subsus_u_w() {
18002        #[rustfmt::skip]
18003        let a = u32x4::new(u32::MAX, 2, 3, 4);
18004        #[rustfmt::skip]
18005        let b = i32x4::new(-6, -7, -8, -9);
18006        #[rustfmt::skip]
18007        let r = u32x4::new(4294967295, 9, 11, 13);
18008
18009        assert_eq!(
18010            r,
18011            mem::transmute(__msa_subsus_u_w(mem::transmute(a), mem::transmute(b)))
18012        );
18013    }
18014
18015    #[simd_test(enable = "msa")]
18016    unsafe fn test_msa_subsus_u_d() {
18017        #[rustfmt::skip]
18018        let a = u64x2::new(u64::MAX, 2);
18019        #[rustfmt::skip]
18020        let b = i64x2::new(-6, -7);
18021        #[rustfmt::skip]
18022        let r = u64x2::new(18446744073709551615, 9);
18023
18024        assert_eq!(
18025            r,
18026            mem::transmute(__msa_subsus_u_d(mem::transmute(a), mem::transmute(b)))
18027        );
18028    }
18029
18030    #[simd_test(enable = "msa")]
18031    unsafe fn test_msa_subsuu_s_b() {
18032        #[rustfmt::skip]
18033        let a = u8x16::new(
18034            u8::MAX, 2, 3, 4,
18035            u8::MAX, 2, 3, 4,
18036            u8::MAX, 2, 3, 4,
18037            u8::MAX, 2, 3, 4
18038        );
18039        #[rustfmt::skip]
18040        let b = u8x16::new(
18041            6, 7, 8, u8::MAX,
18042            6, 7, 8, u8::MAX,
18043            6, 7, 8, u8::MAX,
18044            6, 7, 8, u8::MAX
18045        );
18046        #[rustfmt::skip]
18047        let r = i8x16::new(
18048            127, -5, -5, -128,
18049            127, -5, -5, -128,
18050            127, -5, -5, -128,
18051            127, -5, -5, -128
18052        );
18053
18054        assert_eq!(
18055            r,
18056            mem::transmute(__msa_subsuu_s_b(mem::transmute(a), mem::transmute(b)))
18057        );
18058    }
18059
18060    #[simd_test(enable = "msa")]
18061    unsafe fn test_msa_subsuu_s_h() {
18062        #[rustfmt::skip]
18063        let a = u16x8::new(
18064            u16::MAX, 2, 3,
18065            4, u16::MAX, 2, 3, 4
18066        );
18067        #[rustfmt::skip]
18068        let b = u16x8::new(6, 7, 8, 65535, 6, 7, 8, 65535);
18069        #[rustfmt::skip]
18070        let r = i16x8::new(32767, -5, -5, -32768, 32767, -5, -5, -32768);
18071
18072        assert_eq!(
18073            r,
18074            mem::transmute(__msa_subsuu_s_h(mem::transmute(a), mem::transmute(b)))
18075        );
18076    }
18077
18078    #[simd_test(enable = "msa")]
18079    unsafe fn test_msa_subsuu_s_w() {
18080        #[rustfmt::skip]
18081        let a = u32x4::new(u32::MAX, 2, 3, 4);
18082        #[rustfmt::skip]
18083        let b = u32x4::new(6, 7, 8, 4294967295);
18084        #[rustfmt::skip]
18085        let r = i32x4::new(2147483647, -5, -5, -2147483648);
18086
18087        assert_eq!(
18088            r,
18089            mem::transmute(__msa_subsuu_s_w(mem::transmute(a), mem::transmute(b)))
18090        );
18091    }
18092
18093    #[simd_test(enable = "msa")]
18094    unsafe fn test_msa_subsuu_s_d() {
18095        #[rustfmt::skip]
18096        let a = u64x2::new(u64::MAX, 2);
18097        #[rustfmt::skip]
18098        let b = u64x2::new(6, 7);
18099        #[rustfmt::skip]
18100        let r = i64x2::new(i64::MAX, -5);
18101
18102        assert_eq!(
18103            r,
18104            mem::transmute(__msa_subsuu_s_d(mem::transmute(a), mem::transmute(b)))
18105        );
18106    }
18107
18108    #[simd_test(enable = "msa")]
18109    unsafe fn test_msa_subv_b() {
18110        #[rustfmt::skip]
18111        let a = i8x16::new(
18112            i8::MIN, -2, -3, -4,
18113            i8::MIN, -2, -3, -4,
18114            i8::MIN, -2, -3, -4,
18115            i8::MIN, -2, -3, -4
18116        );
18117        #[rustfmt::skip]
18118        let b = i8x16::new(
18119            6, -7, 8, -9,
18120            6, -7, 8, -9,
18121            6, -7, 8, -9,
18122            6, -7, 8, -9
18123        );
18124        #[rustfmt::skip]
18125        let r = i8x16::new(
18126            122, 5, -11, 5,
18127            122, 5, -11, 5,
18128            122, 5, -11, 5,
18129            122, 5, -11, 5
18130        );
18131
18132        assert_eq!(
18133            r,
18134            mem::transmute(__msa_subv_b(mem::transmute(a), mem::transmute(b)))
18135        );
18136    }
18137
18138    #[simd_test(enable = "msa")]
18139    unsafe fn test_msa_subv_h() {
18140        #[rustfmt::skip]
18141        let a = i16x8::new(
18142            i16::MIN, -2, -3, -4,
18143            i16::MIN, -2, -3, -4
18144        );
18145        #[rustfmt::skip]
18146        let b = i16x8::new(6, -7, 8, -9, 6, -7, 8, -9);
18147        #[rustfmt::skip]
18148        let r = i16x8::new(32762, 5, -11, 5, 32762, 5, -11, 5);
18149
18150        assert_eq!(
18151            r,
18152            mem::transmute(__msa_subv_h(mem::transmute(a), mem::transmute(b)))
18153        );
18154    }
18155
18156    #[simd_test(enable = "msa")]
18157    unsafe fn test_msa_subv_w() {
18158        #[rustfmt::skip]
18159        let a = i32x4::new(i32::MIN, -2, -3, -4);
18160        #[rustfmt::skip]
18161        let b = i32x4::new(6, -7, 8, -9);
18162        #[rustfmt::skip]
18163        let r = i32x4::new(2147483642, 5, -11, 5);
18164
18165        assert_eq!(
18166            r,
18167            mem::transmute(__msa_subv_w(mem::transmute(a), mem::transmute(b)))
18168        );
18169    }
18170
18171    #[simd_test(enable = "msa")]
18172    unsafe fn test_msa_subv_d() {
18173        #[rustfmt::skip]
18174        let a = i64x2::new(i64::MAX, -2);
18175        #[rustfmt::skip]
18176        let b = i64x2::new(6, -7);
18177        #[rustfmt::skip]
18178        let r = i64x2::new(9223372036854775801, 5);
18179
18180        assert_eq!(
18181            r,
18182            mem::transmute(__msa_subv_d(mem::transmute(a), mem::transmute(b)))
18183        );
18184    }
18185
18186    #[simd_test(enable = "msa")]
18187    unsafe fn test_msa_subvi_b() {
18188        #[rustfmt::skip]
18189        let a = i8x16::new(
18190            100, i8::MAX, 50, i8::MIN,
18191            100, i8::MAX, 50, i8::MIN,
18192            100, i8::MAX, 50, i8::MIN,
18193            100, i8::MAX, 50, i8::MIN
18194        );
18195        #[rustfmt::skip]
18196        let r = i8x16::new(
18197            95, 122, 45, 123,
18198            95, 122, 45, 123,
18199            95, 122, 45, 123,
18200            95, 122, 45, 123
18201        );
18202
18203        assert_eq!(r, mem::transmute(__msa_subvi_b::<5>(mem::transmute(a))));
18204    }
18205
18206    #[simd_test(enable = "msa")]
18207    unsafe fn test_msa_subvi_h() {
18208        #[rustfmt::skip]
18209        let a = i16x8::new(
18210            i16::MAX, 3276, -100, i16::MIN,
18211            i16::MAX, 3276, -100, i16::MIN
18212        );
18213        #[rustfmt::skip]
18214        let r = i16x8::new(
18215            32762, 3271, -105, 32763,
18216            32762, 3271, -105, 32763
18217        );
18218
18219        assert_eq!(r, mem::transmute(__msa_subvi_h::<5>(mem::transmute(a))));
18220    }
18221
18222    #[simd_test(enable = "msa")]
18223    unsafe fn test_msa_subvi_w() {
18224        #[rustfmt::skip]
18225        let a = i32x4::new(100, 150, 200, i32::MAX);
18226        #[rustfmt::skip]
18227        let r = i32x4::new(95, 145, 195, 2147483642);
18228
18229        assert_eq!(r, mem::transmute(__msa_subvi_w::<5>(mem::transmute(a))));
18230    }
18231
18232    #[simd_test(enable = "msa")]
18233    unsafe fn test_msa_subvi_d() {
18234        #[rustfmt::skip]
18235        let a = i64x2::new(100, i64::MAX);
18236        #[rustfmt::skip]
18237        let r = i64x2::new(95, 9223372036854775802);
18238
18239        assert_eq!(r, mem::transmute(__msa_subvi_d::<5>(mem::transmute(a))));
18240    }
18241
18242    #[simd_test(enable = "msa")]
18243    unsafe fn test_msa_vshf_b() {
18244        #[rustfmt::skip]
18245        let a = i8x16::new(
18246            1, 2, 3, 4,
18247            1, 2, 3, 4,
18248            1, 2, 3, 4,
18249            1, 2, 3, 4
18250        );
18251        #[rustfmt::skip]
18252        let b = i8x16::new(
18253            4, 3, 2, 1,
18254            4, 3, 2, 1,
18255            4, 3, 2, 1,
18256            4, 3, 2, 1
18257        );
18258        #[rustfmt::skip]
18259        let c = i8x16::new(
18260            4, 3, 2, 1,
18261            4, 3, 2, 1,
18262            4, 3, 2, 1,
18263            4, 3, 2, 1
18264        );
18265        #[rustfmt::skip]
18266        let r = i8x16::new(
18267            3, 2, 1, 4,
18268            3, 2, 1, 4,
18269            3, 2, 1, 4,
18270            3, 2, 1, 4
18271        );
18272
18273        assert_eq!(
18274            r,
18275            mem::transmute(__msa_vshf_b(
18276                mem::transmute(a),
18277                mem::transmute(b),
18278                mem::transmute(c)
18279            ))
18280        );
18281    }
18282
18283    #[simd_test(enable = "msa")]
18284    unsafe fn test_msa_vshf_h() {
18285        #[rustfmt::skip]
18286        let a = i16x8::new(
18287            1, 2, 3, 4,
18288            1, 2, 3, 4
18289        );
18290        #[rustfmt::skip]
18291        let b = i16x8::new(
18292            4, 3, 2, 1,
18293            4, 3, 2, 1
18294        );
18295        #[rustfmt::skip]
18296        let c = i16x8::new(
18297            4, 3, 2, 1,
18298            4, 3, 2, 1
18299        );
18300        let r = i16x8::new(3, 2, 1, 4, 3, 2, 1, 4);
18301
18302        assert_eq!(
18303            r,
18304            mem::transmute(__msa_vshf_h(
18305                mem::transmute(a),
18306                mem::transmute(b),
18307                mem::transmute(c)
18308            ))
18309        );
18310    }
18311
18312    #[simd_test(enable = "msa")]
18313    unsafe fn test_msa_vshf_w() {
18314        #[rustfmt::skip]
18315        let a = i32x4::new(1, 2, 3, 4);
18316        #[rustfmt::skip]
18317        let b = i32x4::new(4, 3, 2, 1);
18318        #[rustfmt::skip]
18319        let c = i32x4::new(4, 3, 2, 1);
18320        #[rustfmt::skip]
18321        let r = i32x4::new(3, 2, 1, 4);
18322
18323        assert_eq!(
18324            r,
18325            mem::transmute(__msa_vshf_w(
18326                mem::transmute(a),
18327                mem::transmute(b),
18328                mem::transmute(c)
18329            ))
18330        );
18331    }
18332
18333    #[simd_test(enable = "msa")]
18334    unsafe fn test_msa_vshf_d() {
18335        #[rustfmt::skip]
18336        let a = i64x2::new(1, 2);
18337        #[rustfmt::skip]
18338        let b = i64x2::new(4, 3);
18339        #[rustfmt::skip]
18340        let c = i64x2::new(4, 3);
18341        #[rustfmt::skip]
18342        let r = i64x2::new(3, 4);
18343
18344        assert_eq!(
18345            r,
18346            mem::transmute(__msa_vshf_d(
18347                mem::transmute(a),
18348                mem::transmute(b),
18349                mem::transmute(c)
18350            ))
18351        );
18352    }
18353
18354    #[simd_test(enable = "msa")]
18355    unsafe fn test_msa_xor_v() {
18356        #[rustfmt::skip]
18357        let a = u8x16::new(
18358            1, 2, 3, 4,
18359            5, 6, 7, 8,
18360            9, 10, 11, 12,
18361            13, 14, 15, 16
18362        );
18363        #[rustfmt::skip]
18364        let b = u8x16::new(
18365            16, 15, 14, 13,
18366            12, 11, 10, 9,
18367            8, 7, 6, 5,
18368            4, 3, 2, 1
18369        );
18370        #[rustfmt::skip]
18371        let r = u8x16::new(
18372            17, 13, 13, 9,
18373            9, 13, 13, 1,
18374            1, 13, 13, 9,
18375            9, 13, 13, 17
18376        );
18377
18378        assert_eq!(
18379            r,
18380            mem::transmute(__msa_xor_v(mem::transmute(a), mem::transmute(b)))
18381        );
18382    }
18383
18384    #[simd_test(enable = "msa")]
18385    unsafe fn test_msa_xori_b() {
18386        #[rustfmt::skip]
18387        let a = u8x16::new(
18388            1, 2, 3, 4,
18389            5, 6, 7, 8,
18390            9, 10, 11, 12,
18391            13, 14, 15, 16
18392        );
18393        #[rustfmt::skip]
18394        let r = u8x16::new(
18395            5, 6, 7, 0,
18396            1, 2, 3, 12,
18397            13, 14, 15, 8,
18398            9, 10, 11, 20
18399        );
18400
18401        assert_eq!(r, mem::transmute(__msa_xori_b::<4>(mem::transmute(a))));
18402    }
18403}