root / target-alpha / op.c @ beb811bd
History | View | Annotate | Download (14.4 kB)
1 | 4c9649a9 | j_mayer | /*
|
---|---|---|---|
2 | 4c9649a9 | j_mayer | * Alpha emulation cpu micro-operations for qemu.
|
3 | 4c9649a9 | j_mayer | *
|
4 | 4c9649a9 | j_mayer | * Copyright (c) 2007 Jocelyn Mayer
|
5 | 4c9649a9 | j_mayer | *
|
6 | 4c9649a9 | j_mayer | * This library is free software; you can redistribute it and/or
|
7 | 4c9649a9 | j_mayer | * modify it under the terms of the GNU Lesser General Public
|
8 | 4c9649a9 | j_mayer | * License as published by the Free Software Foundation; either
|
9 | 4c9649a9 | j_mayer | * version 2 of the License, or (at your option) any later version.
|
10 | 4c9649a9 | j_mayer | *
|
11 | 4c9649a9 | j_mayer | * This library is distributed in the hope that it will be useful,
|
12 | 4c9649a9 | j_mayer | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 4c9649a9 | j_mayer | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | 4c9649a9 | j_mayer | * Lesser General Public License for more details.
|
15 | 4c9649a9 | j_mayer | *
|
16 | 4c9649a9 | j_mayer | * You should have received a copy of the GNU Lesser General Public
|
17 | 4c9649a9 | j_mayer | * License along with this library; if not, write to the Free Software
|
18 | 4c9649a9 | j_mayer | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 | 4c9649a9 | j_mayer | */
|
20 | 4c9649a9 | j_mayer | |
21 | 4c9649a9 | j_mayer | #define DEBUG_OP
|
22 | 4c9649a9 | j_mayer | |
23 | 4c9649a9 | j_mayer | #include "config.h" |
24 | 4c9649a9 | j_mayer | #include "exec.h" |
25 | 4c9649a9 | j_mayer | |
26 | 4c9649a9 | j_mayer | #include "op_helper.h" |
27 | 4c9649a9 | j_mayer | |
28 | 4c9649a9 | j_mayer | #define REG 0 |
29 | 4c9649a9 | j_mayer | #include "op_template.h" |
30 | 4c9649a9 | j_mayer | |
31 | 4c9649a9 | j_mayer | #define REG 1 |
32 | 4c9649a9 | j_mayer | #include "op_template.h" |
33 | 4c9649a9 | j_mayer | |
34 | 4c9649a9 | j_mayer | #define REG 2 |
35 | 4c9649a9 | j_mayer | #include "op_template.h" |
36 | 4c9649a9 | j_mayer | |
37 | 4c9649a9 | j_mayer | #define REG 3 |
38 | 4c9649a9 | j_mayer | #include "op_template.h" |
39 | 4c9649a9 | j_mayer | |
40 | 4c9649a9 | j_mayer | #define REG 4 |
41 | 4c9649a9 | j_mayer | #include "op_template.h" |
42 | 4c9649a9 | j_mayer | |
43 | 4c9649a9 | j_mayer | #define REG 5 |
44 | 4c9649a9 | j_mayer | #include "op_template.h" |
45 | 4c9649a9 | j_mayer | |
46 | 4c9649a9 | j_mayer | #define REG 6 |
47 | 4c9649a9 | j_mayer | #include "op_template.h" |
48 | 4c9649a9 | j_mayer | |
49 | 4c9649a9 | j_mayer | #define REG 7 |
50 | 4c9649a9 | j_mayer | #include "op_template.h" |
51 | 4c9649a9 | j_mayer | |
52 | 4c9649a9 | j_mayer | #define REG 8 |
53 | 4c9649a9 | j_mayer | #include "op_template.h" |
54 | 4c9649a9 | j_mayer | |
55 | 4c9649a9 | j_mayer | #define REG 9 |
56 | 4c9649a9 | j_mayer | #include "op_template.h" |
57 | 4c9649a9 | j_mayer | |
58 | 4c9649a9 | j_mayer | #define REG 10 |
59 | 4c9649a9 | j_mayer | #include "op_template.h" |
60 | 4c9649a9 | j_mayer | |
61 | 4c9649a9 | j_mayer | #define REG 11 |
62 | 4c9649a9 | j_mayer | #include "op_template.h" |
63 | 4c9649a9 | j_mayer | |
64 | 4c9649a9 | j_mayer | #define REG 12 |
65 | 4c9649a9 | j_mayer | #include "op_template.h" |
66 | 4c9649a9 | j_mayer | |
67 | 4c9649a9 | j_mayer | #define REG 13 |
68 | 4c9649a9 | j_mayer | #include "op_template.h" |
69 | 4c9649a9 | j_mayer | |
70 | 4c9649a9 | j_mayer | #define REG 14 |
71 | 4c9649a9 | j_mayer | #include "op_template.h" |
72 | 4c9649a9 | j_mayer | |
73 | 4c9649a9 | j_mayer | #define REG 15 |
74 | 4c9649a9 | j_mayer | #include "op_template.h" |
75 | 4c9649a9 | j_mayer | |
76 | 4c9649a9 | j_mayer | #define REG 16 |
77 | 4c9649a9 | j_mayer | #include "op_template.h" |
78 | 4c9649a9 | j_mayer | |
79 | 4c9649a9 | j_mayer | #define REG 17 |
80 | 4c9649a9 | j_mayer | #include "op_template.h" |
81 | 4c9649a9 | j_mayer | |
82 | 4c9649a9 | j_mayer | #define REG 18 |
83 | 4c9649a9 | j_mayer | #include "op_template.h" |
84 | 4c9649a9 | j_mayer | |
85 | 4c9649a9 | j_mayer | #define REG 19 |
86 | 4c9649a9 | j_mayer | #include "op_template.h" |
87 | 4c9649a9 | j_mayer | |
88 | 4c9649a9 | j_mayer | #define REG 20 |
89 | 4c9649a9 | j_mayer | #include "op_template.h" |
90 | 4c9649a9 | j_mayer | |
91 | 4c9649a9 | j_mayer | #define REG 21 |
92 | 4c9649a9 | j_mayer | #include "op_template.h" |
93 | 4c9649a9 | j_mayer | |
94 | 4c9649a9 | j_mayer | #define REG 22 |
95 | 4c9649a9 | j_mayer | #include "op_template.h" |
96 | 4c9649a9 | j_mayer | |
97 | 4c9649a9 | j_mayer | #define REG 23 |
98 | 4c9649a9 | j_mayer | #include "op_template.h" |
99 | 4c9649a9 | j_mayer | |
100 | 4c9649a9 | j_mayer | #define REG 24 |
101 | 4c9649a9 | j_mayer | #include "op_template.h" |
102 | 4c9649a9 | j_mayer | |
103 | 4c9649a9 | j_mayer | #define REG 25 |
104 | 4c9649a9 | j_mayer | #include "op_template.h" |
105 | 4c9649a9 | j_mayer | |
106 | 4c9649a9 | j_mayer | #define REG 26 |
107 | 4c9649a9 | j_mayer | #include "op_template.h" |
108 | 4c9649a9 | j_mayer | |
109 | 4c9649a9 | j_mayer | #define REG 27 |
110 | 4c9649a9 | j_mayer | #include "op_template.h" |
111 | 4c9649a9 | j_mayer | |
112 | 4c9649a9 | j_mayer | #define REG 28 |
113 | 4c9649a9 | j_mayer | #include "op_template.h" |
114 | 4c9649a9 | j_mayer | |
115 | 4c9649a9 | j_mayer | #define REG 29 |
116 | 4c9649a9 | j_mayer | #include "op_template.h" |
117 | 4c9649a9 | j_mayer | |
118 | 4c9649a9 | j_mayer | #define REG 30 |
119 | 4c9649a9 | j_mayer | #include "op_template.h" |
120 | 4c9649a9 | j_mayer | |
121 | 4c9649a9 | j_mayer | #define REG 31 |
122 | 4c9649a9 | j_mayer | #include "op_template.h" |
123 | 4c9649a9 | j_mayer | |
124 | 4c9649a9 | j_mayer | /* Debug stuff */
|
125 | 4c9649a9 | j_mayer | void OPPROTO op_no_op (void) |
126 | 4c9649a9 | j_mayer | { |
127 | 4c9649a9 | j_mayer | #if !defined (DEBUG_OP)
|
128 | 4c9649a9 | j_mayer | __asm__ __volatile__("nop" : : : "memory"); |
129 | 4c9649a9 | j_mayer | #endif
|
130 | 4c9649a9 | j_mayer | RETURN(); |
131 | 4c9649a9 | j_mayer | } |
132 | 4c9649a9 | j_mayer | |
133 | 4c9649a9 | j_mayer | void OPPROTO op_tb_flush (void) |
134 | 4c9649a9 | j_mayer | { |
135 | 4c9649a9 | j_mayer | helper_tb_flush(); |
136 | 4c9649a9 | j_mayer | RETURN(); |
137 | 4c9649a9 | j_mayer | } |
138 | 4c9649a9 | j_mayer | |
139 | 4c9649a9 | j_mayer | /* Load and stores */
|
140 | 4c9649a9 | j_mayer | #define MEMSUFFIX _raw
|
141 | 4c9649a9 | j_mayer | #include "op_mem.h" |
142 | 4c9649a9 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
143 | 4c9649a9 | j_mayer | #define MEMSUFFIX _user
|
144 | 4c9649a9 | j_mayer | #include "op_mem.h" |
145 | 4c9649a9 | j_mayer | #define MEMSUFFIX _kernel
|
146 | 4c9649a9 | j_mayer | #include "op_mem.h" |
147 | 4c9649a9 | j_mayer | /* Those are used for supervisor, executive and pal modes */
|
148 | 4c9649a9 | j_mayer | #define MEMSUFFIX _data
|
149 | 4c9649a9 | j_mayer | #include "op_mem.h" |
150 | 4c9649a9 | j_mayer | #endif
|
151 | 4c9649a9 | j_mayer | |
152 | 4c9649a9 | j_mayer | /* Special operation for load and store */
|
153 | 4c9649a9 | j_mayer | void OPPROTO op_n7 (void) |
154 | 4c9649a9 | j_mayer | { |
155 | 4c9649a9 | j_mayer | T0 &= ~(uint64_t)0x7;
|
156 | 4c9649a9 | j_mayer | RETURN(); |
157 | 4c9649a9 | j_mayer | } |
158 | 4c9649a9 | j_mayer | |
159 | 4c9649a9 | j_mayer | /* Misc */
|
160 | 4c9649a9 | j_mayer | void OPPROTO op_excp (void) |
161 | 4c9649a9 | j_mayer | { |
162 | 4c9649a9 | j_mayer | helper_excp(PARAM(1), PARAM(2)); |
163 | 4c9649a9 | j_mayer | RETURN(); |
164 | 4c9649a9 | j_mayer | } |
165 | 4c9649a9 | j_mayer | |
166 | 4c9649a9 | j_mayer | void OPPROTO op_load_amask (void) |
167 | 4c9649a9 | j_mayer | { |
168 | 4c9649a9 | j_mayer | helper_amask(); |
169 | 4c9649a9 | j_mayer | RETURN(); |
170 | 4c9649a9 | j_mayer | } |
171 | 4c9649a9 | j_mayer | |
172 | 4c9649a9 | j_mayer | void OPPROTO op_load_pcc (void) |
173 | 4c9649a9 | j_mayer | { |
174 | 4c9649a9 | j_mayer | helper_load_pcc(); |
175 | 4c9649a9 | j_mayer | RETURN(); |
176 | 4c9649a9 | j_mayer | } |
177 | 4c9649a9 | j_mayer | |
178 | 4c9649a9 | j_mayer | void OPPROTO op_load_implver (void) |
179 | 4c9649a9 | j_mayer | { |
180 | 4c9649a9 | j_mayer | helper_load_implver(); |
181 | 4c9649a9 | j_mayer | RETURN(); |
182 | 4c9649a9 | j_mayer | } |
183 | 4c9649a9 | j_mayer | |
184 | 4c9649a9 | j_mayer | void OPPROTO op_load_fpcr (void) |
185 | 4c9649a9 | j_mayer | { |
186 | 4c9649a9 | j_mayer | helper_load_fpcr(); |
187 | 4c9649a9 | j_mayer | RETURN(); |
188 | 4c9649a9 | j_mayer | } |
189 | 4c9649a9 | j_mayer | |
190 | 4c9649a9 | j_mayer | void OPPROTO op_store_fpcr (void) |
191 | 4c9649a9 | j_mayer | { |
192 | 4c9649a9 | j_mayer | helper_store_fpcr(); |
193 | 4c9649a9 | j_mayer | RETURN(); |
194 | 4c9649a9 | j_mayer | } |
195 | 4c9649a9 | j_mayer | |
196 | 4c9649a9 | j_mayer | void OPPROTO op_load_irf (void) |
197 | 4c9649a9 | j_mayer | { |
198 | 4c9649a9 | j_mayer | helper_load_irf(); |
199 | 4c9649a9 | j_mayer | RETURN(); |
200 | 4c9649a9 | j_mayer | } |
201 | 4c9649a9 | j_mayer | |
202 | 4c9649a9 | j_mayer | void OPPROTO op_set_irf (void) |
203 | 4c9649a9 | j_mayer | { |
204 | 4c9649a9 | j_mayer | helper_set_irf(); |
205 | 4c9649a9 | j_mayer | RETURN(); |
206 | 4c9649a9 | j_mayer | } |
207 | 4c9649a9 | j_mayer | |
208 | 4c9649a9 | j_mayer | void OPPROTO op_clear_irf (void) |
209 | 4c9649a9 | j_mayer | { |
210 | 4c9649a9 | j_mayer | helper_clear_irf(); |
211 | 4c9649a9 | j_mayer | RETURN(); |
212 | 4c9649a9 | j_mayer | } |
213 | 4c9649a9 | j_mayer | |
214 | 4c9649a9 | j_mayer | void OPPROTO op_exit_tb (void) |
215 | 4c9649a9 | j_mayer | { |
216 | 4c9649a9 | j_mayer | EXIT_TB(); |
217 | 4c9649a9 | j_mayer | } |
218 | 4c9649a9 | j_mayer | |
219 | 4c9649a9 | j_mayer | /* Arithmetic */
|
220 | 4c9649a9 | j_mayer | void OPPROTO op_addq (void) |
221 | 4c9649a9 | j_mayer | { |
222 | 4c9649a9 | j_mayer | T0 += T1; |
223 | 4c9649a9 | j_mayer | RETURN(); |
224 | 4c9649a9 | j_mayer | } |
225 | 4c9649a9 | j_mayer | |
226 | 4c9649a9 | j_mayer | void OPPROTO op_addqv (void) |
227 | 4c9649a9 | j_mayer | { |
228 | 4c9649a9 | j_mayer | helper_addqv(); |
229 | 4c9649a9 | j_mayer | RETURN(); |
230 | 4c9649a9 | j_mayer | } |
231 | 4c9649a9 | j_mayer | |
232 | 4c9649a9 | j_mayer | void OPPROTO op_addl (void) |
233 | 4c9649a9 | j_mayer | { |
234 | 4c9649a9 | j_mayer | T0 = (int64_t)((int32_t)(T0 + T1)); |
235 | 4c9649a9 | j_mayer | RETURN(); |
236 | 4c9649a9 | j_mayer | } |
237 | 4c9649a9 | j_mayer | |
238 | 4c9649a9 | j_mayer | void OPPROTO op_addlv (void) |
239 | 4c9649a9 | j_mayer | { |
240 | 4c9649a9 | j_mayer | helper_addlv(); |
241 | 4c9649a9 | j_mayer | RETURN(); |
242 | 4c9649a9 | j_mayer | } |
243 | 4c9649a9 | j_mayer | |
244 | 4c9649a9 | j_mayer | void OPPROTO op_subq (void) |
245 | 4c9649a9 | j_mayer | { |
246 | 4c9649a9 | j_mayer | T0 -= T1; |
247 | 4c9649a9 | j_mayer | RETURN(); |
248 | 4c9649a9 | j_mayer | } |
249 | 4c9649a9 | j_mayer | |
250 | 4c9649a9 | j_mayer | void OPPROTO op_subqv (void) |
251 | 4c9649a9 | j_mayer | { |
252 | 4c9649a9 | j_mayer | helper_subqv(); |
253 | 4c9649a9 | j_mayer | RETURN(); |
254 | 4c9649a9 | j_mayer | } |
255 | 4c9649a9 | j_mayer | |
256 | 4c9649a9 | j_mayer | void OPPROTO op_subl (void) |
257 | 4c9649a9 | j_mayer | { |
258 | 4c9649a9 | j_mayer | T0 = (int64_t)((int32_t)(T0 - T1)); |
259 | 4c9649a9 | j_mayer | RETURN(); |
260 | 4c9649a9 | j_mayer | } |
261 | 4c9649a9 | j_mayer | |
262 | 4c9649a9 | j_mayer | void OPPROTO op_sublv (void) |
263 | 4c9649a9 | j_mayer | { |
264 | 4c9649a9 | j_mayer | helper_sublv(); |
265 | 4c9649a9 | j_mayer | RETURN(); |
266 | 4c9649a9 | j_mayer | } |
267 | 4c9649a9 | j_mayer | |
268 | 4c9649a9 | j_mayer | void OPPROTO op_s4 (void) |
269 | 4c9649a9 | j_mayer | { |
270 | 4c9649a9 | j_mayer | T0 <<= 2;
|
271 | 4c9649a9 | j_mayer | RETURN(); |
272 | 4c9649a9 | j_mayer | } |
273 | 4c9649a9 | j_mayer | |
274 | 4c9649a9 | j_mayer | void OPPROTO op_s8 (void) |
275 | 4c9649a9 | j_mayer | { |
276 | 4c9649a9 | j_mayer | T0 <<= 3;
|
277 | 4c9649a9 | j_mayer | RETURN(); |
278 | 4c9649a9 | j_mayer | } |
279 | 4c9649a9 | j_mayer | |
280 | 4c9649a9 | j_mayer | void OPPROTO op_mull (void) |
281 | 4c9649a9 | j_mayer | { |
282 | 4c9649a9 | j_mayer | T0 = (int64_t)((int32_t)T0 * (int32_t)T1); |
283 | 4c9649a9 | j_mayer | RETURN(); |
284 | 4c9649a9 | j_mayer | } |
285 | 4c9649a9 | j_mayer | |
286 | 4c9649a9 | j_mayer | void OPPROTO op_mullv (void) |
287 | 4c9649a9 | j_mayer | { |
288 | 4c9649a9 | j_mayer | helper_mullv(); |
289 | 4c9649a9 | j_mayer | RETURN(); |
290 | 4c9649a9 | j_mayer | } |
291 | 4c9649a9 | j_mayer | |
292 | 4c9649a9 | j_mayer | void OPPROTO op_mulq (void) |
293 | 4c9649a9 | j_mayer | { |
294 | 4c9649a9 | j_mayer | T0 *= T1; |
295 | 4c9649a9 | j_mayer | RETURN(); |
296 | 4c9649a9 | j_mayer | } |
297 | 4c9649a9 | j_mayer | |
298 | 4c9649a9 | j_mayer | void OPPROTO op_mulqv (void) |
299 | 4c9649a9 | j_mayer | { |
300 | 4c9649a9 | j_mayer | helper_mulqv(); |
301 | 4c9649a9 | j_mayer | RETURN(); |
302 | 4c9649a9 | j_mayer | } |
303 | 4c9649a9 | j_mayer | |
304 | 4c9649a9 | j_mayer | void OPPROTO op_umulh (void) |
305 | 4c9649a9 | j_mayer | { |
306 | 4c9649a9 | j_mayer | helper_umulh(); |
307 | 4c9649a9 | j_mayer | RETURN(); |
308 | 4c9649a9 | j_mayer | } |
309 | 4c9649a9 | j_mayer | |
310 | 4c9649a9 | j_mayer | /* Logical */
|
311 | 4c9649a9 | j_mayer | void OPPROTO op_and (void) |
312 | 4c9649a9 | j_mayer | { |
313 | 4c9649a9 | j_mayer | T0 &= T1; |
314 | 4c9649a9 | j_mayer | RETURN(); |
315 | 4c9649a9 | j_mayer | } |
316 | 4c9649a9 | j_mayer | |
317 | 4c9649a9 | j_mayer | void OPPROTO op_bic (void) |
318 | 4c9649a9 | j_mayer | { |
319 | 4c9649a9 | j_mayer | T0 &= ~T1; |
320 | 4c9649a9 | j_mayer | RETURN(); |
321 | 4c9649a9 | j_mayer | } |
322 | 4c9649a9 | j_mayer | |
323 | 4c9649a9 | j_mayer | void OPPROTO op_bis (void) |
324 | 4c9649a9 | j_mayer | { |
325 | 4c9649a9 | j_mayer | T0 |= T1; |
326 | 4c9649a9 | j_mayer | RETURN(); |
327 | 4c9649a9 | j_mayer | } |
328 | 4c9649a9 | j_mayer | |
329 | 4c9649a9 | j_mayer | void OPPROTO op_eqv (void) |
330 | 4c9649a9 | j_mayer | { |
331 | 4c9649a9 | j_mayer | T0 ^= ~T1; |
332 | 4c9649a9 | j_mayer | RETURN(); |
333 | 4c9649a9 | j_mayer | } |
334 | 4c9649a9 | j_mayer | |
335 | 4c9649a9 | j_mayer | void OPPROTO op_ornot (void) |
336 | 4c9649a9 | j_mayer | { |
337 | 4c9649a9 | j_mayer | T0 |= ~T1; |
338 | 4c9649a9 | j_mayer | RETURN(); |
339 | 4c9649a9 | j_mayer | } |
340 | 4c9649a9 | j_mayer | |
341 | 4c9649a9 | j_mayer | void OPPROTO op_xor (void) |
342 | 4c9649a9 | j_mayer | { |
343 | 4c9649a9 | j_mayer | T0 ^= T1; |
344 | 4c9649a9 | j_mayer | RETURN(); |
345 | 4c9649a9 | j_mayer | } |
346 | 4c9649a9 | j_mayer | |
347 | 4c9649a9 | j_mayer | void OPPROTO op_sll (void) |
348 | 4c9649a9 | j_mayer | { |
349 | 4c9649a9 | j_mayer | T0 <<= T1; |
350 | 4c9649a9 | j_mayer | RETURN(); |
351 | 4c9649a9 | j_mayer | } |
352 | 4c9649a9 | j_mayer | |
353 | 4c9649a9 | j_mayer | void OPPROTO op_srl (void) |
354 | 4c9649a9 | j_mayer | { |
355 | 4c9649a9 | j_mayer | T0 >>= T1; |
356 | 4c9649a9 | j_mayer | RETURN(); |
357 | 4c9649a9 | j_mayer | } |
358 | 4c9649a9 | j_mayer | |
359 | 4c9649a9 | j_mayer | void OPPROTO op_sra (void) |
360 | 4c9649a9 | j_mayer | { |
361 | 4c9649a9 | j_mayer | T0 = (int64_t)T0 >> T1; |
362 | 4c9649a9 | j_mayer | RETURN(); |
363 | 4c9649a9 | j_mayer | } |
364 | 4c9649a9 | j_mayer | |
365 | 4c9649a9 | j_mayer | void OPPROTO op_sextb (void) |
366 | 4c9649a9 | j_mayer | { |
367 | 4c9649a9 | j_mayer | T0 = (int64_t)((int8_t)T0); |
368 | 4c9649a9 | j_mayer | RETURN(); |
369 | 4c9649a9 | j_mayer | } |
370 | 4c9649a9 | j_mayer | |
371 | 4c9649a9 | j_mayer | void OPPROTO op_sextw (void) |
372 | 4c9649a9 | j_mayer | { |
373 | 4c9649a9 | j_mayer | T0 = (int64_t)((int16_t)T0); |
374 | 4c9649a9 | j_mayer | RETURN(); |
375 | 4c9649a9 | j_mayer | |
376 | 4c9649a9 | j_mayer | } |
377 | 4c9649a9 | j_mayer | |
378 | 4c9649a9 | j_mayer | void OPPROTO op_ctpop (void) |
379 | 4c9649a9 | j_mayer | { |
380 | 4c9649a9 | j_mayer | helper_ctpop(); |
381 | 4c9649a9 | j_mayer | RETURN(); |
382 | 4c9649a9 | j_mayer | } |
383 | 4c9649a9 | j_mayer | |
384 | 4c9649a9 | j_mayer | void OPPROTO op_ctlz (void) |
385 | 4c9649a9 | j_mayer | { |
386 | 4c9649a9 | j_mayer | helper_ctlz(); |
387 | 4c9649a9 | j_mayer | RETURN(); |
388 | 4c9649a9 | j_mayer | } |
389 | 4c9649a9 | j_mayer | |
390 | 4c9649a9 | j_mayer | void OPPROTO op_cttz (void) |
391 | 4c9649a9 | j_mayer | { |
392 | 4c9649a9 | j_mayer | helper_cttz(); |
393 | 4c9649a9 | j_mayer | RETURN(); |
394 | 4c9649a9 | j_mayer | } |
395 | 4c9649a9 | j_mayer | |
396 | 4c9649a9 | j_mayer | void OPPROTO op_mskbl (void) |
397 | 4c9649a9 | j_mayer | { |
398 | 4c9649a9 | j_mayer | helper_mskbl(); |
399 | 4c9649a9 | j_mayer | RETURN(); |
400 | 4c9649a9 | j_mayer | } |
401 | 4c9649a9 | j_mayer | |
402 | 4c9649a9 | j_mayer | void OPPROTO op_extbl (void) |
403 | 4c9649a9 | j_mayer | { |
404 | 4c9649a9 | j_mayer | helper_extbl(); |
405 | 4c9649a9 | j_mayer | RETURN(); |
406 | 4c9649a9 | j_mayer | } |
407 | 4c9649a9 | j_mayer | |
408 | 4c9649a9 | j_mayer | void OPPROTO op_insbl (void) |
409 | 4c9649a9 | j_mayer | { |
410 | 4c9649a9 | j_mayer | helper_insbl(); |
411 | 4c9649a9 | j_mayer | RETURN(); |
412 | 4c9649a9 | j_mayer | } |
413 | 4c9649a9 | j_mayer | |
414 | 4c9649a9 | j_mayer | void OPPROTO op_mskwl (void) |
415 | 4c9649a9 | j_mayer | { |
416 | 4c9649a9 | j_mayer | helper_mskwl(); |
417 | 4c9649a9 | j_mayer | RETURN(); |
418 | 4c9649a9 | j_mayer | } |
419 | 4c9649a9 | j_mayer | |
420 | 4c9649a9 | j_mayer | void OPPROTO op_extwl (void) |
421 | 4c9649a9 | j_mayer | { |
422 | 4c9649a9 | j_mayer | helper_extwl(); |
423 | 4c9649a9 | j_mayer | RETURN(); |
424 | 4c9649a9 | j_mayer | } |
425 | 4c9649a9 | j_mayer | |
426 | 4c9649a9 | j_mayer | void OPPROTO op_inswl (void) |
427 | 4c9649a9 | j_mayer | { |
428 | 4c9649a9 | j_mayer | helper_inswl(); |
429 | 4c9649a9 | j_mayer | RETURN(); |
430 | 4c9649a9 | j_mayer | } |
431 | 4c9649a9 | j_mayer | |
432 | 4c9649a9 | j_mayer | void OPPROTO op_mskll (void) |
433 | 4c9649a9 | j_mayer | { |
434 | 4c9649a9 | j_mayer | helper_mskll(); |
435 | 4c9649a9 | j_mayer | RETURN(); |
436 | 4c9649a9 | j_mayer | } |
437 | 4c9649a9 | j_mayer | |
438 | 4c9649a9 | j_mayer | void OPPROTO op_extll (void) |
439 | 4c9649a9 | j_mayer | { |
440 | 4c9649a9 | j_mayer | helper_extll(); |
441 | 4c9649a9 | j_mayer | RETURN(); |
442 | 4c9649a9 | j_mayer | } |
443 | 4c9649a9 | j_mayer | |
444 | 4c9649a9 | j_mayer | void OPPROTO op_insll (void) |
445 | 4c9649a9 | j_mayer | { |
446 | 4c9649a9 | j_mayer | helper_insll(); |
447 | 4c9649a9 | j_mayer | RETURN(); |
448 | 4c9649a9 | j_mayer | } |
449 | 4c9649a9 | j_mayer | |
450 | 4c9649a9 | j_mayer | void OPPROTO op_zap (void) |
451 | 4c9649a9 | j_mayer | { |
452 | 4c9649a9 | j_mayer | helper_zap(); |
453 | 4c9649a9 | j_mayer | RETURN(); |
454 | 4c9649a9 | j_mayer | } |
455 | 4c9649a9 | j_mayer | |
456 | 4c9649a9 | j_mayer | void OPPROTO op_zapnot (void) |
457 | 4c9649a9 | j_mayer | { |
458 | 4c9649a9 | j_mayer | helper_zapnot(); |
459 | 4c9649a9 | j_mayer | RETURN(); |
460 | 4c9649a9 | j_mayer | } |
461 | 4c9649a9 | j_mayer | |
462 | 4c9649a9 | j_mayer | void OPPROTO op_mskql (void) |
463 | 4c9649a9 | j_mayer | { |
464 | 4c9649a9 | j_mayer | helper_mskql(); |
465 | 4c9649a9 | j_mayer | RETURN(); |
466 | 4c9649a9 | j_mayer | } |
467 | 4c9649a9 | j_mayer | |
468 | 4c9649a9 | j_mayer | void OPPROTO op_extql (void) |
469 | 4c9649a9 | j_mayer | { |
470 | 4c9649a9 | j_mayer | helper_extql(); |
471 | 4c9649a9 | j_mayer | RETURN(); |
472 | 4c9649a9 | j_mayer | } |
473 | 4c9649a9 | j_mayer | |
474 | 4c9649a9 | j_mayer | void OPPROTO op_insql (void) |
475 | 4c9649a9 | j_mayer | { |
476 | 4c9649a9 | j_mayer | helper_insql(); |
477 | 4c9649a9 | j_mayer | RETURN(); |
478 | 4c9649a9 | j_mayer | } |
479 | 4c9649a9 | j_mayer | |
480 | 4c9649a9 | j_mayer | void OPPROTO op_mskwh (void) |
481 | 4c9649a9 | j_mayer | { |
482 | 4c9649a9 | j_mayer | helper_mskwh(); |
483 | 4c9649a9 | j_mayer | RETURN(); |
484 | 4c9649a9 | j_mayer | } |
485 | 4c9649a9 | j_mayer | |
486 | 4c9649a9 | j_mayer | void OPPROTO op_inswh (void) |
487 | 4c9649a9 | j_mayer | { |
488 | 4c9649a9 | j_mayer | helper_inswh(); |
489 | 4c9649a9 | j_mayer | RETURN(); |
490 | 4c9649a9 | j_mayer | } |
491 | 4c9649a9 | j_mayer | |
492 | 4c9649a9 | j_mayer | void OPPROTO op_extwh (void) |
493 | 4c9649a9 | j_mayer | { |
494 | 4c9649a9 | j_mayer | helper_extwh(); |
495 | 4c9649a9 | j_mayer | RETURN(); |
496 | 4c9649a9 | j_mayer | } |
497 | 4c9649a9 | j_mayer | |
498 | 4c9649a9 | j_mayer | void OPPROTO op_msklh (void) |
499 | 4c9649a9 | j_mayer | { |
500 | 4c9649a9 | j_mayer | helper_msklh(); |
501 | 4c9649a9 | j_mayer | RETURN(); |
502 | 4c9649a9 | j_mayer | } |
503 | 4c9649a9 | j_mayer | |
504 | 4c9649a9 | j_mayer | void OPPROTO op_inslh (void) |
505 | 4c9649a9 | j_mayer | { |
506 | 4c9649a9 | j_mayer | helper_inslh(); |
507 | 4c9649a9 | j_mayer | RETURN(); |
508 | 4c9649a9 | j_mayer | } |
509 | 4c9649a9 | j_mayer | |
510 | 4c9649a9 | j_mayer | void OPPROTO op_extlh (void) |
511 | 4c9649a9 | j_mayer | { |
512 | 4c9649a9 | j_mayer | helper_extlh(); |
513 | 4c9649a9 | j_mayer | RETURN(); |
514 | 4c9649a9 | j_mayer | } |
515 | 4c9649a9 | j_mayer | |
516 | 4c9649a9 | j_mayer | void OPPROTO op_mskqh (void) |
517 | 4c9649a9 | j_mayer | { |
518 | 4c9649a9 | j_mayer | helper_mskqh(); |
519 | 4c9649a9 | j_mayer | RETURN(); |
520 | 4c9649a9 | j_mayer | } |
521 | 4c9649a9 | j_mayer | |
522 | 4c9649a9 | j_mayer | void OPPROTO op_insqh (void) |
523 | 4c9649a9 | j_mayer | { |
524 | 4c9649a9 | j_mayer | helper_insqh(); |
525 | 4c9649a9 | j_mayer | RETURN(); |
526 | 4c9649a9 | j_mayer | } |
527 | 4c9649a9 | j_mayer | |
528 | 4c9649a9 | j_mayer | void OPPROTO op_extqh (void) |
529 | 4c9649a9 | j_mayer | { |
530 | 4c9649a9 | j_mayer | helper_extqh(); |
531 | 4c9649a9 | j_mayer | RETURN(); |
532 | 4c9649a9 | j_mayer | } |
533 | 4c9649a9 | j_mayer | |
534 | 4c9649a9 | j_mayer | /* Tests */
|
535 | 4c9649a9 | j_mayer | void OPPROTO op_cmpult (void) |
536 | 4c9649a9 | j_mayer | { |
537 | 4c9649a9 | j_mayer | if (T0 < T1)
|
538 | 4c9649a9 | j_mayer | T0 = 1;
|
539 | 4c9649a9 | j_mayer | else
|
540 | 4c9649a9 | j_mayer | T0 = 0;
|
541 | 4c9649a9 | j_mayer | RETURN(); |
542 | 4c9649a9 | j_mayer | } |
543 | 4c9649a9 | j_mayer | |
544 | 4c9649a9 | j_mayer | void OPPROTO op_cmpule (void) |
545 | 4c9649a9 | j_mayer | { |
546 | 4c9649a9 | j_mayer | if (T0 <= T1)
|
547 | 4c9649a9 | j_mayer | T0 = 1;
|
548 | 4c9649a9 | j_mayer | else
|
549 | 4c9649a9 | j_mayer | T0 = 0;
|
550 | 4c9649a9 | j_mayer | RETURN(); |
551 | 4c9649a9 | j_mayer | } |
552 | 4c9649a9 | j_mayer | |
553 | 4c9649a9 | j_mayer | void OPPROTO op_cmpeq (void) |
554 | 4c9649a9 | j_mayer | { |
555 | 4c9649a9 | j_mayer | if (T0 == T1)
|
556 | 4c9649a9 | j_mayer | T0 = 1;
|
557 | 4c9649a9 | j_mayer | else
|
558 | 4c9649a9 | j_mayer | T0 = 0;
|
559 | 4c9649a9 | j_mayer | RETURN(); |
560 | 4c9649a9 | j_mayer | } |
561 | 4c9649a9 | j_mayer | |
562 | 4c9649a9 | j_mayer | void OPPROTO op_cmplt (void) |
563 | 4c9649a9 | j_mayer | { |
564 | 4c9649a9 | j_mayer | if ((int64_t)T0 < (int64_t)T1)
|
565 | 4c9649a9 | j_mayer | T0 = 1;
|
566 | 4c9649a9 | j_mayer | else
|
567 | 4c9649a9 | j_mayer | T0 = 0;
|
568 | 4c9649a9 | j_mayer | RETURN(); |
569 | 4c9649a9 | j_mayer | } |
570 | 4c9649a9 | j_mayer | |
571 | 4c9649a9 | j_mayer | void OPPROTO op_cmple (void) |
572 | 4c9649a9 | j_mayer | { |
573 | 4c9649a9 | j_mayer | if ((int64_t)T0 <= (int64_t)T1)
|
574 | 4c9649a9 | j_mayer | T0 = 1;
|
575 | 4c9649a9 | j_mayer | else
|
576 | 4c9649a9 | j_mayer | T0 = 0;
|
577 | 4c9649a9 | j_mayer | RETURN(); |
578 | 4c9649a9 | j_mayer | } |
579 | 4c9649a9 | j_mayer | |
580 | 4c9649a9 | j_mayer | void OPPROTO op_cmpbge (void) |
581 | 4c9649a9 | j_mayer | { |
582 | 4c9649a9 | j_mayer | helper_cmpbge(); |
583 | 4c9649a9 | j_mayer | RETURN(); |
584 | 4c9649a9 | j_mayer | } |
585 | 4c9649a9 | j_mayer | |
586 | 4c9649a9 | j_mayer | void OPPROTO op_cmpeqz (void) |
587 | 4c9649a9 | j_mayer | { |
588 | 4c9649a9 | j_mayer | if (T0 == 0) |
589 | 4c9649a9 | j_mayer | T0 = 1;
|
590 | 4c9649a9 | j_mayer | else
|
591 | 4c9649a9 | j_mayer | T0 = 0;
|
592 | 4c9649a9 | j_mayer | RETURN(); |
593 | 4c9649a9 | j_mayer | } |
594 | 4c9649a9 | j_mayer | |
595 | 4c9649a9 | j_mayer | void OPPROTO op_cmpnez (void) |
596 | 4c9649a9 | j_mayer | { |
597 | 4c9649a9 | j_mayer | if (T0 != 0) |
598 | 4c9649a9 | j_mayer | T0 = 1;
|
599 | 4c9649a9 | j_mayer | else
|
600 | 4c9649a9 | j_mayer | T0 = 0;
|
601 | 4c9649a9 | j_mayer | RETURN(); |
602 | 4c9649a9 | j_mayer | } |
603 | 4c9649a9 | j_mayer | |
604 | 4c9649a9 | j_mayer | void OPPROTO op_cmpltz (void) |
605 | 4c9649a9 | j_mayer | { |
606 | 4c9649a9 | j_mayer | if ((int64_t)T0 < 0) |
607 | 4c9649a9 | j_mayer | T0 = 1;
|
608 | 4c9649a9 | j_mayer | else
|
609 | 4c9649a9 | j_mayer | T0 = 0;
|
610 | 4c9649a9 | j_mayer | RETURN(); |
611 | 4c9649a9 | j_mayer | } |
612 | 4c9649a9 | j_mayer | |
613 | 4c9649a9 | j_mayer | void OPPROTO op_cmplez (void) |
614 | 4c9649a9 | j_mayer | { |
615 | 4c9649a9 | j_mayer | if ((int64_t)T0 <= 0) |
616 | 4c9649a9 | j_mayer | T0 = 1;
|
617 | 4c9649a9 | j_mayer | else
|
618 | 4c9649a9 | j_mayer | T0 = 0;
|
619 | 4c9649a9 | j_mayer | RETURN(); |
620 | 4c9649a9 | j_mayer | } |
621 | 4c9649a9 | j_mayer | |
622 | 4c9649a9 | j_mayer | void OPPROTO op_cmpgtz (void) |
623 | 4c9649a9 | j_mayer | { |
624 | 4c9649a9 | j_mayer | if ((int64_t)T0 > 0) |
625 | 4c9649a9 | j_mayer | T0 = 1;
|
626 | 4c9649a9 | j_mayer | else
|
627 | 4c9649a9 | j_mayer | T0 = 0;
|
628 | 4c9649a9 | j_mayer | RETURN(); |
629 | 4c9649a9 | j_mayer | } |
630 | 4c9649a9 | j_mayer | |
631 | 4c9649a9 | j_mayer | void OPPROTO op_cmpgez (void) |
632 | 4c9649a9 | j_mayer | { |
633 | 4c9649a9 | j_mayer | if ((int64_t)T0 >= 0) |
634 | 4c9649a9 | j_mayer | T0 = 1;
|
635 | 4c9649a9 | j_mayer | else
|
636 | 4c9649a9 | j_mayer | T0 = 0;
|
637 | 4c9649a9 | j_mayer | RETURN(); |
638 | 4c9649a9 | j_mayer | } |
639 | 4c9649a9 | j_mayer | |
640 | 4c9649a9 | j_mayer | void OPPROTO op_cmplbs (void) |
641 | 4c9649a9 | j_mayer | { |
642 | 4c9649a9 | j_mayer | T0 &= 1;
|
643 | 4c9649a9 | j_mayer | RETURN(); |
644 | 4c9649a9 | j_mayer | } |
645 | 4c9649a9 | j_mayer | |
646 | 4c9649a9 | j_mayer | void OPPROTO op_cmplbc (void) |
647 | 4c9649a9 | j_mayer | { |
648 | 4c9649a9 | j_mayer | T0 = (~T0) & 1;
|
649 | 4c9649a9 | j_mayer | RETURN(); |
650 | 4c9649a9 | j_mayer | } |
651 | 4c9649a9 | j_mayer | |
652 | 4c9649a9 | j_mayer | /* Branches */
|
653 | 4c9649a9 | j_mayer | void OPPROTO op_branch (void) |
654 | 4c9649a9 | j_mayer | { |
655 | 4c9649a9 | j_mayer | env->pc = T0 & ~3;
|
656 | 4c9649a9 | j_mayer | RETURN(); |
657 | 4c9649a9 | j_mayer | } |
658 | 4c9649a9 | j_mayer | |
659 | 4c9649a9 | j_mayer | void OPPROTO op_addq1 (void) |
660 | 4c9649a9 | j_mayer | { |
661 | 4c9649a9 | j_mayer | T1 += T0; |
662 | 4c9649a9 | j_mayer | RETURN(); |
663 | 4c9649a9 | j_mayer | } |
664 | 4c9649a9 | j_mayer | |
665 | 4c9649a9 | j_mayer | #if 0 // Qemu does not know how to do this...
|
666 | 4c9649a9 | j_mayer | void OPPROTO op_bcond (void)
|
667 | 4c9649a9 | j_mayer | {
|
668 | 4c9649a9 | j_mayer | if (T0)
|
669 | 4c9649a9 | j_mayer | env->pc = T1 & ~3;
|
670 | 4c9649a9 | j_mayer | else
|
671 | 4c9649a9 | j_mayer | env->pc = PARAM(1);
|
672 | 4c9649a9 | j_mayer | RETURN();
|
673 | 4c9649a9 | j_mayer | }
|
674 | 4c9649a9 | j_mayer | #else
|
675 | 4c9649a9 | j_mayer | void OPPROTO op_bcond (void) |
676 | 4c9649a9 | j_mayer | { |
677 | 4c9649a9 | j_mayer | if (T0)
|
678 | 4c9649a9 | j_mayer | env->pc = T1 & ~3;
|
679 | 4c9649a9 | j_mayer | else
|
680 | 4c9649a9 | j_mayer | env->pc = ((uint64_t)PARAM(1) << 32) | (uint64_t)PARAM(2); |
681 | 4c9649a9 | j_mayer | RETURN(); |
682 | 4c9649a9 | j_mayer | } |
683 | 4c9649a9 | j_mayer | #endif
|
684 | 4c9649a9 | j_mayer | |
685 | 4c9649a9 | j_mayer | #if 0 // Qemu does not know how to do this...
|
686 | 4c9649a9 | j_mayer | void OPPROTO op_update_pc (void)
|
687 | 4c9649a9 | j_mayer | {
|
688 | 4c9649a9 | j_mayer | env->pc = PARAM(1);
|
689 | 4c9649a9 | j_mayer | RETURN();
|
690 | 4c9649a9 | j_mayer | }
|
691 | 4c9649a9 | j_mayer | #else
|
692 | 4c9649a9 | j_mayer | void OPPROTO op_update_pc (void) |
693 | 4c9649a9 | j_mayer | { |
694 | 4c9649a9 | j_mayer | env->pc = ((uint64_t)PARAM(1) << 32) | (uint64_t)PARAM(2); |
695 | 4c9649a9 | j_mayer | RETURN(); |
696 | 4c9649a9 | j_mayer | } |
697 | 4c9649a9 | j_mayer | #endif
|
698 | 4c9649a9 | j_mayer | |
699 | 4c9649a9 | j_mayer | /* Optimization for 32 bits hosts architectures */
|
700 | 4c9649a9 | j_mayer | void OPPROTO op_update_pc32 (void) |
701 | 4c9649a9 | j_mayer | { |
702 | 4c9649a9 | j_mayer | env->pc = (uint64_t)PARAM(1);
|
703 | 4c9649a9 | j_mayer | RETURN(); |
704 | 4c9649a9 | j_mayer | } |
705 | 4c9649a9 | j_mayer | |
706 | 4c9649a9 | j_mayer | /* IEEE floating point arithmetic */
|
707 | 4c9649a9 | j_mayer | /* S floating (single) */
|
708 | 4c9649a9 | j_mayer | void OPPROTO op_adds (void) |
709 | 4c9649a9 | j_mayer | { |
710 | 4c9649a9 | j_mayer | FT0 = float32_add(FT0, FT1, &FP_STATUS); |
711 | 4c9649a9 | j_mayer | RETURN(); |
712 | 4c9649a9 | j_mayer | } |
713 | 4c9649a9 | j_mayer | |
714 | 4c9649a9 | j_mayer | void OPPROTO op_subs (void) |
715 | 4c9649a9 | j_mayer | { |
716 | 4c9649a9 | j_mayer | FT0 = float32_sub(FT0, FT1, &FP_STATUS); |
717 | 4c9649a9 | j_mayer | RETURN(); |
718 | 4c9649a9 | j_mayer | } |
719 | 4c9649a9 | j_mayer | |
720 | 4c9649a9 | j_mayer | void OPPROTO op_muls (void) |
721 | 4c9649a9 | j_mayer | { |
722 | 4c9649a9 | j_mayer | FT0 = float32_mul(FT0, FT1, &FP_STATUS); |
723 | 4c9649a9 | j_mayer | RETURN(); |
724 | 4c9649a9 | j_mayer | } |
725 | 4c9649a9 | j_mayer | |
726 | 4c9649a9 | j_mayer | void OPPROTO op_divs (void) |
727 | 4c9649a9 | j_mayer | { |
728 | 4c9649a9 | j_mayer | FT0 = float32_div(FT0, FT1, &FP_STATUS); |
729 | 4c9649a9 | j_mayer | RETURN(); |
730 | 4c9649a9 | j_mayer | } |
731 | 4c9649a9 | j_mayer | |
732 | 4c9649a9 | j_mayer | void OPPROTO op_sqrts (void) |
733 | 4c9649a9 | j_mayer | { |
734 | 4c9649a9 | j_mayer | helper_sqrts(); |
735 | 4c9649a9 | j_mayer | RETURN(); |
736 | 4c9649a9 | j_mayer | } |
737 | 4c9649a9 | j_mayer | |
738 | 4c9649a9 | j_mayer | void OPPROTO op_cpys (void) |
739 | 4c9649a9 | j_mayer | { |
740 | 4c9649a9 | j_mayer | helper_cpys(); |
741 | 4c9649a9 | j_mayer | RETURN(); |
742 | 4c9649a9 | j_mayer | } |
743 | 4c9649a9 | j_mayer | |
744 | 4c9649a9 | j_mayer | void OPPROTO op_cpysn (void) |
745 | 4c9649a9 | j_mayer | { |
746 | 4c9649a9 | j_mayer | helper_cpysn(); |
747 | 4c9649a9 | j_mayer | RETURN(); |
748 | 4c9649a9 | j_mayer | } |
749 | 4c9649a9 | j_mayer | |
750 | 4c9649a9 | j_mayer | void OPPROTO op_cpyse (void) |
751 | 4c9649a9 | j_mayer | { |
752 | 4c9649a9 | j_mayer | helper_cpyse(); |
753 | 4c9649a9 | j_mayer | RETURN(); |
754 | 4c9649a9 | j_mayer | } |
755 | 4c9649a9 | j_mayer | |
756 | 4c9649a9 | j_mayer | void OPPROTO op_itofs (void) |
757 | 4c9649a9 | j_mayer | { |
758 | 4c9649a9 | j_mayer | helper_itofs(); |
759 | 4c9649a9 | j_mayer | RETURN(); |
760 | 4c9649a9 | j_mayer | } |
761 | 4c9649a9 | j_mayer | |
762 | 4c9649a9 | j_mayer | void OPPROTO op_ftois (void) |
763 | 4c9649a9 | j_mayer | { |
764 | 4c9649a9 | j_mayer | helper_ftois(); |
765 | 4c9649a9 | j_mayer | RETURN(); |
766 | 4c9649a9 | j_mayer | } |
767 | 4c9649a9 | j_mayer | |
768 | 4c9649a9 | j_mayer | /* T floating (double) */
|
769 | 4c9649a9 | j_mayer | void OPPROTO op_addt (void) |
770 | 4c9649a9 | j_mayer | { |
771 | 4c9649a9 | j_mayer | FT0 = float64_add(FT0, FT1, &FP_STATUS); |
772 | 4c9649a9 | j_mayer | RETURN(); |
773 | 4c9649a9 | j_mayer | } |
774 | 4c9649a9 | j_mayer | |
775 | 4c9649a9 | j_mayer | void OPPROTO op_subt (void) |
776 | 4c9649a9 | j_mayer | { |
777 | 4c9649a9 | j_mayer | FT0 = float64_sub(FT0, FT1, &FP_STATUS); |
778 | 4c9649a9 | j_mayer | RETURN(); |
779 | 4c9649a9 | j_mayer | } |
780 | 4c9649a9 | j_mayer | |
781 | 4c9649a9 | j_mayer | void OPPROTO op_mult (void) |
782 | 4c9649a9 | j_mayer | { |
783 | 4c9649a9 | j_mayer | FT0 = float64_mul(FT0, FT1, &FP_STATUS); |
784 | 4c9649a9 | j_mayer | RETURN(); |
785 | 4c9649a9 | j_mayer | } |
786 | 4c9649a9 | j_mayer | |
787 | 4c9649a9 | j_mayer | void OPPROTO op_divt (void) |
788 | 4c9649a9 | j_mayer | { |
789 | 4c9649a9 | j_mayer | FT0 = float64_div(FT0, FT1, &FP_STATUS); |
790 | 4c9649a9 | j_mayer | RETURN(); |
791 | 4c9649a9 | j_mayer | } |
792 | 4c9649a9 | j_mayer | |
793 | 4c9649a9 | j_mayer | void OPPROTO op_sqrtt (void) |
794 | 4c9649a9 | j_mayer | { |
795 | 4c9649a9 | j_mayer | helper_sqrtt(); |
796 | 4c9649a9 | j_mayer | RETURN(); |
797 | 4c9649a9 | j_mayer | } |
798 | 4c9649a9 | j_mayer | |
799 | 4c9649a9 | j_mayer | void OPPROTO op_cmptun (void) |
800 | 4c9649a9 | j_mayer | { |
801 | 4c9649a9 | j_mayer | helper_cmptun(); |
802 | 4c9649a9 | j_mayer | RETURN(); |
803 | 4c9649a9 | j_mayer | } |
804 | 4c9649a9 | j_mayer | |
805 | 4c9649a9 | j_mayer | void OPPROTO op_cmpteq (void) |
806 | 4c9649a9 | j_mayer | { |
807 | 4c9649a9 | j_mayer | helper_cmpteq(); |
808 | 4c9649a9 | j_mayer | RETURN(); |
809 | 4c9649a9 | j_mayer | } |
810 | 4c9649a9 | j_mayer | |
811 | 4c9649a9 | j_mayer | void OPPROTO op_cmptle (void) |
812 | 4c9649a9 | j_mayer | { |
813 | 4c9649a9 | j_mayer | helper_cmptle(); |
814 | 4c9649a9 | j_mayer | RETURN(); |
815 | 4c9649a9 | j_mayer | } |
816 | 4c9649a9 | j_mayer | |
817 | 4c9649a9 | j_mayer | void OPPROTO op_cmptlt (void) |
818 | 4c9649a9 | j_mayer | { |
819 | 4c9649a9 | j_mayer | helper_cmptlt(); |
820 | 4c9649a9 | j_mayer | RETURN(); |
821 | 4c9649a9 | j_mayer | } |
822 | 4c9649a9 | j_mayer | |
823 | 4c9649a9 | j_mayer | void OPPROTO op_itoft (void) |
824 | 4c9649a9 | j_mayer | { |
825 | 4c9649a9 | j_mayer | helper_itoft(); |
826 | 4c9649a9 | j_mayer | RETURN(); |
827 | 4c9649a9 | j_mayer | } |
828 | 4c9649a9 | j_mayer | |
829 | 4c9649a9 | j_mayer | void OPPROTO op_ftoit (void) |
830 | 4c9649a9 | j_mayer | { |
831 | 4c9649a9 | j_mayer | helper_ftoit(); |
832 | 4c9649a9 | j_mayer | RETURN(); |
833 | 4c9649a9 | j_mayer | } |
834 | 4c9649a9 | j_mayer | |
835 | 4c9649a9 | j_mayer | /* VAX floating point arithmetic */
|
836 | 4c9649a9 | j_mayer | /* F floating */
|
837 | 4c9649a9 | j_mayer | void OPPROTO op_addf (void) |
838 | 4c9649a9 | j_mayer | { |
839 | 4c9649a9 | j_mayer | helper_addf(); |
840 | 4c9649a9 | j_mayer | RETURN(); |
841 | 4c9649a9 | j_mayer | } |
842 | 4c9649a9 | j_mayer | |
843 | 4c9649a9 | j_mayer | void OPPROTO op_subf (void) |
844 | 4c9649a9 | j_mayer | { |
845 | 4c9649a9 | j_mayer | helper_subf(); |
846 | 4c9649a9 | j_mayer | RETURN(); |
847 | 4c9649a9 | j_mayer | } |
848 | 4c9649a9 | j_mayer | |
849 | 4c9649a9 | j_mayer | void OPPROTO op_mulf (void) |
850 | 4c9649a9 | j_mayer | { |
851 | 4c9649a9 | j_mayer | helper_mulf(); |
852 | 4c9649a9 | j_mayer | RETURN(); |
853 | 4c9649a9 | j_mayer | } |
854 | 4c9649a9 | j_mayer | |
855 | 4c9649a9 | j_mayer | void OPPROTO op_divf (void) |
856 | 4c9649a9 | j_mayer | { |
857 | 4c9649a9 | j_mayer | helper_divf(); |
858 | 4c9649a9 | j_mayer | RETURN(); |
859 | 4c9649a9 | j_mayer | } |
860 | 4c9649a9 | j_mayer | |
861 | 4c9649a9 | j_mayer | void OPPROTO op_sqrtf (void) |
862 | 4c9649a9 | j_mayer | { |
863 | 4c9649a9 | j_mayer | helper_sqrtf(); |
864 | 4c9649a9 | j_mayer | RETURN(); |
865 | 4c9649a9 | j_mayer | } |
866 | 4c9649a9 | j_mayer | |
867 | 4c9649a9 | j_mayer | void OPPROTO op_cmpfeq (void) |
868 | 4c9649a9 | j_mayer | { |
869 | 4c9649a9 | j_mayer | helper_cmpfeq(); |
870 | 4c9649a9 | j_mayer | RETURN(); |
871 | 4c9649a9 | j_mayer | } |
872 | 4c9649a9 | j_mayer | |
873 | 4c9649a9 | j_mayer | void OPPROTO op_cmpfne (void) |
874 | 4c9649a9 | j_mayer | { |
875 | 4c9649a9 | j_mayer | helper_cmpfne(); |
876 | 4c9649a9 | j_mayer | RETURN(); |
877 | 4c9649a9 | j_mayer | } |
878 | 4c9649a9 | j_mayer | |
879 | 4c9649a9 | j_mayer | void OPPROTO op_cmpflt (void) |
880 | 4c9649a9 | j_mayer | { |
881 | 4c9649a9 | j_mayer | helper_cmpflt(); |
882 | 4c9649a9 | j_mayer | RETURN(); |
883 | 4c9649a9 | j_mayer | } |
884 | 4c9649a9 | j_mayer | |
885 | 4c9649a9 | j_mayer | void OPPROTO op_cmpfle (void) |
886 | 4c9649a9 | j_mayer | { |
887 | 4c9649a9 | j_mayer | helper_cmpfle(); |
888 | 4c9649a9 | j_mayer | RETURN(); |
889 | 4c9649a9 | j_mayer | } |
890 | 4c9649a9 | j_mayer | |
891 | 4c9649a9 | j_mayer | void OPPROTO op_cmpfgt (void) |
892 | 4c9649a9 | j_mayer | { |
893 | 4c9649a9 | j_mayer | helper_cmpfgt(); |
894 | 4c9649a9 | j_mayer | RETURN(); |
895 | 4c9649a9 | j_mayer | } |
896 | 4c9649a9 | j_mayer | |
897 | 4c9649a9 | j_mayer | void OPPROTO op_cmpfge (void) |
898 | 4c9649a9 | j_mayer | { |
899 | 4c9649a9 | j_mayer | helper_cmpfge(); |
900 | 4c9649a9 | j_mayer | RETURN(); |
901 | 4c9649a9 | j_mayer | } |
902 | 4c9649a9 | j_mayer | |
903 | 4c9649a9 | j_mayer | void OPPROTO op_itoff (void) |
904 | 4c9649a9 | j_mayer | { |
905 | 4c9649a9 | j_mayer | helper_itoff(); |
906 | 4c9649a9 | j_mayer | RETURN(); |
907 | 4c9649a9 | j_mayer | } |
908 | 4c9649a9 | j_mayer | |
909 | 4c9649a9 | j_mayer | /* G floating */
|
910 | 4c9649a9 | j_mayer | void OPPROTO op_addg (void) |
911 | 4c9649a9 | j_mayer | { |
912 | 4c9649a9 | j_mayer | helper_addg(); |
913 | 4c9649a9 | j_mayer | RETURN(); |
914 | 4c9649a9 | j_mayer | } |
915 | 4c9649a9 | j_mayer | |
916 | 4c9649a9 | j_mayer | void OPPROTO op_subg (void) |
917 | 4c9649a9 | j_mayer | { |
918 | 4c9649a9 | j_mayer | helper_subg(); |
919 | 4c9649a9 | j_mayer | RETURN(); |
920 | 4c9649a9 | j_mayer | } |
921 | 4c9649a9 | j_mayer | |
922 | 4c9649a9 | j_mayer | void OPPROTO op_mulg (void) |
923 | 4c9649a9 | j_mayer | { |
924 | 4c9649a9 | j_mayer | helper_mulg(); |
925 | 4c9649a9 | j_mayer | RETURN(); |
926 | 4c9649a9 | j_mayer | } |
927 | 4c9649a9 | j_mayer | |
928 | 4c9649a9 | j_mayer | void OPPROTO op_divg (void) |
929 | 4c9649a9 | j_mayer | { |
930 | 4c9649a9 | j_mayer | helper_divg(); |
931 | 4c9649a9 | j_mayer | RETURN(); |
932 | 4c9649a9 | j_mayer | } |
933 | 4c9649a9 | j_mayer | |
934 | 4c9649a9 | j_mayer | void OPPROTO op_sqrtg (void) |
935 | 4c9649a9 | j_mayer | { |
936 | 4c9649a9 | j_mayer | helper_sqrtg(); |
937 | 4c9649a9 | j_mayer | RETURN(); |
938 | 4c9649a9 | j_mayer | } |
939 | 4c9649a9 | j_mayer | |
940 | 4c9649a9 | j_mayer | void OPPROTO op_cmpgeq (void) |
941 | 4c9649a9 | j_mayer | { |
942 | 4c9649a9 | j_mayer | helper_cmpgeq(); |
943 | 4c9649a9 | j_mayer | RETURN(); |
944 | 4c9649a9 | j_mayer | } |
945 | 4c9649a9 | j_mayer | |
946 | 4c9649a9 | j_mayer | void OPPROTO op_cmpglt (void) |
947 | 4c9649a9 | j_mayer | { |
948 | 4c9649a9 | j_mayer | helper_cmpglt(); |
949 | 4c9649a9 | j_mayer | RETURN(); |
950 | 4c9649a9 | j_mayer | } |
951 | 4c9649a9 | j_mayer | |
952 | 4c9649a9 | j_mayer | void OPPROTO op_cmpgle (void) |
953 | 4c9649a9 | j_mayer | { |
954 | 4c9649a9 | j_mayer | helper_cmpgle(); |
955 | 4c9649a9 | j_mayer | RETURN(); |
956 | 4c9649a9 | j_mayer | } |
957 | 4c9649a9 | j_mayer | |
958 | 4c9649a9 | j_mayer | /* Floating point format conversion */
|
959 | 4c9649a9 | j_mayer | void OPPROTO op_cvtst (void) |
960 | 4c9649a9 | j_mayer | { |
961 | 4c9649a9 | j_mayer | FT0 = (float)FT0;
|
962 | 4c9649a9 | j_mayer | RETURN(); |
963 | 4c9649a9 | j_mayer | } |
964 | 4c9649a9 | j_mayer | |
965 | 4c9649a9 | j_mayer | void OPPROTO op_cvtqs (void) |
966 | 4c9649a9 | j_mayer | { |
967 | 4c9649a9 | j_mayer | helper_cvtqs(); |
968 | 4c9649a9 | j_mayer | RETURN(); |
969 | 4c9649a9 | j_mayer | } |
970 | 4c9649a9 | j_mayer | |
971 | 4c9649a9 | j_mayer | void OPPROTO op_cvtts (void) |
972 | 4c9649a9 | j_mayer | { |
973 | 4c9649a9 | j_mayer | FT0 = (float)FT0;
|
974 | 4c9649a9 | j_mayer | RETURN(); |
975 | 4c9649a9 | j_mayer | } |
976 | 4c9649a9 | j_mayer | |
977 | 4c9649a9 | j_mayer | void OPPROTO op_cvttq (void) |
978 | 4c9649a9 | j_mayer | { |
979 | 4c9649a9 | j_mayer | helper_cvttq(); |
980 | 4c9649a9 | j_mayer | RETURN(); |
981 | 4c9649a9 | j_mayer | } |
982 | 4c9649a9 | j_mayer | |
983 | 4c9649a9 | j_mayer | void OPPROTO op_cvtqt (void) |
984 | 4c9649a9 | j_mayer | { |
985 | 4c9649a9 | j_mayer | helper_cvtqt(); |
986 | 4c9649a9 | j_mayer | RETURN(); |
987 | 4c9649a9 | j_mayer | } |
988 | 4c9649a9 | j_mayer | |
989 | 4c9649a9 | j_mayer | void OPPROTO op_cvtqf (void) |
990 | 4c9649a9 | j_mayer | { |
991 | 4c9649a9 | j_mayer | helper_cvtqf(); |
992 | 4c9649a9 | j_mayer | RETURN(); |
993 | 4c9649a9 | j_mayer | } |
994 | 4c9649a9 | j_mayer | |
995 | 4c9649a9 | j_mayer | void OPPROTO op_cvtgf (void) |
996 | 4c9649a9 | j_mayer | { |
997 | 4c9649a9 | j_mayer | helper_cvtgf(); |
998 | 4c9649a9 | j_mayer | RETURN(); |
999 | 4c9649a9 | j_mayer | } |
1000 | 4c9649a9 | j_mayer | |
1001 | 4c9649a9 | j_mayer | void OPPROTO op_cvtgd (void) |
1002 | 4c9649a9 | j_mayer | { |
1003 | 4c9649a9 | j_mayer | helper_cvtgd(); |
1004 | 4c9649a9 | j_mayer | RETURN(); |
1005 | 4c9649a9 | j_mayer | } |
1006 | 4c9649a9 | j_mayer | |
1007 | 4c9649a9 | j_mayer | void OPPROTO op_cvtgq (void) |
1008 | 4c9649a9 | j_mayer | { |
1009 | 4c9649a9 | j_mayer | helper_cvtgq(); |
1010 | 4c9649a9 | j_mayer | RETURN(); |
1011 | 4c9649a9 | j_mayer | } |
1012 | 4c9649a9 | j_mayer | |
1013 | 4c9649a9 | j_mayer | void OPPROTO op_cvtqg (void) |
1014 | 4c9649a9 | j_mayer | { |
1015 | 4c9649a9 | j_mayer | helper_cvtqg(); |
1016 | 4c9649a9 | j_mayer | RETURN(); |
1017 | 4c9649a9 | j_mayer | } |
1018 | 4c9649a9 | j_mayer | |
1019 | 4c9649a9 | j_mayer | void OPPROTO op_cvtdg (void) |
1020 | 4c9649a9 | j_mayer | { |
1021 | 4c9649a9 | j_mayer | helper_cvtdg(); |
1022 | 4c9649a9 | j_mayer | RETURN(); |
1023 | 4c9649a9 | j_mayer | } |
1024 | 4c9649a9 | j_mayer | |
1025 | 4c9649a9 | j_mayer | void OPPROTO op_cvtlq (void) |
1026 | 4c9649a9 | j_mayer | { |
1027 | 4c9649a9 | j_mayer | helper_cvtlq(); |
1028 | 4c9649a9 | j_mayer | RETURN(); |
1029 | 4c9649a9 | j_mayer | } |
1030 | 4c9649a9 | j_mayer | |
1031 | 4c9649a9 | j_mayer | void OPPROTO op_cvtql (void) |
1032 | 4c9649a9 | j_mayer | { |
1033 | 4c9649a9 | j_mayer | helper_cvtql(); |
1034 | 4c9649a9 | j_mayer | RETURN(); |
1035 | 4c9649a9 | j_mayer | } |
1036 | 4c9649a9 | j_mayer | |
1037 | 4c9649a9 | j_mayer | void OPPROTO op_cvtqlv (void) |
1038 | 4c9649a9 | j_mayer | { |
1039 | 4c9649a9 | j_mayer | helper_cvtqlv(); |
1040 | 4c9649a9 | j_mayer | RETURN(); |
1041 | 4c9649a9 | j_mayer | } |
1042 | 4c9649a9 | j_mayer | |
1043 | 4c9649a9 | j_mayer | void OPPROTO op_cvtqlsv (void) |
1044 | 4c9649a9 | j_mayer | { |
1045 | 4c9649a9 | j_mayer | helper_cvtqlsv(); |
1046 | 4c9649a9 | j_mayer | RETURN(); |
1047 | 4c9649a9 | j_mayer | } |
1048 | 4c9649a9 | j_mayer | |
1049 | 4c9649a9 | j_mayer | /* PALcode support special instructions */
|
1050 | 4c9649a9 | j_mayer | #if !defined (CONFIG_USER_ONLY)
|
1051 | 4c9649a9 | j_mayer | void OPPROTO op_hw_rei (void) |
1052 | 4c9649a9 | j_mayer | { |
1053 | 4c9649a9 | j_mayer | env->pc = env->ipr[IPR_EXC_ADDR] & ~3;
|
1054 | 4c9649a9 | j_mayer | env->ipr[IPR_EXC_ADDR] = env->ipr[IPR_EXC_ADDR] & 1;
|
1055 | 4c9649a9 | j_mayer | /* XXX: re-enable interrupts and memory mapping */
|
1056 | 4c9649a9 | j_mayer | RETURN(); |
1057 | 4c9649a9 | j_mayer | } |
1058 | 4c9649a9 | j_mayer | |
1059 | 4c9649a9 | j_mayer | void OPPROTO op_hw_ret (void) |
1060 | 4c9649a9 | j_mayer | { |
1061 | 4c9649a9 | j_mayer | env->pc = T0 & ~3;
|
1062 | 4c9649a9 | j_mayer | env->ipr[IPR_EXC_ADDR] = T0 & 1;
|
1063 | 4c9649a9 | j_mayer | /* XXX: re-enable interrupts and memory mapping */
|
1064 | 4c9649a9 | j_mayer | RETURN(); |
1065 | 4c9649a9 | j_mayer | } |
1066 | 4c9649a9 | j_mayer | |
1067 | 4c9649a9 | j_mayer | void OPPROTO op_mfpr (void) |
1068 | 4c9649a9 | j_mayer | { |
1069 | 4c9649a9 | j_mayer | helper_mfpr(PARAM(1));
|
1070 | 4c9649a9 | j_mayer | RETURN(); |
1071 | 4c9649a9 | j_mayer | } |
1072 | 4c9649a9 | j_mayer | |
1073 | 4c9649a9 | j_mayer | void OPPROTO op_mtpr (void) |
1074 | 4c9649a9 | j_mayer | { |
1075 | 4c9649a9 | j_mayer | helper_mtpr(PARAM(1));
|
1076 | 4c9649a9 | j_mayer | RETURN(); |
1077 | 4c9649a9 | j_mayer | } |
1078 | 4c9649a9 | j_mayer | |
1079 | 4c9649a9 | j_mayer | void OPPROTO op_set_alt_mode (void) |
1080 | 4c9649a9 | j_mayer | { |
1081 | 4c9649a9 | j_mayer | env->saved_mode = env->ps & 0xC;
|
1082 | 4c9649a9 | j_mayer | env->ps = (env->ps & ~0xC) | (env->ipr[IPR_ALT_MODE] & 0xC); |
1083 | 4c9649a9 | j_mayer | RETURN(); |
1084 | 4c9649a9 | j_mayer | } |
1085 | 4c9649a9 | j_mayer | |
1086 | 4c9649a9 | j_mayer | void OPPROTO op_restore_mode (void) |
1087 | 4c9649a9 | j_mayer | { |
1088 | 4c9649a9 | j_mayer | env->ps = (env->ps & ~0xC) | env->saved_mode;
|
1089 | 4c9649a9 | j_mayer | RETURN(); |
1090 | 4c9649a9 | j_mayer | } |
1091 | 4c9649a9 | j_mayer | |
1092 | 4c9649a9 | j_mayer | void OPPROTO op_ld_phys_to_virt (void) |
1093 | 4c9649a9 | j_mayer | { |
1094 | 4c9649a9 | j_mayer | helper_ld_phys_to_virt(); |
1095 | 4c9649a9 | j_mayer | RETURN(); |
1096 | 4c9649a9 | j_mayer | } |
1097 | 4c9649a9 | j_mayer | |
1098 | 4c9649a9 | j_mayer | void OPPROTO op_st_phys_to_virt (void) |
1099 | 4c9649a9 | j_mayer | { |
1100 | 4c9649a9 | j_mayer | helper_st_phys_to_virt(); |
1101 | 4c9649a9 | j_mayer | RETURN(); |
1102 | 4c9649a9 | j_mayer | } |
1103 | 4c9649a9 | j_mayer | #endif /* !defined (CONFIG_USER_ONLY) */ |