1 #include "def-helper.h"
3 DEF_HELPER_3(raise_exception_err, noreturn, env, i32, int)
4 DEF_HELPER_2(raise_exception, noreturn, env, i32)
7 DEF_HELPER_4(ldl, tl, env, tl, tl, int)
8 DEF_HELPER_4(ldr, tl, env, tl, tl, int)
9 DEF_HELPER_4(sdl, void, env, tl, tl, int)
10 DEF_HELPER_4(sdr, void, env, tl, tl, int)
12 DEF_HELPER_4(lwl, tl, env, tl, tl, int)
13 DEF_HELPER_4(lwr, tl, env, tl, tl, int)
14 DEF_HELPER_4(swl, void, env, tl, tl, int)
15 DEF_HELPER_4(swr, void, env, tl, tl, int)
17 #ifndef CONFIG_USER_ONLY
18 DEF_HELPER_3(ll, tl, env, tl, int)
19 DEF_HELPER_4(sc, tl, env, tl, tl, int)
21 DEF_HELPER_3(lld, tl, env, tl, int)
22 DEF_HELPER_4(scd, tl, env, tl, tl, int)
26 DEF_HELPER_FLAGS_1(clo, TCG_CALL_NO_RWG_SE, tl, tl)
27 DEF_HELPER_FLAGS_1(clz, TCG_CALL_NO_RWG_SE, tl, tl)
29 DEF_HELPER_FLAGS_1(dclo, TCG_CALL_NO_RWG_SE, tl, tl)
30 DEF_HELPER_FLAGS_1(dclz, TCG_CALL_NO_RWG_SE, tl, tl)
31 DEF_HELPER_3(dmult, void, env, tl, tl)
32 DEF_HELPER_3(dmultu, void, env, tl, tl)
35 DEF_HELPER_3(muls, tl, env, tl, tl)
36 DEF_HELPER_3(mulsu, tl, env, tl, tl)
37 DEF_HELPER_3(macc, tl, env, tl, tl)
38 DEF_HELPER_3(maccu, tl, env, tl, tl)
39 DEF_HELPER_3(msac, tl, env, tl, tl)
40 DEF_HELPER_3(msacu, tl, env, tl, tl)
41 DEF_HELPER_3(mulhi, tl, env, tl, tl)
42 DEF_HELPER_3(mulhiu, tl, env, tl, tl)
43 DEF_HELPER_3(mulshi, tl, env, tl, tl)
44 DEF_HELPER_3(mulshiu, tl, env, tl, tl)
45 DEF_HELPER_3(macchi, tl, env, tl, tl)
46 DEF_HELPER_3(macchiu, tl, env, tl, tl)
47 DEF_HELPER_3(msachi, tl, env, tl, tl)
48 DEF_HELPER_3(msachiu, tl, env, tl, tl)
50 #ifndef CONFIG_USER_ONLY
52 DEF_HELPER_1(mfc0_mvpcontrol, tl, env)
53 DEF_HELPER_1(mfc0_mvpconf0, tl, env)
54 DEF_HELPER_1(mfc0_mvpconf1, tl, env)
55 DEF_HELPER_1(mftc0_vpecontrol, tl, env)
56 DEF_HELPER_1(mftc0_vpeconf0, tl, env)
57 DEF_HELPER_1(mfc0_random, tl, env)
58 DEF_HELPER_1(mfc0_tcstatus, tl, env)
59 DEF_HELPER_1(mftc0_tcstatus, tl, env)
60 DEF_HELPER_1(mfc0_tcbind, tl, env)
61 DEF_HELPER_1(mftc0_tcbind, tl, env)
62 DEF_HELPER_1(mfc0_tcrestart, tl, env)
63 DEF_HELPER_1(mftc0_tcrestart, tl, env)
64 DEF_HELPER_1(mfc0_tchalt, tl, env)
65 DEF_HELPER_1(mftc0_tchalt, tl, env)
66 DEF_HELPER_1(mfc0_tccontext, tl, env)
67 DEF_HELPER_1(mftc0_tccontext, tl, env)
68 DEF_HELPER_1(mfc0_tcschedule, tl, env)
69 DEF_HELPER_1(mftc0_tcschedule, tl, env)
70 DEF_HELPER_1(mfc0_tcschefback, tl, env)
71 DEF_HELPER_1(mftc0_tcschefback, tl, env)
72 DEF_HELPER_1(mfc0_count, tl, env)
73 DEF_HELPER_1(mftc0_entryhi, tl, env)
74 DEF_HELPER_1(mftc0_status, tl, env)
75 DEF_HELPER_1(mftc0_cause, tl, env)
76 DEF_HELPER_1(mftc0_epc, tl, env)
77 DEF_HELPER_1(mftc0_ebase, tl, env)
78 DEF_HELPER_2(mftc0_configx, tl, env, tl)
79 DEF_HELPER_1(mfc0_lladdr, tl, env)
80 DEF_HELPER_2(mfc0_watchlo, tl, env, i32)
81 DEF_HELPER_2(mfc0_watchhi, tl, env, i32)
82 DEF_HELPER_1(mfc0_debug, tl, env)
83 DEF_HELPER_1(mftc0_debug, tl, env)
85 DEF_HELPER_1(dmfc0_tcrestart, tl, env)
86 DEF_HELPER_1(dmfc0_tchalt, tl, env)
87 DEF_HELPER_1(dmfc0_tccontext, tl, env)
88 DEF_HELPER_1(dmfc0_tcschedule, tl, env)
89 DEF_HELPER_1(dmfc0_tcschefback, tl, env)
90 DEF_HELPER_1(dmfc0_lladdr, tl, env)
91 DEF_HELPER_2(dmfc0_watchlo, tl, env, i32)
92 #endif /* TARGET_MIPS64 */
94 DEF_HELPER_2(mtc0_index, void, env, tl)
95 DEF_HELPER_2(mtc0_mvpcontrol, void, env, tl)
96 DEF_HELPER_2(mtc0_vpecontrol, void, env, tl)
97 DEF_HELPER_2(mttc0_vpecontrol, void, env, tl)
98 DEF_HELPER_2(mtc0_vpeconf0, void, env, tl)
99 DEF_HELPER_2(mttc0_vpeconf0, void, env, tl)
100 DEF_HELPER_2(mtc0_vpeconf1, void, env, tl)
101 DEF_HELPER_2(mtc0_yqmask, void, env, tl)
102 DEF_HELPER_2(mtc0_vpeopt, void, env, tl)
103 DEF_HELPER_2(mtc0_entrylo0, void, env, tl)
104 DEF_HELPER_2(mtc0_tcstatus, void, env, tl)
105 DEF_HELPER_2(mttc0_tcstatus, void, env, tl)
106 DEF_HELPER_2(mtc0_tcbind, void, env, tl)
107 DEF_HELPER_2(mttc0_tcbind, void, env, tl)
108 DEF_HELPER_2(mtc0_tcrestart, void, env, tl)
109 DEF_HELPER_2(mttc0_tcrestart, void, env, tl)
110 DEF_HELPER_2(mtc0_tchalt, void, env, tl)
111 DEF_HELPER_2(mttc0_tchalt, void, env, tl)
112 DEF_HELPER_2(mtc0_tccontext, void, env, tl)
113 DEF_HELPER_2(mttc0_tccontext, void, env, tl)
114 DEF_HELPER_2(mtc0_tcschedule, void, env, tl)
115 DEF_HELPER_2(mttc0_tcschedule, void, env, tl)
116 DEF_HELPER_2(mtc0_tcschefback, void, env, tl)
117 DEF_HELPER_2(mttc0_tcschefback, void, env, tl)
118 DEF_HELPER_2(mtc0_entrylo1, void, env, tl)
119 DEF_HELPER_2(mtc0_context, void, env, tl)
120 DEF_HELPER_2(mtc0_pagemask, void, env, tl)
121 DEF_HELPER_2(mtc0_pagegrain, void, env, tl)
122 DEF_HELPER_2(mtc0_wired, void, env, tl)
123 DEF_HELPER_2(mtc0_srsconf0, void, env, tl)
124 DEF_HELPER_2(mtc0_srsconf1, void, env, tl)
125 DEF_HELPER_2(mtc0_srsconf2, void, env, tl)
126 DEF_HELPER_2(mtc0_srsconf3, void, env, tl)
127 DEF_HELPER_2(mtc0_srsconf4, void, env, tl)
128 DEF_HELPER_2(mtc0_hwrena, void, env, tl)
129 DEF_HELPER_2(mtc0_count, void, env, tl)
130 DEF_HELPER_2(mtc0_entryhi, void, env, tl)
131 DEF_HELPER_2(mttc0_entryhi, void, env, tl)
132 DEF_HELPER_2(mtc0_compare, void, env, tl)
133 DEF_HELPER_2(mtc0_status, void, env, tl)
134 DEF_HELPER_2(mttc0_status, void, env, tl)
135 DEF_HELPER_2(mtc0_intctl, void, env, tl)
136 DEF_HELPER_2(mtc0_srsctl, void, env, tl)
137 DEF_HELPER_2(mtc0_cause, void, env, tl)
138 DEF_HELPER_2(mttc0_cause, void, env, tl)
139 DEF_HELPER_2(mtc0_ebase, void, env, tl)
140 DEF_HELPER_2(mttc0_ebase, void, env, tl)
141 DEF_HELPER_2(mtc0_config0, void, env, tl)
142 DEF_HELPER_2(mtc0_config2, void, env, tl)
143 DEF_HELPER_2(mtc0_lladdr, void, env, tl)
144 DEF_HELPER_3(mtc0_watchlo, void, env, tl, i32)
145 DEF_HELPER_3(mtc0_watchhi, void, env, tl, i32)
146 DEF_HELPER_2(mtc0_xcontext, void, env, tl)
147 DEF_HELPER_2(mtc0_framemask, void, env, tl)
148 DEF_HELPER_2(mtc0_debug, void, env, tl)
149 DEF_HELPER_2(mttc0_debug, void, env, tl)
150 DEF_HELPER_2(mtc0_performance0, void, env, tl)
151 DEF_HELPER_2(mtc0_taglo, void, env, tl)
152 DEF_HELPER_2(mtc0_datalo, void, env, tl)
153 DEF_HELPER_2(mtc0_taghi, void, env, tl)
154 DEF_HELPER_2(mtc0_datahi, void, env, tl)
156 /* MIPS MT functions */
157 DEF_HELPER_2(mftgpr, tl, env, i32);
158 DEF_HELPER_2(mftlo, tl, env, i32)
159 DEF_HELPER_2(mfthi, tl, env, i32)
160 DEF_HELPER_2(mftacx, tl, env, i32)
161 DEF_HELPER_1(mftdsp, tl, env)
162 DEF_HELPER_3(mttgpr, void, env, tl, i32)
163 DEF_HELPER_3(mttlo, void, env, tl, i32)
164 DEF_HELPER_3(mtthi, void, env, tl, i32)
165 DEF_HELPER_3(mttacx, void, env, tl, i32)
166 DEF_HELPER_2(mttdsp, void, env, tl)
167 DEF_HELPER_0(dmt, tl)
168 DEF_HELPER_0(emt, tl)
169 DEF_HELPER_1(dvpe, tl, env)
170 DEF_HELPER_1(evpe, tl, env)
171 #endif /* !CONFIG_USER_ONLY */
173 /* microMIPS functions */
174 DEF_HELPER_4(lwm, void, env, tl, tl, i32);
175 DEF_HELPER_4(swm, void, env, tl, tl, i32);
177 DEF_HELPER_4(ldm, void, env, tl, tl, i32);
178 DEF_HELPER_4(sdm, void, env, tl, tl, i32);
181 DEF_HELPER_2(fork, void, tl, tl)
182 DEF_HELPER_2(yield, tl, env, tl)
185 DEF_HELPER_2(cfc1, tl, env, i32)
186 DEF_HELPER_3(ctc1, void, env, tl, i32)
188 DEF_HELPER_2(float_cvtd_s, i64, env, i32)
189 DEF_HELPER_2(float_cvtd_w, i64, env, i32)
190 DEF_HELPER_2(float_cvtd_l, i64, env, i64)
191 DEF_HELPER_2(float_cvtl_d, i64, env, i64)
192 DEF_HELPER_2(float_cvtl_s, i64, env, i32)
193 DEF_HELPER_2(float_cvtps_pw, i64, env, i64)
194 DEF_HELPER_2(float_cvtpw_ps, i64, env, i64)
195 DEF_HELPER_2(float_cvts_d, i32, env, i64)
196 DEF_HELPER_2(float_cvts_w, i32, env, i32)
197 DEF_HELPER_2(float_cvts_l, i32, env, i64)
198 DEF_HELPER_2(float_cvts_pl, i32, env, i32)
199 DEF_HELPER_2(float_cvts_pu, i32, env, i32)
200 DEF_HELPER_2(float_cvtw_s, i32, env, i32)
201 DEF_HELPER_2(float_cvtw_d, i32, env, i64)
203 DEF_HELPER_3(float_addr_ps, i64, env, i64, i64)
204 DEF_HELPER_3(float_mulr_ps, i64, env, i64, i64)
206 #define FOP_PROTO(op) \
207 DEF_HELPER_2(float_ ## op ## l_s, i64, env, i32) \
208 DEF_HELPER_2(float_ ## op ## l_d, i64, env, i64) \
209 DEF_HELPER_2(float_ ## op ## w_s, i32, env, i32) \
210 DEF_HELPER_2(float_ ## op ## w_d, i32, env, i64)
217 #define FOP_PROTO(op) \
218 DEF_HELPER_2(float_ ## op ## _s, i32, env, i32) \
219 DEF_HELPER_2(float_ ## op ## _d, i64, env, i64)
225 #define FOP_PROTO(op) \
226 DEF_HELPER_1(float_ ## op ## _s, i32, i32) \
227 DEF_HELPER_1(float_ ## op ## _d, i64, i64) \
228 DEF_HELPER_1(float_ ## op ## _ps, i64, i64)
233 #define FOP_PROTO(op) \
234 DEF_HELPER_2(float_ ## op ## _s, i32, env, i32) \
235 DEF_HELPER_2(float_ ## op ## _d, i64, env, i64) \
236 DEF_HELPER_2(float_ ## op ## _ps, i64, env, i64)
241 #define FOP_PROTO(op) \
242 DEF_HELPER_3(float_ ## op ## _s, i32, env, i32, i32) \
243 DEF_HELPER_3(float_ ## op ## _d, i64, env, i64, i64) \
244 DEF_HELPER_3(float_ ## op ## _ps, i64, env, i64, i64)
253 #define FOP_PROTO(op) \
254 DEF_HELPER_4(float_ ## op ## _s, i32, env, i32, i32, i32) \
255 DEF_HELPER_4(float_ ## op ## _d, i64, env, i64, i64, i64) \
256 DEF_HELPER_4(float_ ## op ## _ps, i64, env, i64, i64, i64)
263 #define FOP_PROTO(op) \
264 DEF_HELPER_4(cmp_d_ ## op, void, env, i64, i64, int) \
265 DEF_HELPER_4(cmpabs_d_ ## op, void, env, i64, i64, int) \
266 DEF_HELPER_4(cmp_s_ ## op, void, env, i32, i32, int) \
267 DEF_HELPER_4(cmpabs_s_ ## op, void, env, i32, i32, int) \
268 DEF_HELPER_4(cmp_ps_ ## op, void, env, i64, i64, int) \
269 DEF_HELPER_4(cmpabs_ps_ ## op, void, env, i64, i64, int)
288 /* Special functions */
289 #ifndef CONFIG_USER_ONLY
290 DEF_HELPER_1(tlbwi, void, env)
291 DEF_HELPER_1(tlbwr, void, env)
292 DEF_HELPER_1(tlbp, void, env)
293 DEF_HELPER_1(tlbr, void, env)
294 DEF_HELPER_1(di, tl, env)
295 DEF_HELPER_1(ei, tl, env)
296 DEF_HELPER_1(eret, void, env)
297 DEF_HELPER_1(deret, void, env)
298 #endif /* !CONFIG_USER_ONLY */
299 DEF_HELPER_1(rdhwr_cpunum, tl, env)
300 DEF_HELPER_1(rdhwr_synci_step, tl, env)
301 DEF_HELPER_1(rdhwr_cc, tl, env)
302 DEF_HELPER_1(rdhwr_ccres, tl, env)
303 DEF_HELPER_2(pmon, void, env, int)
304 DEF_HELPER_1(wait, void, env)
306 /* Loongson multimedia functions. */
307 DEF_HELPER_FLAGS_2(paddsh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
308 DEF_HELPER_FLAGS_2(paddush, TCG_CALL_NO_RWG_SE, i64, i64, i64)
309 DEF_HELPER_FLAGS_2(paddh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
310 DEF_HELPER_FLAGS_2(paddw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
311 DEF_HELPER_FLAGS_2(paddsb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
312 DEF_HELPER_FLAGS_2(paddusb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
313 DEF_HELPER_FLAGS_2(paddb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
315 DEF_HELPER_FLAGS_2(psubsh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
316 DEF_HELPER_FLAGS_2(psubush, TCG_CALL_NO_RWG_SE, i64, i64, i64)
317 DEF_HELPER_FLAGS_2(psubh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
318 DEF_HELPER_FLAGS_2(psubw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
319 DEF_HELPER_FLAGS_2(psubsb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
320 DEF_HELPER_FLAGS_2(psubusb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
321 DEF_HELPER_FLAGS_2(psubb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
323 DEF_HELPER_FLAGS_2(pshufh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
324 DEF_HELPER_FLAGS_2(packsswh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
325 DEF_HELPER_FLAGS_2(packsshb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
326 DEF_HELPER_FLAGS_2(packushb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
328 DEF_HELPER_FLAGS_2(punpcklhw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
329 DEF_HELPER_FLAGS_2(punpckhhw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
330 DEF_HELPER_FLAGS_2(punpcklbh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
331 DEF_HELPER_FLAGS_2(punpckhbh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
332 DEF_HELPER_FLAGS_2(punpcklwd, TCG_CALL_NO_RWG_SE, i64, i64, i64)
333 DEF_HELPER_FLAGS_2(punpckhwd, TCG_CALL_NO_RWG_SE, i64, i64, i64)
335 DEF_HELPER_FLAGS_2(pavgh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
336 DEF_HELPER_FLAGS_2(pavgb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
337 DEF_HELPER_FLAGS_2(pmaxsh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
338 DEF_HELPER_FLAGS_2(pminsh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
339 DEF_HELPER_FLAGS_2(pmaxub, TCG_CALL_NO_RWG_SE, i64, i64, i64)
340 DEF_HELPER_FLAGS_2(pminub, TCG_CALL_NO_RWG_SE, i64, i64, i64)
342 DEF_HELPER_FLAGS_2(pcmpeqw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
343 DEF_HELPER_FLAGS_2(pcmpgtw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
344 DEF_HELPER_FLAGS_2(pcmpeqh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
345 DEF_HELPER_FLAGS_2(pcmpgth, TCG_CALL_NO_RWG_SE, i64, i64, i64)
346 DEF_HELPER_FLAGS_2(pcmpeqb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
347 DEF_HELPER_FLAGS_2(pcmpgtb, TCG_CALL_NO_RWG_SE, i64, i64, i64)
349 DEF_HELPER_FLAGS_2(psllw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
350 DEF_HELPER_FLAGS_2(psllh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
351 DEF_HELPER_FLAGS_2(psrlw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
352 DEF_HELPER_FLAGS_2(psrlh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
353 DEF_HELPER_FLAGS_2(psraw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
354 DEF_HELPER_FLAGS_2(psrah, TCG_CALL_NO_RWG_SE, i64, i64, i64)
356 DEF_HELPER_FLAGS_2(pmullh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
357 DEF_HELPER_FLAGS_2(pmulhh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
358 DEF_HELPER_FLAGS_2(pmulhuh, TCG_CALL_NO_RWG_SE, i64, i64, i64)
359 DEF_HELPER_FLAGS_2(pmaddhw, TCG_CALL_NO_RWG_SE, i64, i64, i64)
361 DEF_HELPER_FLAGS_2(pasubub, TCG_CALL_NO_RWG_SE, i64, i64, i64)
362 DEF_HELPER_FLAGS_1(biadd, TCG_CALL_NO_RWG_SE, i64, i64)
363 DEF_HELPER_FLAGS_1(pmovmskb, TCG_CALL_NO_RWG_SE, i64, i64)
365 #include "def-helper.h"