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