helper.h revision 758fa08712c9b1075c49adf86fd0a24c8fdb30ec
1#include "exec/def-helper.h"
2
3DEF_HELPER_2(raise_exception_err, void, i32, int)
4DEF_HELPER_1(raise_exception, void, i32)
5DEF_HELPER_0(interrupt_restart, void)
6
7#ifdef TARGET_MIPS64
8DEF_HELPER_3(ldl, tl, tl, tl, int)
9DEF_HELPER_3(ldr, tl, tl, tl, int)
10DEF_HELPER_3(sdl, void, tl, tl, int)
11DEF_HELPER_3(sdr, void, tl, tl, int)
12#endif
13DEF_HELPER_3(lwl, tl, tl, tl, int)
14DEF_HELPER_3(lwr, tl, tl, tl, int)
15DEF_HELPER_3(swl, void, tl, tl, int)
16DEF_HELPER_3(swr, void, tl, tl, int)
17
18#ifndef CONFIG_USER_ONLY
19DEF_HELPER_2(ll, tl, tl, int)
20DEF_HELPER_3(sc, tl, tl, tl, int)
21#ifdef TARGET_MIPS64
22DEF_HELPER_2(lld, tl, tl, int)
23DEF_HELPER_3(scd, tl, tl, tl, int)
24#endif
25#endif
26
27DEF_HELPER_FLAGS_1(clo, TCG_CALL_CONST | TCG_CALL_PURE, tl, tl)
28DEF_HELPER_FLAGS_1(clz, TCG_CALL_CONST | TCG_CALL_PURE, tl, tl)
29#ifdef TARGET_MIPS64
30DEF_HELPER_FLAGS_1(dclo, TCG_CALL_CONST | TCG_CALL_PURE, tl, tl)
31DEF_HELPER_FLAGS_1(dclz, TCG_CALL_CONST | TCG_CALL_PURE, tl, tl)
32DEF_HELPER_2(dmult, void, tl, tl)
33DEF_HELPER_2(dmultu, void, tl, tl)
34#endif
35
36DEF_HELPER_2(muls, tl, tl, tl)
37DEF_HELPER_2(mulsu, tl, tl, tl)
38DEF_HELPER_2(macc, tl, tl, tl)
39DEF_HELPER_2(maccu, tl, tl, tl)
40DEF_HELPER_2(msac, tl, tl, tl)
41DEF_HELPER_2(msacu, tl, tl, tl)
42DEF_HELPER_2(mulhi, tl, tl, tl)
43DEF_HELPER_2(mulhiu, tl, tl, tl)
44DEF_HELPER_2(mulshi, tl, tl, tl)
45DEF_HELPER_2(mulshiu, tl, tl, tl)
46DEF_HELPER_2(macchi, tl, tl, tl)
47DEF_HELPER_2(macchiu, tl, tl, tl)
48DEF_HELPER_2(msachi, tl, tl, tl)
49DEF_HELPER_2(msachiu, tl, tl, tl)
50
51#ifndef CONFIG_USER_ONLY
52/* CP0 helpers */
53DEF_HELPER_0(mfc0_mvpcontrol, tl)
54DEF_HELPER_0(mfc0_mvpconf0, tl)
55DEF_HELPER_0(mfc0_mvpconf1, tl)
56DEF_HELPER_0(mfc0_random, tl)
57DEF_HELPER_0(mfc0_tcstatus, tl)
58DEF_HELPER_0(mftc0_tcstatus, tl)
59DEF_HELPER_0(mfc0_tcbind, tl)
60DEF_HELPER_0(mftc0_tcbind, tl)
61DEF_HELPER_0(mfc0_tcrestart, tl)
62DEF_HELPER_0(mftc0_tcrestart, tl)
63DEF_HELPER_0(mfc0_tchalt, tl)
64DEF_HELPER_0(mftc0_tchalt, tl)
65DEF_HELPER_0(mfc0_tccontext, tl)
66DEF_HELPER_0(mftc0_tccontext, tl)
67DEF_HELPER_0(mfc0_tcschedule, tl)
68DEF_HELPER_0(mftc0_tcschedule, tl)
69DEF_HELPER_0(mfc0_tcschefback, tl)
70DEF_HELPER_0(mftc0_tcschefback, tl)
71DEF_HELPER_0(mfc0_count, tl)
72DEF_HELPER_0(mftc0_entryhi, tl)
73DEF_HELPER_0(mftc0_status, tl)
74DEF_HELPER_0(mfc0_lladdr, tl)
75DEF_HELPER_1(mfc0_watchlo, tl, i32)
76DEF_HELPER_1(mfc0_watchhi, tl, i32)
77DEF_HELPER_0(mfc0_debug, tl)
78DEF_HELPER_0(mftc0_debug, tl)
79#ifdef TARGET_MIPS64
80DEF_HELPER_0(dmfc0_tcrestart, tl)
81DEF_HELPER_0(dmfc0_tchalt, tl)
82DEF_HELPER_0(dmfc0_tccontext, tl)
83DEF_HELPER_0(dmfc0_tcschedule, tl)
84DEF_HELPER_0(dmfc0_tcschefback, tl)
85DEF_HELPER_0(dmfc0_lladdr, tl)
86DEF_HELPER_1(dmfc0_watchlo, tl, i32)
87#endif /* TARGET_MIPS64 */
88
89DEF_HELPER_1(mtc0_index, void, tl)
90DEF_HELPER_1(mtc0_mvpcontrol, void, tl)
91DEF_HELPER_1(mtc0_vpecontrol, void, tl)
92DEF_HELPER_1(mtc0_vpeconf0, void, tl)
93DEF_HELPER_1(mtc0_vpeconf1, void, tl)
94DEF_HELPER_1(mtc0_yqmask, void, tl)
95DEF_HELPER_1(mtc0_vpeopt, void, tl)
96DEF_HELPER_1(mtc0_entrylo0, void, tl)
97DEF_HELPER_1(mtc0_tcstatus, void, tl)
98DEF_HELPER_1(mttc0_tcstatus, void, tl)
99DEF_HELPER_1(mtc0_tcbind, void, tl)
100DEF_HELPER_1(mttc0_tcbind, void, tl)
101DEF_HELPER_1(mtc0_tcrestart, void, tl)
102DEF_HELPER_1(mttc0_tcrestart, void, tl)
103DEF_HELPER_1(mtc0_tchalt, void, tl)
104DEF_HELPER_1(mttc0_tchalt, void, tl)
105DEF_HELPER_1(mtc0_tccontext, void, tl)
106DEF_HELPER_1(mttc0_tccontext, void, tl)
107DEF_HELPER_1(mtc0_tcschedule, void, tl)
108DEF_HELPER_1(mttc0_tcschedule, void, tl)
109DEF_HELPER_1(mtc0_tcschefback, void, tl)
110DEF_HELPER_1(mttc0_tcschefback, void, tl)
111DEF_HELPER_1(mtc0_entrylo1, void, tl)
112DEF_HELPER_1(mtc0_context, void, tl)
113DEF_HELPER_1(mtc0_pagemask, void, tl)
114DEF_HELPER_1(mtc0_pagegrain, void, tl)
115DEF_HELPER_1(mtc0_wired, void, tl)
116DEF_HELPER_1(mtc0_srsconf0, void, tl)
117DEF_HELPER_1(mtc0_srsconf1, void, tl)
118DEF_HELPER_1(mtc0_srsconf2, void, tl)
119DEF_HELPER_1(mtc0_srsconf3, void, tl)
120DEF_HELPER_1(mtc0_srsconf4, void, tl)
121DEF_HELPER_1(mtc0_hwrena, void, tl)
122DEF_HELPER_1(mtc0_count, void, tl)
123DEF_HELPER_1(mtc0_entryhi, void, tl)
124DEF_HELPER_1(mttc0_entryhi, void, tl)
125DEF_HELPER_1(mtc0_compare, void, tl)
126DEF_HELPER_1(mtc0_status, void, tl)
127DEF_HELPER_1(mttc0_status, void, tl)
128DEF_HELPER_1(mtc0_intctl, void, tl)
129DEF_HELPER_1(mtc0_srsctl, void, tl)
130DEF_HELPER_1(mtc0_cause, void, tl)
131DEF_HELPER_1(mtc0_ebase, void, tl)
132DEF_HELPER_1(mtc0_config0, void, tl)
133DEF_HELPER_1(mtc0_config2, void, tl)
134DEF_HELPER_1(mtc0_lladdr, void, tl)
135DEF_HELPER_2(mtc0_watchlo, void, tl, i32)
136DEF_HELPER_2(mtc0_watchhi, void, tl, i32)
137DEF_HELPER_1(mtc0_xcontext, void, tl)
138DEF_HELPER_1(mtc0_framemask, void, tl)
139DEF_HELPER_1(mtc0_debug, void, tl)
140DEF_HELPER_1(mttc0_debug, void, tl)
141DEF_HELPER_1(mtc0_performance0, void, tl)
142DEF_HELPER_1(mtc0_taglo, void, tl)
143DEF_HELPER_1(mtc0_datalo, void, tl)
144DEF_HELPER_1(mtc0_taghi, void, tl)
145DEF_HELPER_1(mtc0_datahi, void, tl)
146
147/* MIPS MT functions */
148DEF_HELPER_1(mftgpr, tl, i32)
149DEF_HELPER_1(mftlo, tl, i32)
150DEF_HELPER_1(mfthi, tl, i32)
151DEF_HELPER_1(mftacx, tl, i32)
152DEF_HELPER_0(mftdsp, tl)
153DEF_HELPER_2(mttgpr, void, tl, i32)
154DEF_HELPER_2(mttlo, void, tl, i32)
155DEF_HELPER_2(mtthi, void, tl, i32)
156DEF_HELPER_2(mttacx, void, tl, i32)
157DEF_HELPER_1(mttdsp, void, tl)
158DEF_HELPER_1(dmt, tl, tl)
159DEF_HELPER_1(emt, tl, tl)
160DEF_HELPER_1(dvpe, tl, tl)
161DEF_HELPER_1(evpe, tl, tl)
162#endif /* !CONFIG_USER_ONLY */
163DEF_HELPER_2(fork, void, tl, tl)
164DEF_HELPER_1(yield, tl, tl)
165
166/* CP1 functions */
167DEF_HELPER_1(cfc1, tl, i32)
168DEF_HELPER_2(ctc1, void, tl, i32)
169
170DEF_HELPER_1(float_cvtd_s, i64, i32)
171DEF_HELPER_1(float_cvtd_w, i64, i32)
172DEF_HELPER_1(float_cvtd_l, i64, i64)
173DEF_HELPER_1(float_cvtl_d, i64, i64)
174DEF_HELPER_1(float_cvtl_s, i64, i32)
175DEF_HELPER_1(float_cvtps_pw, i64, i64)
176DEF_HELPER_1(float_cvtpw_ps, i64, i64)
177DEF_HELPER_1(float_cvts_d, i32, i64)
178DEF_HELPER_1(float_cvts_w, i32, i32)
179DEF_HELPER_1(float_cvts_l, i32, i64)
180DEF_HELPER_1(float_cvts_pl, i32, i32)
181DEF_HELPER_1(float_cvts_pu, i32, i32)
182DEF_HELPER_1(float_cvtw_s, i32, i32)
183DEF_HELPER_1(float_cvtw_d, i32, i64)
184
185DEF_HELPER_2(float_addr_ps, i64, i64, i64)
186DEF_HELPER_2(float_mulr_ps, i64, i64, i64)
187
188#define FOP_PROTO(op)                       \
189DEF_HELPER_1(float_ ## op ## l_s, i64, i32) \
190DEF_HELPER_1(float_ ## op ## l_d, i64, i64) \
191DEF_HELPER_1(float_ ## op ## w_s, i32, i32) \
192DEF_HELPER_1(float_ ## op ## w_d, i32, i64)
193FOP_PROTO(round)
194FOP_PROTO(trunc)
195FOP_PROTO(ceil)
196FOP_PROTO(floor)
197#undef FOP_PROTO
198
199#define FOP_PROTO(op)                       \
200DEF_HELPER_1(float_ ## op ## _s, i32, i32)  \
201DEF_HELPER_1(float_ ## op ## _d, i64, i64)
202FOP_PROTO(sqrt)
203FOP_PROTO(rsqrt)
204FOP_PROTO(recip)
205#undef FOP_PROTO
206
207#define FOP_PROTO(op)                       \
208DEF_HELPER_1(float_ ## op ## _s, i32, i32)  \
209DEF_HELPER_1(float_ ## op ## _d, i64, i64)  \
210DEF_HELPER_1(float_ ## op ## _ps, i64, i64)
211FOP_PROTO(abs)
212FOP_PROTO(chs)
213FOP_PROTO(recip1)
214FOP_PROTO(rsqrt1)
215#undef FOP_PROTO
216
217#define FOP_PROTO(op)                             \
218DEF_HELPER_2(float_ ## op ## _s, i32, i32, i32)   \
219DEF_HELPER_2(float_ ## op ## _d, i64, i64, i64)   \
220DEF_HELPER_2(float_ ## op ## _ps, i64, i64, i64)
221FOP_PROTO(add)
222FOP_PROTO(sub)
223FOP_PROTO(mul)
224FOP_PROTO(div)
225FOP_PROTO(recip2)
226FOP_PROTO(rsqrt2)
227#undef FOP_PROTO
228
229#define FOP_PROTO(op)                                 \
230DEF_HELPER_3(float_ ## op ## _s, i32, i32, i32, i32)  \
231DEF_HELPER_3(float_ ## op ## _d, i64, i64, i64, i64)  \
232DEF_HELPER_3(float_ ## op ## _ps, i64, i64, i64, i64)
233FOP_PROTO(muladd)
234FOP_PROTO(mulsub)
235FOP_PROTO(nmuladd)
236FOP_PROTO(nmulsub)
237#undef FOP_PROTO
238
239#define FOP_PROTO(op)                               \
240DEF_HELPER_3(cmp_d_ ## op, void, i64, i64, int)     \
241DEF_HELPER_3(cmpabs_d_ ## op, void, i64, i64, int)  \
242DEF_HELPER_3(cmp_s_ ## op, void, i32, i32, int)     \
243DEF_HELPER_3(cmpabs_s_ ## op, void, i32, i32, int)  \
244DEF_HELPER_3(cmp_ps_ ## op, void, i64, i64, int)    \
245DEF_HELPER_3(cmpabs_ps_ ## op, void, i64, i64, int)
246FOP_PROTO(f)
247FOP_PROTO(un)
248FOP_PROTO(eq)
249FOP_PROTO(ueq)
250FOP_PROTO(olt)
251FOP_PROTO(ult)
252FOP_PROTO(ole)
253FOP_PROTO(ule)
254FOP_PROTO(sf)
255FOP_PROTO(ngle)
256FOP_PROTO(seq)
257FOP_PROTO(ngl)
258FOP_PROTO(lt)
259FOP_PROTO(nge)
260FOP_PROTO(le)
261FOP_PROTO(ngt)
262#undef FOP_PROTO
263
264/* Special functions */
265#ifndef CONFIG_USER_ONLY
266DEF_HELPER_1(tlbwi, void, env)
267DEF_HELPER_1(tlbwr, void, env)
268DEF_HELPER_1(tlbp, void, env)
269DEF_HELPER_1(tlbr, void, env)
270DEF_HELPER_0(di, tl)
271DEF_HELPER_0(ei, tl)
272DEF_HELPER_0(eret, void)
273DEF_HELPER_0(deret, void)
274#endif /* !CONFIG_USER_ONLY */
275DEF_HELPER_0(rdhwr_cpunum, tl)
276DEF_HELPER_0(rdhwr_synci_step, tl)
277DEF_HELPER_0(rdhwr_cc, tl)
278DEF_HELPER_0(rdhwr_ccres, tl)
279DEF_HELPER_1(pmon, void, int)
280DEF_HELPER_0(wait, void)
281
282#include "exec/def-helper.h"
283