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