root / target-mips / helper.h @ caa88be0
History | View | Annotate | Download (7.9 kB)
1 |
#ifndef DEF_HELPER
|
---|---|
2 |
#define DEF_HELPER(ret, name, params) ret name params;
|
3 |
#endif
|
4 |
|
5 |
DEF_HELPER(void, do_raise_exception_err, (int excp, int err)) |
6 |
DEF_HELPER(void, do_raise_exception, (int excp)) |
7 |
DEF_HELPER(void, do_interrupt_restart, (void)) |
8 |
|
9 |
DEF_HELPER(void, do_clo, (void)) |
10 |
DEF_HELPER(void, do_clz, (void)) |
11 |
#ifdef TARGET_MIPS64
|
12 |
DEF_HELPER(void, do_dclo, (void)) |
13 |
DEF_HELPER(void, do_dclz, (void)) |
14 |
DEF_HELPER(void, do_dmult, (void)) |
15 |
DEF_HELPER(void, do_dmultu, (void)) |
16 |
#endif
|
17 |
|
18 |
/* CP0 helpers */
|
19 |
#ifndef CONFIG_USER_ONLY
|
20 |
DEF_HELPER(void, do_mfc0_mvpcontrol, (void)) |
21 |
DEF_HELPER(void, do_mfc0_mvpconf0, (void)) |
22 |
DEF_HELPER(void, do_mfc0_mvpconf1, (void)) |
23 |
DEF_HELPER(void, do_mfc0_random, (void)) |
24 |
DEF_HELPER(void, do_mfc0_tcstatus, (void)) |
25 |
DEF_HELPER(void, do_mftc0_tcstatus, (void)) |
26 |
DEF_HELPER(void, do_mfc0_tcbind, (void)) |
27 |
DEF_HELPER(void, do_mftc0_tcbind, (void)) |
28 |
DEF_HELPER(void, do_mfc0_tcrestart, (void)) |
29 |
DEF_HELPER(void, do_mftc0_tcrestart, (void)) |
30 |
DEF_HELPER(void, do_mfc0_tchalt, (void)) |
31 |
DEF_HELPER(void, do_mftc0_tchalt, (void)) |
32 |
DEF_HELPER(void, do_mfc0_tccontext, (void)) |
33 |
DEF_HELPER(void, do_mftc0_tccontext, (void)) |
34 |
DEF_HELPER(void, do_mfc0_tcschedule, (void)) |
35 |
DEF_HELPER(void, do_mftc0_tcschedule, (void)) |
36 |
DEF_HELPER(void, do_mfc0_tcschefback, (void)) |
37 |
DEF_HELPER(void, do_mftc0_tcschefback, (void)) |
38 |
DEF_HELPER(void, do_mfc0_count, (void)) |
39 |
DEF_HELPER(void, do_mftc0_entryhi, (void)) |
40 |
DEF_HELPER(void, do_mftc0_status, (void)) |
41 |
DEF_HELPER(void, do_mfc0_lladdr, (void)) |
42 |
DEF_HELPER(void, do_mfc0_watchlo, (uint32_t sel))
|
43 |
DEF_HELPER(void, do_mfc0_watchhi, (uint32_t sel))
|
44 |
DEF_HELPER(void, do_mfc0_debug, (void)) |
45 |
DEF_HELPER(void, do_mftc0_debug, (void)) |
46 |
#ifdef TARGET_MIPS64
|
47 |
DEF_HELPER(void, do_dmfc0_tcrestart, (void)) |
48 |
DEF_HELPER(void, do_dmfc0_tchalt, (void)) |
49 |
DEF_HELPER(void, do_dmfc0_tccontext, (void)) |
50 |
DEF_HELPER(void, do_dmfc0_tcschedule, (void)) |
51 |
DEF_HELPER(void, do_dmfc0_tcschefback, (void)) |
52 |
DEF_HELPER(void, do_dmfc0_lladdr, (void)) |
53 |
DEF_HELPER(void, do_dmfc0_watchlo, (uint32_t sel))
|
54 |
#endif /* TARGET_MIPS64 */ |
55 |
|
56 |
DEF_HELPER(void, do_mtc0_index, (void)) |
57 |
DEF_HELPER(void, do_mtc0_mvpcontrol, (void)) |
58 |
DEF_HELPER(void, do_mtc0_vpecontrol, (void)) |
59 |
DEF_HELPER(void, do_mtc0_vpeconf0, (void)) |
60 |
DEF_HELPER(void, do_mtc0_vpeconf1, (void)) |
61 |
DEF_HELPER(void, do_mtc0_yqmask, (void)) |
62 |
DEF_HELPER(void, do_mtc0_vpeopt, (void)) |
63 |
DEF_HELPER(void, do_mtc0_entrylo0, (void)) |
64 |
DEF_HELPER(void, do_mtc0_tcstatus, (void)) |
65 |
DEF_HELPER(void, do_mttc0_tcstatus, (void)) |
66 |
DEF_HELPER(void, do_mtc0_tcbind, (void)) |
67 |
DEF_HELPER(void, do_mttc0_tcbind, (void)) |
68 |
DEF_HELPER(void, do_mtc0_tcrestart, (void)) |
69 |
DEF_HELPER(void, do_mttc0_tcrestart, (void)) |
70 |
DEF_HELPER(void, do_mtc0_tchalt, (void)) |
71 |
DEF_HELPER(void, do_mttc0_tchalt, (void)) |
72 |
DEF_HELPER(void, do_mtc0_tccontext, (void)) |
73 |
DEF_HELPER(void, do_mttc0_tccontext, (void)) |
74 |
DEF_HELPER(void, do_mtc0_tcschedule, (void)) |
75 |
DEF_HELPER(void, do_mttc0_tcschedule, (void)) |
76 |
DEF_HELPER(void, do_mtc0_tcschefback, (void)) |
77 |
DEF_HELPER(void, do_mttc0_tcschefback, (void)) |
78 |
DEF_HELPER(void, do_mtc0_entrylo1, (void)) |
79 |
DEF_HELPER(void, do_mtc0_context, (void)) |
80 |
DEF_HELPER(void, do_mtc0_pagemask, (void)) |
81 |
DEF_HELPER(void, do_mtc0_pagegrain, (void)) |
82 |
DEF_HELPER(void, do_mtc0_wired, (void)) |
83 |
DEF_HELPER(void, do_mtc0_srsconf0, (void)) |
84 |
DEF_HELPER(void, do_mtc0_srsconf1, (void)) |
85 |
DEF_HELPER(void, do_mtc0_srsconf2, (void)) |
86 |
DEF_HELPER(void, do_mtc0_srsconf3, (void)) |
87 |
DEF_HELPER(void, do_mtc0_srsconf4, (void)) |
88 |
DEF_HELPER(void, do_mtc0_hwrena, (void)) |
89 |
DEF_HELPER(void, do_mtc0_count, (void)) |
90 |
DEF_HELPER(void, do_mtc0_entryhi, (void)) |
91 |
DEF_HELPER(void, do_mttc0_entryhi, (void)) |
92 |
DEF_HELPER(void, do_mtc0_compare, (void)) |
93 |
DEF_HELPER(void, do_mtc0_status, (void)) |
94 |
DEF_HELPER(void, do_mttc0_status, (void)) |
95 |
DEF_HELPER(void, do_mtc0_intctl, (void)) |
96 |
DEF_HELPER(void, do_mtc0_srsctl, (void)) |
97 |
DEF_HELPER(void, do_mtc0_cause, (void)) |
98 |
DEF_HELPER(void, do_mtc0_ebase, (void)) |
99 |
DEF_HELPER(void, do_mtc0_config0, (void)) |
100 |
DEF_HELPER(void, do_mtc0_config2, (void)) |
101 |
DEF_HELPER(void, do_mtc0_watchlo, (uint32_t sel))
|
102 |
DEF_HELPER(void, do_mtc0_watchhi, (uint32_t sel))
|
103 |
DEF_HELPER(void, do_mtc0_xcontext, (void)) |
104 |
DEF_HELPER(void, do_mtc0_framemask, (void)) |
105 |
DEF_HELPER(void, do_mtc0_debug, (void)) |
106 |
DEF_HELPER(void, do_mttc0_debug, (void)) |
107 |
DEF_HELPER(void, do_mtc0_performance0, (void)) |
108 |
DEF_HELPER(void, do_mtc0_taglo, (void)) |
109 |
DEF_HELPER(void, do_mtc0_datalo, (void)) |
110 |
DEF_HELPER(void, do_mtc0_taghi, (void)) |
111 |
DEF_HELPER(void, do_mtc0_datahi, (void)) |
112 |
#endif /* !CONFIG_USER_ONLY */ |
113 |
|
114 |
/* MIPS MT functions */
|
115 |
DEF_HELPER(void, do_mftgpr, (uint32_t sel))
|
116 |
DEF_HELPER(void, do_mftlo, (uint32_t sel))
|
117 |
DEF_HELPER(void, do_mfthi, (uint32_t sel))
|
118 |
DEF_HELPER(void, do_mftacx, (uint32_t sel))
|
119 |
DEF_HELPER(void, do_mftdsp, (void)) |
120 |
DEF_HELPER(void, do_mttgpr, (uint32_t sel))
|
121 |
DEF_HELPER(void, do_mttlo, (uint32_t sel))
|
122 |
DEF_HELPER(void, do_mtthi, (uint32_t sel))
|
123 |
DEF_HELPER(void, do_mttacx, (uint32_t sel))
|
124 |
DEF_HELPER(void, do_mttdsp, (void)) |
125 |
DEF_HELPER(void, do_dmt, (void)) |
126 |
DEF_HELPER(void, do_emt, (void)) |
127 |
DEF_HELPER(void, do_dvpe, (void)) |
128 |
DEF_HELPER(void, do_evpe, (void)) |
129 |
DEF_HELPER(void, do_fork, (void)) |
130 |
DEF_HELPER(void, do_yield, (void)) |
131 |
|
132 |
/* CP1 functions */
|
133 |
DEF_HELPER(void, do_cfc1, (uint32_t reg))
|
134 |
DEF_HELPER(void, do_ctc1, (uint32_t reg))
|
135 |
|
136 |
DEF_HELPER(void, do_float_cvtd_s, (void)) |
137 |
DEF_HELPER(void, do_float_cvtd_w, (void)) |
138 |
DEF_HELPER(void, do_float_cvtd_l, (void)) |
139 |
DEF_HELPER(void, do_float_cvtl_d, (void)) |
140 |
DEF_HELPER(void, do_float_cvtl_s, (void)) |
141 |
DEF_HELPER(void, do_float_cvtps_pw, (void)) |
142 |
DEF_HELPER(void, do_float_cvtpw_ps, (void)) |
143 |
DEF_HELPER(void, do_float_cvts_d, (void)) |
144 |
DEF_HELPER(void, do_float_cvts_w, (void)) |
145 |
DEF_HELPER(void, do_float_cvts_l, (void)) |
146 |
DEF_HELPER(void, do_float_cvts_pl, (void)) |
147 |
DEF_HELPER(void, do_float_cvts_pu, (void)) |
148 |
DEF_HELPER(void, do_float_cvtw_s, (void)) |
149 |
DEF_HELPER(void, do_float_cvtw_d, (void)) |
150 |
|
151 |
DEF_HELPER(void, do_float_addr_ps, (void)) |
152 |
DEF_HELPER(void, do_float_mulr_ps, (void)) |
153 |
|
154 |
#define FOP_PROTO(op) \
|
155 |
DEF_HELPER(void, do_float_ ## op ## _s, (void)) \ |
156 |
DEF_HELPER(void, do_float_ ## op ## _d, (void)) |
157 |
FOP_PROTO(sqrt) |
158 |
FOP_PROTO(roundl) |
159 |
FOP_PROTO(roundw) |
160 |
FOP_PROTO(truncl) |
161 |
FOP_PROTO(truncw) |
162 |
FOP_PROTO(ceill) |
163 |
FOP_PROTO(ceilw) |
164 |
FOP_PROTO(floorl) |
165 |
FOP_PROTO(floorw) |
166 |
FOP_PROTO(rsqrt) |
167 |
FOP_PROTO(recip) |
168 |
#undef FOP_PROTO
|
169 |
|
170 |
#define FOP_PROTO(op) \
|
171 |
DEF_HELPER(void, do_float_ ## op ## _s, (void)) \ |
172 |
DEF_HELPER(void, do_float_ ## op ## _d, (void)) \ |
173 |
DEF_HELPER(void, do_float_ ## op ## _ps, (void)) |
174 |
FOP_PROTO(add) |
175 |
FOP_PROTO(sub) |
176 |
FOP_PROTO(mul) |
177 |
FOP_PROTO(div) |
178 |
FOP_PROTO(abs) |
179 |
FOP_PROTO(chs) |
180 |
FOP_PROTO(muladd) |
181 |
FOP_PROTO(mulsub) |
182 |
FOP_PROTO(nmuladd) |
183 |
FOP_PROTO(nmulsub) |
184 |
FOP_PROTO(recip1) |
185 |
FOP_PROTO(recip2) |
186 |
FOP_PROTO(rsqrt1) |
187 |
FOP_PROTO(rsqrt2) |
188 |
#undef FOP_PROTO
|
189 |
|
190 |
#define FOP_PROTO(op) \
|
191 |
DEF_HELPER(void, do_cmp_d_ ## op, (long cc)) \ |
192 |
DEF_HELPER(void, do_cmpabs_d_ ## op, (long cc)) \ |
193 |
DEF_HELPER(void, do_cmp_s_ ## op, (long cc)) \ |
194 |
DEF_HELPER(void, do_cmpabs_s_ ## op, (long cc)) \ |
195 |
DEF_HELPER(void, do_cmp_ps_ ## op, (long cc)) \ |
196 |
DEF_HELPER(void, do_cmpabs_ps_ ## op, (long cc)) |
197 |
FOP_PROTO(f) |
198 |
FOP_PROTO(un) |
199 |
FOP_PROTO(eq) |
200 |
FOP_PROTO(ueq) |
201 |
FOP_PROTO(olt) |
202 |
FOP_PROTO(ult) |
203 |
FOP_PROTO(ole) |
204 |
FOP_PROTO(ule) |
205 |
FOP_PROTO(sf) |
206 |
FOP_PROTO(ngle) |
207 |
FOP_PROTO(seq) |
208 |
FOP_PROTO(ngl) |
209 |
FOP_PROTO(lt) |
210 |
FOP_PROTO(nge) |
211 |
FOP_PROTO(le) |
212 |
FOP_PROTO(ngt) |
213 |
#undef FOP_PROTO
|
214 |
|
215 |
/* Special functions */
|
216 |
DEF_HELPER(void, do_di, (void)) |
217 |
DEF_HELPER(void, do_ei, (void)) |
218 |
DEF_HELPER(void, do_eret, (void)) |
219 |
DEF_HELPER(void, do_deret, (void)) |
220 |
DEF_HELPER(void, do_rdhwr_cpunum, (void)) |
221 |
DEF_HELPER(void, do_rdhwr_synci_step, (void)) |
222 |
DEF_HELPER(void, do_rdhwr_cc, (void)) |
223 |
DEF_HELPER(void, do_rdhwr_ccres, (void)) |
224 |
DEF_HELPER(void, do_pmon, (int function)) |
225 |
DEF_HELPER(void, do_wait, (void)) |
226 |
|
227 |
/* Bitfield operations. */
|
228 |
DEF_HELPER(void, do_ext, (uint32_t pos, uint32_t size))
|
229 |
DEF_HELPER(void, do_ins, (uint32_t pos, uint32_t size))
|
230 |
DEF_HELPER(void, do_wsbh, (void)) |
231 |
#ifdef TARGET_MIPS64
|
232 |
DEF_HELPER(void, do_dext, (uint32_t pos, uint32_t size))
|
233 |
DEF_HELPER(void, do_dins, (uint32_t pos, uint32_t size))
|
234 |
DEF_HELPER(void, do_dsbh, (void)) |
235 |
DEF_HELPER(void, do_dshd, (void)) |
236 |
#endif
|