xref: /openbmc/qemu/target/mips/helper.h (revision 40f23e4e)
1 DEF_HELPER_3(raise_exception_err, noreturn, env, i32, int)
2 DEF_HELPER_2(raise_exception, noreturn, env, i32)
3 DEF_HELPER_1(raise_exception_debug, noreturn, env)
4 
5 #ifdef TARGET_MIPS64
6 DEF_HELPER_4(sdl, void, env, tl, tl, int)
7 DEF_HELPER_4(sdr, void, env, tl, tl, int)
8 #endif
9 DEF_HELPER_4(swl, void, env, tl, tl, int)
10 DEF_HELPER_4(swr, void, env, tl, tl, int)
11 
12 #ifndef CONFIG_USER_ONLY
13 DEF_HELPER_3(ll, tl, env, tl, int)
14 #ifdef TARGET_MIPS64
15 DEF_HELPER_3(lld, tl, env, tl, int)
16 #endif
17 #endif
18 
19 DEF_HELPER_3(muls, tl, env, tl, tl)
20 DEF_HELPER_3(mulsu, tl, env, tl, tl)
21 DEF_HELPER_3(macc, tl, env, tl, tl)
22 DEF_HELPER_3(maccu, tl, env, tl, tl)
23 DEF_HELPER_3(msac, tl, env, tl, tl)
24 DEF_HELPER_3(msacu, tl, env, tl, tl)
25 DEF_HELPER_3(mulhi, tl, env, tl, tl)
26 DEF_HELPER_3(mulhiu, tl, env, tl, tl)
27 DEF_HELPER_3(mulshi, tl, env, tl, tl)
28 DEF_HELPER_3(mulshiu, tl, env, tl, tl)
29 DEF_HELPER_3(macchi, tl, env, tl, tl)
30 DEF_HELPER_3(macchiu, tl, env, tl, tl)
31 DEF_HELPER_3(msachi, tl, env, tl, tl)
32 DEF_HELPER_3(msachiu, tl, env, tl, tl)
33 
34 DEF_HELPER_FLAGS_1(bitswap, TCG_CALL_NO_RWG_SE, tl, tl)
35 #ifdef TARGET_MIPS64
36 DEF_HELPER_FLAGS_1(dbitswap, TCG_CALL_NO_RWG_SE, tl, tl)
37 #endif
38 
39 DEF_HELPER_FLAGS_4(rotx, TCG_CALL_NO_RWG_SE, tl, tl, i32, i32, i32)
40 
41 /* microMIPS functions */
42 DEF_HELPER_4(lwm, void, env, tl, tl, i32)
43 DEF_HELPER_4(swm, void, env, tl, tl, i32)
44 #ifdef TARGET_MIPS64
45 DEF_HELPER_4(ldm, void, env, tl, tl, i32)
46 DEF_HELPER_4(sdm, void, env, tl, tl, i32)
47 #endif
48 
49 DEF_HELPER_2(fork, void, tl, tl)
50 DEF_HELPER_2(yield, tl, env, tl)
51 
52 /* CP1 functions */
53 DEF_HELPER_2(cfc1, tl, env, i32)
54 DEF_HELPER_4(ctc1, void, env, tl, i32, i32)
55 
56 DEF_HELPER_2(float_cvtd_s, i64, env, i32)
57 DEF_HELPER_2(float_cvtd_w, i64, env, i32)
58 DEF_HELPER_2(float_cvtd_l, i64, env, i64)
59 DEF_HELPER_2(float_cvtps_pw, i64, env, i64)
60 DEF_HELPER_2(float_cvtpw_ps, i64, env, i64)
61 DEF_HELPER_2(float_cvts_d, i32, env, i64)
62 DEF_HELPER_2(float_cvts_w, i32, env, i32)
63 DEF_HELPER_2(float_cvts_l, i32, env, i64)
64 DEF_HELPER_2(float_cvts_pl, i32, env, i32)
65 DEF_HELPER_2(float_cvts_pu, i32, env, i32)
66 
67 DEF_HELPER_3(float_addr_ps, i64, env, i64, i64)
68 DEF_HELPER_3(float_mulr_ps, i64, env, i64, i64)
69 
70 DEF_HELPER_FLAGS_2(float_class_s, TCG_CALL_NO_RWG_SE, i32, env, i32)
71 DEF_HELPER_FLAGS_2(float_class_d, TCG_CALL_NO_RWG_SE, i64, env, i64)
72 
73 #define FOP_PROTO(op)                                     \
74 DEF_HELPER_4(float_ ## op ## _s, i32, env, i32, i32, i32) \
75 DEF_HELPER_4(float_ ## op ## _d, i64, env, i64, i64, i64)
76 FOP_PROTO(maddf)
77 FOP_PROTO(msubf)
78 #undef FOP_PROTO
79 
80 #define FOP_PROTO(op)                                \
81 DEF_HELPER_3(float_ ## op ## _s, i32, env, i32, i32) \
82 DEF_HELPER_3(float_ ## op ## _d, i64, env, i64, i64)
83 FOP_PROTO(max)
84 FOP_PROTO(maxa)
85 FOP_PROTO(min)
86 FOP_PROTO(mina)
87 #undef FOP_PROTO
88 
89 #define FOP_PROTO(op)                            \
90 DEF_HELPER_2(float_ ## op ## _l_s, i64, env, i32) \
91 DEF_HELPER_2(float_ ## op ## _l_d, i64, env, i64) \
92 DEF_HELPER_2(float_ ## op ## _w_s, i32, env, i32) \
93 DEF_HELPER_2(float_ ## op ## _w_d, i32, env, i64)
94 FOP_PROTO(cvt)
95 FOP_PROTO(round)
96 FOP_PROTO(trunc)
97 FOP_PROTO(ceil)
98 FOP_PROTO(floor)
99 FOP_PROTO(cvt_2008)
100 FOP_PROTO(round_2008)
101 FOP_PROTO(trunc_2008)
102 FOP_PROTO(ceil_2008)
103 FOP_PROTO(floor_2008)
104 #undef FOP_PROTO
105 
106 #define FOP_PROTO(op)                            \
107 DEF_HELPER_2(float_ ## op ## _s, i32, env, i32)  \
108 DEF_HELPER_2(float_ ## op ## _d, i64, env, i64)
109 FOP_PROTO(sqrt)
110 FOP_PROTO(rsqrt)
111 FOP_PROTO(recip)
112 FOP_PROTO(rint)
113 #undef FOP_PROTO
114 
115 #define FOP_PROTO(op)                       \
116 DEF_HELPER_1(float_ ## op ## _s, i32, i32)  \
117 DEF_HELPER_1(float_ ## op ## _d, i64, i64)  \
118 DEF_HELPER_1(float_ ## op ## _ps, i64, i64)
119 FOP_PROTO(abs)
120 FOP_PROTO(chs)
121 #undef FOP_PROTO
122 
123 #define FOP_PROTO(op)                            \
124 DEF_HELPER_2(float_ ## op ## _s, i32, env, i32)  \
125 DEF_HELPER_2(float_ ## op ## _d, i64, env, i64)  \
126 DEF_HELPER_2(float_ ## op ## _ps, i64, env, i64)
127 FOP_PROTO(recip1)
128 FOP_PROTO(rsqrt1)
129 #undef FOP_PROTO
130 
131 #define FOP_PROTO(op)                                  \
132 DEF_HELPER_3(float_ ## op ## _s, i32, env, i32, i32)   \
133 DEF_HELPER_3(float_ ## op ## _d, i64, env, i64, i64)   \
134 DEF_HELPER_3(float_ ## op ## _ps, i64, env, i64, i64)
135 FOP_PROTO(add)
136 FOP_PROTO(sub)
137 FOP_PROTO(mul)
138 FOP_PROTO(div)
139 FOP_PROTO(recip2)
140 FOP_PROTO(rsqrt2)
141 #undef FOP_PROTO
142 
143 #define FOP_PROTO(op)                                      \
144 DEF_HELPER_4(float_ ## op ## _s, i32, env, i32, i32, i32)  \
145 DEF_HELPER_4(float_ ## op ## _d, i64, env, i64, i64, i64)  \
146 DEF_HELPER_4(float_ ## op ## _ps, i64, env, i64, i64, i64)
147 FOP_PROTO(madd)
148 FOP_PROTO(msub)
149 FOP_PROTO(nmadd)
150 FOP_PROTO(nmsub)
151 #undef FOP_PROTO
152 
153 #define FOP_PROTO(op)                                    \
154 DEF_HELPER_4(cmp_d_ ## op, void, env, i64, i64, int)     \
155 DEF_HELPER_4(cmpabs_d_ ## op, void, env, i64, i64, int)  \
156 DEF_HELPER_4(cmp_s_ ## op, void, env, i32, i32, int)     \
157 DEF_HELPER_4(cmpabs_s_ ## op, void, env, i32, i32, int)  \
158 DEF_HELPER_4(cmp_ps_ ## op, void, env, i64, i64, int)    \
159 DEF_HELPER_4(cmpabs_ps_ ## op, void, env, i64, i64, int)
160 FOP_PROTO(f)
161 FOP_PROTO(un)
162 FOP_PROTO(eq)
163 FOP_PROTO(ueq)
164 FOP_PROTO(olt)
165 FOP_PROTO(ult)
166 FOP_PROTO(ole)
167 FOP_PROTO(ule)
168 FOP_PROTO(sf)
169 FOP_PROTO(ngle)
170 FOP_PROTO(seq)
171 FOP_PROTO(ngl)
172 FOP_PROTO(lt)
173 FOP_PROTO(nge)
174 FOP_PROTO(le)
175 FOP_PROTO(ngt)
176 #undef FOP_PROTO
177 
178 #define FOP_PROTO(op) \
179 DEF_HELPER_3(r6_cmp_d_ ## op, i64, env, i64, i64) \
180 DEF_HELPER_3(r6_cmp_s_ ## op, i32, env, i32, i32)
181 FOP_PROTO(af)
182 FOP_PROTO(un)
183 FOP_PROTO(eq)
184 FOP_PROTO(ueq)
185 FOP_PROTO(lt)
186 FOP_PROTO(ult)
187 FOP_PROTO(le)
188 FOP_PROTO(ule)
189 FOP_PROTO(saf)
190 FOP_PROTO(sun)
191 FOP_PROTO(seq)
192 FOP_PROTO(sueq)
193 FOP_PROTO(slt)
194 FOP_PROTO(sult)
195 FOP_PROTO(sle)
196 FOP_PROTO(sule)
197 FOP_PROTO(or)
198 FOP_PROTO(une)
199 FOP_PROTO(ne)
200 FOP_PROTO(sor)
201 FOP_PROTO(sune)
202 FOP_PROTO(sne)
203 #undef FOP_PROTO
204 
205 DEF_HELPER_1(rdhwr_cpunum, tl, env)
206 DEF_HELPER_1(rdhwr_synci_step, tl, env)
207 DEF_HELPER_1(rdhwr_cc, tl, env)
208 DEF_HELPER_1(rdhwr_ccres, tl, env)
209 DEF_HELPER_1(rdhwr_performance, tl, env)
210 DEF_HELPER_1(rdhwr_xnp, tl, env)
211 DEF_HELPER_2(pmon, void, env, int)
212 DEF_HELPER_1(wait, void, env)
213 
214 /* Loongson multimedia functions.  */
215 DEF_HELPER_FLAGS_2(paddsh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
216 DEF_HELPER_FLAGS_2(paddush, TCG_CALL_NO_RWG_SE, i64, i64, i64)
217 DEF_HELPER_FLAGS_2(paddh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
218 DEF_HELPER_FLAGS_2(paddw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
219 DEF_HELPER_FLAGS_2(paddsb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
220 DEF_HELPER_FLAGS_2(paddusb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
221 DEF_HELPER_FLAGS_2(paddb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
222 
223 DEF_HELPER_FLAGS_2(psubsh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
224 DEF_HELPER_FLAGS_2(psubush, TCG_CALL_NO_RWG_SE, i64, i64, i64)
225 DEF_HELPER_FLAGS_2(psubh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
226 DEF_HELPER_FLAGS_2(psubw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
227 DEF_HELPER_FLAGS_2(psubsb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
228 DEF_HELPER_FLAGS_2(psubusb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
229 DEF_HELPER_FLAGS_2(psubb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
230 
231 DEF_HELPER_FLAGS_2(pshufh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
232 DEF_HELPER_FLAGS_2(packsswh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
233 DEF_HELPER_FLAGS_2(packsshb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
234 DEF_HELPER_FLAGS_2(packushb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
235 
236 DEF_HELPER_FLAGS_2(punpcklhw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
237 DEF_HELPER_FLAGS_2(punpckhhw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
238 DEF_HELPER_FLAGS_2(punpcklbh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
239 DEF_HELPER_FLAGS_2(punpckhbh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
240 DEF_HELPER_FLAGS_2(punpcklwd, TCG_CALL_NO_RWG_SE, i64, i64, i64)
241 DEF_HELPER_FLAGS_2(punpckhwd, TCG_CALL_NO_RWG_SE, i64, i64, i64)
242 
243 DEF_HELPER_FLAGS_2(pavgh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
244 DEF_HELPER_FLAGS_2(pavgb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
245 DEF_HELPER_FLAGS_2(pmaxsh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
246 DEF_HELPER_FLAGS_2(pminsh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
247 DEF_HELPER_FLAGS_2(pmaxub, TCG_CALL_NO_RWG_SE, i64, i64, i64)
248 DEF_HELPER_FLAGS_2(pminub, TCG_CALL_NO_RWG_SE, i64, i64, i64)
249 
250 DEF_HELPER_FLAGS_2(pcmpeqw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
251 DEF_HELPER_FLAGS_2(pcmpgtw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
252 DEF_HELPER_FLAGS_2(pcmpeqh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
253 DEF_HELPER_FLAGS_2(pcmpgth, TCG_CALL_NO_RWG_SE, i64, i64, i64)
254 DEF_HELPER_FLAGS_2(pcmpeqb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
255 DEF_HELPER_FLAGS_2(pcmpgtb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
256 
257 DEF_HELPER_FLAGS_2(psllw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
258 DEF_HELPER_FLAGS_2(psllh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
259 DEF_HELPER_FLAGS_2(psrlw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
260 DEF_HELPER_FLAGS_2(psrlh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
261 DEF_HELPER_FLAGS_2(psraw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
262 DEF_HELPER_FLAGS_2(psrah, TCG_CALL_NO_RWG_SE, i64, i64, i64)
263 
264 DEF_HELPER_FLAGS_2(pmullh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
265 DEF_HELPER_FLAGS_2(pmulhh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
266 DEF_HELPER_FLAGS_2(pmulhuh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
267 DEF_HELPER_FLAGS_2(pmaddhw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
268 
269 DEF_HELPER_FLAGS_2(pasubub, TCG_CALL_NO_RWG_SE, i64, i64, i64)
270 DEF_HELPER_FLAGS_1(biadd, TCG_CALL_NO_RWG_SE, i64, i64)
271 DEF_HELPER_FLAGS_1(pmovmskb, TCG_CALL_NO_RWG_SE, i64, i64)
272 
273 /*** MIPS DSP ***/
274 /* DSP Arithmetic Sub-class insns */
275 DEF_HELPER_FLAGS_3(addq_ph, 0, tl, tl, tl, env)
276 DEF_HELPER_FLAGS_3(addq_s_ph, 0, tl, tl, tl, env)
277 #if defined(TARGET_MIPS64)
278 DEF_HELPER_FLAGS_3(addq_qh, 0, tl, tl, tl, env)
279 DEF_HELPER_FLAGS_3(addq_s_qh, 0, tl, tl, tl, env)
280 #endif
281 DEF_HELPER_FLAGS_3(addq_s_w, 0, tl, tl, tl, env)
282 #if defined(TARGET_MIPS64)
283 DEF_HELPER_FLAGS_3(addq_pw, 0, tl, tl, tl, env)
284 DEF_HELPER_FLAGS_3(addq_s_pw, 0, tl, tl, tl, env)
285 #endif
286 DEF_HELPER_FLAGS_3(addu_qb, 0, tl, tl, tl, env)
287 DEF_HELPER_FLAGS_3(addu_s_qb, 0, tl, tl, tl, env)
288 DEF_HELPER_FLAGS_2(adduh_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
289 DEF_HELPER_FLAGS_2(adduh_r_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
290 DEF_HELPER_FLAGS_3(addu_ph, 0, tl, tl, tl, env)
291 DEF_HELPER_FLAGS_3(addu_s_ph, 0, tl, tl, tl, env)
292 DEF_HELPER_FLAGS_2(addqh_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
293 DEF_HELPER_FLAGS_2(addqh_r_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
294 DEF_HELPER_FLAGS_2(addqh_w, TCG_CALL_NO_RWG_SE, tl, tl, tl)
295 DEF_HELPER_FLAGS_2(addqh_r_w, TCG_CALL_NO_RWG_SE, tl, tl, tl)
296 #if defined(TARGET_MIPS64)
297 DEF_HELPER_FLAGS_3(addu_ob, 0, tl, tl, tl, env)
298 DEF_HELPER_FLAGS_3(addu_s_ob, 0, tl, tl, tl, env)
299 DEF_HELPER_FLAGS_2(adduh_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
300 DEF_HELPER_FLAGS_2(adduh_r_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
301 DEF_HELPER_FLAGS_3(addu_qh, 0, tl, tl, tl, env)
302 DEF_HELPER_FLAGS_3(addu_s_qh, 0, tl, tl, tl, env)
303 #endif
304 DEF_HELPER_FLAGS_3(subq_ph, 0, tl, tl, tl, env)
305 DEF_HELPER_FLAGS_3(subq_s_ph, 0, tl, tl, tl, env)
306 #if defined(TARGET_MIPS64)
307 DEF_HELPER_FLAGS_3(subq_qh, 0, tl, tl, tl, env)
308 DEF_HELPER_FLAGS_3(subq_s_qh, 0, tl, tl, tl, env)
309 #endif
310 DEF_HELPER_FLAGS_3(subq_s_w, 0, tl, tl, tl, env)
311 #if defined(TARGET_MIPS64)
312 DEF_HELPER_FLAGS_3(subq_pw, 0, tl, tl, tl, env)
313 DEF_HELPER_FLAGS_3(subq_s_pw, 0, tl, tl, tl, env)
314 #endif
315 DEF_HELPER_FLAGS_3(subu_qb, 0, tl, tl, tl, env)
316 DEF_HELPER_FLAGS_3(subu_s_qb, 0, tl, tl, tl, env)
317 DEF_HELPER_FLAGS_2(subuh_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
318 DEF_HELPER_FLAGS_2(subuh_r_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
319 DEF_HELPER_FLAGS_3(subu_ph, 0, tl, tl, tl, env)
320 DEF_HELPER_FLAGS_3(subu_s_ph, 0, tl, tl, tl, env)
321 DEF_HELPER_FLAGS_2(subqh_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
322 DEF_HELPER_FLAGS_2(subqh_r_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
323 DEF_HELPER_FLAGS_2(subqh_w, TCG_CALL_NO_RWG_SE, tl, tl, tl)
324 DEF_HELPER_FLAGS_2(subqh_r_w, TCG_CALL_NO_RWG_SE, tl, tl, tl)
325 #if defined(TARGET_MIPS64)
326 DEF_HELPER_FLAGS_3(subu_ob, 0, tl, tl, tl, env)
327 DEF_HELPER_FLAGS_3(subu_s_ob, 0, tl, tl, tl, env)
328 DEF_HELPER_FLAGS_2(subuh_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
329 DEF_HELPER_FLAGS_2(subuh_r_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
330 DEF_HELPER_FLAGS_3(subu_qh, 0, tl, tl, tl, env)
331 DEF_HELPER_FLAGS_3(subu_s_qh, 0, tl, tl, tl, env)
332 #endif
333 DEF_HELPER_FLAGS_3(addsc, 0, tl, tl, tl, env)
334 DEF_HELPER_FLAGS_3(addwc, 0, tl, tl, tl, env)
335 DEF_HELPER_FLAGS_2(modsub, TCG_CALL_NO_RWG_SE, tl, tl, tl)
336 DEF_HELPER_FLAGS_1(raddu_w_qb, TCG_CALL_NO_RWG_SE, tl, tl)
337 #if defined(TARGET_MIPS64)
338 DEF_HELPER_FLAGS_1(raddu_l_ob, TCG_CALL_NO_RWG_SE, tl, tl)
339 #endif
340 DEF_HELPER_FLAGS_2(absq_s_qb, 0, tl, tl, env)
341 DEF_HELPER_FLAGS_2(absq_s_ph, 0, tl, tl, env)
342 DEF_HELPER_FLAGS_2(absq_s_w, 0, tl, tl, env)
343 #if defined(TARGET_MIPS64)
344 DEF_HELPER_FLAGS_2(absq_s_ob, 0, tl, tl, env)
345 DEF_HELPER_FLAGS_2(absq_s_qh, 0, tl, tl, env)
346 DEF_HELPER_FLAGS_2(absq_s_pw, 0, tl, tl, env)
347 #endif
348 DEF_HELPER_FLAGS_2(precr_qb_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
349 DEF_HELPER_FLAGS_2(precrq_qb_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
350 DEF_HELPER_FLAGS_3(precr_sra_ph_w, TCG_CALL_NO_RWG_SE,
351                    tl, i32, tl, tl)
352 DEF_HELPER_FLAGS_3(precr_sra_r_ph_w, TCG_CALL_NO_RWG_SE,
353                    tl, i32, tl, tl)
354 DEF_HELPER_FLAGS_2(precrq_ph_w, TCG_CALL_NO_RWG_SE, tl, tl, tl)
355 DEF_HELPER_FLAGS_3(precrq_rs_ph_w, 0, tl, tl, tl, env)
356 #if defined(TARGET_MIPS64)
357 DEF_HELPER_FLAGS_2(precr_ob_qh, TCG_CALL_NO_RWG_SE, tl, tl, tl)
358 DEF_HELPER_FLAGS_3(precr_sra_qh_pw,
359                    TCG_CALL_NO_RWG_SE, tl, tl, tl, i32)
360 DEF_HELPER_FLAGS_3(precr_sra_r_qh_pw,
361                    TCG_CALL_NO_RWG_SE, tl, tl, tl, i32)
362 DEF_HELPER_FLAGS_2(precrq_ob_qh, TCG_CALL_NO_RWG_SE, tl, tl, tl)
363 DEF_HELPER_FLAGS_2(precrq_qh_pw, TCG_CALL_NO_RWG_SE, tl, tl, tl)
364 DEF_HELPER_FLAGS_3(precrq_rs_qh_pw,
365                    TCG_CALL_NO_RWG_SE, tl, tl, tl, env)
366 DEF_HELPER_FLAGS_2(precrq_pw_l, TCG_CALL_NO_RWG_SE, tl, tl, tl)
367 #endif
368 DEF_HELPER_FLAGS_3(precrqu_s_qb_ph, 0, tl, tl, tl, env)
369 #if defined(TARGET_MIPS64)
370 DEF_HELPER_FLAGS_3(precrqu_s_ob_qh,
371                    TCG_CALL_NO_RWG_SE, tl, tl, tl, env)
372 
373 DEF_HELPER_FLAGS_1(preceq_pw_qhl, TCG_CALL_NO_RWG_SE, tl, tl)
374 DEF_HELPER_FLAGS_1(preceq_pw_qhr, TCG_CALL_NO_RWG_SE, tl, tl)
375 DEF_HELPER_FLAGS_1(preceq_pw_qhla, TCG_CALL_NO_RWG_SE, tl, tl)
376 DEF_HELPER_FLAGS_1(preceq_pw_qhra, TCG_CALL_NO_RWG_SE, tl, tl)
377 #endif
378 DEF_HELPER_FLAGS_1(precequ_ph_qbl, TCG_CALL_NO_RWG_SE, tl, tl)
379 DEF_HELPER_FLAGS_1(precequ_ph_qbr, TCG_CALL_NO_RWG_SE, tl, tl)
380 DEF_HELPER_FLAGS_1(precequ_ph_qbla, TCG_CALL_NO_RWG_SE, tl, tl)
381 DEF_HELPER_FLAGS_1(precequ_ph_qbra, TCG_CALL_NO_RWG_SE, tl, tl)
382 #if defined(TARGET_MIPS64)
383 DEF_HELPER_FLAGS_1(precequ_qh_obl, TCG_CALL_NO_RWG_SE, tl, tl)
384 DEF_HELPER_FLAGS_1(precequ_qh_obr, TCG_CALL_NO_RWG_SE, tl, tl)
385 DEF_HELPER_FLAGS_1(precequ_qh_obla, TCG_CALL_NO_RWG_SE, tl, tl)
386 DEF_HELPER_FLAGS_1(precequ_qh_obra, TCG_CALL_NO_RWG_SE, tl, tl)
387 #endif
388 DEF_HELPER_FLAGS_1(preceu_ph_qbl, TCG_CALL_NO_RWG_SE, tl, tl)
389 DEF_HELPER_FLAGS_1(preceu_ph_qbr, TCG_CALL_NO_RWG_SE, tl, tl)
390 DEF_HELPER_FLAGS_1(preceu_ph_qbla, TCG_CALL_NO_RWG_SE, tl, tl)
391 DEF_HELPER_FLAGS_1(preceu_ph_qbra, TCG_CALL_NO_RWG_SE, tl, tl)
392 #if defined(TARGET_MIPS64)
393 DEF_HELPER_FLAGS_1(preceu_qh_obl, TCG_CALL_NO_RWG_SE, tl, tl)
394 DEF_HELPER_FLAGS_1(preceu_qh_obr, TCG_CALL_NO_RWG_SE, tl, tl)
395 DEF_HELPER_FLAGS_1(preceu_qh_obla, TCG_CALL_NO_RWG_SE, tl, tl)
396 DEF_HELPER_FLAGS_1(preceu_qh_obra, TCG_CALL_NO_RWG_SE, tl, tl)
397 #endif
398 
399 /* DSP GPR-Based Shift Sub-class insns */
400 DEF_HELPER_FLAGS_3(shll_qb, 0, tl, tl, tl, env)
401 #if defined(TARGET_MIPS64)
402 DEF_HELPER_FLAGS_3(shll_ob, 0, tl, tl, tl, env)
403 #endif
404 DEF_HELPER_FLAGS_3(shll_ph, 0, tl, tl, tl, env)
405 DEF_HELPER_FLAGS_3(shll_s_ph, 0, tl, tl, tl, env)
406 #if defined(TARGET_MIPS64)
407 DEF_HELPER_FLAGS_3(shll_qh, 0, tl, tl, tl, env)
408 DEF_HELPER_FLAGS_3(shll_s_qh, 0, tl, tl, tl, env)
409 #endif
410 DEF_HELPER_FLAGS_3(shll_s_w, 0, tl, tl, tl, env)
411 #if defined(TARGET_MIPS64)
412 DEF_HELPER_FLAGS_3(shll_pw, 0, tl, tl, tl, env)
413 DEF_HELPER_FLAGS_3(shll_s_pw, 0, tl, tl, tl, env)
414 #endif
415 DEF_HELPER_FLAGS_2(shrl_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
416 DEF_HELPER_FLAGS_2(shrl_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
417 #if defined(TARGET_MIPS64)
418 DEF_HELPER_FLAGS_2(shrl_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
419 DEF_HELPER_FLAGS_2(shrl_qh, TCG_CALL_NO_RWG_SE, tl, tl, tl)
420 #endif
421 DEF_HELPER_FLAGS_2(shra_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
422 DEF_HELPER_FLAGS_2(shra_r_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
423 #if defined(TARGET_MIPS64)
424 DEF_HELPER_FLAGS_2(shra_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
425 DEF_HELPER_FLAGS_2(shra_r_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
426 #endif
427 DEF_HELPER_FLAGS_2(shra_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
428 DEF_HELPER_FLAGS_2(shra_r_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
429 DEF_HELPER_FLAGS_2(shra_r_w, TCG_CALL_NO_RWG_SE, tl, tl, tl)
430 #if defined(TARGET_MIPS64)
431 DEF_HELPER_FLAGS_2(shra_qh, TCG_CALL_NO_RWG_SE, tl, tl, tl)
432 DEF_HELPER_FLAGS_2(shra_r_qh, TCG_CALL_NO_RWG_SE, tl, tl, tl)
433 DEF_HELPER_FLAGS_2(shra_pw, TCG_CALL_NO_RWG_SE, tl, tl, tl)
434 DEF_HELPER_FLAGS_2(shra_r_pw, TCG_CALL_NO_RWG_SE, tl, tl, tl)
435 #endif
436 
437 /* DSP Multiply Sub-class insns */
438 DEF_HELPER_FLAGS_3(muleu_s_ph_qbl, 0, tl, tl, tl, env)
439 DEF_HELPER_FLAGS_3(muleu_s_ph_qbr, 0, tl, tl, tl, env)
440 #if defined(TARGET_MIPS64)
441 DEF_HELPER_FLAGS_3(muleu_s_qh_obl, 0, tl, tl, tl, env)
442 DEF_HELPER_FLAGS_3(muleu_s_qh_obr, 0, tl, tl, tl, env)
443 #endif
444 DEF_HELPER_FLAGS_3(mulq_rs_ph, 0, tl, tl, tl, env)
445 #if defined(TARGET_MIPS64)
446 DEF_HELPER_FLAGS_3(mulq_rs_qh, 0, tl, tl, tl, env)
447 #endif
448 DEF_HELPER_FLAGS_3(muleq_s_w_phl, 0, tl, tl, tl, env)
449 DEF_HELPER_FLAGS_3(muleq_s_w_phr, 0, tl, tl, tl, env)
450 #if defined(TARGET_MIPS64)
451 DEF_HELPER_FLAGS_3(muleq_s_pw_qhl, 0, tl, tl, tl, env)
452 DEF_HELPER_FLAGS_3(muleq_s_pw_qhr, 0, tl, tl, tl, env)
453 #endif
454 DEF_HELPER_FLAGS_4(dpau_h_qbl, 0, void, i32, tl, tl, env)
455 DEF_HELPER_FLAGS_4(dpau_h_qbr, 0, void, i32, tl, tl, env)
456 #if defined(TARGET_MIPS64)
457 DEF_HELPER_FLAGS_4(dpau_h_obl, 0, void, tl, tl, i32, env)
458 DEF_HELPER_FLAGS_4(dpau_h_obr, 0, void, tl, tl, i32, env)
459 #endif
460 DEF_HELPER_FLAGS_4(dpsu_h_qbl, 0, void, i32, tl, tl, env)
461 DEF_HELPER_FLAGS_4(dpsu_h_qbr, 0, void, i32, tl, tl, env)
462 #if defined(TARGET_MIPS64)
463 DEF_HELPER_FLAGS_4(dpsu_h_obl, 0, void, tl, tl, i32, env)
464 DEF_HELPER_FLAGS_4(dpsu_h_obr, 0, void, tl, tl, i32, env)
465 #endif
466 DEF_HELPER_FLAGS_4(dpa_w_ph, 0, void, i32, tl, tl, env)
467 #if defined(TARGET_MIPS64)
468 DEF_HELPER_FLAGS_4(dpa_w_qh, 0, void, tl, tl, i32, env)
469 #endif
470 DEF_HELPER_FLAGS_4(dpax_w_ph, 0, void, i32, tl, tl, env)
471 DEF_HELPER_FLAGS_4(dpaq_s_w_ph, 0, void, i32, tl, tl, env)
472 #if defined(TARGET_MIPS64)
473 DEF_HELPER_FLAGS_4(dpaq_s_w_qh, 0, void, tl, tl, i32, env)
474 #endif
475 DEF_HELPER_FLAGS_4(dpaqx_s_w_ph, 0, void, i32, tl, tl, env)
476 DEF_HELPER_FLAGS_4(dpaqx_sa_w_ph, 0, void, i32, tl, tl, env)
477 DEF_HELPER_FLAGS_4(dps_w_ph, 0, void, i32, tl, tl, env)
478 #if defined(TARGET_MIPS64)
479 DEF_HELPER_FLAGS_4(dps_w_qh, 0, void, tl, tl, i32, env)
480 #endif
481 DEF_HELPER_FLAGS_4(dpsx_w_ph, 0, void, i32, tl, tl, env)
482 DEF_HELPER_FLAGS_4(dpsq_s_w_ph, 0, void, i32, tl, tl, env)
483 #if defined(TARGET_MIPS64)
484 DEF_HELPER_FLAGS_4(dpsq_s_w_qh, 0, void, tl, tl, i32, env)
485 #endif
486 DEF_HELPER_FLAGS_4(dpsqx_s_w_ph, 0, void, i32, tl, tl, env)
487 DEF_HELPER_FLAGS_4(dpsqx_sa_w_ph, 0, void, i32, tl, tl, env)
488 DEF_HELPER_FLAGS_4(mulsaq_s_w_ph, 0, void, i32, tl, tl, env)
489 #if defined(TARGET_MIPS64)
490 DEF_HELPER_FLAGS_4(mulsaq_s_w_qh, 0, void, tl, tl, i32, env)
491 #endif
492 DEF_HELPER_FLAGS_4(dpaq_sa_l_w, 0, void, i32, tl, tl, env)
493 #if defined(TARGET_MIPS64)
494 DEF_HELPER_FLAGS_4(dpaq_sa_l_pw, 0, void, tl, tl, i32, env)
495 #endif
496 DEF_HELPER_FLAGS_4(dpsq_sa_l_w, 0, void, i32, tl, tl, env)
497 #if defined(TARGET_MIPS64)
498 DEF_HELPER_FLAGS_4(dpsq_sa_l_pw, 0, void, tl, tl, i32, env)
499 DEF_HELPER_FLAGS_4(mulsaq_s_l_pw, 0, void, tl, tl, i32, env)
500 #endif
501 DEF_HELPER_FLAGS_4(maq_s_w_phl, 0, void, i32, tl, tl, env)
502 DEF_HELPER_FLAGS_4(maq_s_w_phr, 0, void, i32, tl, tl, env)
503 DEF_HELPER_FLAGS_4(maq_sa_w_phl, 0, void, i32, tl, tl, env)
504 DEF_HELPER_FLAGS_4(maq_sa_w_phr, 0, void, i32, tl, tl, env)
505 DEF_HELPER_FLAGS_3(mul_ph, 0, tl, tl, tl, env)
506 DEF_HELPER_FLAGS_3(mul_s_ph, 0, tl, tl, tl, env)
507 DEF_HELPER_FLAGS_3(mulq_s_ph, 0, tl, tl, tl, env)
508 DEF_HELPER_FLAGS_3(mulq_s_w, 0, tl, tl, tl, env)
509 DEF_HELPER_FLAGS_3(mulq_rs_w, 0, tl, tl, tl, env)
510 DEF_HELPER_FLAGS_4(mulsa_w_ph, 0, void, i32, tl, tl, env)
511 #if defined(TARGET_MIPS64)
512 DEF_HELPER_FLAGS_4(maq_s_w_qhll, 0, void, tl, tl, i32, env)
513 DEF_HELPER_FLAGS_4(maq_s_w_qhlr, 0, void, tl, tl, i32, env)
514 DEF_HELPER_FLAGS_4(maq_s_w_qhrl, 0, void, tl, tl, i32, env)
515 DEF_HELPER_FLAGS_4(maq_s_w_qhrr, 0, void, tl, tl, i32, env)
516 DEF_HELPER_FLAGS_4(maq_sa_w_qhll, 0, void, tl, tl, i32, env)
517 DEF_HELPER_FLAGS_4(maq_sa_w_qhlr, 0, void, tl, tl, i32, env)
518 DEF_HELPER_FLAGS_4(maq_sa_w_qhrl, 0, void, tl, tl, i32, env)
519 DEF_HELPER_FLAGS_4(maq_sa_w_qhrr, 0, void, tl, tl, i32, env)
520 DEF_HELPER_FLAGS_4(maq_s_l_pwl, 0, void, tl, tl, i32, env)
521 DEF_HELPER_FLAGS_4(maq_s_l_pwr, 0, void, tl, tl, i32, env)
522 DEF_HELPER_FLAGS_4(dmadd, 0, void, tl, tl, i32, env)
523 DEF_HELPER_FLAGS_4(dmaddu, 0, void, tl, tl, i32, env)
524 DEF_HELPER_FLAGS_4(dmsub, 0, void, tl, tl, i32, env)
525 DEF_HELPER_FLAGS_4(dmsubu, 0, void, tl, tl, i32, env)
526 #endif
527 
528 /* DSP Bit/Manipulation Sub-class insns */
529 DEF_HELPER_FLAGS_1(bitrev, TCG_CALL_NO_RWG_SE, tl, tl)
530 DEF_HELPER_FLAGS_3(insv, 0, tl, env, tl, tl)
531 #if defined(TARGET_MIPS64)
532 DEF_HELPER_FLAGS_3(dinsv, 0, tl, env, tl, tl)
533 #endif
534 
535 /* DSP Compare-Pick Sub-class insns */
536 DEF_HELPER_FLAGS_3(cmpu_eq_qb, 0, void, tl, tl, env)
537 DEF_HELPER_FLAGS_3(cmpu_lt_qb, 0, void, tl, tl, env)
538 DEF_HELPER_FLAGS_3(cmpu_le_qb, 0, void, tl, tl, env)
539 DEF_HELPER_FLAGS_2(cmpgu_eq_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
540 DEF_HELPER_FLAGS_2(cmpgu_lt_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
541 DEF_HELPER_FLAGS_2(cmpgu_le_qb, TCG_CALL_NO_RWG_SE, tl, tl, tl)
542 DEF_HELPER_FLAGS_3(cmp_eq_ph, 0, void, tl, tl, env)
543 DEF_HELPER_FLAGS_3(cmp_lt_ph, 0, void, tl, tl, env)
544 DEF_HELPER_FLAGS_3(cmp_le_ph, 0, void, tl, tl, env)
545 #if defined(TARGET_MIPS64)
546 DEF_HELPER_FLAGS_3(cmpu_eq_ob, 0, void, tl, tl, env)
547 DEF_HELPER_FLAGS_3(cmpu_lt_ob, 0, void, tl, tl, env)
548 DEF_HELPER_FLAGS_3(cmpu_le_ob, 0, void, tl, tl, env)
549 DEF_HELPER_FLAGS_3(cmpgdu_eq_ob, 0, tl, tl, tl, env)
550 DEF_HELPER_FLAGS_3(cmpgdu_lt_ob, 0, tl, tl, tl, env)
551 DEF_HELPER_FLAGS_3(cmpgdu_le_ob, 0, tl, tl, tl, env)
552 DEF_HELPER_FLAGS_2(cmpgu_eq_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
553 DEF_HELPER_FLAGS_2(cmpgu_lt_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
554 DEF_HELPER_FLAGS_2(cmpgu_le_ob, TCG_CALL_NO_RWG_SE, tl, tl, tl)
555 DEF_HELPER_FLAGS_3(cmp_eq_qh, 0, void, tl, tl, env)
556 DEF_HELPER_FLAGS_3(cmp_lt_qh, 0, void, tl, tl, env)
557 DEF_HELPER_FLAGS_3(cmp_le_qh, 0, void, tl, tl, env)
558 DEF_HELPER_FLAGS_3(cmp_eq_pw, 0, void, tl, tl, env)
559 DEF_HELPER_FLAGS_3(cmp_lt_pw, 0, void, tl, tl, env)
560 DEF_HELPER_FLAGS_3(cmp_le_pw, 0, void, tl, tl, env)
561 #endif
562 DEF_HELPER_FLAGS_3(pick_qb, 0, tl, tl, tl, env)
563 DEF_HELPER_FLAGS_3(pick_ph, 0, tl, tl, tl, env)
564 #if defined(TARGET_MIPS64)
565 DEF_HELPER_FLAGS_3(pick_ob, 0, tl, tl, tl, env)
566 DEF_HELPER_FLAGS_3(pick_qh, 0, tl, tl, tl, env)
567 DEF_HELPER_FLAGS_3(pick_pw, 0, tl, tl, tl, env)
568 #endif
569 DEF_HELPER_FLAGS_2(packrl_ph, TCG_CALL_NO_RWG_SE, tl, tl, tl)
570 #if defined(TARGET_MIPS64)
571 DEF_HELPER_FLAGS_2(packrl_pw, TCG_CALL_NO_RWG_SE, tl, tl, tl)
572 #endif
573 
574 /* DSP Accumulator and DSPControl Access Sub-class insns */
575 DEF_HELPER_FLAGS_3(extr_w, 0, tl, tl, tl, env)
576 DEF_HELPER_FLAGS_3(extr_r_w, 0, tl, tl, tl, env)
577 DEF_HELPER_FLAGS_3(extr_rs_w, 0, tl, tl, tl, env)
578 #if defined(TARGET_MIPS64)
579 DEF_HELPER_FLAGS_3(dextr_w, 0, tl, tl, tl, env)
580 DEF_HELPER_FLAGS_3(dextr_r_w, 0, tl, tl, tl, env)
581 DEF_HELPER_FLAGS_3(dextr_rs_w, 0, tl, tl, tl, env)
582 DEF_HELPER_FLAGS_3(dextr_l, 0, tl, tl, tl, env)
583 DEF_HELPER_FLAGS_3(dextr_r_l, 0, tl, tl, tl, env)
584 DEF_HELPER_FLAGS_3(dextr_rs_l, 0, tl, tl, tl, env)
585 #endif
586 DEF_HELPER_FLAGS_3(extr_s_h, 0, tl, tl, tl, env)
587 #if defined(TARGET_MIPS64)
588 DEF_HELPER_FLAGS_3(dextr_s_h, 0, tl, tl, tl, env)
589 #endif
590 DEF_HELPER_FLAGS_3(extp, 0, tl, tl, tl, env)
591 DEF_HELPER_FLAGS_3(extpdp, 0, tl, tl, tl, env)
592 #if defined(TARGET_MIPS64)
593 DEF_HELPER_FLAGS_3(dextp, 0, tl, tl, tl, env)
594 DEF_HELPER_FLAGS_3(dextpdp, 0, tl, tl, tl, env)
595 #endif
596 DEF_HELPER_FLAGS_3(shilo, 0, void, tl, tl, env)
597 #if defined(TARGET_MIPS64)
598 DEF_HELPER_FLAGS_3(dshilo, 0, void, tl, tl, env)
599 #endif
600 DEF_HELPER_FLAGS_3(mthlip, 0, void, tl, tl, env)
601 #if defined(TARGET_MIPS64)
602 DEF_HELPER_FLAGS_3(dmthlip, 0, void, tl, tl, env)
603 #endif
604 DEF_HELPER_FLAGS_3(wrdsp, 0, void, tl, tl, env)
605 DEF_HELPER_FLAGS_2(rddsp, 0, tl, tl, env)
606 
607 #ifndef CONFIG_USER_ONLY
608 #include "tcg/sysemu_helper.h.inc"
609 #endif /* !CONFIG_USER_ONLY */
610 
611 #include "tcg/msa_helper.h.inc"
612