xref: /freebsd/contrib/llvm-project/llvm/include/llvm/IR/IntrinsicsMips.td (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1//===- IntrinsicsMips.td - Defines Mips intrinsics ---------*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines all of the MIPS-specific intrinsics.
10//
11//===----------------------------------------------------------------------===//
12
13//===----------------------------------------------------------------------===//
14// MIPS DSP data types
15def mips_v2q15_ty: LLVMType<v2i16>;
16def mips_v4q7_ty: LLVMType<v4i8>;
17def mips_q31_ty: LLVMType<i32>;
18
19let TargetPrefix = "mips" in {  // All intrinsics start with "llvm.mips.".
20
21//===----------------------------------------------------------------------===//
22// MIPS DSP Rev 1
23
24//===----------------------------------------------------------------------===//
25// Addition/subtraction
26
27def int_mips_addu_qb : ClangBuiltin<"__builtin_mips_addu_qb">,
28  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty],
29            [Commutative, IntrNoMem]>;
30def int_mips_addu_s_qb : ClangBuiltin<"__builtin_mips_addu_s_qb">,
31  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty],
32            [Commutative, IntrNoMem]>;
33def int_mips_subu_qb : ClangBuiltin<"__builtin_mips_subu_qb">,
34  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrNoMem]>;
35def int_mips_subu_s_qb : ClangBuiltin<"__builtin_mips_subu_s_qb">,
36  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrNoMem]>;
37
38def int_mips_addq_ph : ClangBuiltin<"__builtin_mips_addq_ph">,
39  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty],
40            [Commutative, IntrNoMem]>;
41def int_mips_addq_s_ph : ClangBuiltin<"__builtin_mips_addq_s_ph">,
42  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty],
43            [Commutative, IntrNoMem]>;
44def int_mips_subq_ph : ClangBuiltin<"__builtin_mips_subq_ph">,
45  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
46def int_mips_subq_s_ph : ClangBuiltin<"__builtin_mips_subq_s_ph">,
47  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
48
49def int_mips_madd: ClangBuiltin<"__builtin_mips_madd">,
50  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
51            [IntrNoMem, Commutative]>;
52def int_mips_maddu: ClangBuiltin<"__builtin_mips_maddu">,
53  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
54            [IntrNoMem, Commutative]>;
55
56def int_mips_msub: ClangBuiltin<"__builtin_mips_msub">,
57  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
58            [IntrNoMem]>;
59def int_mips_msubu: ClangBuiltin<"__builtin_mips_msubu">,
60  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
61            [IntrNoMem]>;
62
63def int_mips_addq_s_w: ClangBuiltin<"__builtin_mips_addq_s_w">,
64  Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [Commutative]>;
65def int_mips_subq_s_w: ClangBuiltin<"__builtin_mips_subq_s_w">,
66  Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], []>;
67
68def int_mips_addsc: ClangBuiltin<"__builtin_mips_addsc">,
69  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [Commutative]>;
70def int_mips_addwc: ClangBuiltin<"__builtin_mips_addwc">,
71  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [Commutative]>;
72
73def int_mips_modsub: ClangBuiltin<"__builtin_mips_modsub">,
74  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
75
76def int_mips_raddu_w_qb: ClangBuiltin<"__builtin_mips_raddu_w_qb">,
77  Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty], [IntrNoMem]>;
78
79//===----------------------------------------------------------------------===//
80// Absolute value
81
82def int_mips_absq_s_ph: ClangBuiltin<"__builtin_mips_absq_s_ph">,
83  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty], []>;
84def int_mips_absq_s_w: ClangBuiltin<"__builtin_mips_absq_s_w">,
85  Intrinsic<[mips_q31_ty], [mips_q31_ty], []>;
86
87//===----------------------------------------------------------------------===//
88// Precision reduce/expand
89
90def int_mips_precrq_qb_ph: ClangBuiltin<"__builtin_mips_precrq_qb_ph">,
91  Intrinsic<[llvm_v4i8_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
92def int_mips_precrqu_s_qb_ph: ClangBuiltin<"__builtin_mips_precrqu_s_qb_ph">,
93  Intrinsic<[llvm_v4i8_ty], [mips_v2q15_ty, mips_v2q15_ty], []>;
94def int_mips_precrq_ph_w: ClangBuiltin<"__builtin_mips_precrq_ph_w">,
95  Intrinsic<[mips_v2q15_ty], [mips_q31_ty, mips_q31_ty], [IntrNoMem]>;
96def int_mips_precrq_rs_ph_w: ClangBuiltin<"__builtin_mips_precrq_rs_ph_w">,
97  Intrinsic<[mips_v2q15_ty], [mips_q31_ty, mips_q31_ty], []>;
98def int_mips_preceq_w_phl: ClangBuiltin<"__builtin_mips_preceq_w_phl">,
99  Intrinsic<[mips_q31_ty], [mips_v2q15_ty], [IntrNoMem]>;
100def int_mips_preceq_w_phr: ClangBuiltin<"__builtin_mips_preceq_w_phr">,
101  Intrinsic<[mips_q31_ty], [mips_v2q15_ty], [IntrNoMem]>;
102def int_mips_precequ_ph_qbl: ClangBuiltin<"__builtin_mips_precequ_ph_qbl">,
103  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
104def int_mips_precequ_ph_qbr: ClangBuiltin<"__builtin_mips_precequ_ph_qbr">,
105  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
106def int_mips_precequ_ph_qbla: ClangBuiltin<"__builtin_mips_precequ_ph_qbla">,
107  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
108def int_mips_precequ_ph_qbra: ClangBuiltin<"__builtin_mips_precequ_ph_qbra">,
109  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
110def int_mips_preceu_ph_qbl: ClangBuiltin<"__builtin_mips_preceu_ph_qbl">,
111  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
112def int_mips_preceu_ph_qbr: ClangBuiltin<"__builtin_mips_preceu_ph_qbr">,
113  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
114def int_mips_preceu_ph_qbla: ClangBuiltin<"__builtin_mips_preceu_ph_qbla">,
115  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
116def int_mips_preceu_ph_qbra: ClangBuiltin<"__builtin_mips_preceu_ph_qbra">,
117  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
118
119//===----------------------------------------------------------------------===//
120// Shift
121
122def int_mips_shll_qb: ClangBuiltin<"__builtin_mips_shll_qb">,
123  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_i32_ty], []>;
124def int_mips_shrl_qb: ClangBuiltin<"__builtin_mips_shrl_qb">,
125  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_i32_ty], [IntrNoMem]>;
126def int_mips_shll_ph: ClangBuiltin<"__builtin_mips_shll_ph">,
127  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, llvm_i32_ty], []>;
128def int_mips_shll_s_ph: ClangBuiltin<"__builtin_mips_shll_s_ph">,
129  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, llvm_i32_ty], []>;
130def int_mips_shra_ph: ClangBuiltin<"__builtin_mips_shra_ph">,
131  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, llvm_i32_ty], [IntrNoMem]>;
132def int_mips_shra_r_ph: ClangBuiltin<"__builtin_mips_shra_r_ph">,
133  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, llvm_i32_ty], [IntrNoMem]>;
134def int_mips_shll_s_w: ClangBuiltin<"__builtin_mips_shll_s_w">,
135  Intrinsic<[mips_q31_ty], [mips_q31_ty, llvm_i32_ty], []>;
136def int_mips_shra_r_w: ClangBuiltin<"__builtin_mips_shra_r_w">,
137  Intrinsic<[mips_q31_ty], [mips_q31_ty, llvm_i32_ty], [IntrNoMem]>;
138def int_mips_shilo: ClangBuiltin<"__builtin_mips_shilo">,
139  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty], [IntrNoMem]>;
140
141//===----------------------------------------------------------------------===//
142// Multiplication
143
144def int_mips_muleu_s_ph_qbl: ClangBuiltin<"__builtin_mips_muleu_s_ph_qbl">,
145  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty, mips_v2q15_ty], []>;
146def int_mips_muleu_s_ph_qbr: ClangBuiltin<"__builtin_mips_muleu_s_ph_qbr">,
147  Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty, mips_v2q15_ty], []>;
148def int_mips_mulq_rs_ph: ClangBuiltin<"__builtin_mips_mulq_rs_ph">,
149  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
150def int_mips_muleq_s_w_phl: ClangBuiltin<"__builtin_mips_muleq_s_w_phl">,
151  Intrinsic<[mips_q31_ty], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
152def int_mips_muleq_s_w_phr: ClangBuiltin<"__builtin_mips_muleq_s_w_phr">,
153  Intrinsic<[mips_q31_ty], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
154def int_mips_mulsaq_s_w_ph: ClangBuiltin<"__builtin_mips_mulsaq_s_w_ph">,
155  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
156def int_mips_maq_s_w_phl: ClangBuiltin<"__builtin_mips_maq_s_w_phl">,
157  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
158def int_mips_maq_s_w_phr: ClangBuiltin<"__builtin_mips_maq_s_w_phr">,
159  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
160def int_mips_maq_sa_w_phl: ClangBuiltin<"__builtin_mips_maq_sa_w_phl">,
161  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
162def int_mips_maq_sa_w_phr: ClangBuiltin<"__builtin_mips_maq_sa_w_phr">,
163  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
164def int_mips_mult: ClangBuiltin<"__builtin_mips_mult">,
165  Intrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i32_ty],
166            [IntrNoMem, Commutative]>;
167def int_mips_multu: ClangBuiltin<"__builtin_mips_multu">,
168  Intrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i32_ty],
169            [IntrNoMem, Commutative]>;
170
171//===----------------------------------------------------------------------===//
172// Dot product with accumulate/subtract
173
174def int_mips_dpau_h_qbl: ClangBuiltin<"__builtin_mips_dpau_h_qbl">,
175  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v4i8_ty, llvm_v4i8_ty],
176            [IntrNoMem]>;
177def int_mips_dpau_h_qbr: ClangBuiltin<"__builtin_mips_dpau_h_qbr">,
178  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v4i8_ty, llvm_v4i8_ty],
179            [IntrNoMem]>;
180def int_mips_dpsu_h_qbl: ClangBuiltin<"__builtin_mips_dpsu_h_qbl">,
181  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v4i8_ty, llvm_v4i8_ty],
182            [IntrNoMem]>;
183def int_mips_dpsu_h_qbr: ClangBuiltin<"__builtin_mips_dpsu_h_qbr">,
184  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v4i8_ty, llvm_v4i8_ty],
185            [IntrNoMem]>;
186def int_mips_dpaq_s_w_ph: ClangBuiltin<"__builtin_mips_dpaq_s_w_ph">,
187  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
188def int_mips_dpsq_s_w_ph: ClangBuiltin<"__builtin_mips_dpsq_s_w_ph">,
189  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
190def int_mips_dpaq_sa_l_w: ClangBuiltin<"__builtin_mips_dpaq_sa_l_w">,
191  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_q31_ty, mips_q31_ty], []>;
192def int_mips_dpsq_sa_l_w: ClangBuiltin<"__builtin_mips_dpsq_sa_l_w">,
193  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_q31_ty, mips_q31_ty], []>;
194
195//===----------------------------------------------------------------------===//
196// Comparison
197
198def int_mips_cmpu_eq_qb: ClangBuiltin<"__builtin_mips_cmpu_eq_qb">,
199  Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
200def int_mips_cmpu_lt_qb: ClangBuiltin<"__builtin_mips_cmpu_lt_qb">,
201  Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
202def int_mips_cmpu_le_qb: ClangBuiltin<"__builtin_mips_cmpu_le_qb">,
203  Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
204def int_mips_cmpgu_eq_qb: ClangBuiltin<"__builtin_mips_cmpgu_eq_qb">,
205  Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
206def int_mips_cmpgu_lt_qb: ClangBuiltin<"__builtin_mips_cmpgu_lt_qb">,
207  Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
208def int_mips_cmpgu_le_qb: ClangBuiltin<"__builtin_mips_cmpgu_le_qb">,
209  Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
210def int_mips_cmp_eq_ph: ClangBuiltin<"__builtin_mips_cmp_eq_ph">,
211  Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
212def int_mips_cmp_lt_ph: ClangBuiltin<"__builtin_mips_cmp_lt_ph">,
213  Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], []>;
214def int_mips_cmp_le_ph: ClangBuiltin<"__builtin_mips_cmp_le_ph">,
215  Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], []>;
216
217//===----------------------------------------------------------------------===//
218// Extracting
219
220def int_mips_extr_s_h: ClangBuiltin<"__builtin_mips_extr_s_h">,
221  Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
222def int_mips_extr_w: ClangBuiltin<"__builtin_mips_extr_w">,
223  Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
224def int_mips_extr_rs_w: ClangBuiltin<"__builtin_mips_extr_rs_w">,
225  Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
226def int_mips_extr_r_w: ClangBuiltin<"__builtin_mips_extr_r_w">,
227  Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
228def int_mips_extp: ClangBuiltin<"__builtin_mips_extp">,
229  Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
230def int_mips_extpdp: ClangBuiltin<"__builtin_mips_extpdp">,
231  Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
232
233//===----------------------------------------------------------------------===//
234// Misc
235
236def int_mips_wrdsp: ClangBuiltin<"__builtin_mips_wrdsp">,
237  Intrinsic<[], [llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<1>>]>;
238def int_mips_rddsp: ClangBuiltin<"__builtin_mips_rddsp">,
239  Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrReadMem, ImmArg<ArgIndex<0>>]>;
240
241def int_mips_insv: ClangBuiltin<"__builtin_mips_insv">,
242  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrReadMem]>;
243def int_mips_bitrev: ClangBuiltin<"__builtin_mips_bitrev">,
244  Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
245
246def int_mips_packrl_ph: ClangBuiltin<"__builtin_mips_packrl_ph">,
247  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
248
249def int_mips_repl_qb: ClangBuiltin<"__builtin_mips_repl_qb">,
250  Intrinsic<[llvm_v4i8_ty], [llvm_i32_ty], [IntrNoMem]>;
251def int_mips_repl_ph: ClangBuiltin<"__builtin_mips_repl_ph">,
252  Intrinsic<[mips_v2q15_ty], [llvm_i32_ty], [IntrNoMem]>;
253
254def int_mips_pick_qb: ClangBuiltin<"__builtin_mips_pick_qb">,
255  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrReadMem]>;
256def int_mips_pick_ph: ClangBuiltin<"__builtin_mips_pick_ph">,
257  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrReadMem]>;
258
259def int_mips_mthlip: ClangBuiltin<"__builtin_mips_mthlip">,
260  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty], []>;
261
262def int_mips_bposge32: ClangBuiltin<"__builtin_mips_bposge32">,
263  Intrinsic<[llvm_i32_ty], [], [IntrReadMem]>;
264
265def int_mips_lbux: ClangBuiltin<"__builtin_mips_lbux">,
266  Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty], [IntrReadMem, IntrArgMemOnly]>;
267def int_mips_lhx: ClangBuiltin<"__builtin_mips_lhx">,
268  Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty], [IntrReadMem, IntrArgMemOnly]>;
269def int_mips_lwx: ClangBuiltin<"__builtin_mips_lwx">,
270  Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty], [IntrReadMem, IntrArgMemOnly]>;
271
272//===----------------------------------------------------------------------===//
273// MIPS DSP Rev 2
274
275def int_mips_absq_s_qb: ClangBuiltin<"__builtin_mips_absq_s_qb">,
276  Intrinsic<[mips_v4q7_ty], [mips_v4q7_ty], []>;
277
278def int_mips_addqh_ph: ClangBuiltin<"__builtin_mips_addqh_ph">,
279  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty],
280            [IntrNoMem, Commutative]>;
281def int_mips_addqh_r_ph: ClangBuiltin<"__builtin_mips_addqh_r_ph">,
282  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty],
283            [IntrNoMem, Commutative]>;
284def int_mips_addqh_w: ClangBuiltin<"__builtin_mips_addqh_w">,
285  Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty],
286            [IntrNoMem, Commutative]>;
287def int_mips_addqh_r_w: ClangBuiltin<"__builtin_mips_addqh_r_w">,
288  Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty],
289            [IntrNoMem, Commutative]>;
290
291def int_mips_addu_ph: ClangBuiltin<"__builtin_mips_addu_ph">,
292  Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], [Commutative]>;
293def int_mips_addu_s_ph: ClangBuiltin<"__builtin_mips_addu_s_ph">,
294  Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], [Commutative]>;
295
296def int_mips_adduh_qb: ClangBuiltin<"__builtin_mips_adduh_qb">,
297  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty],
298            [IntrNoMem, Commutative]>;
299def int_mips_adduh_r_qb: ClangBuiltin<"__builtin_mips_adduh_r_qb">,
300  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty],
301            [IntrNoMem, Commutative]>;
302
303def int_mips_append: ClangBuiltin<"__builtin_mips_append">,
304  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
305  [IntrNoMem, ImmArg<ArgIndex<2>>]>;
306def int_mips_balign: ClangBuiltin<"__builtin_mips_balign">,
307  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
308  [IntrNoMem, ImmArg<ArgIndex<2>>]>;
309
310def int_mips_cmpgdu_eq_qb: ClangBuiltin<"__builtin_mips_cmpgdu_eq_qb">,
311  Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
312def int_mips_cmpgdu_lt_qb: ClangBuiltin<"__builtin_mips_cmpgdu_lt_qb">,
313  Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
314def int_mips_cmpgdu_le_qb: ClangBuiltin<"__builtin_mips_cmpgdu_le_qb">,
315  Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
316
317def int_mips_dpa_w_ph: ClangBuiltin<"__builtin_mips_dpa_w_ph">,
318  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
319            [IntrNoMem]>;
320def int_mips_dps_w_ph: ClangBuiltin<"__builtin_mips_dps_w_ph">,
321  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
322            [IntrNoMem]>;
323
324def int_mips_dpaqx_s_w_ph: ClangBuiltin<"__builtin_mips_dpaqx_s_w_ph">,
325  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
326def int_mips_dpaqx_sa_w_ph: ClangBuiltin<"__builtin_mips_dpaqx_sa_w_ph">,
327  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
328def int_mips_dpax_w_ph: ClangBuiltin<"__builtin_mips_dpax_w_ph">,
329  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
330            [IntrNoMem]>;
331def int_mips_dpsx_w_ph: ClangBuiltin<"__builtin_mips_dpsx_w_ph">,
332  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
333            [IntrNoMem]>;
334def int_mips_dpsqx_s_w_ph: ClangBuiltin<"__builtin_mips_dpsqx_s_w_ph">,
335  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
336def int_mips_dpsqx_sa_w_ph: ClangBuiltin<"__builtin_mips_dpsqx_sa_w_ph">,
337  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
338
339def int_mips_mul_ph: ClangBuiltin<"__builtin_mips_mul_ph">,
340  Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], [Commutative]>;
341def int_mips_mul_s_ph: ClangBuiltin<"__builtin_mips_mul_s_ph">,
342  Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], [Commutative]>;
343
344def int_mips_mulq_rs_w: ClangBuiltin<"__builtin_mips_mulq_rs_w">,
345  Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [Commutative]>;
346def int_mips_mulq_s_ph: ClangBuiltin<"__builtin_mips_mulq_s_ph">,
347  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
348def int_mips_mulq_s_w: ClangBuiltin<"__builtin_mips_mulq_s_w">,
349  Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [Commutative]>;
350def int_mips_mulsa_w_ph: ClangBuiltin<"__builtin_mips_mulsa_w_ph">,
351  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
352            [IntrNoMem]>;
353
354def int_mips_precr_qb_ph: ClangBuiltin<"__builtin_mips_precr_qb_ph">,
355  Intrinsic<[llvm_v4i8_ty], [llvm_v2i16_ty, llvm_v2i16_ty], []>;
356def int_mips_precr_sra_ph_w: ClangBuiltin<"__builtin_mips_precr_sra_ph_w">,
357  Intrinsic<[llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
358            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
359def int_mips_precr_sra_r_ph_w: ClangBuiltin<"__builtin_mips_precr_sra_r_ph_w">,
360  Intrinsic<[llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
361            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
362
363def int_mips_prepend: ClangBuiltin<"__builtin_mips_prepend">,
364  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
365  [IntrNoMem, ImmArg<ArgIndex<2>>]>;
366
367def int_mips_shra_qb: ClangBuiltin<"__builtin_mips_shra_qb">,
368  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_i32_ty], [IntrNoMem]>;
369def int_mips_shra_r_qb: ClangBuiltin<"__builtin_mips_shra_r_qb">,
370  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_i32_ty], [IntrNoMem]>;
371def int_mips_shrl_ph: ClangBuiltin<"__builtin_mips_shrl_ph">,
372  Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_i32_ty], [IntrNoMem]>;
373
374def int_mips_subqh_ph: ClangBuiltin<"__builtin_mips_subqh_ph">,
375  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
376def int_mips_subqh_r_ph: ClangBuiltin<"__builtin_mips_subqh_r_ph">,
377  Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
378def int_mips_subqh_w: ClangBuiltin<"__builtin_mips_subqh_w">,
379  Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [IntrNoMem]>;
380def int_mips_subqh_r_w: ClangBuiltin<"__builtin_mips_subqh_r_w">,
381  Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [IntrNoMem]>;
382
383def int_mips_subu_ph: ClangBuiltin<"__builtin_mips_subu_ph">,
384  Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], []>;
385def int_mips_subu_s_ph: ClangBuiltin<"__builtin_mips_subu_s_ph">,
386  Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], []>;
387
388def int_mips_subuh_qb: ClangBuiltin<"__builtin_mips_subuh_qb">,
389  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrNoMem]>;
390def int_mips_subuh_r_qb: ClangBuiltin<"__builtin_mips_subuh_r_qb">,
391  Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrNoMem]>;
392
393//===----------------------------------------------------------------------===//
394// MIPS MSA
395
396//===----------------------------------------------------------------------===//
397// Addition/subtraction
398
399def int_mips_add_a_b : ClangBuiltin<"__builtin_msa_add_a_b">,
400  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
401  [Commutative, IntrNoMem]>;
402def int_mips_add_a_h : ClangBuiltin<"__builtin_msa_add_a_h">,
403  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
404  [Commutative, IntrNoMem]>;
405def int_mips_add_a_w : ClangBuiltin<"__builtin_msa_add_a_w">,
406  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
407  [Commutative, IntrNoMem]>;
408def int_mips_add_a_d : ClangBuiltin<"__builtin_msa_add_a_d">,
409  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
410  [Commutative, IntrNoMem]>;
411
412def int_mips_adds_a_b : ClangBuiltin<"__builtin_msa_adds_a_b">,
413  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
414  [Commutative, IntrNoMem]>;
415def int_mips_adds_a_h : ClangBuiltin<"__builtin_msa_adds_a_h">,
416  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
417  [Commutative, IntrNoMem]>;
418def int_mips_adds_a_w : ClangBuiltin<"__builtin_msa_adds_a_w">,
419  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
420  [Commutative, IntrNoMem]>;
421def int_mips_adds_a_d : ClangBuiltin<"__builtin_msa_adds_a_d">,
422  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
423  [Commutative, IntrNoMem]>;
424
425def int_mips_adds_s_b : ClangBuiltin<"__builtin_msa_adds_s_b">,
426  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
427  [Commutative, IntrNoMem]>;
428def int_mips_adds_s_h : ClangBuiltin<"__builtin_msa_adds_s_h">,
429  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
430  [Commutative, IntrNoMem]>;
431def int_mips_adds_s_w : ClangBuiltin<"__builtin_msa_adds_s_w">,
432  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
433  [Commutative, IntrNoMem]>;
434def int_mips_adds_s_d : ClangBuiltin<"__builtin_msa_adds_s_d">,
435  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
436  [Commutative, IntrNoMem]>;
437
438def int_mips_adds_u_b : ClangBuiltin<"__builtin_msa_adds_u_b">,
439  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
440  [Commutative, IntrNoMem]>;
441def int_mips_adds_u_h : ClangBuiltin<"__builtin_msa_adds_u_h">,
442  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
443  [Commutative, IntrNoMem]>;
444def int_mips_adds_u_w : ClangBuiltin<"__builtin_msa_adds_u_w">,
445  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
446  [Commutative, IntrNoMem]>;
447def int_mips_adds_u_d : ClangBuiltin<"__builtin_msa_adds_u_d">,
448  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
449  [Commutative, IntrNoMem]>;
450
451def int_mips_addv_b : ClangBuiltin<"__builtin_msa_addv_b">,
452  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
453  [Commutative, IntrNoMem]>;
454def int_mips_addv_h : ClangBuiltin<"__builtin_msa_addv_h">,
455  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
456  [Commutative, IntrNoMem]>;
457def int_mips_addv_w : ClangBuiltin<"__builtin_msa_addv_w">,
458  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
459  [Commutative, IntrNoMem]>;
460def int_mips_addv_d : ClangBuiltin<"__builtin_msa_addv_d">,
461  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
462  [Commutative, IntrNoMem]>;
463
464def int_mips_addvi_b : ClangBuiltin<"__builtin_msa_addvi_b">,
465  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty],
466  [Commutative, IntrNoMem, ImmArg<ArgIndex<1>>]>;
467def int_mips_addvi_h : ClangBuiltin<"__builtin_msa_addvi_h">,
468  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty],
469  [Commutative, IntrNoMem, ImmArg<ArgIndex<1>>]>;
470def int_mips_addvi_w : ClangBuiltin<"__builtin_msa_addvi_w">,
471  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty],
472  [Commutative, IntrNoMem, ImmArg<ArgIndex<1>>]>;
473def int_mips_addvi_d : ClangBuiltin<"__builtin_msa_addvi_d">,
474  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty],
475  [Commutative, IntrNoMem, ImmArg<ArgIndex<1>>]>;
476
477def int_mips_and_v : ClangBuiltin<"__builtin_msa_and_v">,
478  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
479
480def int_mips_andi_b : ClangBuiltin<"__builtin_msa_andi_b">,
481  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
482
483def int_mips_asub_s_b : ClangBuiltin<"__builtin_msa_asub_s_b">,
484  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
485def int_mips_asub_s_h : ClangBuiltin<"__builtin_msa_asub_s_h">,
486  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
487def int_mips_asub_s_w : ClangBuiltin<"__builtin_msa_asub_s_w">,
488  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
489def int_mips_asub_s_d : ClangBuiltin<"__builtin_msa_asub_s_d">,
490  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
491
492def int_mips_asub_u_b : ClangBuiltin<"__builtin_msa_asub_u_b">,
493  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
494def int_mips_asub_u_h : ClangBuiltin<"__builtin_msa_asub_u_h">,
495  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
496def int_mips_asub_u_w : ClangBuiltin<"__builtin_msa_asub_u_w">,
497  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
498def int_mips_asub_u_d : ClangBuiltin<"__builtin_msa_asub_u_d">,
499  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
500
501def int_mips_ave_s_b : ClangBuiltin<"__builtin_msa_ave_s_b">,
502  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
503  [Commutative, IntrNoMem]>;
504def int_mips_ave_s_h : ClangBuiltin<"__builtin_msa_ave_s_h">,
505  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
506  [Commutative, IntrNoMem]>;
507def int_mips_ave_s_w : ClangBuiltin<"__builtin_msa_ave_s_w">,
508  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
509  [Commutative, IntrNoMem]>;
510def int_mips_ave_s_d : ClangBuiltin<"__builtin_msa_ave_s_d">,
511  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
512  [Commutative, IntrNoMem]>;
513
514def int_mips_ave_u_b : ClangBuiltin<"__builtin_msa_ave_u_b">,
515  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
516  [Commutative, IntrNoMem]>;
517def int_mips_ave_u_h : ClangBuiltin<"__builtin_msa_ave_u_h">,
518  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
519  [Commutative, IntrNoMem]>;
520def int_mips_ave_u_w : ClangBuiltin<"__builtin_msa_ave_u_w">,
521  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
522  [Commutative, IntrNoMem]>;
523def int_mips_ave_u_d : ClangBuiltin<"__builtin_msa_ave_u_d">,
524  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
525  [Commutative, IntrNoMem]>;
526
527def int_mips_aver_s_b : ClangBuiltin<"__builtin_msa_aver_s_b">,
528  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
529  [Commutative, IntrNoMem]>;
530def int_mips_aver_s_h : ClangBuiltin<"__builtin_msa_aver_s_h">,
531  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
532  [Commutative, IntrNoMem]>;
533def int_mips_aver_s_w : ClangBuiltin<"__builtin_msa_aver_s_w">,
534  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
535  [Commutative, IntrNoMem]>;
536def int_mips_aver_s_d : ClangBuiltin<"__builtin_msa_aver_s_d">,
537  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
538  [Commutative, IntrNoMem]>;
539
540def int_mips_aver_u_b : ClangBuiltin<"__builtin_msa_aver_u_b">,
541  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
542  [Commutative, IntrNoMem]>;
543def int_mips_aver_u_h : ClangBuiltin<"__builtin_msa_aver_u_h">,
544  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
545  [Commutative, IntrNoMem]>;
546def int_mips_aver_u_w : ClangBuiltin<"__builtin_msa_aver_u_w">,
547  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
548  [Commutative, IntrNoMem]>;
549def int_mips_aver_u_d : ClangBuiltin<"__builtin_msa_aver_u_d">,
550  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
551  [Commutative, IntrNoMem]>;
552
553def int_mips_bclr_b : ClangBuiltin<"__builtin_msa_bclr_b">,
554  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
555def int_mips_bclr_h : ClangBuiltin<"__builtin_msa_bclr_h">,
556  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
557def int_mips_bclr_w : ClangBuiltin<"__builtin_msa_bclr_w">,
558  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
559def int_mips_bclr_d : ClangBuiltin<"__builtin_msa_bclr_d">,
560  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
561
562def int_mips_bclri_b : ClangBuiltin<"__builtin_msa_bclri_b">,
563  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
564def int_mips_bclri_h : ClangBuiltin<"__builtin_msa_bclri_h">,
565  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
566def int_mips_bclri_w : ClangBuiltin<"__builtin_msa_bclri_w">,
567  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
568def int_mips_bclri_d : ClangBuiltin<"__builtin_msa_bclri_d">,
569  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
570
571def int_mips_binsl_b : ClangBuiltin<"__builtin_msa_binsl_b">,
572  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
573            [IntrNoMem]>;
574def int_mips_binsl_h : ClangBuiltin<"__builtin_msa_binsl_h">,
575  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
576            [IntrNoMem]>;
577def int_mips_binsl_w : ClangBuiltin<"__builtin_msa_binsl_w">,
578  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
579            [IntrNoMem]>;
580def int_mips_binsl_d : ClangBuiltin<"__builtin_msa_binsl_d">,
581  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
582            [IntrNoMem]>;
583
584def int_mips_binsli_b : ClangBuiltin<"__builtin_msa_binsli_b">,
585  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
586            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
587def int_mips_binsli_h : ClangBuiltin<"__builtin_msa_binsli_h">,
588  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
589            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
590def int_mips_binsli_w : ClangBuiltin<"__builtin_msa_binsli_w">,
591  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
592            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
593def int_mips_binsli_d : ClangBuiltin<"__builtin_msa_binsli_d">,
594  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
595            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
596
597def int_mips_binsr_b : ClangBuiltin<"__builtin_msa_binsr_b">,
598  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
599            [IntrNoMem]>;
600def int_mips_binsr_h : ClangBuiltin<"__builtin_msa_binsr_h">,
601  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
602            [IntrNoMem]>;
603def int_mips_binsr_w : ClangBuiltin<"__builtin_msa_binsr_w">,
604  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
605            [IntrNoMem]>;
606def int_mips_binsr_d : ClangBuiltin<"__builtin_msa_binsr_d">,
607  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
608            [IntrNoMem]>;
609
610def int_mips_binsri_b : ClangBuiltin<"__builtin_msa_binsri_b">,
611  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
612            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
613def int_mips_binsri_h : ClangBuiltin<"__builtin_msa_binsri_h">,
614  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
615            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
616def int_mips_binsri_w : ClangBuiltin<"__builtin_msa_binsri_w">,
617  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
618            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
619def int_mips_binsri_d : ClangBuiltin<"__builtin_msa_binsri_d">,
620  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
621            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
622
623def int_mips_bmnz_v : ClangBuiltin<"__builtin_msa_bmnz_v">,
624  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
625            [IntrNoMem]>;
626
627def int_mips_bmnzi_b : ClangBuiltin<"__builtin_msa_bmnzi_b">,
628  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
629            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
630
631def int_mips_bmz_v : ClangBuiltin<"__builtin_msa_bmz_v">,
632  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
633            [IntrNoMem]>;
634
635def int_mips_bmzi_b : ClangBuiltin<"__builtin_msa_bmzi_b">,
636  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
637            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
638
639def int_mips_bneg_b : ClangBuiltin<"__builtin_msa_bneg_b">,
640  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
641def int_mips_bneg_h : ClangBuiltin<"__builtin_msa_bneg_h">,
642  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
643def int_mips_bneg_w : ClangBuiltin<"__builtin_msa_bneg_w">,
644  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
645def int_mips_bneg_d : ClangBuiltin<"__builtin_msa_bneg_d">,
646  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
647
648def int_mips_bnegi_b : ClangBuiltin<"__builtin_msa_bnegi_b">,
649  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
650def int_mips_bnegi_h : ClangBuiltin<"__builtin_msa_bnegi_h">,
651  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
652def int_mips_bnegi_w : ClangBuiltin<"__builtin_msa_bnegi_w">,
653  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
654def int_mips_bnegi_d : ClangBuiltin<"__builtin_msa_bnegi_d">,
655  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
656
657def int_mips_bnz_b : ClangBuiltin<"__builtin_msa_bnz_b">,
658  Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
659def int_mips_bnz_h : ClangBuiltin<"__builtin_msa_bnz_h">,
660  Intrinsic<[llvm_i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
661def int_mips_bnz_w : ClangBuiltin<"__builtin_msa_bnz_w">,
662  Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
663def int_mips_bnz_d : ClangBuiltin<"__builtin_msa_bnz_d">,
664  Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty], [IntrNoMem]>;
665
666def int_mips_bnz_v : ClangBuiltin<"__builtin_msa_bnz_v">,
667  Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
668
669def int_mips_bsel_v : ClangBuiltin<"__builtin_msa_bsel_v">,
670  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
671            [IntrNoMem]>;
672
673def int_mips_bseli_b : ClangBuiltin<"__builtin_msa_bseli_b">,
674  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
675            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
676
677def int_mips_bset_b : ClangBuiltin<"__builtin_msa_bset_b">,
678  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
679def int_mips_bset_h : ClangBuiltin<"__builtin_msa_bset_h">,
680  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
681def int_mips_bset_w : ClangBuiltin<"__builtin_msa_bset_w">,
682  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
683def int_mips_bset_d : ClangBuiltin<"__builtin_msa_bset_d">,
684  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
685
686def int_mips_bseti_b : ClangBuiltin<"__builtin_msa_bseti_b">,
687  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
688def int_mips_bseti_h : ClangBuiltin<"__builtin_msa_bseti_h">,
689  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
690def int_mips_bseti_w : ClangBuiltin<"__builtin_msa_bseti_w">,
691  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
692def int_mips_bseti_d : ClangBuiltin<"__builtin_msa_bseti_d">,
693  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
694
695def int_mips_bz_b : ClangBuiltin<"__builtin_msa_bz_b">,
696  Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
697def int_mips_bz_h : ClangBuiltin<"__builtin_msa_bz_h">,
698  Intrinsic<[llvm_i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
699def int_mips_bz_w : ClangBuiltin<"__builtin_msa_bz_w">,
700  Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
701def int_mips_bz_d : ClangBuiltin<"__builtin_msa_bz_d">,
702  Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty], [IntrNoMem]>;
703
704def int_mips_bz_v : ClangBuiltin<"__builtin_msa_bz_v">,
705  Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
706
707def int_mips_ceq_b : ClangBuiltin<"__builtin_msa_ceq_b">,
708  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
709def int_mips_ceq_h : ClangBuiltin<"__builtin_msa_ceq_h">,
710  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
711def int_mips_ceq_w : ClangBuiltin<"__builtin_msa_ceq_w">,
712  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
713def int_mips_ceq_d : ClangBuiltin<"__builtin_msa_ceq_d">,
714  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
715
716def int_mips_ceqi_b : ClangBuiltin<"__builtin_msa_ceqi_b">,
717  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
718def int_mips_ceqi_h : ClangBuiltin<"__builtin_msa_ceqi_h">,
719  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
720def int_mips_ceqi_w : ClangBuiltin<"__builtin_msa_ceqi_w">,
721  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
722def int_mips_ceqi_d : ClangBuiltin<"__builtin_msa_ceqi_d">,
723  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
724
725def int_mips_cfcmsa : ClangBuiltin<"__builtin_msa_cfcmsa">,
726  Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [ImmArg<ArgIndex<0>>]>;
727
728def int_mips_cle_s_b : ClangBuiltin<"__builtin_msa_cle_s_b">,
729  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
730def int_mips_cle_s_h : ClangBuiltin<"__builtin_msa_cle_s_h">,
731  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
732def int_mips_cle_s_w : ClangBuiltin<"__builtin_msa_cle_s_w">,
733  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
734def int_mips_cle_s_d : ClangBuiltin<"__builtin_msa_cle_s_d">,
735  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
736
737def int_mips_cle_u_b : ClangBuiltin<"__builtin_msa_cle_u_b">,
738  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
739def int_mips_cle_u_h : ClangBuiltin<"__builtin_msa_cle_u_h">,
740  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
741def int_mips_cle_u_w : ClangBuiltin<"__builtin_msa_cle_u_w">,
742  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
743def int_mips_cle_u_d : ClangBuiltin<"__builtin_msa_cle_u_d">,
744  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
745
746def int_mips_clei_s_b : ClangBuiltin<"__builtin_msa_clei_s_b">,
747  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
748def int_mips_clei_s_h : ClangBuiltin<"__builtin_msa_clei_s_h">,
749  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
750def int_mips_clei_s_w : ClangBuiltin<"__builtin_msa_clei_s_w">,
751  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
752def int_mips_clei_s_d : ClangBuiltin<"__builtin_msa_clei_s_d">,
753  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
754
755def int_mips_clei_u_b : ClangBuiltin<"__builtin_msa_clei_u_b">,
756  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
757def int_mips_clei_u_h : ClangBuiltin<"__builtin_msa_clei_u_h">,
758  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
759def int_mips_clei_u_w : ClangBuiltin<"__builtin_msa_clei_u_w">,
760  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
761def int_mips_clei_u_d : ClangBuiltin<"__builtin_msa_clei_u_d">,
762  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
763
764def int_mips_clt_s_b : ClangBuiltin<"__builtin_msa_clt_s_b">,
765  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
766def int_mips_clt_s_h : ClangBuiltin<"__builtin_msa_clt_s_h">,
767  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
768def int_mips_clt_s_w : ClangBuiltin<"__builtin_msa_clt_s_w">,
769  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
770def int_mips_clt_s_d : ClangBuiltin<"__builtin_msa_clt_s_d">,
771  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
772
773def int_mips_clt_u_b : ClangBuiltin<"__builtin_msa_clt_u_b">,
774  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
775def int_mips_clt_u_h : ClangBuiltin<"__builtin_msa_clt_u_h">,
776  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
777def int_mips_clt_u_w : ClangBuiltin<"__builtin_msa_clt_u_w">,
778  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
779def int_mips_clt_u_d : ClangBuiltin<"__builtin_msa_clt_u_d">,
780  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
781
782def int_mips_clti_s_b : ClangBuiltin<"__builtin_msa_clti_s_b">,
783  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
784def int_mips_clti_s_h : ClangBuiltin<"__builtin_msa_clti_s_h">,
785  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
786def int_mips_clti_s_w : ClangBuiltin<"__builtin_msa_clti_s_w">,
787  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
788def int_mips_clti_s_d : ClangBuiltin<"__builtin_msa_clti_s_d">,
789  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
790
791def int_mips_clti_u_b : ClangBuiltin<"__builtin_msa_clti_u_b">,
792  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
793def int_mips_clti_u_h : ClangBuiltin<"__builtin_msa_clti_u_h">,
794  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
795def int_mips_clti_u_w : ClangBuiltin<"__builtin_msa_clti_u_w">,
796  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
797def int_mips_clti_u_d : ClangBuiltin<"__builtin_msa_clti_u_d">,
798  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
799
800def int_mips_copy_s_b : ClangBuiltin<"__builtin_msa_copy_s_b">,
801  Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
802def int_mips_copy_s_h : ClangBuiltin<"__builtin_msa_copy_s_h">,
803  Intrinsic<[llvm_i32_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
804def int_mips_copy_s_w : ClangBuiltin<"__builtin_msa_copy_s_w">,
805  Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
806def int_mips_copy_s_d : ClangBuiltin<"__builtin_msa_copy_s_d">,
807  Intrinsic<[llvm_i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
808
809def int_mips_copy_u_b : ClangBuiltin<"__builtin_msa_copy_u_b">,
810  Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
811def int_mips_copy_u_h : ClangBuiltin<"__builtin_msa_copy_u_h">,
812  Intrinsic<[llvm_i32_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
813def int_mips_copy_u_w : ClangBuiltin<"__builtin_msa_copy_u_w">,
814  Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
815def int_mips_copy_u_d : ClangBuiltin<"__builtin_msa_copy_u_d">,
816  Intrinsic<[llvm_i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
817
818def int_mips_ctcmsa : ClangBuiltin<"__builtin_msa_ctcmsa">,
819  Intrinsic<[], [llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<0>>]>;
820
821def int_mips_div_s_b : ClangBuiltin<"__builtin_msa_div_s_b">,
822  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
823def int_mips_div_s_h : ClangBuiltin<"__builtin_msa_div_s_h">,
824  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
825def int_mips_div_s_w : ClangBuiltin<"__builtin_msa_div_s_w">,
826  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
827def int_mips_div_s_d : ClangBuiltin<"__builtin_msa_div_s_d">,
828  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
829
830def int_mips_div_u_b : ClangBuiltin<"__builtin_msa_div_u_b">,
831  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
832def int_mips_div_u_h : ClangBuiltin<"__builtin_msa_div_u_h">,
833  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
834def int_mips_div_u_w : ClangBuiltin<"__builtin_msa_div_u_w">,
835  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
836def int_mips_div_u_d : ClangBuiltin<"__builtin_msa_div_u_d">,
837  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
838
839// This instruction is part of the MSA spec but it does not share the
840// __builtin_msa prefix because it operates on GP registers.
841def int_mips_dlsa : ClangBuiltin<"__builtin_mips_dlsa">,
842  Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty],
843            [IntrNoMem]>;
844
845def int_mips_dotp_s_h : ClangBuiltin<"__builtin_msa_dotp_s_h">,
846  Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
847def int_mips_dotp_s_w : ClangBuiltin<"__builtin_msa_dotp_s_w">,
848  Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
849def int_mips_dotp_s_d : ClangBuiltin<"__builtin_msa_dotp_s_d">,
850  Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
851
852def int_mips_dotp_u_h : ClangBuiltin<"__builtin_msa_dotp_u_h">,
853  Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
854def int_mips_dotp_u_w : ClangBuiltin<"__builtin_msa_dotp_u_w">,
855  Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
856def int_mips_dotp_u_d : ClangBuiltin<"__builtin_msa_dotp_u_d">,
857  Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
858
859def int_mips_dpadd_s_h : ClangBuiltin<"__builtin_msa_dpadd_s_h">,
860  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
861  [IntrNoMem]>;
862def int_mips_dpadd_s_w : ClangBuiltin<"__builtin_msa_dpadd_s_w">,
863  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
864  [IntrNoMem]>;
865def int_mips_dpadd_s_d : ClangBuiltin<"__builtin_msa_dpadd_s_d">,
866  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty],
867  [IntrNoMem]>;
868
869def int_mips_dpadd_u_h : ClangBuiltin<"__builtin_msa_dpadd_u_h">,
870  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
871  [IntrNoMem]>;
872def int_mips_dpadd_u_w : ClangBuiltin<"__builtin_msa_dpadd_u_w">,
873  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
874  [IntrNoMem]>;
875def int_mips_dpadd_u_d : ClangBuiltin<"__builtin_msa_dpadd_u_d">,
876  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty],
877  [IntrNoMem]>;
878
879def int_mips_dpsub_s_h : ClangBuiltin<"__builtin_msa_dpsub_s_h">,
880  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
881  [IntrNoMem]>;
882def int_mips_dpsub_s_w : ClangBuiltin<"__builtin_msa_dpsub_s_w">,
883  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
884  [IntrNoMem]>;
885def int_mips_dpsub_s_d : ClangBuiltin<"__builtin_msa_dpsub_s_d">,
886  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty],
887  [IntrNoMem]>;
888
889def int_mips_dpsub_u_h : ClangBuiltin<"__builtin_msa_dpsub_u_h">,
890  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
891  [IntrNoMem]>;
892def int_mips_dpsub_u_w : ClangBuiltin<"__builtin_msa_dpsub_u_w">,
893  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
894  [IntrNoMem]>;
895def int_mips_dpsub_u_d : ClangBuiltin<"__builtin_msa_dpsub_u_d">,
896  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty],
897  [IntrNoMem]>;
898
899def int_mips_fadd_w : ClangBuiltin<"__builtin_msa_fadd_w">,
900  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
901def int_mips_fadd_d : ClangBuiltin<"__builtin_msa_fadd_d">,
902  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
903
904def int_mips_fcaf_w : ClangBuiltin<"__builtin_msa_fcaf_w">,
905  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
906def int_mips_fcaf_d : ClangBuiltin<"__builtin_msa_fcaf_d">,
907  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
908
909def int_mips_fceq_w : ClangBuiltin<"__builtin_msa_fceq_w">,
910  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
911def int_mips_fceq_d : ClangBuiltin<"__builtin_msa_fceq_d">,
912  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
913
914def int_mips_fcle_w : ClangBuiltin<"__builtin_msa_fcle_w">,
915  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
916def int_mips_fcle_d : ClangBuiltin<"__builtin_msa_fcle_d">,
917  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
918
919def int_mips_fclt_w : ClangBuiltin<"__builtin_msa_fclt_w">,
920  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
921def int_mips_fclt_d : ClangBuiltin<"__builtin_msa_fclt_d">,
922  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
923
924def int_mips_fclass_w : ClangBuiltin<"__builtin_msa_fclass_w">,
925  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
926def int_mips_fclass_d : ClangBuiltin<"__builtin_msa_fclass_d">,
927  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
928
929def int_mips_fcne_w : ClangBuiltin<"__builtin_msa_fcne_w">,
930  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
931def int_mips_fcne_d : ClangBuiltin<"__builtin_msa_fcne_d">,
932  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
933
934def int_mips_fcor_w : ClangBuiltin<"__builtin_msa_fcor_w">,
935  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
936def int_mips_fcor_d : ClangBuiltin<"__builtin_msa_fcor_d">,
937  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
938
939def int_mips_fcueq_w : ClangBuiltin<"__builtin_msa_fcueq_w">,
940  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
941def int_mips_fcueq_d : ClangBuiltin<"__builtin_msa_fcueq_d">,
942  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
943
944def int_mips_fcule_w : ClangBuiltin<"__builtin_msa_fcule_w">,
945  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
946def int_mips_fcule_d : ClangBuiltin<"__builtin_msa_fcule_d">,
947  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
948
949def int_mips_fcult_w : ClangBuiltin<"__builtin_msa_fcult_w">,
950  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
951def int_mips_fcult_d : ClangBuiltin<"__builtin_msa_fcult_d">,
952  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
953
954def int_mips_fcun_w : ClangBuiltin<"__builtin_msa_fcun_w">,
955  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
956def int_mips_fcun_d : ClangBuiltin<"__builtin_msa_fcun_d">,
957  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
958
959def int_mips_fcune_w : ClangBuiltin<"__builtin_msa_fcune_w">,
960  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
961def int_mips_fcune_d : ClangBuiltin<"__builtin_msa_fcune_d">,
962  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
963
964def int_mips_fdiv_w : ClangBuiltin<"__builtin_msa_fdiv_w">,
965  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
966def int_mips_fdiv_d : ClangBuiltin<"__builtin_msa_fdiv_d">,
967  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
968
969def int_mips_fexdo_h : ClangBuiltin<"__builtin_msa_fexdo_h">,
970  Intrinsic<[llvm_v8f16_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
971def int_mips_fexdo_w : ClangBuiltin<"__builtin_msa_fexdo_w">,
972  Intrinsic<[llvm_v4f32_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
973
974def int_mips_fexp2_w : ClangBuiltin<"__builtin_msa_fexp2_w">,
975  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4i32_ty], [IntrNoMem]>;
976def int_mips_fexp2_d : ClangBuiltin<"__builtin_msa_fexp2_d">,
977  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2i64_ty], [IntrNoMem]>;
978
979def int_mips_fexupl_w : ClangBuiltin<"__builtin_msa_fexupl_w">,
980  Intrinsic<[llvm_v4f32_ty], [llvm_v8f16_ty], [IntrNoMem]>;
981def int_mips_fexupl_d : ClangBuiltin<"__builtin_msa_fexupl_d">,
982  Intrinsic<[llvm_v2f64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
983
984def int_mips_fexupr_w : ClangBuiltin<"__builtin_msa_fexupr_w">,
985  Intrinsic<[llvm_v4f32_ty], [llvm_v8f16_ty], [IntrNoMem]>;
986def int_mips_fexupr_d : ClangBuiltin<"__builtin_msa_fexupr_d">,
987  Intrinsic<[llvm_v2f64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
988
989def int_mips_ffint_s_w : ClangBuiltin<"__builtin_msa_ffint_s_w">,
990  Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
991def int_mips_ffint_s_d : ClangBuiltin<"__builtin_msa_ffint_s_d">,
992  Intrinsic<[llvm_v2f64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
993
994def int_mips_ffint_u_w : ClangBuiltin<"__builtin_msa_ffint_u_w">,
995  Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
996def int_mips_ffint_u_d : ClangBuiltin<"__builtin_msa_ffint_u_d">,
997  Intrinsic<[llvm_v2f64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
998
999def int_mips_ffql_w : ClangBuiltin<"__builtin_msa_ffql_w">,
1000  Intrinsic<[llvm_v4f32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1001def int_mips_ffql_d : ClangBuiltin<"__builtin_msa_ffql_d">,
1002  Intrinsic<[llvm_v2f64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
1003
1004def int_mips_ffqr_w : ClangBuiltin<"__builtin_msa_ffqr_w">,
1005  Intrinsic<[llvm_v4f32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1006def int_mips_ffqr_d : ClangBuiltin<"__builtin_msa_ffqr_d">,
1007  Intrinsic<[llvm_v2f64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
1008
1009def int_mips_fill_b : ClangBuiltin<"__builtin_msa_fill_b">,
1010  Intrinsic<[llvm_v16i8_ty], [llvm_i32_ty], [IntrNoMem]>;
1011def int_mips_fill_h : ClangBuiltin<"__builtin_msa_fill_h">,
1012  Intrinsic<[llvm_v8i16_ty], [llvm_i32_ty], [IntrNoMem]>;
1013def int_mips_fill_w : ClangBuiltin<"__builtin_msa_fill_w">,
1014  Intrinsic<[llvm_v4i32_ty], [llvm_i32_ty], [IntrNoMem]>;
1015def int_mips_fill_d : ClangBuiltin<"__builtin_msa_fill_d">,
1016  Intrinsic<[llvm_v2i64_ty], [llvm_i64_ty], [IntrNoMem]>;
1017
1018def int_mips_flog2_w : ClangBuiltin<"__builtin_msa_flog2_w">,
1019  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1020def int_mips_flog2_d : ClangBuiltin<"__builtin_msa_flog2_d">,
1021  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1022
1023def int_mips_fmadd_w : ClangBuiltin<"__builtin_msa_fmadd_w">,
1024  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
1025            [IntrNoMem]>;
1026def int_mips_fmadd_d : ClangBuiltin<"__builtin_msa_fmadd_d">,
1027  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
1028            [IntrNoMem]>;
1029
1030def int_mips_fmax_w : ClangBuiltin<"__builtin_msa_fmax_w">,
1031  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1032def int_mips_fmax_d : ClangBuiltin<"__builtin_msa_fmax_d">,
1033  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1034
1035def int_mips_fmax_a_w : ClangBuiltin<"__builtin_msa_fmax_a_w">,
1036  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1037def int_mips_fmax_a_d : ClangBuiltin<"__builtin_msa_fmax_a_d">,
1038  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1039
1040def int_mips_fmin_w : ClangBuiltin<"__builtin_msa_fmin_w">,
1041  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1042def int_mips_fmin_d : ClangBuiltin<"__builtin_msa_fmin_d">,
1043  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1044
1045def int_mips_fmin_a_w : ClangBuiltin<"__builtin_msa_fmin_a_w">,
1046  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1047def int_mips_fmin_a_d : ClangBuiltin<"__builtin_msa_fmin_a_d">,
1048  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1049
1050def int_mips_fmsub_w : ClangBuiltin<"__builtin_msa_fmsub_w">,
1051  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
1052            [IntrNoMem]>;
1053def int_mips_fmsub_d : ClangBuiltin<"__builtin_msa_fmsub_d">,
1054  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
1055            [IntrNoMem]>;
1056
1057def int_mips_fmul_w : ClangBuiltin<"__builtin_msa_fmul_w">,
1058  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1059def int_mips_fmul_d : ClangBuiltin<"__builtin_msa_fmul_d">,
1060  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1061
1062def int_mips_frint_w : ClangBuiltin<"__builtin_msa_frint_w">,
1063  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1064def int_mips_frint_d : ClangBuiltin<"__builtin_msa_frint_d">,
1065  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1066
1067def int_mips_frcp_w : ClangBuiltin<"__builtin_msa_frcp_w">,
1068  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1069def int_mips_frcp_d : ClangBuiltin<"__builtin_msa_frcp_d">,
1070  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1071
1072def int_mips_frsqrt_w : ClangBuiltin<"__builtin_msa_frsqrt_w">,
1073  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1074def int_mips_frsqrt_d : ClangBuiltin<"__builtin_msa_frsqrt_d">,
1075  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1076
1077def int_mips_fsaf_w : ClangBuiltin<"__builtin_msa_fsaf_w">,
1078  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1079def int_mips_fsaf_d : ClangBuiltin<"__builtin_msa_fsaf_d">,
1080  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1081
1082def int_mips_fseq_w : ClangBuiltin<"__builtin_msa_fseq_w">,
1083  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1084def int_mips_fseq_d : ClangBuiltin<"__builtin_msa_fseq_d">,
1085  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1086
1087def int_mips_fsle_w : ClangBuiltin<"__builtin_msa_fsle_w">,
1088  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1089def int_mips_fsle_d : ClangBuiltin<"__builtin_msa_fsle_d">,
1090  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1091
1092def int_mips_fslt_w : ClangBuiltin<"__builtin_msa_fslt_w">,
1093  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1094def int_mips_fslt_d : ClangBuiltin<"__builtin_msa_fslt_d">,
1095  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1096
1097def int_mips_fsne_w : ClangBuiltin<"__builtin_msa_fsne_w">,
1098  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1099def int_mips_fsne_d : ClangBuiltin<"__builtin_msa_fsne_d">,
1100  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1101
1102def int_mips_fsor_w : ClangBuiltin<"__builtin_msa_fsor_w">,
1103  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1104def int_mips_fsor_d : ClangBuiltin<"__builtin_msa_fsor_d">,
1105  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1106
1107def int_mips_fsqrt_w : ClangBuiltin<"__builtin_msa_fsqrt_w">,
1108  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1109def int_mips_fsqrt_d : ClangBuiltin<"__builtin_msa_fsqrt_d">,
1110  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1111
1112def int_mips_fsub_w : ClangBuiltin<"__builtin_msa_fsub_w">,
1113  Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1114def int_mips_fsub_d : ClangBuiltin<"__builtin_msa_fsub_d">,
1115  Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1116
1117def int_mips_fsueq_w : ClangBuiltin<"__builtin_msa_fsueq_w">,
1118  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1119def int_mips_fsueq_d : ClangBuiltin<"__builtin_msa_fsueq_d">,
1120  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1121
1122def int_mips_fsule_w : ClangBuiltin<"__builtin_msa_fsule_w">,
1123  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1124def int_mips_fsule_d : ClangBuiltin<"__builtin_msa_fsule_d">,
1125  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1126
1127def int_mips_fsult_w : ClangBuiltin<"__builtin_msa_fsult_w">,
1128  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1129def int_mips_fsult_d : ClangBuiltin<"__builtin_msa_fsult_d">,
1130  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1131
1132def int_mips_fsun_w : ClangBuiltin<"__builtin_msa_fsun_w">,
1133  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1134def int_mips_fsun_d : ClangBuiltin<"__builtin_msa_fsun_d">,
1135  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1136
1137def int_mips_fsune_w : ClangBuiltin<"__builtin_msa_fsune_w">,
1138  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1139def int_mips_fsune_d : ClangBuiltin<"__builtin_msa_fsune_d">,
1140  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1141
1142def int_mips_ftint_s_w : ClangBuiltin<"__builtin_msa_ftint_s_w">,
1143  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1144def int_mips_ftint_s_d : ClangBuiltin<"__builtin_msa_ftint_s_d">,
1145  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1146
1147def int_mips_ftint_u_w : ClangBuiltin<"__builtin_msa_ftint_u_w">,
1148  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1149def int_mips_ftint_u_d : ClangBuiltin<"__builtin_msa_ftint_u_d">,
1150  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1151
1152def int_mips_ftq_h : ClangBuiltin<"__builtin_msa_ftq_h">,
1153  Intrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1154def int_mips_ftq_w : ClangBuiltin<"__builtin_msa_ftq_w">,
1155  Intrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1156
1157def int_mips_ftrunc_s_w : ClangBuiltin<"__builtin_msa_ftrunc_s_w">,
1158  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1159def int_mips_ftrunc_s_d : ClangBuiltin<"__builtin_msa_ftrunc_s_d">,
1160  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1161
1162def int_mips_ftrunc_u_w : ClangBuiltin<"__builtin_msa_ftrunc_u_w">,
1163  Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1164def int_mips_ftrunc_u_d : ClangBuiltin<"__builtin_msa_ftrunc_u_d">,
1165  Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1166
1167def int_mips_hadd_s_h : ClangBuiltin<"__builtin_msa_hadd_s_h">,
1168  Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1169def int_mips_hadd_s_w : ClangBuiltin<"__builtin_msa_hadd_s_w">,
1170  Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1171def int_mips_hadd_s_d : ClangBuiltin<"__builtin_msa_hadd_s_d">,
1172  Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1173
1174def int_mips_hadd_u_h : ClangBuiltin<"__builtin_msa_hadd_u_h">,
1175  Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1176def int_mips_hadd_u_w : ClangBuiltin<"__builtin_msa_hadd_u_w">,
1177  Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1178def int_mips_hadd_u_d : ClangBuiltin<"__builtin_msa_hadd_u_d">,
1179  Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1180
1181def int_mips_hsub_s_h : ClangBuiltin<"__builtin_msa_hsub_s_h">,
1182  Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1183def int_mips_hsub_s_w : ClangBuiltin<"__builtin_msa_hsub_s_w">,
1184  Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1185def int_mips_hsub_s_d : ClangBuiltin<"__builtin_msa_hsub_s_d">,
1186  Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1187
1188def int_mips_hsub_u_h : ClangBuiltin<"__builtin_msa_hsub_u_h">,
1189  Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1190def int_mips_hsub_u_w : ClangBuiltin<"__builtin_msa_hsub_u_w">,
1191  Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1192def int_mips_hsub_u_d : ClangBuiltin<"__builtin_msa_hsub_u_d">,
1193  Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1194
1195def int_mips_ilvev_b : ClangBuiltin<"__builtin_msa_ilvev_b">,
1196  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1197def int_mips_ilvev_h : ClangBuiltin<"__builtin_msa_ilvev_h">,
1198  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1199def int_mips_ilvev_w : ClangBuiltin<"__builtin_msa_ilvev_w">,
1200  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1201def int_mips_ilvev_d : ClangBuiltin<"__builtin_msa_ilvev_d">,
1202  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1203
1204def int_mips_ilvl_b : ClangBuiltin<"__builtin_msa_ilvl_b">,
1205  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1206def int_mips_ilvl_h : ClangBuiltin<"__builtin_msa_ilvl_h">,
1207  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1208def int_mips_ilvl_w : ClangBuiltin<"__builtin_msa_ilvl_w">,
1209  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1210def int_mips_ilvl_d : ClangBuiltin<"__builtin_msa_ilvl_d">,
1211  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1212
1213def int_mips_ilvod_b : ClangBuiltin<"__builtin_msa_ilvod_b">,
1214  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1215def int_mips_ilvod_h : ClangBuiltin<"__builtin_msa_ilvod_h">,
1216  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1217def int_mips_ilvod_w : ClangBuiltin<"__builtin_msa_ilvod_w">,
1218  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1219def int_mips_ilvod_d : ClangBuiltin<"__builtin_msa_ilvod_d">,
1220  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1221
1222def int_mips_ilvr_b : ClangBuiltin<"__builtin_msa_ilvr_b">,
1223  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1224def int_mips_ilvr_h : ClangBuiltin<"__builtin_msa_ilvr_h">,
1225  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1226def int_mips_ilvr_w : ClangBuiltin<"__builtin_msa_ilvr_w">,
1227  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1228def int_mips_ilvr_d : ClangBuiltin<"__builtin_msa_ilvr_d">,
1229  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1230
1231def int_mips_insert_b : ClangBuiltin<"__builtin_msa_insert_b">,
1232  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty, llvm_i32_ty],
1233  [IntrNoMem]>;
1234def int_mips_insert_h : ClangBuiltin<"__builtin_msa_insert_h">,
1235  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty, llvm_i32_ty],
1236  [IntrNoMem]>;
1237def int_mips_insert_w : ClangBuiltin<"__builtin_msa_insert_w">,
1238  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty, llvm_i32_ty],
1239  [IntrNoMem]>;
1240def int_mips_insert_d : ClangBuiltin<"__builtin_msa_insert_d">,
1241  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty, llvm_i64_ty],
1242  [IntrNoMem]>;
1243
1244def int_mips_insve_b : ClangBuiltin<"__builtin_msa_insve_b">,
1245  Intrinsic<[llvm_v16i8_ty],
1246            [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty],
1247            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1248def int_mips_insve_h : ClangBuiltin<"__builtin_msa_insve_h">,
1249  Intrinsic<[llvm_v8i16_ty],
1250            [llvm_v8i16_ty, llvm_i32_ty, llvm_v8i16_ty],
1251            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1252def int_mips_insve_w : ClangBuiltin<"__builtin_msa_insve_w">,
1253  Intrinsic<[llvm_v4i32_ty],
1254            [llvm_v4i32_ty, llvm_i32_ty, llvm_v4i32_ty],
1255            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1256def int_mips_insve_d : ClangBuiltin<"__builtin_msa_insve_d">,
1257  Intrinsic<[llvm_v2i64_ty],
1258            [llvm_v2i64_ty, llvm_i32_ty, llvm_v2i64_ty],
1259            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1260
1261def int_mips_ld_b : ClangBuiltin<"__builtin_msa_ld_b">,
1262  Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty, llvm_i32_ty],
1263  [IntrReadMem, IntrArgMemOnly]>;
1264def int_mips_ld_h : ClangBuiltin<"__builtin_msa_ld_h">,
1265  Intrinsic<[llvm_v8i16_ty], [llvm_ptr_ty, llvm_i32_ty],
1266  [IntrReadMem, IntrArgMemOnly]>;
1267def int_mips_ld_w : ClangBuiltin<"__builtin_msa_ld_w">,
1268  Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty, llvm_i32_ty],
1269  [IntrReadMem, IntrArgMemOnly]>;
1270def int_mips_ld_d : ClangBuiltin<"__builtin_msa_ld_d">,
1271  Intrinsic<[llvm_v2i64_ty], [llvm_ptr_ty, llvm_i32_ty],
1272  [IntrReadMem, IntrArgMemOnly]>;
1273
1274def int_mips_ldr_d : ClangBuiltin<"__builtin_msa_ldr_d">,
1275  Intrinsic<[llvm_v2i64_ty], [llvm_ptr_ty, llvm_i32_ty],
1276  [IntrReadMem, IntrArgMemOnly]>;
1277def int_mips_ldr_w : ClangBuiltin<"__builtin_msa_ldr_w">,
1278  Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty, llvm_i32_ty],
1279  [IntrReadMem, IntrArgMemOnly]>;
1280
1281def int_mips_ldi_b : ClangBuiltin<"__builtin_msa_ldi_b">,
1282  Intrinsic<[llvm_v16i8_ty], [llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<0>>]>;
1283def int_mips_ldi_h : ClangBuiltin<"__builtin_msa_ldi_h">,
1284  Intrinsic<[llvm_v8i16_ty], [llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<0>>]>;
1285def int_mips_ldi_w : ClangBuiltin<"__builtin_msa_ldi_w">,
1286  Intrinsic<[llvm_v4i32_ty], [llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<0>>]>;
1287def int_mips_ldi_d : ClangBuiltin<"__builtin_msa_ldi_d">,
1288  Intrinsic<[llvm_v2i64_ty], [llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<0>>]>;
1289
1290// This instruction is part of the MSA spec but it does not share the
1291// __builtin_msa prefix because it operates on the GPR registers.
1292def int_mips_lsa : ClangBuiltin<"__builtin_mips_lsa">,
1293  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1294            [IntrNoMem]>;
1295
1296def int_mips_madd_q_h : ClangBuiltin<"__builtin_msa_madd_q_h">,
1297  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
1298  [IntrNoMem]>;
1299def int_mips_madd_q_w : ClangBuiltin<"__builtin_msa_madd_q_w">,
1300  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1301  [IntrNoMem]>;
1302
1303def int_mips_maddr_q_h : ClangBuiltin<"__builtin_msa_maddr_q_h">,
1304  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
1305  [IntrNoMem]>;
1306def int_mips_maddr_q_w : ClangBuiltin<"__builtin_msa_maddr_q_w">,
1307  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1308  [IntrNoMem]>;
1309
1310def int_mips_maddv_b : ClangBuiltin<"__builtin_msa_maddv_b">,
1311  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
1312  [IntrNoMem]>;
1313def int_mips_maddv_h : ClangBuiltin<"__builtin_msa_maddv_h">,
1314  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
1315  [IntrNoMem]>;
1316def int_mips_maddv_w : ClangBuiltin<"__builtin_msa_maddv_w">,
1317  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1318  [IntrNoMem]>;
1319def int_mips_maddv_d : ClangBuiltin<"__builtin_msa_maddv_d">,
1320  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
1321  [IntrNoMem]>;
1322
1323def int_mips_max_a_b : ClangBuiltin<"__builtin_msa_max_a_b">,
1324  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1325def int_mips_max_a_h : ClangBuiltin<"__builtin_msa_max_a_h">,
1326  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1327def int_mips_max_a_w : ClangBuiltin<"__builtin_msa_max_a_w">,
1328  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1329def int_mips_max_a_d : ClangBuiltin<"__builtin_msa_max_a_d">,
1330  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1331
1332def int_mips_max_s_b : ClangBuiltin<"__builtin_msa_max_s_b">,
1333  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1334def int_mips_max_s_h : ClangBuiltin<"__builtin_msa_max_s_h">,
1335  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1336def int_mips_max_s_w : ClangBuiltin<"__builtin_msa_max_s_w">,
1337  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1338def int_mips_max_s_d : ClangBuiltin<"__builtin_msa_max_s_d">,
1339  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1340
1341def int_mips_max_u_b : ClangBuiltin<"__builtin_msa_max_u_b">,
1342  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1343def int_mips_max_u_h : ClangBuiltin<"__builtin_msa_max_u_h">,
1344  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1345def int_mips_max_u_w : ClangBuiltin<"__builtin_msa_max_u_w">,
1346  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1347def int_mips_max_u_d : ClangBuiltin<"__builtin_msa_max_u_d">,
1348  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1349
1350def int_mips_maxi_s_b : ClangBuiltin<"__builtin_msa_maxi_s_b">,
1351  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1352def int_mips_maxi_s_h : ClangBuiltin<"__builtin_msa_maxi_s_h">,
1353  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1354def int_mips_maxi_s_w : ClangBuiltin<"__builtin_msa_maxi_s_w">,
1355  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1356def int_mips_maxi_s_d : ClangBuiltin<"__builtin_msa_maxi_s_d">,
1357  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1358
1359def int_mips_maxi_u_b : ClangBuiltin<"__builtin_msa_maxi_u_b">,
1360  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1361def int_mips_maxi_u_h : ClangBuiltin<"__builtin_msa_maxi_u_h">,
1362  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1363def int_mips_maxi_u_w : ClangBuiltin<"__builtin_msa_maxi_u_w">,
1364  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1365def int_mips_maxi_u_d : ClangBuiltin<"__builtin_msa_maxi_u_d">,
1366  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1367
1368def int_mips_min_a_b : ClangBuiltin<"__builtin_msa_min_a_b">,
1369  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1370def int_mips_min_a_h : ClangBuiltin<"__builtin_msa_min_a_h">,
1371  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1372def int_mips_min_a_w : ClangBuiltin<"__builtin_msa_min_a_w">,
1373  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1374def int_mips_min_a_d : ClangBuiltin<"__builtin_msa_min_a_d">,
1375  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1376
1377def int_mips_min_s_b : ClangBuiltin<"__builtin_msa_min_s_b">,
1378  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1379def int_mips_min_s_h : ClangBuiltin<"__builtin_msa_min_s_h">,
1380  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1381def int_mips_min_s_w : ClangBuiltin<"__builtin_msa_min_s_w">,
1382  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1383def int_mips_min_s_d : ClangBuiltin<"__builtin_msa_min_s_d">,
1384  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1385
1386def int_mips_min_u_b : ClangBuiltin<"__builtin_msa_min_u_b">,
1387  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1388def int_mips_min_u_h : ClangBuiltin<"__builtin_msa_min_u_h">,
1389  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1390def int_mips_min_u_w : ClangBuiltin<"__builtin_msa_min_u_w">,
1391  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1392def int_mips_min_u_d : ClangBuiltin<"__builtin_msa_min_u_d">,
1393  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1394
1395def int_mips_mini_s_b : ClangBuiltin<"__builtin_msa_mini_s_b">,
1396  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1397def int_mips_mini_s_h : ClangBuiltin<"__builtin_msa_mini_s_h">,
1398  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1399def int_mips_mini_s_w : ClangBuiltin<"__builtin_msa_mini_s_w">,
1400  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1401def int_mips_mini_s_d : ClangBuiltin<"__builtin_msa_mini_s_d">,
1402  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1403
1404def int_mips_mini_u_b : ClangBuiltin<"__builtin_msa_mini_u_b">,
1405  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1406def int_mips_mini_u_h : ClangBuiltin<"__builtin_msa_mini_u_h">,
1407  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1408def int_mips_mini_u_w : ClangBuiltin<"__builtin_msa_mini_u_w">,
1409  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1410def int_mips_mini_u_d : ClangBuiltin<"__builtin_msa_mini_u_d">,
1411  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1412
1413def int_mips_mod_s_b : ClangBuiltin<"__builtin_msa_mod_s_b">,
1414  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1415def int_mips_mod_s_h : ClangBuiltin<"__builtin_msa_mod_s_h">,
1416  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1417def int_mips_mod_s_w : ClangBuiltin<"__builtin_msa_mod_s_w">,
1418  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1419def int_mips_mod_s_d : ClangBuiltin<"__builtin_msa_mod_s_d">,
1420  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1421
1422def int_mips_mod_u_b : ClangBuiltin<"__builtin_msa_mod_u_b">,
1423  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1424def int_mips_mod_u_h : ClangBuiltin<"__builtin_msa_mod_u_h">,
1425  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1426def int_mips_mod_u_w : ClangBuiltin<"__builtin_msa_mod_u_w">,
1427  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1428def int_mips_mod_u_d : ClangBuiltin<"__builtin_msa_mod_u_d">,
1429  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1430
1431def int_mips_move_v : ClangBuiltin<"__builtin_msa_move_v">,
1432  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1433
1434def int_mips_msub_q_h : ClangBuiltin<"__builtin_msa_msub_q_h">,
1435  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
1436  [IntrNoMem]>;
1437def int_mips_msub_q_w : ClangBuiltin<"__builtin_msa_msub_q_w">,
1438  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1439  [IntrNoMem]>;
1440
1441def int_mips_msubr_q_h : ClangBuiltin<"__builtin_msa_msubr_q_h">,
1442  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
1443  [IntrNoMem]>;
1444def int_mips_msubr_q_w : ClangBuiltin<"__builtin_msa_msubr_q_w">,
1445  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1446  [IntrNoMem]>;
1447
1448def int_mips_msubv_b : ClangBuiltin<"__builtin_msa_msubv_b">,
1449  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
1450  [IntrNoMem]>;
1451def int_mips_msubv_h : ClangBuiltin<"__builtin_msa_msubv_h">,
1452  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
1453  [IntrNoMem]>;
1454def int_mips_msubv_w : ClangBuiltin<"__builtin_msa_msubv_w">,
1455  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1456  [IntrNoMem]>;
1457def int_mips_msubv_d : ClangBuiltin<"__builtin_msa_msubv_d">,
1458  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
1459  [IntrNoMem]>;
1460
1461def int_mips_mul_q_h : ClangBuiltin<"__builtin_msa_mul_q_h">,
1462  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1463def int_mips_mul_q_w : ClangBuiltin<"__builtin_msa_mul_q_w">,
1464  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1465
1466def int_mips_mulr_q_h : ClangBuiltin<"__builtin_msa_mulr_q_h">,
1467  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1468def int_mips_mulr_q_w : ClangBuiltin<"__builtin_msa_mulr_q_w">,
1469  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1470
1471def int_mips_mulv_b : ClangBuiltin<"__builtin_msa_mulv_b">,
1472  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1473def int_mips_mulv_h : ClangBuiltin<"__builtin_msa_mulv_h">,
1474  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1475def int_mips_mulv_w : ClangBuiltin<"__builtin_msa_mulv_w">,
1476  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1477def int_mips_mulv_d : ClangBuiltin<"__builtin_msa_mulv_d">,
1478  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1479
1480def int_mips_nloc_b : ClangBuiltin<"__builtin_msa_nloc_b">,
1481  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1482def int_mips_nloc_h : ClangBuiltin<"__builtin_msa_nloc_h">,
1483  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1484def int_mips_nloc_w : ClangBuiltin<"__builtin_msa_nloc_w">,
1485  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
1486def int_mips_nloc_d : ClangBuiltin<"__builtin_msa_nloc_d">,
1487  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
1488
1489def int_mips_nlzc_b : ClangBuiltin<"__builtin_msa_nlzc_b">,
1490  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1491def int_mips_nlzc_h : ClangBuiltin<"__builtin_msa_nlzc_h">,
1492  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1493def int_mips_nlzc_w : ClangBuiltin<"__builtin_msa_nlzc_w">,
1494  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
1495def int_mips_nlzc_d : ClangBuiltin<"__builtin_msa_nlzc_d">,
1496  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
1497
1498def int_mips_nor_v : ClangBuiltin<"__builtin_msa_nor_v">,
1499  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1500
1501def int_mips_nori_b : ClangBuiltin<"__builtin_msa_nori_b">,
1502  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1503
1504def int_mips_or_v : ClangBuiltin<"__builtin_msa_or_v">,
1505  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1506
1507def int_mips_ori_b : ClangBuiltin<"__builtin_msa_ori_b">,
1508  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1509
1510def int_mips_pckev_b : ClangBuiltin<"__builtin_msa_pckev_b">,
1511  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1512def int_mips_pckev_h : ClangBuiltin<"__builtin_msa_pckev_h">,
1513  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1514def int_mips_pckev_w : ClangBuiltin<"__builtin_msa_pckev_w">,
1515  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1516def int_mips_pckev_d : ClangBuiltin<"__builtin_msa_pckev_d">,
1517  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1518
1519def int_mips_pckod_b : ClangBuiltin<"__builtin_msa_pckod_b">,
1520  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1521def int_mips_pckod_h : ClangBuiltin<"__builtin_msa_pckod_h">,
1522  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1523def int_mips_pckod_w : ClangBuiltin<"__builtin_msa_pckod_w">,
1524  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1525def int_mips_pckod_d : ClangBuiltin<"__builtin_msa_pckod_d">,
1526  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1527
1528def int_mips_pcnt_b : ClangBuiltin<"__builtin_msa_pcnt_b">,
1529  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1530def int_mips_pcnt_h : ClangBuiltin<"__builtin_msa_pcnt_h">,
1531  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1532def int_mips_pcnt_w : ClangBuiltin<"__builtin_msa_pcnt_w">,
1533  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
1534def int_mips_pcnt_d : ClangBuiltin<"__builtin_msa_pcnt_d">,
1535  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
1536
1537def int_mips_sat_s_b : ClangBuiltin<"__builtin_msa_sat_s_b">,
1538  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1539def int_mips_sat_s_h : ClangBuiltin<"__builtin_msa_sat_s_h">,
1540  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1541def int_mips_sat_s_w : ClangBuiltin<"__builtin_msa_sat_s_w">,
1542  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1543def int_mips_sat_s_d : ClangBuiltin<"__builtin_msa_sat_s_d">,
1544  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1545
1546def int_mips_sat_u_b : ClangBuiltin<"__builtin_msa_sat_u_b">,
1547  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1548def int_mips_sat_u_h : ClangBuiltin<"__builtin_msa_sat_u_h">,
1549  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1550def int_mips_sat_u_w : ClangBuiltin<"__builtin_msa_sat_u_w">,
1551  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1552def int_mips_sat_u_d : ClangBuiltin<"__builtin_msa_sat_u_d">,
1553  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1554
1555def int_mips_shf_b : ClangBuiltin<"__builtin_msa_shf_b">,
1556  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1557def int_mips_shf_h : ClangBuiltin<"__builtin_msa_shf_h">,
1558  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1559def int_mips_shf_w : ClangBuiltin<"__builtin_msa_shf_w">,
1560  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1561
1562def int_mips_sld_b : ClangBuiltin<"__builtin_msa_sld_b">,
1563  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
1564def int_mips_sld_h : ClangBuiltin<"__builtin_msa_sld_h">,
1565  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
1566def int_mips_sld_w : ClangBuiltin<"__builtin_msa_sld_w">,
1567  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
1568def int_mips_sld_d : ClangBuiltin<"__builtin_msa_sld_d">,
1569  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
1570
1571def int_mips_sldi_b : ClangBuiltin<"__builtin_msa_sldi_b">,
1572  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
1573            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1574def int_mips_sldi_h : ClangBuiltin<"__builtin_msa_sldi_h">,
1575  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
1576            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1577def int_mips_sldi_w : ClangBuiltin<"__builtin_msa_sldi_w">,
1578  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
1579            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1580def int_mips_sldi_d : ClangBuiltin<"__builtin_msa_sldi_d">,
1581  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
1582            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1583
1584def int_mips_sll_b : ClangBuiltin<"__builtin_msa_sll_b">,
1585  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1586def int_mips_sll_h : ClangBuiltin<"__builtin_msa_sll_h">,
1587  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1588def int_mips_sll_w : ClangBuiltin<"__builtin_msa_sll_w">,
1589  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1590def int_mips_sll_d : ClangBuiltin<"__builtin_msa_sll_d">,
1591  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1592
1593def int_mips_slli_b : ClangBuiltin<"__builtin_msa_slli_b">,
1594  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1595def int_mips_slli_h : ClangBuiltin<"__builtin_msa_slli_h">,
1596  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1597def int_mips_slli_w : ClangBuiltin<"__builtin_msa_slli_w">,
1598  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1599def int_mips_slli_d : ClangBuiltin<"__builtin_msa_slli_d">,
1600  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1601
1602def int_mips_splat_b : ClangBuiltin<"__builtin_msa_splat_b">,
1603  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
1604def int_mips_splat_h : ClangBuiltin<"__builtin_msa_splat_h">,
1605  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
1606def int_mips_splat_w : ClangBuiltin<"__builtin_msa_splat_w">,
1607  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
1608def int_mips_splat_d : ClangBuiltin<"__builtin_msa_splat_d">,
1609  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
1610
1611def int_mips_splati_b : ClangBuiltin<"__builtin_msa_splati_b">,
1612  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1613def int_mips_splati_h : ClangBuiltin<"__builtin_msa_splati_h">,
1614  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1615def int_mips_splati_w : ClangBuiltin<"__builtin_msa_splati_w">,
1616  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1617def int_mips_splati_d : ClangBuiltin<"__builtin_msa_splati_d">,
1618  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1619
1620def int_mips_sra_b : ClangBuiltin<"__builtin_msa_sra_b">,
1621  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1622def int_mips_sra_h : ClangBuiltin<"__builtin_msa_sra_h">,
1623  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1624def int_mips_sra_w : ClangBuiltin<"__builtin_msa_sra_w">,
1625  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1626def int_mips_sra_d : ClangBuiltin<"__builtin_msa_sra_d">,
1627  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1628
1629def int_mips_srai_b : ClangBuiltin<"__builtin_msa_srai_b">,
1630  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1631def int_mips_srai_h : ClangBuiltin<"__builtin_msa_srai_h">,
1632  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1633def int_mips_srai_w : ClangBuiltin<"__builtin_msa_srai_w">,
1634  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1635def int_mips_srai_d : ClangBuiltin<"__builtin_msa_srai_d">,
1636  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1637
1638def int_mips_srar_b : ClangBuiltin<"__builtin_msa_srar_b">,
1639  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1640def int_mips_srar_h : ClangBuiltin<"__builtin_msa_srar_h">,
1641  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1642def int_mips_srar_w : ClangBuiltin<"__builtin_msa_srar_w">,
1643  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1644def int_mips_srar_d : ClangBuiltin<"__builtin_msa_srar_d">,
1645  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1646
1647def int_mips_srari_b : ClangBuiltin<"__builtin_msa_srari_b">,
1648  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1649def int_mips_srari_h : ClangBuiltin<"__builtin_msa_srari_h">,
1650  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1651def int_mips_srari_w : ClangBuiltin<"__builtin_msa_srari_w">,
1652  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1653def int_mips_srari_d : ClangBuiltin<"__builtin_msa_srari_d">,
1654  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1655
1656def int_mips_srl_b : ClangBuiltin<"__builtin_msa_srl_b">,
1657  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1658def int_mips_srl_h : ClangBuiltin<"__builtin_msa_srl_h">,
1659  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1660def int_mips_srl_w : ClangBuiltin<"__builtin_msa_srl_w">,
1661  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1662def int_mips_srl_d : ClangBuiltin<"__builtin_msa_srl_d">,
1663  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1664
1665def int_mips_srli_b : ClangBuiltin<"__builtin_msa_srli_b">,
1666  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1667def int_mips_srli_h : ClangBuiltin<"__builtin_msa_srli_h">,
1668  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1669def int_mips_srli_w : ClangBuiltin<"__builtin_msa_srli_w">,
1670  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1671def int_mips_srli_d : ClangBuiltin<"__builtin_msa_srli_d">,
1672  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1673
1674def int_mips_srlr_b : ClangBuiltin<"__builtin_msa_srlr_b">,
1675  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1676def int_mips_srlr_h : ClangBuiltin<"__builtin_msa_srlr_h">,
1677  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1678def int_mips_srlr_w : ClangBuiltin<"__builtin_msa_srlr_w">,
1679  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1680def int_mips_srlr_d : ClangBuiltin<"__builtin_msa_srlr_d">,
1681  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1682
1683def int_mips_srlri_b : ClangBuiltin<"__builtin_msa_srlri_b">,
1684  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1685def int_mips_srlri_h : ClangBuiltin<"__builtin_msa_srlri_h">,
1686  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1687def int_mips_srlri_w : ClangBuiltin<"__builtin_msa_srlri_w">,
1688  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1689def int_mips_srlri_d : ClangBuiltin<"__builtin_msa_srlri_d">,
1690  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1691
1692def int_mips_st_b : ClangBuiltin<"__builtin_msa_st_b">,
1693  Intrinsic<[], [llvm_v16i8_ty, llvm_ptr_ty, llvm_i32_ty],
1694  [IntrArgMemOnly]>;
1695def int_mips_st_h : ClangBuiltin<"__builtin_msa_st_h">,
1696  Intrinsic<[], [llvm_v8i16_ty, llvm_ptr_ty, llvm_i32_ty],
1697  [IntrArgMemOnly]>;
1698def int_mips_st_w : ClangBuiltin<"__builtin_msa_st_w">,
1699  Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty, llvm_i32_ty],
1700  [IntrArgMemOnly]>;
1701def int_mips_st_d : ClangBuiltin<"__builtin_msa_st_d">,
1702  Intrinsic<[], [llvm_v2i64_ty, llvm_ptr_ty, llvm_i32_ty],
1703  [IntrArgMemOnly]>;
1704
1705def int_mips_str_d : ClangBuiltin<"__builtin_msa_str_d">,
1706  Intrinsic<[], [llvm_v2i64_ty, llvm_ptr_ty, llvm_i32_ty],
1707  [IntrArgMemOnly]>;
1708def int_mips_str_w : ClangBuiltin<"__builtin_msa_str_w">,
1709  Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty, llvm_i32_ty],
1710  [IntrArgMemOnly]>;
1711
1712def int_mips_subs_s_b : ClangBuiltin<"__builtin_msa_subs_s_b">,
1713  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1714def int_mips_subs_s_h : ClangBuiltin<"__builtin_msa_subs_s_h">,
1715  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1716def int_mips_subs_s_w : ClangBuiltin<"__builtin_msa_subs_s_w">,
1717  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1718def int_mips_subs_s_d : ClangBuiltin<"__builtin_msa_subs_s_d">,
1719  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1720
1721def int_mips_subs_u_b : ClangBuiltin<"__builtin_msa_subs_u_b">,
1722  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1723def int_mips_subs_u_h : ClangBuiltin<"__builtin_msa_subs_u_h">,
1724  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1725def int_mips_subs_u_w : ClangBuiltin<"__builtin_msa_subs_u_w">,
1726  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1727def int_mips_subs_u_d : ClangBuiltin<"__builtin_msa_subs_u_d">,
1728  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1729
1730def int_mips_subsus_u_b : ClangBuiltin<"__builtin_msa_subsus_u_b">,
1731  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1732def int_mips_subsus_u_h : ClangBuiltin<"__builtin_msa_subsus_u_h">,
1733  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1734def int_mips_subsus_u_w : ClangBuiltin<"__builtin_msa_subsus_u_w">,
1735  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1736def int_mips_subsus_u_d : ClangBuiltin<"__builtin_msa_subsus_u_d">,
1737  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1738
1739def int_mips_subsuu_s_b : ClangBuiltin<"__builtin_msa_subsuu_s_b">,
1740  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1741def int_mips_subsuu_s_h : ClangBuiltin<"__builtin_msa_subsuu_s_h">,
1742  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1743def int_mips_subsuu_s_w : ClangBuiltin<"__builtin_msa_subsuu_s_w">,
1744  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1745def int_mips_subsuu_s_d : ClangBuiltin<"__builtin_msa_subsuu_s_d">,
1746  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1747
1748def int_mips_subv_b : ClangBuiltin<"__builtin_msa_subv_b">,
1749  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1750def int_mips_subv_h : ClangBuiltin<"__builtin_msa_subv_h">,
1751  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1752def int_mips_subv_w : ClangBuiltin<"__builtin_msa_subv_w">,
1753  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
1754def int_mips_subv_d : ClangBuiltin<"__builtin_msa_subv_d">,
1755  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1756
1757def int_mips_subvi_b : ClangBuiltin<"__builtin_msa_subvi_b">,
1758  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1759def int_mips_subvi_h : ClangBuiltin<"__builtin_msa_subvi_h">,
1760  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1761def int_mips_subvi_w : ClangBuiltin<"__builtin_msa_subvi_w">,
1762  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1763def int_mips_subvi_d : ClangBuiltin<"__builtin_msa_subvi_d">,
1764  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1765
1766def int_mips_vshf_b : ClangBuiltin<"__builtin_msa_vshf_b">,
1767  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
1768            [IntrNoMem]>;
1769def int_mips_vshf_h : ClangBuiltin<"__builtin_msa_vshf_h">,
1770  Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
1771            [IntrNoMem]>;
1772def int_mips_vshf_w : ClangBuiltin<"__builtin_msa_vshf_w">,
1773  Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1774            [IntrNoMem]>;
1775def int_mips_vshf_d : ClangBuiltin<"__builtin_msa_vshf_d">,
1776  Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
1777            [IntrNoMem]>;
1778
1779def int_mips_xor_v : ClangBuiltin<"__builtin_msa_xor_v">,
1780  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1781
1782def int_mips_xori_b : ClangBuiltin<"__builtin_msa_xori_b">,
1783  Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1784}
1785