root / target-ppc / op.c @ 40d0591e
History | View | Annotate | Download (47.3 kB)
1 | 79aceca5 | bellard | /*
|
---|---|---|---|
2 | 3fc6c082 | bellard | * PowerPC emulation micro-operations for qemu.
|
3 | 5fafdf24 | ths | *
|
4 | 76a66253 | j_mayer | * Copyright (c) 2003-2007 Jocelyn Mayer
|
5 | 79aceca5 | bellard | *
|
6 | 79aceca5 | bellard | * This library is free software; you can redistribute it and/or
|
7 | 79aceca5 | bellard | * modify it under the terms of the GNU Lesser General Public
|
8 | 79aceca5 | bellard | * License as published by the Free Software Foundation; either
|
9 | 79aceca5 | bellard | * version 2 of the License, or (at your option) any later version.
|
10 | 79aceca5 | bellard | *
|
11 | 79aceca5 | bellard | * This library is distributed in the hope that it will be useful,
|
12 | 79aceca5 | bellard | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 79aceca5 | bellard | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | 79aceca5 | bellard | * Lesser General Public License for more details.
|
15 | 79aceca5 | bellard | *
|
16 | 79aceca5 | bellard | * You should have received a copy of the GNU Lesser General Public
|
17 | 79aceca5 | bellard | * License along with this library; if not, write to the Free Software
|
18 | 79aceca5 | bellard | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 | 79aceca5 | bellard | */
|
20 | 79aceca5 | bellard | |
21 | a541f297 | bellard | //#define DEBUG_OP
|
22 | a541f297 | bellard | |
23 | 79aceca5 | bellard | #include "config.h" |
24 | 79aceca5 | bellard | #include "exec.h" |
25 | 76a66253 | j_mayer | #include "op_helper.h" |
26 | 79aceca5 | bellard | |
27 | 28b6751f | bellard | #define REG 0 |
28 | 28b6751f | bellard | #include "op_template.h" |
29 | 28b6751f | bellard | |
30 | 28b6751f | bellard | #define REG 1 |
31 | 28b6751f | bellard | #include "op_template.h" |
32 | 28b6751f | bellard | |
33 | 28b6751f | bellard | #define REG 2 |
34 | 28b6751f | bellard | #include "op_template.h" |
35 | 28b6751f | bellard | |
36 | 28b6751f | bellard | #define REG 3 |
37 | 28b6751f | bellard | #include "op_template.h" |
38 | 28b6751f | bellard | |
39 | 28b6751f | bellard | #define REG 4 |
40 | 28b6751f | bellard | #include "op_template.h" |
41 | 28b6751f | bellard | |
42 | 28b6751f | bellard | #define REG 5 |
43 | 28b6751f | bellard | #include "op_template.h" |
44 | 28b6751f | bellard | |
45 | 28b6751f | bellard | #define REG 6 |
46 | 28b6751f | bellard | #include "op_template.h" |
47 | 28b6751f | bellard | |
48 | 28b6751f | bellard | #define REG 7 |
49 | 28b6751f | bellard | #include "op_template.h" |
50 | 28b6751f | bellard | |
51 | 28b6751f | bellard | #define REG 8 |
52 | 28b6751f | bellard | #include "op_template.h" |
53 | 28b6751f | bellard | |
54 | 28b6751f | bellard | #define REG 9 |
55 | 28b6751f | bellard | #include "op_template.h" |
56 | 28b6751f | bellard | |
57 | 28b6751f | bellard | #define REG 10 |
58 | 28b6751f | bellard | #include "op_template.h" |
59 | 28b6751f | bellard | |
60 | 28b6751f | bellard | #define REG 11 |
61 | 28b6751f | bellard | #include "op_template.h" |
62 | 28b6751f | bellard | |
63 | 28b6751f | bellard | #define REG 12 |
64 | 28b6751f | bellard | #include "op_template.h" |
65 | 28b6751f | bellard | |
66 | 28b6751f | bellard | #define REG 13 |
67 | 28b6751f | bellard | #include "op_template.h" |
68 | 28b6751f | bellard | |
69 | 28b6751f | bellard | #define REG 14 |
70 | 28b6751f | bellard | #include "op_template.h" |
71 | 28b6751f | bellard | |
72 | 28b6751f | bellard | #define REG 15 |
73 | 28b6751f | bellard | #include "op_template.h" |
74 | 28b6751f | bellard | |
75 | 28b6751f | bellard | #define REG 16 |
76 | 28b6751f | bellard | #include "op_template.h" |
77 | 28b6751f | bellard | |
78 | 28b6751f | bellard | #define REG 17 |
79 | 28b6751f | bellard | #include "op_template.h" |
80 | 28b6751f | bellard | |
81 | 28b6751f | bellard | #define REG 18 |
82 | 28b6751f | bellard | #include "op_template.h" |
83 | 28b6751f | bellard | |
84 | 28b6751f | bellard | #define REG 19 |
85 | 28b6751f | bellard | #include "op_template.h" |
86 | 28b6751f | bellard | |
87 | 28b6751f | bellard | #define REG 20 |
88 | 28b6751f | bellard | #include "op_template.h" |
89 | 28b6751f | bellard | |
90 | 28b6751f | bellard | #define REG 21 |
91 | 28b6751f | bellard | #include "op_template.h" |
92 | 28b6751f | bellard | |
93 | 28b6751f | bellard | #define REG 22 |
94 | 28b6751f | bellard | #include "op_template.h" |
95 | 28b6751f | bellard | |
96 | 28b6751f | bellard | #define REG 23 |
97 | 28b6751f | bellard | #include "op_template.h" |
98 | 28b6751f | bellard | |
99 | 28b6751f | bellard | #define REG 24 |
100 | 28b6751f | bellard | #include "op_template.h" |
101 | 28b6751f | bellard | |
102 | 28b6751f | bellard | #define REG 25 |
103 | 28b6751f | bellard | #include "op_template.h" |
104 | 28b6751f | bellard | |
105 | 28b6751f | bellard | #define REG 26 |
106 | 28b6751f | bellard | #include "op_template.h" |
107 | 28b6751f | bellard | |
108 | 28b6751f | bellard | #define REG 27 |
109 | 28b6751f | bellard | #include "op_template.h" |
110 | 28b6751f | bellard | |
111 | 28b6751f | bellard | #define REG 28 |
112 | 28b6751f | bellard | #include "op_template.h" |
113 | 28b6751f | bellard | |
114 | 28b6751f | bellard | #define REG 29 |
115 | 28b6751f | bellard | #include "op_template.h" |
116 | 28b6751f | bellard | |
117 | 28b6751f | bellard | #define REG 30 |
118 | 28b6751f | bellard | #include "op_template.h" |
119 | 28b6751f | bellard | |
120 | 28b6751f | bellard | #define REG 31 |
121 | 28b6751f | bellard | #include "op_template.h" |
122 | 28b6751f | bellard | |
123 | a496775f | j_mayer | |
124 | a496775f | j_mayer | void OPPROTO op_print_mem_EA (void) |
125 | a496775f | j_mayer | { |
126 | a496775f | j_mayer | do_print_mem_EA(T0); |
127 | a496775f | j_mayer | RETURN(); |
128 | a496775f | j_mayer | } |
129 | a496775f | j_mayer | |
130 | 3fc6c082 | bellard | /* PowerPC state maintenance operations */
|
131 | 79aceca5 | bellard | /* set_Rc0 */
|
132 | 36081602 | j_mayer | void OPPROTO op_set_Rc0 (void) |
133 | 79aceca5 | bellard | { |
134 | 966439a6 | j_mayer | env->crf[0] = T0 | xer_so;
|
135 | 79aceca5 | bellard | RETURN(); |
136 | 79aceca5 | bellard | } |
137 | 79aceca5 | bellard | |
138 | fb0eaffc | bellard | /* Set Rc1 (for floating point arithmetic) */
|
139 | 36081602 | j_mayer | void OPPROTO op_set_Rc1 (void) |
140 | fb0eaffc | bellard | { |
141 | 36081602 | j_mayer | env->crf[1] = env->fpscr[7]; |
142 | fb0eaffc | bellard | RETURN(); |
143 | fb0eaffc | bellard | } |
144 | fb0eaffc | bellard | |
145 | 9a64fbe4 | bellard | /* Constants load */
|
146 | 76a66253 | j_mayer | void OPPROTO op_reset_T0 (void) |
147 | 76a66253 | j_mayer | { |
148 | 76a66253 | j_mayer | T0 = 0;
|
149 | 76a66253 | j_mayer | RETURN(); |
150 | 76a66253 | j_mayer | } |
151 | 76a66253 | j_mayer | |
152 | 36081602 | j_mayer | void OPPROTO op_set_T0 (void) |
153 | 79aceca5 | bellard | { |
154 | d9bce9d9 | j_mayer | T0 = (uint32_t)PARAM1; |
155 | 79aceca5 | bellard | RETURN(); |
156 | 79aceca5 | bellard | } |
157 | 79aceca5 | bellard | |
158 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
159 | d9bce9d9 | j_mayer | void OPPROTO op_set_T0_64 (void) |
160 | d9bce9d9 | j_mayer | { |
161 | d9bce9d9 | j_mayer | T0 = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
|
162 | d9bce9d9 | j_mayer | RETURN(); |
163 | d9bce9d9 | j_mayer | } |
164 | d9bce9d9 | j_mayer | #endif
|
165 | d9bce9d9 | j_mayer | |
166 | 36081602 | j_mayer | void OPPROTO op_set_T1 (void) |
167 | 79aceca5 | bellard | { |
168 | d9bce9d9 | j_mayer | T1 = (uint32_t)PARAM1; |
169 | d9bce9d9 | j_mayer | RETURN(); |
170 | d9bce9d9 | j_mayer | } |
171 | d9bce9d9 | j_mayer | |
172 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
173 | d9bce9d9 | j_mayer | void OPPROTO op_set_T1_64 (void) |
174 | d9bce9d9 | j_mayer | { |
175 | d9bce9d9 | j_mayer | T1 = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
|
176 | 79aceca5 | bellard | RETURN(); |
177 | 79aceca5 | bellard | } |
178 | d9bce9d9 | j_mayer | #endif
|
179 | 79aceca5 | bellard | |
180 | 76a66253 | j_mayer | #if 0 // unused
|
181 | 36081602 | j_mayer | void OPPROTO op_set_T2 (void)
|
182 | 79aceca5 | bellard | {
|
183 | 36081602 | j_mayer | T2 = PARAM1;
|
184 | 79aceca5 | bellard | RETURN();
|
185 | 79aceca5 | bellard | }
|
186 | 76a66253 | j_mayer | #endif
|
187 | 79aceca5 | bellard | |
188 | 76a66253 | j_mayer | void OPPROTO op_move_T1_T0 (void) |
189 | 79aceca5 | bellard | { |
190 | 76a66253 | j_mayer | T1 = T0; |
191 | 76a66253 | j_mayer | RETURN(); |
192 | 9a64fbe4 | bellard | } |
193 | 9a64fbe4 | bellard | |
194 | d9bce9d9 | j_mayer | void OPPROTO op_move_T2_T0 (void) |
195 | d9bce9d9 | j_mayer | { |
196 | d9bce9d9 | j_mayer | T2 = T0; |
197 | d9bce9d9 | j_mayer | RETURN(); |
198 | d9bce9d9 | j_mayer | } |
199 | d9bce9d9 | j_mayer | |
200 | 76a66253 | j_mayer | /* Generate exceptions */
|
201 | 36081602 | j_mayer | void OPPROTO op_raise_exception_err (void) |
202 | 9a64fbe4 | bellard | { |
203 | 36081602 | j_mayer | do_raise_exception_err(PARAM1, PARAM2); |
204 | 9a64fbe4 | bellard | } |
205 | 9a64fbe4 | bellard | |
206 | 36081602 | j_mayer | void OPPROTO op_update_nip (void) |
207 | 9a64fbe4 | bellard | { |
208 | d9bce9d9 | j_mayer | env->nip = (uint32_t)PARAM1; |
209 | 76a66253 | j_mayer | RETURN(); |
210 | 9a64fbe4 | bellard | } |
211 | 9a64fbe4 | bellard | |
212 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
213 | d9bce9d9 | j_mayer | void OPPROTO op_update_nip_64 (void) |
214 | d9bce9d9 | j_mayer | { |
215 | d9bce9d9 | j_mayer | env->nip = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
|
216 | d9bce9d9 | j_mayer | RETURN(); |
217 | d9bce9d9 | j_mayer | } |
218 | d9bce9d9 | j_mayer | #endif
|
219 | d9bce9d9 | j_mayer | |
220 | 36081602 | j_mayer | void OPPROTO op_debug (void) |
221 | ea4e754f | bellard | { |
222 | ea4e754f | bellard | do_raise_exception(EXCP_DEBUG); |
223 | ea4e754f | bellard | } |
224 | ea4e754f | bellard | |
225 | 36081602 | j_mayer | void OPPROTO op_exit_tb (void) |
226 | 9a64fbe4 | bellard | { |
227 | 76a66253 | j_mayer | EXIT_TB(); |
228 | 9a64fbe4 | bellard | } |
229 | 9a64fbe4 | bellard | |
230 | 76a66253 | j_mayer | /* Load/store special registers */
|
231 | 36081602 | j_mayer | void OPPROTO op_load_cr (void) |
232 | 9a64fbe4 | bellard | { |
233 | 76a66253 | j_mayer | do_load_cr(); |
234 | 79aceca5 | bellard | RETURN(); |
235 | 79aceca5 | bellard | } |
236 | 79aceca5 | bellard | |
237 | 36081602 | j_mayer | void OPPROTO op_store_cr (void) |
238 | 79aceca5 | bellard | { |
239 | 36081602 | j_mayer | do_store_cr(PARAM1); |
240 | 79aceca5 | bellard | RETURN(); |
241 | 79aceca5 | bellard | } |
242 | 79aceca5 | bellard | |
243 | 76a66253 | j_mayer | void OPPROTO op_load_cro (void) |
244 | 79aceca5 | bellard | { |
245 | 76a66253 | j_mayer | T0 = env->crf[PARAM1]; |
246 | 79aceca5 | bellard | RETURN(); |
247 | 79aceca5 | bellard | } |
248 | 79aceca5 | bellard | |
249 | 76a66253 | j_mayer | void OPPROTO op_store_cro (void) |
250 | 79aceca5 | bellard | { |
251 | 76a66253 | j_mayer | env->crf[PARAM1] = T0; |
252 | 79aceca5 | bellard | RETURN(); |
253 | 79aceca5 | bellard | } |
254 | 79aceca5 | bellard | |
255 | 36081602 | j_mayer | void OPPROTO op_load_xer_cr (void) |
256 | 79aceca5 | bellard | { |
257 | 79aceca5 | bellard | T0 = (xer_so << 3) | (xer_ov << 2) | (xer_ca << 1); |
258 | 79aceca5 | bellard | RETURN(); |
259 | 79aceca5 | bellard | } |
260 | 79aceca5 | bellard | |
261 | 36081602 | j_mayer | void OPPROTO op_clear_xer_ov (void) |
262 | 79aceca5 | bellard | { |
263 | 79aceca5 | bellard | xer_so = 0;
|
264 | 79aceca5 | bellard | xer_ov = 0;
|
265 | e864cabd | j_mayer | RETURN(); |
266 | e864cabd | j_mayer | } |
267 | e864cabd | j_mayer | |
268 | 36081602 | j_mayer | void OPPROTO op_clear_xer_ca (void) |
269 | e864cabd | j_mayer | { |
270 | 79aceca5 | bellard | xer_ca = 0;
|
271 | 79aceca5 | bellard | RETURN(); |
272 | 79aceca5 | bellard | } |
273 | 79aceca5 | bellard | |
274 | 36081602 | j_mayer | void OPPROTO op_load_xer_bc (void) |
275 | 79aceca5 | bellard | { |
276 | 9a64fbe4 | bellard | T1 = xer_bc; |
277 | 79aceca5 | bellard | RETURN(); |
278 | 79aceca5 | bellard | } |
279 | 79aceca5 | bellard | |
280 | 76a66253 | j_mayer | void OPPROTO op_store_xer_bc (void) |
281 | 76a66253 | j_mayer | { |
282 | 76a66253 | j_mayer | xer_bc = T0; |
283 | 76a66253 | j_mayer | RETURN(); |
284 | 76a66253 | j_mayer | } |
285 | 76a66253 | j_mayer | |
286 | 36081602 | j_mayer | void OPPROTO op_load_xer (void) |
287 | 79aceca5 | bellard | { |
288 | 76a66253 | j_mayer | do_load_xer(); |
289 | 79aceca5 | bellard | RETURN(); |
290 | 79aceca5 | bellard | } |
291 | 79aceca5 | bellard | |
292 | 36081602 | j_mayer | void OPPROTO op_store_xer (void) |
293 | 79aceca5 | bellard | { |
294 | 76a66253 | j_mayer | do_store_xer(); |
295 | 76a66253 | j_mayer | RETURN(); |
296 | 76a66253 | j_mayer | } |
297 | 76a66253 | j_mayer | |
298 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
299 | 76a66253 | j_mayer | /* Segment registers load and store */
|
300 | 36081602 | j_mayer | void OPPROTO op_load_sr (void) |
301 | 76a66253 | j_mayer | { |
302 | 36081602 | j_mayer | T0 = env->sr[T1]; |
303 | 76a66253 | j_mayer | RETURN(); |
304 | 76a66253 | j_mayer | } |
305 | 76a66253 | j_mayer | |
306 | 36081602 | j_mayer | void OPPROTO op_store_sr (void) |
307 | 76a66253 | j_mayer | { |
308 | 76a66253 | j_mayer | do_store_sr(env, T1, T0); |
309 | 76a66253 | j_mayer | RETURN(); |
310 | 76a66253 | j_mayer | } |
311 | 76a66253 | j_mayer | |
312 | 36081602 | j_mayer | void OPPROTO op_load_sdr1 (void) |
313 | 76a66253 | j_mayer | { |
314 | 36081602 | j_mayer | T0 = env->sdr1; |
315 | 76a66253 | j_mayer | RETURN(); |
316 | 76a66253 | j_mayer | } |
317 | 76a66253 | j_mayer | |
318 | 36081602 | j_mayer | void OPPROTO op_store_sdr1 (void) |
319 | 76a66253 | j_mayer | { |
320 | 76a66253 | j_mayer | do_store_sdr1(env, T0); |
321 | 79aceca5 | bellard | RETURN(); |
322 | 79aceca5 | bellard | } |
323 | 79aceca5 | bellard | |
324 | d9bce9d9 | j_mayer | #if defined (TARGET_PPC64)
|
325 | d9bce9d9 | j_mayer | void OPPROTO op_load_asr (void) |
326 | d9bce9d9 | j_mayer | { |
327 | d9bce9d9 | j_mayer | T0 = env->asr; |
328 | d9bce9d9 | j_mayer | RETURN(); |
329 | d9bce9d9 | j_mayer | } |
330 | d9bce9d9 | j_mayer | |
331 | d9bce9d9 | j_mayer | void OPPROTO op_store_asr (void) |
332 | d9bce9d9 | j_mayer | { |
333 | d9bce9d9 | j_mayer | ppc_store_asr(env, T0); |
334 | d9bce9d9 | j_mayer | RETURN(); |
335 | d9bce9d9 | j_mayer | } |
336 | d9bce9d9 | j_mayer | #endif
|
337 | d9bce9d9 | j_mayer | |
338 | 36081602 | j_mayer | void OPPROTO op_load_msr (void) |
339 | 79aceca5 | bellard | { |
340 | 3fc6c082 | bellard | T0 = do_load_msr(env); |
341 | 79aceca5 | bellard | RETURN(); |
342 | 79aceca5 | bellard | } |
343 | 79aceca5 | bellard | |
344 | 36081602 | j_mayer | void OPPROTO op_store_msr (void) |
345 | 79aceca5 | bellard | { |
346 | 3fc6c082 | bellard | do_store_msr(env, T0); |
347 | 9a64fbe4 | bellard | RETURN(); |
348 | 9a64fbe4 | bellard | } |
349 | d9bce9d9 | j_mayer | |
350 | d9bce9d9 | j_mayer | #if defined (TARGET_PPC64)
|
351 | d9bce9d9 | j_mayer | void OPPROTO op_store_msr_32 (void) |
352 | d9bce9d9 | j_mayer | { |
353 | d9bce9d9 | j_mayer | ppc_store_msr_32(env, T0); |
354 | d9bce9d9 | j_mayer | RETURN(); |
355 | d9bce9d9 | j_mayer | } |
356 | d9bce9d9 | j_mayer | #endif
|
357 | 76a66253 | j_mayer | #endif
|
358 | 9a64fbe4 | bellard | |
359 | 9a64fbe4 | bellard | /* SPR */
|
360 | a496775f | j_mayer | void OPPROTO op_load_spr (void) |
361 | a496775f | j_mayer | { |
362 | a496775f | j_mayer | T0 = env->spr[PARAM1]; |
363 | a496775f | j_mayer | RETURN(); |
364 | a496775f | j_mayer | } |
365 | a496775f | j_mayer | |
366 | a496775f | j_mayer | void OPPROTO op_store_spr (void) |
367 | a496775f | j_mayer | { |
368 | a496775f | j_mayer | env->spr[PARAM1] = T0; |
369 | a496775f | j_mayer | RETURN(); |
370 | a496775f | j_mayer | } |
371 | a496775f | j_mayer | |
372 | a496775f | j_mayer | void OPPROTO op_load_dump_spr (void) |
373 | a496775f | j_mayer | { |
374 | a496775f | j_mayer | T0 = ppc_load_dump_spr(PARAM1); |
375 | a496775f | j_mayer | RETURN(); |
376 | a496775f | j_mayer | } |
377 | a496775f | j_mayer | |
378 | a496775f | j_mayer | void OPPROTO op_store_dump_spr (void) |
379 | 9a64fbe4 | bellard | { |
380 | a496775f | j_mayer | ppc_store_dump_spr(PARAM1, T0); |
381 | 9a64fbe4 | bellard | RETURN(); |
382 | 9a64fbe4 | bellard | } |
383 | 9a64fbe4 | bellard | |
384 | a496775f | j_mayer | void OPPROTO op_mask_spr (void) |
385 | 9a64fbe4 | bellard | { |
386 | a496775f | j_mayer | env->spr[PARAM1] &= ~T0; |
387 | 79aceca5 | bellard | RETURN(); |
388 | 79aceca5 | bellard | } |
389 | 79aceca5 | bellard | |
390 | 36081602 | j_mayer | void OPPROTO op_load_lr (void) |
391 | 79aceca5 | bellard | { |
392 | 36081602 | j_mayer | T0 = env->lr; |
393 | 9a64fbe4 | bellard | RETURN(); |
394 | 9a64fbe4 | bellard | } |
395 | 9a64fbe4 | bellard | |
396 | 36081602 | j_mayer | void OPPROTO op_store_lr (void) |
397 | 9a64fbe4 | bellard | { |
398 | 36081602 | j_mayer | env->lr = T0; |
399 | 9a64fbe4 | bellard | RETURN(); |
400 | 9a64fbe4 | bellard | } |
401 | 9a64fbe4 | bellard | |
402 | 36081602 | j_mayer | void OPPROTO op_load_ctr (void) |
403 | 9a64fbe4 | bellard | { |
404 | 36081602 | j_mayer | T0 = env->ctr; |
405 | 9a64fbe4 | bellard | RETURN(); |
406 | 9a64fbe4 | bellard | } |
407 | 9a64fbe4 | bellard | |
408 | 36081602 | j_mayer | void OPPROTO op_store_ctr (void) |
409 | 9a64fbe4 | bellard | { |
410 | 36081602 | j_mayer | env->ctr = T0; |
411 | 9a64fbe4 | bellard | RETURN(); |
412 | 9a64fbe4 | bellard | } |
413 | 9a64fbe4 | bellard | |
414 | 36081602 | j_mayer | void OPPROTO op_load_tbl (void) |
415 | 9a64fbe4 | bellard | { |
416 | 36081602 | j_mayer | T0 = cpu_ppc_load_tbl(env); |
417 | 9a64fbe4 | bellard | RETURN(); |
418 | 9a64fbe4 | bellard | } |
419 | 9a64fbe4 | bellard | |
420 | 36081602 | j_mayer | void OPPROTO op_load_tbu (void) |
421 | 9a64fbe4 | bellard | { |
422 | 36081602 | j_mayer | T0 = cpu_ppc_load_tbu(env); |
423 | 9a64fbe4 | bellard | RETURN(); |
424 | 9a64fbe4 | bellard | } |
425 | 9a64fbe4 | bellard | |
426 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
427 | 36081602 | j_mayer | void OPPROTO op_store_tbl (void) |
428 | 9a64fbe4 | bellard | { |
429 | 36081602 | j_mayer | cpu_ppc_store_tbl(env, T0); |
430 | 79aceca5 | bellard | RETURN(); |
431 | 79aceca5 | bellard | } |
432 | 79aceca5 | bellard | |
433 | 36081602 | j_mayer | void OPPROTO op_store_tbu (void) |
434 | 9a64fbe4 | bellard | { |
435 | 36081602 | j_mayer | cpu_ppc_store_tbu(env, T0); |
436 | 9a64fbe4 | bellard | RETURN(); |
437 | 9a64fbe4 | bellard | } |
438 | 9a64fbe4 | bellard | |
439 | 36081602 | j_mayer | void OPPROTO op_load_decr (void) |
440 | 9a64fbe4 | bellard | { |
441 | 36081602 | j_mayer | T0 = cpu_ppc_load_decr(env); |
442 | 76a66253 | j_mayer | RETURN(); |
443 | 76a66253 | j_mayer | } |
444 | 9fddaa0c | bellard | |
445 | 36081602 | j_mayer | void OPPROTO op_store_decr (void) |
446 | 9fddaa0c | bellard | { |
447 | 36081602 | j_mayer | cpu_ppc_store_decr(env, T0); |
448 | 9a64fbe4 | bellard | RETURN(); |
449 | 9a64fbe4 | bellard | } |
450 | 9a64fbe4 | bellard | |
451 | 36081602 | j_mayer | void OPPROTO op_load_ibat (void) |
452 | 9a64fbe4 | bellard | { |
453 | 36081602 | j_mayer | T0 = env->IBAT[PARAM1][PARAM2]; |
454 | 76a66253 | j_mayer | RETURN(); |
455 | 9a64fbe4 | bellard | } |
456 | 9a64fbe4 | bellard | |
457 | 76a66253 | j_mayer | void OPPROTO op_store_ibatu (void) |
458 | 9a64fbe4 | bellard | { |
459 | 3fc6c082 | bellard | do_store_ibatu(env, PARAM1, T0); |
460 | 3fc6c082 | bellard | RETURN(); |
461 | 3fc6c082 | bellard | } |
462 | 3fc6c082 | bellard | |
463 | 76a66253 | j_mayer | void OPPROTO op_store_ibatl (void) |
464 | 3fc6c082 | bellard | { |
465 | 3fc6c082 | bellard | #if 1 |
466 | 3fc6c082 | bellard | env->IBAT[1][PARAM1] = T0;
|
467 | 3fc6c082 | bellard | #else
|
468 | 3fc6c082 | bellard | do_store_ibatl(env, PARAM1, T0); |
469 | 3fc6c082 | bellard | #endif
|
470 | 3fc6c082 | bellard | RETURN(); |
471 | 9a64fbe4 | bellard | } |
472 | 9a64fbe4 | bellard | |
473 | 36081602 | j_mayer | void OPPROTO op_load_dbat (void) |
474 | 9a64fbe4 | bellard | { |
475 | 36081602 | j_mayer | T0 = env->DBAT[PARAM1][PARAM2]; |
476 | 76a66253 | j_mayer | RETURN(); |
477 | 9a64fbe4 | bellard | } |
478 | 9a64fbe4 | bellard | |
479 | 76a66253 | j_mayer | void OPPROTO op_store_dbatu (void) |
480 | 3fc6c082 | bellard | { |
481 | 3fc6c082 | bellard | do_store_dbatu(env, PARAM1, T0); |
482 | 3fc6c082 | bellard | RETURN(); |
483 | 3fc6c082 | bellard | } |
484 | 3fc6c082 | bellard | |
485 | 76a66253 | j_mayer | void OPPROTO op_store_dbatl (void) |
486 | 9a64fbe4 | bellard | { |
487 | 3fc6c082 | bellard | #if 1 |
488 | 3fc6c082 | bellard | env->DBAT[1][PARAM1] = T0;
|
489 | 3fc6c082 | bellard | #else
|
490 | 3fc6c082 | bellard | do_store_dbatl(env, PARAM1, T0); |
491 | 3fc6c082 | bellard | #endif
|
492 | 3fc6c082 | bellard | RETURN(); |
493 | 9a64fbe4 | bellard | } |
494 | 76a66253 | j_mayer | #endif /* !defined(CONFIG_USER_ONLY) */ |
495 | 9a64fbe4 | bellard | |
496 | fb0eaffc | bellard | /* FPSCR */
|
497 | 36081602 | j_mayer | void OPPROTO op_load_fpscr (void) |
498 | fb0eaffc | bellard | { |
499 | 76a66253 | j_mayer | do_load_fpscr(); |
500 | fb0eaffc | bellard | RETURN(); |
501 | fb0eaffc | bellard | } |
502 | fb0eaffc | bellard | |
503 | 36081602 | j_mayer | void OPPROTO op_store_fpscr (void) |
504 | fb0eaffc | bellard | { |
505 | 76a66253 | j_mayer | do_store_fpscr(PARAM1); |
506 | fb0eaffc | bellard | RETURN(); |
507 | fb0eaffc | bellard | } |
508 | fb0eaffc | bellard | |
509 | 36081602 | j_mayer | void OPPROTO op_reset_scrfx (void) |
510 | fb0eaffc | bellard | { |
511 | 36081602 | j_mayer | env->fpscr[7] &= ~0x8; |
512 | fb0eaffc | bellard | RETURN(); |
513 | fb0eaffc | bellard | } |
514 | fb0eaffc | bellard | |
515 | 79aceca5 | bellard | /* crf operations */
|
516 | 36081602 | j_mayer | void OPPROTO op_getbit_T0 (void) |
517 | 79aceca5 | bellard | { |
518 | 36081602 | j_mayer | T0 = (T0 >> PARAM1) & 1;
|
519 | 79aceca5 | bellard | RETURN(); |
520 | 79aceca5 | bellard | } |
521 | 79aceca5 | bellard | |
522 | 36081602 | j_mayer | void OPPROTO op_getbit_T1 (void) |
523 | 79aceca5 | bellard | { |
524 | 36081602 | j_mayer | T1 = (T1 >> PARAM1) & 1;
|
525 | 79aceca5 | bellard | RETURN(); |
526 | 79aceca5 | bellard | } |
527 | 79aceca5 | bellard | |
528 | 36081602 | j_mayer | void OPPROTO op_setcrfbit (void) |
529 | 79aceca5 | bellard | { |
530 | 36081602 | j_mayer | T1 = (T1 & PARAM1) | (T0 << PARAM2); |
531 | 79aceca5 | bellard | RETURN(); |
532 | 79aceca5 | bellard | } |
533 | 79aceca5 | bellard | |
534 | 79aceca5 | bellard | /* Branch */
|
535 | 36081602 | j_mayer | #define EIP env->nip
|
536 | 9a64fbe4 | bellard | |
537 | 36081602 | j_mayer | void OPPROTO op_setlr (void) |
538 | e98a6e40 | bellard | { |
539 | 36081602 | j_mayer | env->lr = (uint32_t)PARAM1; |
540 | 76a66253 | j_mayer | RETURN(); |
541 | e98a6e40 | bellard | } |
542 | e98a6e40 | bellard | |
543 | d9bce9d9 | j_mayer | #if defined (TARGET_PPC64)
|
544 | d9bce9d9 | j_mayer | void OPPROTO op_setlr_64 (void) |
545 | d9bce9d9 | j_mayer | { |
546 | 36081602 | j_mayer | env->lr = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
|
547 | d9bce9d9 | j_mayer | RETURN(); |
548 | d9bce9d9 | j_mayer | } |
549 | d9bce9d9 | j_mayer | #endif
|
550 | d9bce9d9 | j_mayer | |
551 | 36081602 | j_mayer | void OPPROTO op_goto_tb0 (void) |
552 | e98a6e40 | bellard | { |
553 | c53be334 | bellard | GOTO_TB(op_goto_tb0, PARAM1, 0);
|
554 | c53be334 | bellard | } |
555 | c53be334 | bellard | |
556 | 36081602 | j_mayer | void OPPROTO op_goto_tb1 (void) |
557 | c53be334 | bellard | { |
558 | c53be334 | bellard | GOTO_TB(op_goto_tb1, PARAM1, 1);
|
559 | e98a6e40 | bellard | } |
560 | e98a6e40 | bellard | |
561 | d9bce9d9 | j_mayer | void OPPROTO op_b_T1 (void) |
562 | e98a6e40 | bellard | { |
563 | 36081602 | j_mayer | env->nip = (uint32_t)(T1 & ~3);
|
564 | 76a66253 | j_mayer | RETURN(); |
565 | e98a6e40 | bellard | } |
566 | e98a6e40 | bellard | |
567 | d9bce9d9 | j_mayer | #if defined (TARGET_PPC64)
|
568 | d9bce9d9 | j_mayer | void OPPROTO op_b_T1_64 (void) |
569 | d9bce9d9 | j_mayer | { |
570 | 36081602 | j_mayer | env->nip = (uint64_t)(T1 & ~3);
|
571 | d9bce9d9 | j_mayer | RETURN(); |
572 | d9bce9d9 | j_mayer | } |
573 | d9bce9d9 | j_mayer | #endif
|
574 | d9bce9d9 | j_mayer | |
575 | 36081602 | j_mayer | void OPPROTO op_jz_T0 (void) |
576 | e98a6e40 | bellard | { |
577 | c53be334 | bellard | if (!T0)
|
578 | c53be334 | bellard | GOTO_LABEL_PARAM(1);
|
579 | e98a6e40 | bellard | RETURN(); |
580 | e98a6e40 | bellard | } |
581 | e98a6e40 | bellard | |
582 | d9bce9d9 | j_mayer | void OPPROTO op_btest_T1 (void) |
583 | e98a6e40 | bellard | { |
584 | e98a6e40 | bellard | if (T0) {
|
585 | 36081602 | j_mayer | env->nip = (uint32_t)(T1 & ~3);
|
586 | e98a6e40 | bellard | } else {
|
587 | 36081602 | j_mayer | env->nip = (uint32_t)PARAM1; |
588 | e98a6e40 | bellard | } |
589 | e98a6e40 | bellard | RETURN(); |
590 | e98a6e40 | bellard | } |
591 | e98a6e40 | bellard | |
592 | d9bce9d9 | j_mayer | #if defined (TARGET_PPC64)
|
593 | d9bce9d9 | j_mayer | void OPPROTO op_btest_T1_64 (void) |
594 | d9bce9d9 | j_mayer | { |
595 | d9bce9d9 | j_mayer | if (T0) {
|
596 | 36081602 | j_mayer | env->nip = (uint64_t)(T1 & ~3);
|
597 | d9bce9d9 | j_mayer | } else {
|
598 | 36081602 | j_mayer | env->nip = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
|
599 | d9bce9d9 | j_mayer | } |
600 | d9bce9d9 | j_mayer | RETURN(); |
601 | d9bce9d9 | j_mayer | } |
602 | d9bce9d9 | j_mayer | #endif
|
603 | d9bce9d9 | j_mayer | |
604 | 36081602 | j_mayer | void OPPROTO op_movl_T1_ctr (void) |
605 | e98a6e40 | bellard | { |
606 | 36081602 | j_mayer | T1 = env->ctr; |
607 | 76a66253 | j_mayer | RETURN(); |
608 | e98a6e40 | bellard | } |
609 | e98a6e40 | bellard | |
610 | 36081602 | j_mayer | void OPPROTO op_movl_T1_lr (void) |
611 | e98a6e40 | bellard | { |
612 | 36081602 | j_mayer | T1 = env->lr; |
613 | 76a66253 | j_mayer | RETURN(); |
614 | e98a6e40 | bellard | } |
615 | e98a6e40 | bellard | |
616 | e98a6e40 | bellard | /* tests with result in T0 */
|
617 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctr (void) |
618 | d9bce9d9 | j_mayer | { |
619 | 36081602 | j_mayer | T0 = (uint32_t)env->ctr; |
620 | d9bce9d9 | j_mayer | RETURN(); |
621 | d9bce9d9 | j_mayer | } |
622 | e98a6e40 | bellard | |
623 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
624 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctr_64 (void) |
625 | e98a6e40 | bellard | { |
626 | 36081602 | j_mayer | T0 = (uint64_t)env->ctr; |
627 | d9bce9d9 | j_mayer | RETURN(); |
628 | d9bce9d9 | j_mayer | } |
629 | d9bce9d9 | j_mayer | #endif
|
630 | d9bce9d9 | j_mayer | |
631 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctr_true (void) |
632 | d9bce9d9 | j_mayer | { |
633 | 36081602 | j_mayer | T0 = ((uint32_t)env->ctr != 0 && (T0 & PARAM1) != 0); |
634 | 76a66253 | j_mayer | RETURN(); |
635 | e98a6e40 | bellard | } |
636 | e98a6e40 | bellard | |
637 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
638 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctr_true_64 (void) |
639 | e98a6e40 | bellard | { |
640 | 36081602 | j_mayer | T0 = ((uint64_t)env->ctr != 0 && (T0 & PARAM1) != 0); |
641 | 76a66253 | j_mayer | RETURN(); |
642 | e98a6e40 | bellard | } |
643 | d9bce9d9 | j_mayer | #endif
|
644 | e98a6e40 | bellard | |
645 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctr_false (void) |
646 | e98a6e40 | bellard | { |
647 | 36081602 | j_mayer | T0 = ((uint32_t)env->ctr != 0 && (T0 & PARAM1) == 0); |
648 | 76a66253 | j_mayer | RETURN(); |
649 | e98a6e40 | bellard | } |
650 | e98a6e40 | bellard | |
651 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
652 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctr_false_64 (void) |
653 | e98a6e40 | bellard | { |
654 | 36081602 | j_mayer | T0 = ((uint64_t)env->ctr != 0 && (T0 & PARAM1) == 0); |
655 | 76a66253 | j_mayer | RETURN(); |
656 | e98a6e40 | bellard | } |
657 | d9bce9d9 | j_mayer | #endif
|
658 | d9bce9d9 | j_mayer | |
659 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctrz (void) |
660 | d9bce9d9 | j_mayer | { |
661 | 36081602 | j_mayer | T0 = ((uint32_t)env->ctr == 0);
|
662 | d9bce9d9 | j_mayer | RETURN(); |
663 | d9bce9d9 | j_mayer | } |
664 | d9bce9d9 | j_mayer | |
665 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
666 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctrz_64 (void) |
667 | d9bce9d9 | j_mayer | { |
668 | 36081602 | j_mayer | T0 = ((uint64_t)env->ctr == 0);
|
669 | d9bce9d9 | j_mayer | RETURN(); |
670 | d9bce9d9 | j_mayer | } |
671 | d9bce9d9 | j_mayer | #endif
|
672 | d9bce9d9 | j_mayer | |
673 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctrz_true (void) |
674 | d9bce9d9 | j_mayer | { |
675 | 36081602 | j_mayer | T0 = ((uint32_t)env->ctr == 0 && (T0 & PARAM1) != 0); |
676 | d9bce9d9 | j_mayer | RETURN(); |
677 | d9bce9d9 | j_mayer | } |
678 | d9bce9d9 | j_mayer | |
679 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
680 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctrz_true_64 (void) |
681 | d9bce9d9 | j_mayer | { |
682 | 36081602 | j_mayer | T0 = ((uint64_t)env->ctr == 0 && (T0 & PARAM1) != 0); |
683 | d9bce9d9 | j_mayer | RETURN(); |
684 | d9bce9d9 | j_mayer | } |
685 | d9bce9d9 | j_mayer | #endif
|
686 | e98a6e40 | bellard | |
687 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctrz_false (void) |
688 | e98a6e40 | bellard | { |
689 | 36081602 | j_mayer | T0 = ((uint32_t)env->ctr == 0 && (T0 & PARAM1) == 0); |
690 | 76a66253 | j_mayer | RETURN(); |
691 | e98a6e40 | bellard | } |
692 | e98a6e40 | bellard | |
693 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
694 | d9bce9d9 | j_mayer | void OPPROTO op_test_ctrz_false_64 (void) |
695 | e98a6e40 | bellard | { |
696 | 36081602 | j_mayer | T0 = ((uint64_t)env->ctr == 0 && (T0 & PARAM1) == 0); |
697 | 76a66253 | j_mayer | RETURN(); |
698 | e98a6e40 | bellard | } |
699 | d9bce9d9 | j_mayer | #endif
|
700 | e98a6e40 | bellard | |
701 | 36081602 | j_mayer | void OPPROTO op_test_true (void) |
702 | e98a6e40 | bellard | { |
703 | 36081602 | j_mayer | T0 = (T0 & PARAM1); |
704 | 76a66253 | j_mayer | RETURN(); |
705 | e98a6e40 | bellard | } |
706 | e98a6e40 | bellard | |
707 | 36081602 | j_mayer | void OPPROTO op_test_false (void) |
708 | e98a6e40 | bellard | { |
709 | 36081602 | j_mayer | T0 = ((T0 & PARAM1) == 0);
|
710 | 76a66253 | j_mayer | RETURN(); |
711 | e98a6e40 | bellard | } |
712 | 79aceca5 | bellard | |
713 | 79aceca5 | bellard | /* CTR maintenance */
|
714 | 36081602 | j_mayer | void OPPROTO op_dec_ctr (void) |
715 | 79aceca5 | bellard | { |
716 | 36081602 | j_mayer | env->ctr--; |
717 | 79aceca5 | bellard | RETURN(); |
718 | 79aceca5 | bellard | } |
719 | 79aceca5 | bellard | |
720 | 79aceca5 | bellard | /*** Integer arithmetic ***/
|
721 | 79aceca5 | bellard | /* add */
|
722 | 36081602 | j_mayer | void OPPROTO op_add (void) |
723 | 79aceca5 | bellard | { |
724 | 79aceca5 | bellard | T0 += T1; |
725 | 79aceca5 | bellard | RETURN(); |
726 | 79aceca5 | bellard | } |
727 | 79aceca5 | bellard | |
728 | d9bce9d9 | j_mayer | void OPPROTO op_check_addo (void) |
729 | 79aceca5 | bellard | { |
730 | d9bce9d9 | j_mayer | if (likely(!(((uint32_t)T2 ^ (uint32_t)T1 ^ UINT32_MAX) &
|
731 | d9bce9d9 | j_mayer | ((uint32_t)T2 ^ (uint32_t)T0) & (1UL << 31)))) { |
732 | d9bce9d9 | j_mayer | xer_ov = 0;
|
733 | d9bce9d9 | j_mayer | } else {
|
734 | d9bce9d9 | j_mayer | xer_ov = 1;
|
735 | 966439a6 | j_mayer | xer_so = 1;
|
736 | d9bce9d9 | j_mayer | } |
737 | e864cabd | j_mayer | RETURN(); |
738 | 79aceca5 | bellard | } |
739 | 79aceca5 | bellard | |
740 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
741 | d9bce9d9 | j_mayer | void OPPROTO op_check_addo_64 (void) |
742 | 79aceca5 | bellard | { |
743 | d9bce9d9 | j_mayer | if (likely(!(((uint64_t)T2 ^ (uint64_t)T1 ^ UINT64_MAX) &
|
744 | 1698b741 | j_mayer | ((uint64_t)T2 ^ (uint64_t)T0) & (1ULL << 63)))) { |
745 | d9bce9d9 | j_mayer | xer_ov = 0;
|
746 | 79aceca5 | bellard | } else {
|
747 | d9bce9d9 | j_mayer | xer_ov = 1;
|
748 | 966439a6 | j_mayer | xer_so = 1;
|
749 | d9bce9d9 | j_mayer | } |
750 | e864cabd | j_mayer | RETURN(); |
751 | d9bce9d9 | j_mayer | } |
752 | d9bce9d9 | j_mayer | #endif
|
753 | d9bce9d9 | j_mayer | |
754 | d9bce9d9 | j_mayer | /* add carrying */
|
755 | d9bce9d9 | j_mayer | void OPPROTO op_check_addc (void) |
756 | d9bce9d9 | j_mayer | { |
757 | d9bce9d9 | j_mayer | if (likely((uint32_t)T0 >= (uint32_t)T2)) {
|
758 | 79aceca5 | bellard | xer_ca = 0;
|
759 | d9bce9d9 | j_mayer | } else {
|
760 | d9bce9d9 | j_mayer | xer_ca = 1;
|
761 | 79aceca5 | bellard | } |
762 | 79aceca5 | bellard | RETURN(); |
763 | 79aceca5 | bellard | } |
764 | 79aceca5 | bellard | |
765 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
766 | d9bce9d9 | j_mayer | void OPPROTO op_check_addc_64 (void) |
767 | 79aceca5 | bellard | { |
768 | d9bce9d9 | j_mayer | if (likely((uint64_t)T0 >= (uint64_t)T2)) {
|
769 | d9bce9d9 | j_mayer | xer_ca = 0;
|
770 | d9bce9d9 | j_mayer | } else {
|
771 | d9bce9d9 | j_mayer | xer_ca = 1;
|
772 | d9bce9d9 | j_mayer | } |
773 | 79aceca5 | bellard | RETURN(); |
774 | 79aceca5 | bellard | } |
775 | d9bce9d9 | j_mayer | #endif
|
776 | 79aceca5 | bellard | |
777 | 79aceca5 | bellard | /* add extended */
|
778 | 76a66253 | j_mayer | void OPPROTO op_adde (void) |
779 | 79aceca5 | bellard | { |
780 | fdabc366 | bellard | do_adde(); |
781 | 76a66253 | j_mayer | RETURN(); |
782 | 79aceca5 | bellard | } |
783 | 79aceca5 | bellard | |
784 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
785 | d9bce9d9 | j_mayer | void OPPROTO op_adde_64 (void) |
786 | 79aceca5 | bellard | { |
787 | d9bce9d9 | j_mayer | do_adde_64(); |
788 | 79aceca5 | bellard | RETURN(); |
789 | 79aceca5 | bellard | } |
790 | d9bce9d9 | j_mayer | #endif
|
791 | 79aceca5 | bellard | |
792 | 79aceca5 | bellard | /* add immediate */
|
793 | 36081602 | j_mayer | void OPPROTO op_addi (void) |
794 | 79aceca5 | bellard | { |
795 | 36081602 | j_mayer | T0 += (int32_t)PARAM1; |
796 | 79aceca5 | bellard | RETURN(); |
797 | 79aceca5 | bellard | } |
798 | 79aceca5 | bellard | |
799 | d9bce9d9 | j_mayer | /* add to minus one extended */
|
800 | d9bce9d9 | j_mayer | void OPPROTO op_add_me (void) |
801 | 79aceca5 | bellard | { |
802 | d9bce9d9 | j_mayer | T0 += xer_ca + (-1);
|
803 | d9bce9d9 | j_mayer | if (likely((uint32_t)T1 != 0)) |
804 | 79aceca5 | bellard | xer_ca = 1;
|
805 | 79aceca5 | bellard | RETURN(); |
806 | 79aceca5 | bellard | } |
807 | 79aceca5 | bellard | |
808 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
809 | d9bce9d9 | j_mayer | void OPPROTO op_add_me_64 (void) |
810 | 79aceca5 | bellard | { |
811 | 79aceca5 | bellard | T0 += xer_ca + (-1);
|
812 | d9bce9d9 | j_mayer | if (likely((uint64_t)T1 != 0)) |
813 | 79aceca5 | bellard | xer_ca = 1;
|
814 | 79aceca5 | bellard | RETURN(); |
815 | 79aceca5 | bellard | } |
816 | d9bce9d9 | j_mayer | #endif
|
817 | 79aceca5 | bellard | |
818 | 76a66253 | j_mayer | void OPPROTO op_addmeo (void) |
819 | 79aceca5 | bellard | { |
820 | fdabc366 | bellard | do_addmeo(); |
821 | 79aceca5 | bellard | RETURN(); |
822 | 79aceca5 | bellard | } |
823 | 79aceca5 | bellard | |
824 | d9bce9d9 | j_mayer | void OPPROTO op_addmeo_64 (void) |
825 | d9bce9d9 | j_mayer | { |
826 | d9bce9d9 | j_mayer | do_addmeo(); |
827 | d9bce9d9 | j_mayer | RETURN(); |
828 | d9bce9d9 | j_mayer | } |
829 | d9bce9d9 | j_mayer | |
830 | 79aceca5 | bellard | /* add to zero extended */
|
831 | d9bce9d9 | j_mayer | void OPPROTO op_add_ze (void) |
832 | 79aceca5 | bellard | { |
833 | 79aceca5 | bellard | T0 += xer_ca; |
834 | 79aceca5 | bellard | RETURN(); |
835 | 79aceca5 | bellard | } |
836 | 79aceca5 | bellard | |
837 | d9bce9d9 | j_mayer | /* divide word */
|
838 | d9bce9d9 | j_mayer | void OPPROTO op_divw (void) |
839 | 79aceca5 | bellard | { |
840 | d9bce9d9 | j_mayer | if (unlikely(((int32_t)T0 == INT32_MIN && (int32_t)T1 == -1) || |
841 | d9bce9d9 | j_mayer | (int32_t)T1 == 0)) {
|
842 | d9bce9d9 | j_mayer | T0 = (int32_t)((-1) * ((uint32_t)T0 >> 31)); |
843 | d9bce9d9 | j_mayer | } else {
|
844 | d9bce9d9 | j_mayer | T0 = (int32_t)T0 / (int32_t)T1; |
845 | d9bce9d9 | j_mayer | } |
846 | 79aceca5 | bellard | RETURN(); |
847 | 79aceca5 | bellard | } |
848 | 79aceca5 | bellard | |
849 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
850 | d9bce9d9 | j_mayer | void OPPROTO op_divd (void) |
851 | 79aceca5 | bellard | { |
852 | d9bce9d9 | j_mayer | if (unlikely(((int64_t)T0 == INT64_MIN && (int64_t)T1 == -1) || |
853 | d9bce9d9 | j_mayer | (int64_t)T1 == 0)) {
|
854 | d9bce9d9 | j_mayer | T0 = (int64_t)((-1ULL) * ((uint64_t)T0 >> 63)); |
855 | 79aceca5 | bellard | } else {
|
856 | d9bce9d9 | j_mayer | T0 = (int64_t)T0 / (int64_t)T1; |
857 | 79aceca5 | bellard | } |
858 | 79aceca5 | bellard | RETURN(); |
859 | 79aceca5 | bellard | } |
860 | d9bce9d9 | j_mayer | #endif
|
861 | 79aceca5 | bellard | |
862 | 76a66253 | j_mayer | void OPPROTO op_divwo (void) |
863 | 79aceca5 | bellard | { |
864 | fdabc366 | bellard | do_divwo(); |
865 | 79aceca5 | bellard | RETURN(); |
866 | 79aceca5 | bellard | } |
867 | 79aceca5 | bellard | |
868 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
869 | d9bce9d9 | j_mayer | void OPPROTO op_divdo (void) |
870 | d9bce9d9 | j_mayer | { |
871 | d9bce9d9 | j_mayer | do_divdo(); |
872 | d9bce9d9 | j_mayer | RETURN(); |
873 | d9bce9d9 | j_mayer | } |
874 | d9bce9d9 | j_mayer | #endif
|
875 | d9bce9d9 | j_mayer | |
876 | 79aceca5 | bellard | /* divide word unsigned */
|
877 | d9bce9d9 | j_mayer | void OPPROTO op_divwu (void) |
878 | d9bce9d9 | j_mayer | { |
879 | d9bce9d9 | j_mayer | if (unlikely(T1 == 0)) { |
880 | d9bce9d9 | j_mayer | T0 = 0;
|
881 | d9bce9d9 | j_mayer | } else {
|
882 | d9bce9d9 | j_mayer | T0 = (uint32_t)T0 / (uint32_t)T1; |
883 | d9bce9d9 | j_mayer | } |
884 | d9bce9d9 | j_mayer | RETURN(); |
885 | d9bce9d9 | j_mayer | } |
886 | d9bce9d9 | j_mayer | |
887 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
888 | d9bce9d9 | j_mayer | void OPPROTO op_divdu (void) |
889 | 79aceca5 | bellard | { |
890 | d9bce9d9 | j_mayer | if (unlikely(T1 == 0)) { |
891 | 79aceca5 | bellard | T0 = 0;
|
892 | 79aceca5 | bellard | } else {
|
893 | 79aceca5 | bellard | T0 /= T1; |
894 | 79aceca5 | bellard | } |
895 | 79aceca5 | bellard | RETURN(); |
896 | 79aceca5 | bellard | } |
897 | d9bce9d9 | j_mayer | #endif
|
898 | 79aceca5 | bellard | |
899 | 76a66253 | j_mayer | void OPPROTO op_divwuo (void) |
900 | 79aceca5 | bellard | { |
901 | fdabc366 | bellard | do_divwuo(); |
902 | 79aceca5 | bellard | RETURN(); |
903 | 79aceca5 | bellard | } |
904 | 79aceca5 | bellard | |
905 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
906 | d9bce9d9 | j_mayer | void OPPROTO op_divduo (void) |
907 | d9bce9d9 | j_mayer | { |
908 | d9bce9d9 | j_mayer | do_divduo(); |
909 | d9bce9d9 | j_mayer | RETURN(); |
910 | d9bce9d9 | j_mayer | } |
911 | d9bce9d9 | j_mayer | #endif
|
912 | d9bce9d9 | j_mayer | |
913 | 79aceca5 | bellard | /* multiply high word */
|
914 | d9bce9d9 | j_mayer | void OPPROTO op_mulhw (void) |
915 | 79aceca5 | bellard | { |
916 | d9bce9d9 | j_mayer | T0 = ((int64_t)((int32_t)T0) * (int64_t)((int32_t)T1)) >> 32;
|
917 | 79aceca5 | bellard | RETURN(); |
918 | 79aceca5 | bellard | } |
919 | 79aceca5 | bellard | |
920 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
921 | d9bce9d9 | j_mayer | void OPPROTO op_mulhd (void) |
922 | d9bce9d9 | j_mayer | { |
923 | d9bce9d9 | j_mayer | uint64_t tl, th; |
924 | d9bce9d9 | j_mayer | |
925 | d9bce9d9 | j_mayer | do_imul64(&tl, &th); |
926 | d9bce9d9 | j_mayer | T0 = th; |
927 | d9bce9d9 | j_mayer | RETURN(); |
928 | d9bce9d9 | j_mayer | } |
929 | d9bce9d9 | j_mayer | #endif
|
930 | d9bce9d9 | j_mayer | |
931 | 79aceca5 | bellard | /* multiply high word unsigned */
|
932 | d9bce9d9 | j_mayer | void OPPROTO op_mulhwu (void) |
933 | 79aceca5 | bellard | { |
934 | d9bce9d9 | j_mayer | T0 = ((uint64_t)(uint32_t)T0 * (uint64_t)(uint32_t)T1) >> 32;
|
935 | 79aceca5 | bellard | RETURN(); |
936 | 79aceca5 | bellard | } |
937 | 79aceca5 | bellard | |
938 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
939 | d9bce9d9 | j_mayer | void OPPROTO op_mulhdu (void) |
940 | d9bce9d9 | j_mayer | { |
941 | d9bce9d9 | j_mayer | uint64_t tl, th; |
942 | d9bce9d9 | j_mayer | |
943 | d9bce9d9 | j_mayer | do_mul64(&tl, &th); |
944 | d9bce9d9 | j_mayer | T0 = th; |
945 | d9bce9d9 | j_mayer | RETURN(); |
946 | d9bce9d9 | j_mayer | } |
947 | d9bce9d9 | j_mayer | #endif
|
948 | d9bce9d9 | j_mayer | |
949 | 79aceca5 | bellard | /* multiply low immediate */
|
950 | 36081602 | j_mayer | void OPPROTO op_mulli (void) |
951 | 79aceca5 | bellard | { |
952 | d9bce9d9 | j_mayer | T0 = ((int32_t)T0 * (int32_t)PARAM1); |
953 | 79aceca5 | bellard | RETURN(); |
954 | 79aceca5 | bellard | } |
955 | 79aceca5 | bellard | |
956 | 79aceca5 | bellard | /* multiply low word */
|
957 | 36081602 | j_mayer | void OPPROTO op_mullw (void) |
958 | 79aceca5 | bellard | { |
959 | d9bce9d9 | j_mayer | T0 = (int32_t)(T0 * T1); |
960 | d9bce9d9 | j_mayer | RETURN(); |
961 | d9bce9d9 | j_mayer | } |
962 | d9bce9d9 | j_mayer | |
963 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
964 | d9bce9d9 | j_mayer | void OPPROTO op_mulld (void) |
965 | d9bce9d9 | j_mayer | { |
966 | 79aceca5 | bellard | T0 *= T1; |
967 | 79aceca5 | bellard | RETURN(); |
968 | 79aceca5 | bellard | } |
969 | d9bce9d9 | j_mayer | #endif
|
970 | 79aceca5 | bellard | |
971 | 76a66253 | j_mayer | void OPPROTO op_mullwo (void) |
972 | 79aceca5 | bellard | { |
973 | fdabc366 | bellard | do_mullwo(); |
974 | 79aceca5 | bellard | RETURN(); |
975 | 79aceca5 | bellard | } |
976 | 79aceca5 | bellard | |
977 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
978 | d9bce9d9 | j_mayer | void OPPROTO op_mulldo (void) |
979 | d9bce9d9 | j_mayer | { |
980 | d9bce9d9 | j_mayer | do_mulldo(); |
981 | d9bce9d9 | j_mayer | RETURN(); |
982 | d9bce9d9 | j_mayer | } |
983 | d9bce9d9 | j_mayer | #endif
|
984 | d9bce9d9 | j_mayer | |
985 | 79aceca5 | bellard | /* negate */
|
986 | d9bce9d9 | j_mayer | void OPPROTO op_neg (void) |
987 | 79aceca5 | bellard | { |
988 | d9bce9d9 | j_mayer | if (likely(T0 != INT32_MIN)) {
|
989 | d9bce9d9 | j_mayer | T0 = -(int32_t)T0; |
990 | 79aceca5 | bellard | } |
991 | 79aceca5 | bellard | RETURN(); |
992 | 79aceca5 | bellard | } |
993 | 79aceca5 | bellard | |
994 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
995 | d9bce9d9 | j_mayer | void OPPROTO op_neg_64 (void) |
996 | d9bce9d9 | j_mayer | { |
997 | d9bce9d9 | j_mayer | if (likely(T0 != INT64_MIN)) {
|
998 | d9bce9d9 | j_mayer | T0 = -(int64_t)T0; |
999 | d9bce9d9 | j_mayer | } |
1000 | d9bce9d9 | j_mayer | RETURN(); |
1001 | d9bce9d9 | j_mayer | } |
1002 | d9bce9d9 | j_mayer | #endif
|
1003 | d9bce9d9 | j_mayer | |
1004 | 76a66253 | j_mayer | void OPPROTO op_nego (void) |
1005 | 79aceca5 | bellard | { |
1006 | fdabc366 | bellard | do_nego(); |
1007 | 79aceca5 | bellard | RETURN(); |
1008 | 79aceca5 | bellard | } |
1009 | 79aceca5 | bellard | |
1010 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1011 | d9bce9d9 | j_mayer | void OPPROTO op_nego_64 (void) |
1012 | d9bce9d9 | j_mayer | { |
1013 | d9bce9d9 | j_mayer | do_nego_64(); |
1014 | d9bce9d9 | j_mayer | RETURN(); |
1015 | d9bce9d9 | j_mayer | } |
1016 | d9bce9d9 | j_mayer | #endif
|
1017 | d9bce9d9 | j_mayer | |
1018 | 0cfec834 | ths | /* subtract from */
|
1019 | 36081602 | j_mayer | void OPPROTO op_subf (void) |
1020 | 79aceca5 | bellard | { |
1021 | 79aceca5 | bellard | T0 = T1 - T0; |
1022 | 79aceca5 | bellard | RETURN(); |
1023 | 79aceca5 | bellard | } |
1024 | 79aceca5 | bellard | |
1025 | d9bce9d9 | j_mayer | void OPPROTO op_check_subfo (void) |
1026 | d9bce9d9 | j_mayer | { |
1027 | d9bce9d9 | j_mayer | if (likely(!(((uint32_t)(~T2) ^ (uint32_t)T1 ^ UINT32_MAX) &
|
1028 | d9bce9d9 | j_mayer | ((uint32_t)(~T2) ^ (uint32_t)T0) & (1UL << 31)))) { |
1029 | d9bce9d9 | j_mayer | xer_ov = 0;
|
1030 | d9bce9d9 | j_mayer | } else {
|
1031 | d9bce9d9 | j_mayer | xer_ov = 1;
|
1032 | 966439a6 | j_mayer | xer_so = 1;
|
1033 | d9bce9d9 | j_mayer | } |
1034 | d9bce9d9 | j_mayer | RETURN(); |
1035 | d9bce9d9 | j_mayer | } |
1036 | d9bce9d9 | j_mayer | |
1037 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1038 | d9bce9d9 | j_mayer | void OPPROTO op_check_subfo_64 (void) |
1039 | 79aceca5 | bellard | { |
1040 | d9bce9d9 | j_mayer | if (likely(!(((uint64_t)(~T2) ^ (uint64_t)T1 ^ UINT64_MAX) &
|
1041 | d9bce9d9 | j_mayer | ((uint64_t)(~T2) ^ (uint64_t)T0) & (1ULL << 63)))) { |
1042 | d9bce9d9 | j_mayer | xer_ov = 0;
|
1043 | d9bce9d9 | j_mayer | } else {
|
1044 | d9bce9d9 | j_mayer | xer_ov = 1;
|
1045 | 966439a6 | j_mayer | xer_so = 1;
|
1046 | d9bce9d9 | j_mayer | } |
1047 | 79aceca5 | bellard | RETURN(); |
1048 | 79aceca5 | bellard | } |
1049 | d9bce9d9 | j_mayer | #endif
|
1050 | 79aceca5 | bellard | |
1051 | 0cfec834 | ths | /* subtract from carrying */
|
1052 | d9bce9d9 | j_mayer | void OPPROTO op_check_subfc (void) |
1053 | 79aceca5 | bellard | { |
1054 | d9bce9d9 | j_mayer | if (likely((uint32_t)T0 > (uint32_t)T1)) {
|
1055 | 79aceca5 | bellard | xer_ca = 0;
|
1056 | d9bce9d9 | j_mayer | } else {
|
1057 | d9bce9d9 | j_mayer | xer_ca = 1;
|
1058 | 79aceca5 | bellard | } |
1059 | 79aceca5 | bellard | RETURN(); |
1060 | 79aceca5 | bellard | } |
1061 | 79aceca5 | bellard | |
1062 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1063 | d9bce9d9 | j_mayer | void OPPROTO op_check_subfc_64 (void) |
1064 | 79aceca5 | bellard | { |
1065 | d9bce9d9 | j_mayer | if (likely((uint64_t)T0 > (uint64_t)T1)) {
|
1066 | d9bce9d9 | j_mayer | xer_ca = 0;
|
1067 | d9bce9d9 | j_mayer | } else {
|
1068 | d9bce9d9 | j_mayer | xer_ca = 1;
|
1069 | d9bce9d9 | j_mayer | } |
1070 | 79aceca5 | bellard | RETURN(); |
1071 | 79aceca5 | bellard | } |
1072 | d9bce9d9 | j_mayer | #endif
|
1073 | 79aceca5 | bellard | |
1074 | 0cfec834 | ths | /* subtract from extended */
|
1075 | 76a66253 | j_mayer | void OPPROTO op_subfe (void) |
1076 | 79aceca5 | bellard | { |
1077 | fdabc366 | bellard | do_subfe(); |
1078 | 79aceca5 | bellard | RETURN(); |
1079 | 79aceca5 | bellard | } |
1080 | 79aceca5 | bellard | |
1081 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1082 | d9bce9d9 | j_mayer | void OPPROTO op_subfe_64 (void) |
1083 | 79aceca5 | bellard | { |
1084 | d9bce9d9 | j_mayer | do_subfe_64(); |
1085 | 79aceca5 | bellard | RETURN(); |
1086 | 79aceca5 | bellard | } |
1087 | d9bce9d9 | j_mayer | #endif
|
1088 | 79aceca5 | bellard | |
1089 | 0cfec834 | ths | /* subtract from immediate carrying */
|
1090 | d9bce9d9 | j_mayer | void OPPROTO op_subfic (void) |
1091 | 79aceca5 | bellard | { |
1092 | b6e27ab8 | j_mayer | T0 = (int32_t)PARAM1 + ~T0 + 1;
|
1093 | d9bce9d9 | j_mayer | if ((uint32_t)T0 <= (uint32_t)PARAM1) {
|
1094 | 79aceca5 | bellard | xer_ca = 1;
|
1095 | 79aceca5 | bellard | } else {
|
1096 | 79aceca5 | bellard | xer_ca = 0;
|
1097 | 79aceca5 | bellard | } |
1098 | 79aceca5 | bellard | RETURN(); |
1099 | 79aceca5 | bellard | } |
1100 | 79aceca5 | bellard | |
1101 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1102 | d9bce9d9 | j_mayer | void OPPROTO op_subfic_64 (void) |
1103 | d9bce9d9 | j_mayer | { |
1104 | d9bce9d9 | j_mayer | T0 = PARAM1 + ~T0 + 1;
|
1105 | d9bce9d9 | j_mayer | if ((uint64_t)T0 <= (uint64_t)PARAM1) {
|
1106 | d9bce9d9 | j_mayer | xer_ca = 1;
|
1107 | d9bce9d9 | j_mayer | } else {
|
1108 | d9bce9d9 | j_mayer | xer_ca = 0;
|
1109 | d9bce9d9 | j_mayer | } |
1110 | d9bce9d9 | j_mayer | RETURN(); |
1111 | d9bce9d9 | j_mayer | } |
1112 | d9bce9d9 | j_mayer | #endif
|
1113 | d9bce9d9 | j_mayer | |
1114 | 0cfec834 | ths | /* subtract from minus one extended */
|
1115 | d9bce9d9 | j_mayer | void OPPROTO op_subfme (void) |
1116 | 79aceca5 | bellard | { |
1117 | 79aceca5 | bellard | T0 = ~T0 + xer_ca - 1;
|
1118 | d9bce9d9 | j_mayer | if (likely((uint32_t)T0 != (uint32_t)-1)) |
1119 | d9bce9d9 | j_mayer | xer_ca = 1;
|
1120 | d9bce9d9 | j_mayer | RETURN(); |
1121 | d9bce9d9 | j_mayer | } |
1122 | 79aceca5 | bellard | |
1123 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1124 | d9bce9d9 | j_mayer | void OPPROTO op_subfme_64 (void) |
1125 | d9bce9d9 | j_mayer | { |
1126 | d9bce9d9 | j_mayer | T0 = ~T0 + xer_ca - 1;
|
1127 | d9bce9d9 | j_mayer | if (likely((uint64_t)T0 != (uint64_t)-1)) |
1128 | 79aceca5 | bellard | xer_ca = 1;
|
1129 | 79aceca5 | bellard | RETURN(); |
1130 | 79aceca5 | bellard | } |
1131 | d9bce9d9 | j_mayer | #endif
|
1132 | 79aceca5 | bellard | |
1133 | 76a66253 | j_mayer | void OPPROTO op_subfmeo (void) |
1134 | 79aceca5 | bellard | { |
1135 | fdabc366 | bellard | do_subfmeo(); |
1136 | 79aceca5 | bellard | RETURN(); |
1137 | 79aceca5 | bellard | } |
1138 | 79aceca5 | bellard | |
1139 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1140 | d9bce9d9 | j_mayer | void OPPROTO op_subfmeo_64 (void) |
1141 | d9bce9d9 | j_mayer | { |
1142 | d9bce9d9 | j_mayer | do_subfmeo_64(); |
1143 | d9bce9d9 | j_mayer | RETURN(); |
1144 | d9bce9d9 | j_mayer | } |
1145 | d9bce9d9 | j_mayer | #endif
|
1146 | d9bce9d9 | j_mayer | |
1147 | 0cfec834 | ths | /* subtract from zero extended */
|
1148 | d9bce9d9 | j_mayer | void OPPROTO op_subfze (void) |
1149 | 79aceca5 | bellard | { |
1150 | 79aceca5 | bellard | T1 = ~T0; |
1151 | 79aceca5 | bellard | T0 = T1 + xer_ca; |
1152 | d9bce9d9 | j_mayer | if ((uint32_t)T0 < (uint32_t)T1) {
|
1153 | 79aceca5 | bellard | xer_ca = 1;
|
1154 | 79aceca5 | bellard | } else {
|
1155 | 79aceca5 | bellard | xer_ca = 0;
|
1156 | 79aceca5 | bellard | } |
1157 | 79aceca5 | bellard | RETURN(); |
1158 | 79aceca5 | bellard | } |
1159 | 79aceca5 | bellard | |
1160 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1161 | d9bce9d9 | j_mayer | void OPPROTO op_subfze_64 (void) |
1162 | d9bce9d9 | j_mayer | { |
1163 | d9bce9d9 | j_mayer | T1 = ~T0; |
1164 | d9bce9d9 | j_mayer | T0 = T1 + xer_ca; |
1165 | d9bce9d9 | j_mayer | if ((uint64_t)T0 < (uint64_t)T1) {
|
1166 | d9bce9d9 | j_mayer | xer_ca = 1;
|
1167 | d9bce9d9 | j_mayer | } else {
|
1168 | d9bce9d9 | j_mayer | xer_ca = 0;
|
1169 | d9bce9d9 | j_mayer | } |
1170 | d9bce9d9 | j_mayer | RETURN(); |
1171 | d9bce9d9 | j_mayer | } |
1172 | d9bce9d9 | j_mayer | #endif
|
1173 | d9bce9d9 | j_mayer | |
1174 | 76a66253 | j_mayer | void OPPROTO op_subfzeo (void) |
1175 | 79aceca5 | bellard | { |
1176 | fdabc366 | bellard | do_subfzeo(); |
1177 | 79aceca5 | bellard | RETURN(); |
1178 | 79aceca5 | bellard | } |
1179 | 79aceca5 | bellard | |
1180 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1181 | d9bce9d9 | j_mayer | void OPPROTO op_subfzeo_64 (void) |
1182 | d9bce9d9 | j_mayer | { |
1183 | d9bce9d9 | j_mayer | do_subfzeo_64(); |
1184 | d9bce9d9 | j_mayer | RETURN(); |
1185 | d9bce9d9 | j_mayer | } |
1186 | d9bce9d9 | j_mayer | #endif
|
1187 | d9bce9d9 | j_mayer | |
1188 | 79aceca5 | bellard | /*** Integer comparison ***/
|
1189 | 79aceca5 | bellard | /* compare */
|
1190 | d9bce9d9 | j_mayer | void OPPROTO op_cmp (void) |
1191 | d9bce9d9 | j_mayer | { |
1192 | d9bce9d9 | j_mayer | if ((int32_t)T0 < (int32_t)T1) {
|
1193 | d9bce9d9 | j_mayer | T0 = 0x08;
|
1194 | d9bce9d9 | j_mayer | } else if ((int32_t)T0 > (int32_t)T1) { |
1195 | d9bce9d9 | j_mayer | T0 = 0x04;
|
1196 | d9bce9d9 | j_mayer | } else {
|
1197 | d9bce9d9 | j_mayer | T0 = 0x02;
|
1198 | d9bce9d9 | j_mayer | } |
1199 | 966439a6 | j_mayer | T0 |= xer_so; |
1200 | d9bce9d9 | j_mayer | RETURN(); |
1201 | d9bce9d9 | j_mayer | } |
1202 | d9bce9d9 | j_mayer | |
1203 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1204 | d9bce9d9 | j_mayer | void OPPROTO op_cmp_64 (void) |
1205 | 79aceca5 | bellard | { |
1206 | d9bce9d9 | j_mayer | if ((int64_t)T0 < (int64_t)T1) {
|
1207 | 79aceca5 | bellard | T0 = 0x08;
|
1208 | d9bce9d9 | j_mayer | } else if ((int64_t)T0 > (int64_t)T1) { |
1209 | 79aceca5 | bellard | T0 = 0x04;
|
1210 | 79aceca5 | bellard | } else {
|
1211 | 79aceca5 | bellard | T0 = 0x02;
|
1212 | 79aceca5 | bellard | } |
1213 | 966439a6 | j_mayer | T0 |= xer_so; |
1214 | 79aceca5 | bellard | RETURN(); |
1215 | 79aceca5 | bellard | } |
1216 | d9bce9d9 | j_mayer | #endif
|
1217 | 79aceca5 | bellard | |
1218 | 79aceca5 | bellard | /* compare immediate */
|
1219 | d9bce9d9 | j_mayer | void OPPROTO op_cmpi (void) |
1220 | 79aceca5 | bellard | { |
1221 | d9bce9d9 | j_mayer | if ((int32_t)T0 < (int32_t)PARAM1) {
|
1222 | 79aceca5 | bellard | T0 = 0x08;
|
1223 | d9bce9d9 | j_mayer | } else if ((int32_t)T0 > (int32_t)PARAM1) { |
1224 | 79aceca5 | bellard | T0 = 0x04;
|
1225 | 79aceca5 | bellard | } else {
|
1226 | 79aceca5 | bellard | T0 = 0x02;
|
1227 | 79aceca5 | bellard | } |
1228 | 966439a6 | j_mayer | T0 |= xer_so; |
1229 | 79aceca5 | bellard | RETURN(); |
1230 | 79aceca5 | bellard | } |
1231 | 79aceca5 | bellard | |
1232 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1233 | d9bce9d9 | j_mayer | void OPPROTO op_cmpi_64 (void) |
1234 | d9bce9d9 | j_mayer | { |
1235 | d9bce9d9 | j_mayer | if ((int64_t)T0 < (int64_t)((int32_t)PARAM1)) {
|
1236 | d9bce9d9 | j_mayer | T0 = 0x08;
|
1237 | d9bce9d9 | j_mayer | } else if ((int64_t)T0 > (int64_t)((int32_t)PARAM1)) { |
1238 | d9bce9d9 | j_mayer | T0 = 0x04;
|
1239 | d9bce9d9 | j_mayer | } else {
|
1240 | d9bce9d9 | j_mayer | T0 = 0x02;
|
1241 | d9bce9d9 | j_mayer | } |
1242 | 966439a6 | j_mayer | T0 |= xer_so; |
1243 | d9bce9d9 | j_mayer | RETURN(); |
1244 | d9bce9d9 | j_mayer | } |
1245 | d9bce9d9 | j_mayer | #endif
|
1246 | d9bce9d9 | j_mayer | |
1247 | 79aceca5 | bellard | /* compare logical */
|
1248 | d9bce9d9 | j_mayer | void OPPROTO op_cmpl (void) |
1249 | 79aceca5 | bellard | { |
1250 | d9bce9d9 | j_mayer | if ((uint32_t)T0 < (uint32_t)T1) {
|
1251 | 79aceca5 | bellard | T0 = 0x08;
|
1252 | d9bce9d9 | j_mayer | } else if ((uint32_t)T0 > (uint32_t)T1) { |
1253 | 79aceca5 | bellard | T0 = 0x04;
|
1254 | 79aceca5 | bellard | } else {
|
1255 | 79aceca5 | bellard | T0 = 0x02;
|
1256 | 79aceca5 | bellard | } |
1257 | 966439a6 | j_mayer | T0 |= xer_so; |
1258 | 79aceca5 | bellard | RETURN(); |
1259 | 79aceca5 | bellard | } |
1260 | 79aceca5 | bellard | |
1261 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1262 | d9bce9d9 | j_mayer | void OPPROTO op_cmpl_64 (void) |
1263 | d9bce9d9 | j_mayer | { |
1264 | d9bce9d9 | j_mayer | if ((uint64_t)T0 < (uint64_t)T1) {
|
1265 | d9bce9d9 | j_mayer | T0 = 0x08;
|
1266 | d9bce9d9 | j_mayer | } else if ((uint64_t)T0 > (uint64_t)T1) { |
1267 | d9bce9d9 | j_mayer | T0 = 0x04;
|
1268 | d9bce9d9 | j_mayer | } else {
|
1269 | d9bce9d9 | j_mayer | T0 = 0x02;
|
1270 | d9bce9d9 | j_mayer | } |
1271 | 966439a6 | j_mayer | T0 |= xer_so; |
1272 | d9bce9d9 | j_mayer | RETURN(); |
1273 | d9bce9d9 | j_mayer | } |
1274 | d9bce9d9 | j_mayer | #endif
|
1275 | d9bce9d9 | j_mayer | |
1276 | 79aceca5 | bellard | /* compare logical immediate */
|
1277 | d9bce9d9 | j_mayer | void OPPROTO op_cmpli (void) |
1278 | d9bce9d9 | j_mayer | { |
1279 | d9bce9d9 | j_mayer | if ((uint32_t)T0 < (uint32_t)PARAM1) {
|
1280 | d9bce9d9 | j_mayer | T0 = 0x08;
|
1281 | d9bce9d9 | j_mayer | } else if ((uint32_t)T0 > (uint32_t)PARAM1) { |
1282 | d9bce9d9 | j_mayer | T0 = 0x04;
|
1283 | d9bce9d9 | j_mayer | } else {
|
1284 | d9bce9d9 | j_mayer | T0 = 0x02;
|
1285 | d9bce9d9 | j_mayer | } |
1286 | 966439a6 | j_mayer | T0 |= xer_so; |
1287 | d9bce9d9 | j_mayer | RETURN(); |
1288 | d9bce9d9 | j_mayer | } |
1289 | d9bce9d9 | j_mayer | |
1290 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1291 | d9bce9d9 | j_mayer | void OPPROTO op_cmpli_64 (void) |
1292 | 79aceca5 | bellard | { |
1293 | d9bce9d9 | j_mayer | if ((uint64_t)T0 < (uint64_t)PARAM1) {
|
1294 | 79aceca5 | bellard | T0 = 0x08;
|
1295 | d9bce9d9 | j_mayer | } else if ((uint64_t)T0 > (uint64_t)PARAM1) { |
1296 | 79aceca5 | bellard | T0 = 0x04;
|
1297 | 79aceca5 | bellard | } else {
|
1298 | 79aceca5 | bellard | T0 = 0x02;
|
1299 | 79aceca5 | bellard | } |
1300 | 966439a6 | j_mayer | T0 |= xer_so; |
1301 | 79aceca5 | bellard | RETURN(); |
1302 | 79aceca5 | bellard | } |
1303 | d9bce9d9 | j_mayer | #endif
|
1304 | d9bce9d9 | j_mayer | |
1305 | d9bce9d9 | j_mayer | void OPPROTO op_isel (void) |
1306 | d9bce9d9 | j_mayer | { |
1307 | d9bce9d9 | j_mayer | if (T0)
|
1308 | d9bce9d9 | j_mayer | T0 = T1; |
1309 | d9bce9d9 | j_mayer | else
|
1310 | d9bce9d9 | j_mayer | T0 = T2; |
1311 | d9bce9d9 | j_mayer | RETURN(); |
1312 | d9bce9d9 | j_mayer | } |
1313 | d9bce9d9 | j_mayer | |
1314 | d9bce9d9 | j_mayer | void OPPROTO op_popcntb (void) |
1315 | d9bce9d9 | j_mayer | { |
1316 | d9bce9d9 | j_mayer | do_popcntb(); |
1317 | d9bce9d9 | j_mayer | RETURN(); |
1318 | d9bce9d9 | j_mayer | } |
1319 | d9bce9d9 | j_mayer | |
1320 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1321 | d9bce9d9 | j_mayer | void OPPROTO op_popcntb_64 (void) |
1322 | d9bce9d9 | j_mayer | { |
1323 | d9bce9d9 | j_mayer | do_popcntb_64(); |
1324 | d9bce9d9 | j_mayer | RETURN(); |
1325 | d9bce9d9 | j_mayer | } |
1326 | d9bce9d9 | j_mayer | #endif
|
1327 | 79aceca5 | bellard | |
1328 | 79aceca5 | bellard | /*** Integer logical ***/
|
1329 | 79aceca5 | bellard | /* and */
|
1330 | 36081602 | j_mayer | void OPPROTO op_and (void) |
1331 | 79aceca5 | bellard | { |
1332 | 79aceca5 | bellard | T0 &= T1; |
1333 | 79aceca5 | bellard | RETURN(); |
1334 | 79aceca5 | bellard | } |
1335 | 79aceca5 | bellard | |
1336 | 79aceca5 | bellard | /* andc */
|
1337 | 36081602 | j_mayer | void OPPROTO op_andc (void) |
1338 | 79aceca5 | bellard | { |
1339 | 79aceca5 | bellard | T0 &= ~T1; |
1340 | 79aceca5 | bellard | RETURN(); |
1341 | 79aceca5 | bellard | } |
1342 | 79aceca5 | bellard | |
1343 | 79aceca5 | bellard | /* andi. */
|
1344 | 76a66253 | j_mayer | void OPPROTO op_andi_T0 (void) |
1345 | 79aceca5 | bellard | { |
1346 | 36081602 | j_mayer | T0 &= PARAM1; |
1347 | 79aceca5 | bellard | RETURN(); |
1348 | 79aceca5 | bellard | } |
1349 | 79aceca5 | bellard | |
1350 | 76a66253 | j_mayer | void OPPROTO op_andi_T1 (void) |
1351 | 76a66253 | j_mayer | { |
1352 | 76a66253 | j_mayer | T1 &= PARAM1; |
1353 | 76a66253 | j_mayer | RETURN(); |
1354 | 76a66253 | j_mayer | } |
1355 | 76a66253 | j_mayer | |
1356 | 40d0591e | j_mayer | #if defined(TARGET_PPC64)
|
1357 | 40d0591e | j_mayer | void OPPROTO op_andi_T0_64 (void) |
1358 | 40d0591e | j_mayer | { |
1359 | 40d0591e | j_mayer | T0 &= ((uint64_t)PARAM1 << 32) | PARAM2;
|
1360 | 40d0591e | j_mayer | RETURN(); |
1361 | 40d0591e | j_mayer | } |
1362 | 40d0591e | j_mayer | |
1363 | 40d0591e | j_mayer | void OPPROTO op_andi_T1_64 (void) |
1364 | 40d0591e | j_mayer | { |
1365 | 40d0591e | j_mayer | T1 &= ((uint64_t)PARAM1 << 32) | PARAM2;
|
1366 | 40d0591e | j_mayer | RETURN(); |
1367 | 40d0591e | j_mayer | } |
1368 | 40d0591e | j_mayer | #endif
|
1369 | 40d0591e | j_mayer | |
1370 | 40d0591e | j_mayer | |
1371 | 79aceca5 | bellard | /* count leading zero */
|
1372 | 76a66253 | j_mayer | void OPPROTO op_cntlzw (void) |
1373 | 79aceca5 | bellard | { |
1374 | 0487d6a8 | j_mayer | T0 = _do_cntlzw(T0); |
1375 | 79aceca5 | bellard | RETURN(); |
1376 | 79aceca5 | bellard | } |
1377 | 79aceca5 | bellard | |
1378 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1379 | d9bce9d9 | j_mayer | void OPPROTO op_cntlzd (void) |
1380 | d9bce9d9 | j_mayer | { |
1381 | 0487d6a8 | j_mayer | T0 = _do_cntlzd(T0); |
1382 | d9bce9d9 | j_mayer | RETURN(); |
1383 | d9bce9d9 | j_mayer | } |
1384 | d9bce9d9 | j_mayer | #endif
|
1385 | d9bce9d9 | j_mayer | |
1386 | 79aceca5 | bellard | /* eqv */
|
1387 | 36081602 | j_mayer | void OPPROTO op_eqv (void) |
1388 | 79aceca5 | bellard | { |
1389 | 79aceca5 | bellard | T0 = ~(T0 ^ T1); |
1390 | 79aceca5 | bellard | RETURN(); |
1391 | 79aceca5 | bellard | } |
1392 | 79aceca5 | bellard | |
1393 | 79aceca5 | bellard | /* extend sign byte */
|
1394 | d9bce9d9 | j_mayer | void OPPROTO op_extsb (void) |
1395 | 79aceca5 | bellard | { |
1396 | d9bce9d9 | j_mayer | #if defined (TARGET_PPC64)
|
1397 | d9bce9d9 | j_mayer | T0 = (int64_t)((int8_t)T0); |
1398 | d9bce9d9 | j_mayer | #else
|
1399 | d9bce9d9 | j_mayer | T0 = (int32_t)((int8_t)T0); |
1400 | d9bce9d9 | j_mayer | #endif
|
1401 | 79aceca5 | bellard | RETURN(); |
1402 | 79aceca5 | bellard | } |
1403 | 79aceca5 | bellard | |
1404 | 79aceca5 | bellard | /* extend sign half word */
|
1405 | d9bce9d9 | j_mayer | void OPPROTO op_extsh (void) |
1406 | 79aceca5 | bellard | { |
1407 | d9bce9d9 | j_mayer | #if defined (TARGET_PPC64)
|
1408 | d9bce9d9 | j_mayer | T0 = (int64_t)((int16_t)T0); |
1409 | d9bce9d9 | j_mayer | #else
|
1410 | d9bce9d9 | j_mayer | T0 = (int32_t)((int16_t)T0); |
1411 | d9bce9d9 | j_mayer | #endif
|
1412 | 79aceca5 | bellard | RETURN(); |
1413 | 79aceca5 | bellard | } |
1414 | 79aceca5 | bellard | |
1415 | d9bce9d9 | j_mayer | #if defined (TARGET_PPC64)
|
1416 | d9bce9d9 | j_mayer | void OPPROTO op_extsw (void) |
1417 | d9bce9d9 | j_mayer | { |
1418 | d9bce9d9 | j_mayer | T0 = (int64_t)((int32_t)T0); |
1419 | d9bce9d9 | j_mayer | RETURN(); |
1420 | d9bce9d9 | j_mayer | } |
1421 | d9bce9d9 | j_mayer | #endif
|
1422 | d9bce9d9 | j_mayer | |
1423 | 79aceca5 | bellard | /* nand */
|
1424 | 36081602 | j_mayer | void OPPROTO op_nand (void) |
1425 | 79aceca5 | bellard | { |
1426 | 79aceca5 | bellard | T0 = ~(T0 & T1); |
1427 | 79aceca5 | bellard | RETURN(); |
1428 | 79aceca5 | bellard | } |
1429 | 79aceca5 | bellard | |
1430 | 79aceca5 | bellard | /* nor */
|
1431 | 36081602 | j_mayer | void OPPROTO op_nor (void) |
1432 | 79aceca5 | bellard | { |
1433 | 79aceca5 | bellard | T0 = ~(T0 | T1); |
1434 | 79aceca5 | bellard | RETURN(); |
1435 | 79aceca5 | bellard | } |
1436 | 79aceca5 | bellard | |
1437 | 79aceca5 | bellard | /* or */
|
1438 | 36081602 | j_mayer | void OPPROTO op_or (void) |
1439 | 79aceca5 | bellard | { |
1440 | 79aceca5 | bellard | T0 |= T1; |
1441 | 79aceca5 | bellard | RETURN(); |
1442 | 79aceca5 | bellard | } |
1443 | 79aceca5 | bellard | |
1444 | 79aceca5 | bellard | /* orc */
|
1445 | 36081602 | j_mayer | void OPPROTO op_orc (void) |
1446 | 79aceca5 | bellard | { |
1447 | 79aceca5 | bellard | T0 |= ~T1; |
1448 | 79aceca5 | bellard | RETURN(); |
1449 | 79aceca5 | bellard | } |
1450 | 79aceca5 | bellard | |
1451 | 79aceca5 | bellard | /* ori */
|
1452 | 36081602 | j_mayer | void OPPROTO op_ori (void) |
1453 | 79aceca5 | bellard | { |
1454 | 36081602 | j_mayer | T0 |= PARAM1; |
1455 | 79aceca5 | bellard | RETURN(); |
1456 | 79aceca5 | bellard | } |
1457 | 79aceca5 | bellard | |
1458 | 79aceca5 | bellard | /* xor */
|
1459 | 36081602 | j_mayer | void OPPROTO op_xor (void) |
1460 | 79aceca5 | bellard | { |
1461 | 79aceca5 | bellard | T0 ^= T1; |
1462 | 79aceca5 | bellard | RETURN(); |
1463 | 79aceca5 | bellard | } |
1464 | 79aceca5 | bellard | |
1465 | 79aceca5 | bellard | /* xori */
|
1466 | 36081602 | j_mayer | void OPPROTO op_xori (void) |
1467 | 79aceca5 | bellard | { |
1468 | 36081602 | j_mayer | T0 ^= PARAM1; |
1469 | 79aceca5 | bellard | RETURN(); |
1470 | 79aceca5 | bellard | } |
1471 | 79aceca5 | bellard | |
1472 | 79aceca5 | bellard | /*** Integer rotate ***/
|
1473 | 76a66253 | j_mayer | void OPPROTO op_rotl32_T0_T1 (void) |
1474 | 79aceca5 | bellard | { |
1475 | 76a66253 | j_mayer | T0 = rotl32(T0, T1 & 0x1F);
|
1476 | 79aceca5 | bellard | RETURN(); |
1477 | 79aceca5 | bellard | } |
1478 | 79aceca5 | bellard | |
1479 | 76a66253 | j_mayer | void OPPROTO op_rotli32_T0 (void) |
1480 | 79aceca5 | bellard | { |
1481 | 76a66253 | j_mayer | T0 = rotl32(T0, PARAM1); |
1482 | 79aceca5 | bellard | RETURN(); |
1483 | 79aceca5 | bellard | } |
1484 | 79aceca5 | bellard | |
1485 | 51789c41 | j_mayer | #if defined(TARGET_PPC64)
|
1486 | 51789c41 | j_mayer | void OPPROTO op_rotl64_T0_T1 (void) |
1487 | 51789c41 | j_mayer | { |
1488 | 51789c41 | j_mayer | T0 = rotl64(T0, T1 & 0x3F);
|
1489 | 51789c41 | j_mayer | RETURN(); |
1490 | 51789c41 | j_mayer | } |
1491 | 51789c41 | j_mayer | |
1492 | 51789c41 | j_mayer | void OPPROTO op_rotli64_T0 (void) |
1493 | 51789c41 | j_mayer | { |
1494 | 51789c41 | j_mayer | T0 = rotl64(T0, PARAM1); |
1495 | 51789c41 | j_mayer | RETURN(); |
1496 | 51789c41 | j_mayer | } |
1497 | 51789c41 | j_mayer | #endif
|
1498 | 51789c41 | j_mayer | |
1499 | 79aceca5 | bellard | /*** Integer shift ***/
|
1500 | 79aceca5 | bellard | /* shift left word */
|
1501 | d9bce9d9 | j_mayer | void OPPROTO op_slw (void) |
1502 | 79aceca5 | bellard | { |
1503 | 79aceca5 | bellard | if (T1 & 0x20) { |
1504 | 79aceca5 | bellard | T0 = 0;
|
1505 | 79aceca5 | bellard | } else {
|
1506 | d9bce9d9 | j_mayer | T0 = (uint32_t)(T0 << T1); |
1507 | d9bce9d9 | j_mayer | } |
1508 | d9bce9d9 | j_mayer | RETURN(); |
1509 | d9bce9d9 | j_mayer | } |
1510 | d9bce9d9 | j_mayer | |
1511 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1512 | d9bce9d9 | j_mayer | void OPPROTO op_sld (void) |
1513 | d9bce9d9 | j_mayer | { |
1514 | d9bce9d9 | j_mayer | if (T1 & 0x40) { |
1515 | d9bce9d9 | j_mayer | T0 = 0;
|
1516 | d9bce9d9 | j_mayer | } else {
|
1517 | 79aceca5 | bellard | T0 = T0 << T1; |
1518 | 79aceca5 | bellard | } |
1519 | 79aceca5 | bellard | RETURN(); |
1520 | 79aceca5 | bellard | } |
1521 | d9bce9d9 | j_mayer | #endif
|
1522 | 79aceca5 | bellard | |
1523 | 79aceca5 | bellard | /* shift right algebraic word */
|
1524 | 76a66253 | j_mayer | void OPPROTO op_sraw (void) |
1525 | 79aceca5 | bellard | { |
1526 | 9a64fbe4 | bellard | do_sraw(); |
1527 | 79aceca5 | bellard | RETURN(); |
1528 | 79aceca5 | bellard | } |
1529 | 79aceca5 | bellard | |
1530 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1531 | d9bce9d9 | j_mayer | void OPPROTO op_srad (void) |
1532 | d9bce9d9 | j_mayer | { |
1533 | d9bce9d9 | j_mayer | do_srad(); |
1534 | d9bce9d9 | j_mayer | RETURN(); |
1535 | d9bce9d9 | j_mayer | } |
1536 | d9bce9d9 | j_mayer | #endif
|
1537 | d9bce9d9 | j_mayer | |
1538 | 79aceca5 | bellard | /* shift right algebraic word immediate */
|
1539 | d9bce9d9 | j_mayer | void OPPROTO op_srawi (void) |
1540 | 79aceca5 | bellard | { |
1541 | d9bce9d9 | j_mayer | uint32_t mask = (uint32_t)PARAM2; |
1542 | d9bce9d9 | j_mayer | |
1543 | d9bce9d9 | j_mayer | T0 = (int32_t)T0 >> PARAM1; |
1544 | d9bce9d9 | j_mayer | if ((int32_t)T1 < 0 && (T1 & mask) != 0) { |
1545 | 79aceca5 | bellard | xer_ca = 1;
|
1546 | 79aceca5 | bellard | } else {
|
1547 | 79aceca5 | bellard | xer_ca = 0;
|
1548 | 79aceca5 | bellard | } |
1549 | 79aceca5 | bellard | RETURN(); |
1550 | 79aceca5 | bellard | } |
1551 | 79aceca5 | bellard | |
1552 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1553 | d9bce9d9 | j_mayer | void OPPROTO op_sradi (void) |
1554 | d9bce9d9 | j_mayer | { |
1555 | d9bce9d9 | j_mayer | uint64_t mask = ((uint64_t)PARAM2 << 32) | (uint64_t)PARAM3;
|
1556 | d9bce9d9 | j_mayer | |
1557 | d9bce9d9 | j_mayer | T0 = (int64_t)T0 >> PARAM1; |
1558 | d9bce9d9 | j_mayer | if ((int64_t)T1 < 0 && ((uint64_t)T1 & mask) != 0) { |
1559 | d9bce9d9 | j_mayer | xer_ca = 1;
|
1560 | d9bce9d9 | j_mayer | } else {
|
1561 | d9bce9d9 | j_mayer | xer_ca = 0;
|
1562 | d9bce9d9 | j_mayer | } |
1563 | d9bce9d9 | j_mayer | RETURN(); |
1564 | d9bce9d9 | j_mayer | } |
1565 | d9bce9d9 | j_mayer | #endif
|
1566 | d9bce9d9 | j_mayer | |
1567 | 79aceca5 | bellard | /* shift right word */
|
1568 | d9bce9d9 | j_mayer | void OPPROTO op_srw (void) |
1569 | 79aceca5 | bellard | { |
1570 | 79aceca5 | bellard | if (T1 & 0x20) { |
1571 | 79aceca5 | bellard | T0 = 0;
|
1572 | 79aceca5 | bellard | } else {
|
1573 | d9bce9d9 | j_mayer | T0 = (uint32_t)T0 >> T1; |
1574 | d9bce9d9 | j_mayer | } |
1575 | d9bce9d9 | j_mayer | RETURN(); |
1576 | d9bce9d9 | j_mayer | } |
1577 | d9bce9d9 | j_mayer | |
1578 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1579 | d9bce9d9 | j_mayer | void OPPROTO op_srd (void) |
1580 | d9bce9d9 | j_mayer | { |
1581 | d9bce9d9 | j_mayer | if (T1 & 0x40) { |
1582 | d9bce9d9 | j_mayer | T0 = 0;
|
1583 | d9bce9d9 | j_mayer | } else {
|
1584 | d9bce9d9 | j_mayer | T0 = (uint64_t)T0 >> T1; |
1585 | 79aceca5 | bellard | } |
1586 | 79aceca5 | bellard | RETURN(); |
1587 | 79aceca5 | bellard | } |
1588 | d9bce9d9 | j_mayer | #endif
|
1589 | 79aceca5 | bellard | |
1590 | 76a66253 | j_mayer | void OPPROTO op_sl_T0_T1 (void) |
1591 | 76a66253 | j_mayer | { |
1592 | 76a66253 | j_mayer | T0 = T0 << T1; |
1593 | 76a66253 | j_mayer | RETURN(); |
1594 | 76a66253 | j_mayer | } |
1595 | 76a66253 | j_mayer | |
1596 | 76a66253 | j_mayer | void OPPROTO op_sli_T0 (void) |
1597 | 76a66253 | j_mayer | { |
1598 | 76a66253 | j_mayer | T0 = T0 << PARAM1; |
1599 | 76a66253 | j_mayer | RETURN(); |
1600 | 76a66253 | j_mayer | } |
1601 | 76a66253 | j_mayer | |
1602 | 76a66253 | j_mayer | void OPPROTO op_srl_T0_T1 (void) |
1603 | 76a66253 | j_mayer | { |
1604 | d9bce9d9 | j_mayer | T0 = (uint32_t)T0 >> T1; |
1605 | d9bce9d9 | j_mayer | RETURN(); |
1606 | d9bce9d9 | j_mayer | } |
1607 | d9bce9d9 | j_mayer | |
1608 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1609 | d9bce9d9 | j_mayer | void OPPROTO op_srl_T0_T1_64 (void) |
1610 | d9bce9d9 | j_mayer | { |
1611 | d9bce9d9 | j_mayer | T0 = (uint32_t)T0 >> T1; |
1612 | 76a66253 | j_mayer | RETURN(); |
1613 | 76a66253 | j_mayer | } |
1614 | d9bce9d9 | j_mayer | #endif
|
1615 | 76a66253 | j_mayer | |
1616 | 76a66253 | j_mayer | void OPPROTO op_srli_T0 (void) |
1617 | 76a66253 | j_mayer | { |
1618 | d9bce9d9 | j_mayer | T0 = (uint32_t)T0 >> PARAM1; |
1619 | 76a66253 | j_mayer | RETURN(); |
1620 | 76a66253 | j_mayer | } |
1621 | 76a66253 | j_mayer | |
1622 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1623 | d9bce9d9 | j_mayer | void OPPROTO op_srli_T0_64 (void) |
1624 | d9bce9d9 | j_mayer | { |
1625 | d9bce9d9 | j_mayer | T0 = (uint64_t)T0 >> PARAM1; |
1626 | d9bce9d9 | j_mayer | RETURN(); |
1627 | d9bce9d9 | j_mayer | } |
1628 | d9bce9d9 | j_mayer | #endif
|
1629 | d9bce9d9 | j_mayer | |
1630 | 76a66253 | j_mayer | void OPPROTO op_srli_T1 (void) |
1631 | 76a66253 | j_mayer | { |
1632 | d9bce9d9 | j_mayer | T1 = (uint32_t)T1 >> PARAM1; |
1633 | 76a66253 | j_mayer | RETURN(); |
1634 | 76a66253 | j_mayer | } |
1635 | 76a66253 | j_mayer | |
1636 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1637 | d9bce9d9 | j_mayer | void OPPROTO op_srli_T1_64 (void) |
1638 | d9bce9d9 | j_mayer | { |
1639 | d9bce9d9 | j_mayer | T1 = (uint64_t)T1 >> PARAM1; |
1640 | d9bce9d9 | j_mayer | RETURN(); |
1641 | d9bce9d9 | j_mayer | } |
1642 | d9bce9d9 | j_mayer | #endif
|
1643 | d9bce9d9 | j_mayer | |
1644 | 79aceca5 | bellard | /*** Floating-Point arithmetic ***/
|
1645 | 9a64fbe4 | bellard | /* fadd - fadd. */
|
1646 | 36081602 | j_mayer | void OPPROTO op_fadd (void) |
1647 | 79aceca5 | bellard | { |
1648 | 76a66253 | j_mayer | FT0 = float64_add(FT0, FT1, &env->fp_status); |
1649 | 79aceca5 | bellard | RETURN(); |
1650 | 79aceca5 | bellard | } |
1651 | 79aceca5 | bellard | |
1652 | 9a64fbe4 | bellard | /* fsub - fsub. */
|
1653 | 36081602 | j_mayer | void OPPROTO op_fsub (void) |
1654 | 79aceca5 | bellard | { |
1655 | 76a66253 | j_mayer | FT0 = float64_sub(FT0, FT1, &env->fp_status); |
1656 | 79aceca5 | bellard | RETURN(); |
1657 | 79aceca5 | bellard | } |
1658 | 79aceca5 | bellard | |
1659 | 9a64fbe4 | bellard | /* fmul - fmul. */
|
1660 | 36081602 | j_mayer | void OPPROTO op_fmul (void) |
1661 | 79aceca5 | bellard | { |
1662 | 76a66253 | j_mayer | FT0 = float64_mul(FT0, FT1, &env->fp_status); |
1663 | 79aceca5 | bellard | RETURN(); |
1664 | 79aceca5 | bellard | } |
1665 | 79aceca5 | bellard | |
1666 | 9a64fbe4 | bellard | /* fdiv - fdiv. */
|
1667 | 36081602 | j_mayer | void OPPROTO op_fdiv (void) |
1668 | 79aceca5 | bellard | { |
1669 | fdabc366 | bellard | FT0 = float64_div(FT0, FT1, &env->fp_status); |
1670 | 79aceca5 | bellard | RETURN(); |
1671 | 79aceca5 | bellard | } |
1672 | 28b6751f | bellard | |
1673 | 9a64fbe4 | bellard | /* fsqrt - fsqrt. */
|
1674 | 36081602 | j_mayer | void OPPROTO op_fsqrt (void) |
1675 | 28b6751f | bellard | { |
1676 | 9a64fbe4 | bellard | do_fsqrt(); |
1677 | 9a64fbe4 | bellard | RETURN(); |
1678 | 28b6751f | bellard | } |
1679 | 28b6751f | bellard | |
1680 | 9a64fbe4 | bellard | /* fres - fres. */
|
1681 | 36081602 | j_mayer | void OPPROTO op_fres (void) |
1682 | 28b6751f | bellard | { |
1683 | 9a64fbe4 | bellard | do_fres(); |
1684 | 9a64fbe4 | bellard | RETURN(); |
1685 | 28b6751f | bellard | } |
1686 | 28b6751f | bellard | |
1687 | 9a64fbe4 | bellard | /* frsqrte - frsqrte. */
|
1688 | 36081602 | j_mayer | void OPPROTO op_frsqrte (void) |
1689 | 28b6751f | bellard | { |
1690 | 4ecc3190 | bellard | do_frsqrte(); |
1691 | 9a64fbe4 | bellard | RETURN(); |
1692 | 28b6751f | bellard | } |
1693 | 28b6751f | bellard | |
1694 | 9a64fbe4 | bellard | /* fsel - fsel. */
|
1695 | 36081602 | j_mayer | void OPPROTO op_fsel (void) |
1696 | 28b6751f | bellard | { |
1697 | 9a64fbe4 | bellard | do_fsel(); |
1698 | 9a64fbe4 | bellard | RETURN(); |
1699 | 28b6751f | bellard | } |
1700 | 28b6751f | bellard | |
1701 | 9a64fbe4 | bellard | /*** Floating-Point multiply-and-add ***/
|
1702 | 9a64fbe4 | bellard | /* fmadd - fmadd. */
|
1703 | 36081602 | j_mayer | void OPPROTO op_fmadd (void) |
1704 | 28b6751f | bellard | { |
1705 | e864cabd | j_mayer | #if USE_PRECISE_EMULATION
|
1706 | e864cabd | j_mayer | do_fmadd(); |
1707 | e864cabd | j_mayer | #else
|
1708 | 76a66253 | j_mayer | FT0 = float64_mul(FT0, FT1, &env->fp_status); |
1709 | 76a66253 | j_mayer | FT0 = float64_add(FT0, FT2, &env->fp_status); |
1710 | e864cabd | j_mayer | #endif
|
1711 | 9a64fbe4 | bellard | RETURN(); |
1712 | 28b6751f | bellard | } |
1713 | 28b6751f | bellard | |
1714 | 9a64fbe4 | bellard | /* fmsub - fmsub. */
|
1715 | 36081602 | j_mayer | void OPPROTO op_fmsub (void) |
1716 | 28b6751f | bellard | { |
1717 | e864cabd | j_mayer | #if USE_PRECISE_EMULATION
|
1718 | e864cabd | j_mayer | do_fmsub(); |
1719 | e864cabd | j_mayer | #else
|
1720 | 76a66253 | j_mayer | FT0 = float64_mul(FT0, FT1, &env->fp_status); |
1721 | 76a66253 | j_mayer | FT0 = float64_sub(FT0, FT2, &env->fp_status); |
1722 | e864cabd | j_mayer | #endif
|
1723 | 9a64fbe4 | bellard | RETURN(); |
1724 | 28b6751f | bellard | } |
1725 | 28b6751f | bellard | |
1726 | 9a64fbe4 | bellard | /* fnmadd - fnmadd. - fnmadds - fnmadds. */
|
1727 | 36081602 | j_mayer | void OPPROTO op_fnmadd (void) |
1728 | 28b6751f | bellard | { |
1729 | 4b3686fa | bellard | do_fnmadd(); |
1730 | 9a64fbe4 | bellard | RETURN(); |
1731 | 28b6751f | bellard | } |
1732 | 28b6751f | bellard | |
1733 | 9a64fbe4 | bellard | /* fnmsub - fnmsub. */
|
1734 | 36081602 | j_mayer | void OPPROTO op_fnmsub (void) |
1735 | 28b6751f | bellard | { |
1736 | 4b3686fa | bellard | do_fnmsub(); |
1737 | 9a64fbe4 | bellard | RETURN(); |
1738 | 28b6751f | bellard | } |
1739 | 28b6751f | bellard | |
1740 | 9a64fbe4 | bellard | /*** Floating-Point round & convert ***/
|
1741 | 9a64fbe4 | bellard | /* frsp - frsp. */
|
1742 | 36081602 | j_mayer | void OPPROTO op_frsp (void) |
1743 | 28b6751f | bellard | { |
1744 | 76a66253 | j_mayer | FT0 = float64_to_float32(FT0, &env->fp_status); |
1745 | 9a64fbe4 | bellard | RETURN(); |
1746 | 28b6751f | bellard | } |
1747 | 28b6751f | bellard | |
1748 | 9a64fbe4 | bellard | /* fctiw - fctiw. */
|
1749 | 36081602 | j_mayer | void OPPROTO op_fctiw (void) |
1750 | 28b6751f | bellard | { |
1751 | 9a64fbe4 | bellard | do_fctiw(); |
1752 | 9a64fbe4 | bellard | RETURN(); |
1753 | 28b6751f | bellard | } |
1754 | 28b6751f | bellard | |
1755 | 9a64fbe4 | bellard | /* fctiwz - fctiwz. */
|
1756 | 36081602 | j_mayer | void OPPROTO op_fctiwz (void) |
1757 | 28b6751f | bellard | { |
1758 | 9a64fbe4 | bellard | do_fctiwz(); |
1759 | 9a64fbe4 | bellard | RETURN(); |
1760 | 28b6751f | bellard | } |
1761 | 28b6751f | bellard | |
1762 | 426613db | j_mayer | #if defined(TARGET_PPC64)
|
1763 | 426613db | j_mayer | /* fcfid - fcfid. */
|
1764 | 36081602 | j_mayer | void OPPROTO op_fcfid (void) |
1765 | 426613db | j_mayer | { |
1766 | 426613db | j_mayer | do_fcfid(); |
1767 | 426613db | j_mayer | RETURN(); |
1768 | 426613db | j_mayer | } |
1769 | 426613db | j_mayer | |
1770 | 426613db | j_mayer | /* fctid - fctid. */
|
1771 | 36081602 | j_mayer | void OPPROTO op_fctid (void) |
1772 | 426613db | j_mayer | { |
1773 | 426613db | j_mayer | do_fctid(); |
1774 | 426613db | j_mayer | RETURN(); |
1775 | 426613db | j_mayer | } |
1776 | 426613db | j_mayer | |
1777 | 426613db | j_mayer | /* fctidz - fctidz. */
|
1778 | 36081602 | j_mayer | void OPPROTO op_fctidz (void) |
1779 | 426613db | j_mayer | { |
1780 | 426613db | j_mayer | do_fctidz(); |
1781 | 426613db | j_mayer | RETURN(); |
1782 | 426613db | j_mayer | } |
1783 | 426613db | j_mayer | #endif
|
1784 | 426613db | j_mayer | |
1785 | 9a64fbe4 | bellard | /*** Floating-Point compare ***/
|
1786 | 9a64fbe4 | bellard | /* fcmpu */
|
1787 | 36081602 | j_mayer | void OPPROTO op_fcmpu (void) |
1788 | 28b6751f | bellard | { |
1789 | 9a64fbe4 | bellard | do_fcmpu(); |
1790 | 9a64fbe4 | bellard | RETURN(); |
1791 | 28b6751f | bellard | } |
1792 | 28b6751f | bellard | |
1793 | 9a64fbe4 | bellard | /* fcmpo */
|
1794 | 36081602 | j_mayer | void OPPROTO op_fcmpo (void) |
1795 | 28b6751f | bellard | { |
1796 | 9a64fbe4 | bellard | do_fcmpo(); |
1797 | 9a64fbe4 | bellard | RETURN(); |
1798 | fb0eaffc | bellard | } |
1799 | fb0eaffc | bellard | |
1800 | 9a64fbe4 | bellard | /*** Floating-point move ***/
|
1801 | 9a64fbe4 | bellard | /* fabs */
|
1802 | 36081602 | j_mayer | void OPPROTO op_fabs (void) |
1803 | fb0eaffc | bellard | { |
1804 | fdabc366 | bellard | FT0 = float64_abs(FT0); |
1805 | fb0eaffc | bellard | RETURN(); |
1806 | fb0eaffc | bellard | } |
1807 | fb0eaffc | bellard | |
1808 | 9a64fbe4 | bellard | /* fnabs */
|
1809 | 36081602 | j_mayer | void OPPROTO op_fnabs (void) |
1810 | fb0eaffc | bellard | { |
1811 | fdabc366 | bellard | FT0 = float64_abs(FT0); |
1812 | fdabc366 | bellard | FT0 = float64_chs(FT0); |
1813 | fb0eaffc | bellard | RETURN(); |
1814 | fb0eaffc | bellard | } |
1815 | fb0eaffc | bellard | |
1816 | 9a64fbe4 | bellard | /* fneg */
|
1817 | 36081602 | j_mayer | void OPPROTO op_fneg (void) |
1818 | fb0eaffc | bellard | { |
1819 | fdabc366 | bellard | FT0 = float64_chs(FT0); |
1820 | fb0eaffc | bellard | RETURN(); |
1821 | fb0eaffc | bellard | } |
1822 | fb0eaffc | bellard | |
1823 | 9a64fbe4 | bellard | /* Load and store */
|
1824 | 9a64fbe4 | bellard | #define MEMSUFFIX _raw
|
1825 | 76a66253 | j_mayer | #include "op_helper.h" |
1826 | 9a64fbe4 | bellard | #include "op_mem.h" |
1827 | a541f297 | bellard | #if !defined(CONFIG_USER_ONLY)
|
1828 | 9a64fbe4 | bellard | #define MEMSUFFIX _user
|
1829 | 76a66253 | j_mayer | #include "op_helper.h" |
1830 | 9a64fbe4 | bellard | #include "op_mem.h" |
1831 | 9a64fbe4 | bellard | #define MEMSUFFIX _kernel
|
1832 | 76a66253 | j_mayer | #include "op_helper.h" |
1833 | 9a64fbe4 | bellard | #include "op_mem.h" |
1834 | 9a64fbe4 | bellard | #endif
|
1835 | 9a64fbe4 | bellard | |
1836 | 4b3686fa | bellard | /* Special op to check and maybe clear reservation */
|
1837 | d9bce9d9 | j_mayer | void OPPROTO op_check_reservation (void) |
1838 | 4b3686fa | bellard | { |
1839 | fdabc366 | bellard | if ((uint32_t)env->reserve == (uint32_t)(T0 & ~0x00000003)) |
1840 | fdabc366 | bellard | env->reserve = -1;
|
1841 | 4b3686fa | bellard | RETURN(); |
1842 | 4b3686fa | bellard | } |
1843 | 4b3686fa | bellard | |
1844 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1845 | d9bce9d9 | j_mayer | void OPPROTO op_check_reservation_64 (void) |
1846 | d9bce9d9 | j_mayer | { |
1847 | d9bce9d9 | j_mayer | if ((uint64_t)env->reserve == (uint64_t)(T0 & ~0x00000003)) |
1848 | d9bce9d9 | j_mayer | env->reserve = -1;
|
1849 | d9bce9d9 | j_mayer | RETURN(); |
1850 | d9bce9d9 | j_mayer | } |
1851 | d9bce9d9 | j_mayer | #endif
|
1852 | d9bce9d9 | j_mayer | |
1853 | 9a64fbe4 | bellard | /* Return from interrupt */
|
1854 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
1855 | 76a66253 | j_mayer | void OPPROTO op_rfi (void) |
1856 | fb0eaffc | bellard | { |
1857 | fdabc366 | bellard | do_rfi(); |
1858 | fb0eaffc | bellard | RETURN(); |
1859 | fb0eaffc | bellard | } |
1860 | d9bce9d9 | j_mayer | |
1861 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1862 | 426613db | j_mayer | void OPPROTO op_rfid (void) |
1863 | 426613db | j_mayer | { |
1864 | 426613db | j_mayer | do_rfid(); |
1865 | 426613db | j_mayer | RETURN(); |
1866 | 426613db | j_mayer | } |
1867 | d9bce9d9 | j_mayer | #endif
|
1868 | 76a66253 | j_mayer | #endif
|
1869 | fb0eaffc | bellard | |
1870 | 9a64fbe4 | bellard | /* Trap word */
|
1871 | 76a66253 | j_mayer | void OPPROTO op_tw (void) |
1872 | fb0eaffc | bellard | { |
1873 | 76a66253 | j_mayer | do_tw(PARAM1); |
1874 | fb0eaffc | bellard | RETURN(); |
1875 | fb0eaffc | bellard | } |
1876 | fb0eaffc | bellard | |
1877 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1878 | d9bce9d9 | j_mayer | void OPPROTO op_td (void) |
1879 | d9bce9d9 | j_mayer | { |
1880 | d9bce9d9 | j_mayer | do_td(PARAM1); |
1881 | d9bce9d9 | j_mayer | RETURN(); |
1882 | d9bce9d9 | j_mayer | } |
1883 | d9bce9d9 | j_mayer | #endif
|
1884 | d9bce9d9 | j_mayer | |
1885 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
1886 | 9a64fbe4 | bellard | /* tlbia */
|
1887 | 36081602 | j_mayer | void OPPROTO op_tlbia (void) |
1888 | fb0eaffc | bellard | { |
1889 | 9a64fbe4 | bellard | do_tlbia(); |
1890 | 9a64fbe4 | bellard | RETURN(); |
1891 | 9a64fbe4 | bellard | } |
1892 | 9a64fbe4 | bellard | |
1893 | 9a64fbe4 | bellard | /* tlbie */
|
1894 | d9bce9d9 | j_mayer | void OPPROTO op_tlbie (void) |
1895 | 9a64fbe4 | bellard | { |
1896 | 9a64fbe4 | bellard | do_tlbie(); |
1897 | fb0eaffc | bellard | RETURN(); |
1898 | 28b6751f | bellard | } |
1899 | d9bce9d9 | j_mayer | |
1900 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1901 | d9bce9d9 | j_mayer | void OPPROTO op_tlbie_64 (void) |
1902 | d9bce9d9 | j_mayer | { |
1903 | d9bce9d9 | j_mayer | do_tlbie_64(); |
1904 | d9bce9d9 | j_mayer | RETURN(); |
1905 | d9bce9d9 | j_mayer | } |
1906 | d9bce9d9 | j_mayer | #endif
|
1907 | d9bce9d9 | j_mayer | |
1908 | d9bce9d9 | j_mayer | #if defined(TARGET_PPC64)
|
1909 | d9bce9d9 | j_mayer | void OPPROTO op_slbia (void) |
1910 | d9bce9d9 | j_mayer | { |
1911 | d9bce9d9 | j_mayer | do_slbia(); |
1912 | d9bce9d9 | j_mayer | RETURN(); |
1913 | d9bce9d9 | j_mayer | } |
1914 | d9bce9d9 | j_mayer | |
1915 | d9bce9d9 | j_mayer | void OPPROTO op_slbie (void) |
1916 | d9bce9d9 | j_mayer | { |
1917 | d9bce9d9 | j_mayer | do_slbie(); |
1918 | d9bce9d9 | j_mayer | RETURN(); |
1919 | d9bce9d9 | j_mayer | } |
1920 | d9bce9d9 | j_mayer | #endif
|
1921 | 76a66253 | j_mayer | #endif
|
1922 | 3fc6c082 | bellard | |
1923 | 76a66253 | j_mayer | /* PowerPC 602/603/755 software TLB load instructions */
|
1924 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
1925 | 76a66253 | j_mayer | void OPPROTO op_6xx_tlbld (void) |
1926 | 76a66253 | j_mayer | { |
1927 | 76a66253 | j_mayer | do_load_6xx_tlb(0);
|
1928 | 76a66253 | j_mayer | RETURN(); |
1929 | 76a66253 | j_mayer | } |
1930 | 76a66253 | j_mayer | |
1931 | 76a66253 | j_mayer | void OPPROTO op_6xx_tlbli (void) |
1932 | 76a66253 | j_mayer | { |
1933 | 76a66253 | j_mayer | do_load_6xx_tlb(1);
|
1934 | 76a66253 | j_mayer | RETURN(); |
1935 | 76a66253 | j_mayer | } |
1936 | 76a66253 | j_mayer | #endif
|
1937 | 76a66253 | j_mayer | |
1938 | 76a66253 | j_mayer | /* 601 specific */
|
1939 | 76a66253 | j_mayer | void OPPROTO op_load_601_rtcl (void) |
1940 | 76a66253 | j_mayer | { |
1941 | 76a66253 | j_mayer | T0 = cpu_ppc601_load_rtcl(env); |
1942 | 76a66253 | j_mayer | RETURN(); |
1943 | 76a66253 | j_mayer | } |
1944 | 76a66253 | j_mayer | |
1945 | 76a66253 | j_mayer | void OPPROTO op_load_601_rtcu (void) |
1946 | 76a66253 | j_mayer | { |
1947 | 76a66253 | j_mayer | T0 = cpu_ppc601_load_rtcu(env); |
1948 | 76a66253 | j_mayer | RETURN(); |
1949 | 76a66253 | j_mayer | } |
1950 | 76a66253 | j_mayer | |
1951 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
1952 | 76a66253 | j_mayer | void OPPROTO op_store_601_rtcl (void) |
1953 | 76a66253 | j_mayer | { |
1954 | 76a66253 | j_mayer | cpu_ppc601_store_rtcl(env, T0); |
1955 | 76a66253 | j_mayer | RETURN(); |
1956 | 76a66253 | j_mayer | } |
1957 | 76a66253 | j_mayer | |
1958 | 76a66253 | j_mayer | void OPPROTO op_store_601_rtcu (void) |
1959 | 76a66253 | j_mayer | { |
1960 | 76a66253 | j_mayer | cpu_ppc601_store_rtcu(env, T0); |
1961 | 76a66253 | j_mayer | RETURN(); |
1962 | 76a66253 | j_mayer | } |
1963 | 76a66253 | j_mayer | |
1964 | 76a66253 | j_mayer | void OPPROTO op_load_601_bat (void) |
1965 | 76a66253 | j_mayer | { |
1966 | 76a66253 | j_mayer | T0 = env->IBAT[PARAM1][PARAM2]; |
1967 | 76a66253 | j_mayer | RETURN(); |
1968 | 76a66253 | j_mayer | } |
1969 | 76a66253 | j_mayer | #endif /* !defined(CONFIG_USER_ONLY) */ |
1970 | 76a66253 | j_mayer | |
1971 | 76a66253 | j_mayer | /* 601 unified BATs store.
|
1972 | 76a66253 | j_mayer | * To avoid using specific MMU code for 601, we store BATs in
|
1973 | 76a66253 | j_mayer | * IBAT and DBAT simultaneously, then emulate unified BATs.
|
1974 | 76a66253 | j_mayer | */
|
1975 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
1976 | 76a66253 | j_mayer | void OPPROTO op_store_601_batl (void) |
1977 | 76a66253 | j_mayer | { |
1978 | 76a66253 | j_mayer | int nr = PARAM1;
|
1979 | 76a66253 | j_mayer | |
1980 | 76a66253 | j_mayer | env->IBAT[1][nr] = T0;
|
1981 | 76a66253 | j_mayer | env->DBAT[1][nr] = T0;
|
1982 | 76a66253 | j_mayer | RETURN(); |
1983 | 76a66253 | j_mayer | } |
1984 | 76a66253 | j_mayer | |
1985 | 76a66253 | j_mayer | void OPPROTO op_store_601_batu (void) |
1986 | 76a66253 | j_mayer | { |
1987 | 76a66253 | j_mayer | do_store_601_batu(PARAM1); |
1988 | 76a66253 | j_mayer | RETURN(); |
1989 | 76a66253 | j_mayer | } |
1990 | 76a66253 | j_mayer | #endif /* !defined(CONFIG_USER_ONLY) */ |
1991 | 76a66253 | j_mayer | |
1992 | 76a66253 | j_mayer | /* PowerPC 601 specific instructions (POWER bridge) */
|
1993 | 76a66253 | j_mayer | /* XXX: those micro-ops need tests ! */
|
1994 | 76a66253 | j_mayer | void OPPROTO op_POWER_abs (void) |
1995 | 76a66253 | j_mayer | { |
1996 | 76a66253 | j_mayer | if (T0 == INT32_MIN)
|
1997 | 76a66253 | j_mayer | T0 = INT32_MAX; |
1998 | 76a66253 | j_mayer | else if (T0 < 0) |
1999 | 76a66253 | j_mayer | T0 = -T0; |
2000 | 76a66253 | j_mayer | RETURN(); |
2001 | 76a66253 | j_mayer | } |
2002 | 76a66253 | j_mayer | |
2003 | 76a66253 | j_mayer | void OPPROTO op_POWER_abso (void) |
2004 | 76a66253 | j_mayer | { |
2005 | 76a66253 | j_mayer | do_POWER_abso(); |
2006 | 76a66253 | j_mayer | RETURN(); |
2007 | 76a66253 | j_mayer | } |
2008 | 76a66253 | j_mayer | |
2009 | 76a66253 | j_mayer | void OPPROTO op_POWER_clcs (void) |
2010 | 76a66253 | j_mayer | { |
2011 | 76a66253 | j_mayer | do_POWER_clcs(); |
2012 | 76a66253 | j_mayer | RETURN(); |
2013 | 76a66253 | j_mayer | } |
2014 | 76a66253 | j_mayer | |
2015 | 76a66253 | j_mayer | void OPPROTO op_POWER_div (void) |
2016 | 76a66253 | j_mayer | { |
2017 | 76a66253 | j_mayer | do_POWER_div(); |
2018 | 76a66253 | j_mayer | RETURN(); |
2019 | 76a66253 | j_mayer | } |
2020 | 76a66253 | j_mayer | |
2021 | 76a66253 | j_mayer | void OPPROTO op_POWER_divo (void) |
2022 | 76a66253 | j_mayer | { |
2023 | 76a66253 | j_mayer | do_POWER_divo(); |
2024 | 76a66253 | j_mayer | RETURN(); |
2025 | 76a66253 | j_mayer | } |
2026 | 76a66253 | j_mayer | |
2027 | 76a66253 | j_mayer | void OPPROTO op_POWER_divs (void) |
2028 | 76a66253 | j_mayer | { |
2029 | 76a66253 | j_mayer | do_POWER_divs(); |
2030 | 76a66253 | j_mayer | RETURN(); |
2031 | 76a66253 | j_mayer | } |
2032 | 76a66253 | j_mayer | |
2033 | 76a66253 | j_mayer | void OPPROTO op_POWER_divso (void) |
2034 | 76a66253 | j_mayer | { |
2035 | 76a66253 | j_mayer | do_POWER_divso(); |
2036 | 76a66253 | j_mayer | RETURN(); |
2037 | 76a66253 | j_mayer | } |
2038 | 76a66253 | j_mayer | |
2039 | 76a66253 | j_mayer | void OPPROTO op_POWER_doz (void) |
2040 | 76a66253 | j_mayer | { |
2041 | d9bce9d9 | j_mayer | if ((int32_t)T1 > (int32_t)T0)
|
2042 | 76a66253 | j_mayer | T0 = T1 - T0; |
2043 | 76a66253 | j_mayer | else
|
2044 | 76a66253 | j_mayer | T0 = 0;
|
2045 | 76a66253 | j_mayer | RETURN(); |
2046 | 76a66253 | j_mayer | } |
2047 | 76a66253 | j_mayer | |
2048 | 76a66253 | j_mayer | void OPPROTO op_POWER_dozo (void) |
2049 | 76a66253 | j_mayer | { |
2050 | 76a66253 | j_mayer | do_POWER_dozo(); |
2051 | 76a66253 | j_mayer | RETURN(); |
2052 | 76a66253 | j_mayer | } |
2053 | 76a66253 | j_mayer | |
2054 | 76a66253 | j_mayer | void OPPROTO op_load_xer_cmp (void) |
2055 | 76a66253 | j_mayer | { |
2056 | 76a66253 | j_mayer | T2 = xer_cmp; |
2057 | 76a66253 | j_mayer | RETURN(); |
2058 | 76a66253 | j_mayer | } |
2059 | 76a66253 | j_mayer | |
2060 | 76a66253 | j_mayer | void OPPROTO op_POWER_maskg (void) |
2061 | 76a66253 | j_mayer | { |
2062 | 76a66253 | j_mayer | do_POWER_maskg(); |
2063 | 76a66253 | j_mayer | RETURN(); |
2064 | 76a66253 | j_mayer | } |
2065 | 76a66253 | j_mayer | |
2066 | 76a66253 | j_mayer | void OPPROTO op_POWER_maskir (void) |
2067 | 76a66253 | j_mayer | { |
2068 | 76a66253 | j_mayer | T0 = (T0 & ~T2) | (T1 & T2); |
2069 | 76a66253 | j_mayer | RETURN(); |
2070 | 76a66253 | j_mayer | } |
2071 | 76a66253 | j_mayer | |
2072 | 76a66253 | j_mayer | void OPPROTO op_POWER_mul (void) |
2073 | 76a66253 | j_mayer | { |
2074 | 76a66253 | j_mayer | uint64_t tmp; |
2075 | 76a66253 | j_mayer | |
2076 | 76a66253 | j_mayer | tmp = (uint64_t)T0 * (uint64_t)T1; |
2077 | 76a66253 | j_mayer | env->spr[SPR_MQ] = tmp >> 32;
|
2078 | 76a66253 | j_mayer | T0 = tmp; |
2079 | 76a66253 | j_mayer | RETURN(); |
2080 | 76a66253 | j_mayer | } |
2081 | 76a66253 | j_mayer | |
2082 | 76a66253 | j_mayer | void OPPROTO op_POWER_mulo (void) |
2083 | 76a66253 | j_mayer | { |
2084 | 76a66253 | j_mayer | do_POWER_mulo(); |
2085 | 76a66253 | j_mayer | RETURN(); |
2086 | 76a66253 | j_mayer | } |
2087 | 76a66253 | j_mayer | |
2088 | 76a66253 | j_mayer | void OPPROTO op_POWER_nabs (void) |
2089 | 76a66253 | j_mayer | { |
2090 | 76a66253 | j_mayer | if (T0 > 0) |
2091 | 76a66253 | j_mayer | T0 = -T0; |
2092 | 76a66253 | j_mayer | RETURN(); |
2093 | 76a66253 | j_mayer | } |
2094 | 76a66253 | j_mayer | |
2095 | 76a66253 | j_mayer | void OPPROTO op_POWER_nabso (void) |
2096 | 76a66253 | j_mayer | { |
2097 | 76a66253 | j_mayer | /* nabs never overflows */
|
2098 | 76a66253 | j_mayer | if (T0 > 0) |
2099 | 76a66253 | j_mayer | T0 = -T0; |
2100 | 76a66253 | j_mayer | xer_ov = 0;
|
2101 | 76a66253 | j_mayer | RETURN(); |
2102 | 76a66253 | j_mayer | } |
2103 | 76a66253 | j_mayer | |
2104 | 76a66253 | j_mayer | /* XXX: factorise POWER rotates... */
|
2105 | 76a66253 | j_mayer | void OPPROTO op_POWER_rlmi (void) |
2106 | 76a66253 | j_mayer | { |
2107 | 76a66253 | j_mayer | T0 = rotl32(T0, T2) & PARAM1; |
2108 | 76a66253 | j_mayer | T0 |= T1 & PARAM2; |
2109 | 76a66253 | j_mayer | RETURN(); |
2110 | 76a66253 | j_mayer | } |
2111 | 76a66253 | j_mayer | |
2112 | 76a66253 | j_mayer | void OPPROTO op_POWER_rrib (void) |
2113 | 76a66253 | j_mayer | { |
2114 | 76a66253 | j_mayer | T2 &= 0x1FUL;
|
2115 | 76a66253 | j_mayer | T0 = rotl32(T0 & INT32_MIN, T2); |
2116 | 76a66253 | j_mayer | T0 |= T1 & ~rotl32(INT32_MIN, T2); |
2117 | 76a66253 | j_mayer | RETURN(); |
2118 | 76a66253 | j_mayer | } |
2119 | 76a66253 | j_mayer | |
2120 | 76a66253 | j_mayer | void OPPROTO op_POWER_sle (void) |
2121 | 76a66253 | j_mayer | { |
2122 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2123 | 76a66253 | j_mayer | env->spr[SPR_MQ] = rotl32(T0, T1); |
2124 | 76a66253 | j_mayer | T0 = T0 << T1; |
2125 | 76a66253 | j_mayer | RETURN(); |
2126 | 76a66253 | j_mayer | } |
2127 | 76a66253 | j_mayer | |
2128 | 76a66253 | j_mayer | void OPPROTO op_POWER_sleq (void) |
2129 | 76a66253 | j_mayer | { |
2130 | 76a66253 | j_mayer | uint32_t tmp = env->spr[SPR_MQ]; |
2131 | 76a66253 | j_mayer | |
2132 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2133 | 76a66253 | j_mayer | env->spr[SPR_MQ] = rotl32(T0, T1); |
2134 | 76a66253 | j_mayer | T0 = T0 << T1; |
2135 | 76a66253 | j_mayer | T0 |= tmp >> (32 - T1);
|
2136 | 76a66253 | j_mayer | RETURN(); |
2137 | 76a66253 | j_mayer | } |
2138 | 76a66253 | j_mayer | |
2139 | 76a66253 | j_mayer | void OPPROTO op_POWER_sllq (void) |
2140 | 76a66253 | j_mayer | { |
2141 | 76a66253 | j_mayer | uint32_t msk = -1;
|
2142 | 76a66253 | j_mayer | |
2143 | 76a66253 | j_mayer | msk = msk << (T1 & 0x1FUL);
|
2144 | 76a66253 | j_mayer | if (T1 & 0x20UL) |
2145 | 76a66253 | j_mayer | msk = ~msk; |
2146 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2147 | 76a66253 | j_mayer | T0 = (T0 << T1) & msk; |
2148 | 76a66253 | j_mayer | T0 |= env->spr[SPR_MQ] & ~msk; |
2149 | 76a66253 | j_mayer | RETURN(); |
2150 | 76a66253 | j_mayer | } |
2151 | 76a66253 | j_mayer | |
2152 | 76a66253 | j_mayer | void OPPROTO op_POWER_slq (void) |
2153 | 76a66253 | j_mayer | { |
2154 | 76a66253 | j_mayer | uint32_t msk = -1, tmp;
|
2155 | 76a66253 | j_mayer | |
2156 | 76a66253 | j_mayer | msk = msk << (T1 & 0x1FUL);
|
2157 | 76a66253 | j_mayer | if (T1 & 0x20UL) |
2158 | 76a66253 | j_mayer | msk = ~msk; |
2159 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2160 | 76a66253 | j_mayer | tmp = rotl32(T0, T1); |
2161 | 76a66253 | j_mayer | T0 = tmp & msk; |
2162 | 76a66253 | j_mayer | env->spr[SPR_MQ] = tmp; |
2163 | 76a66253 | j_mayer | RETURN(); |
2164 | 76a66253 | j_mayer | } |
2165 | 76a66253 | j_mayer | |
2166 | 76a66253 | j_mayer | void OPPROTO op_POWER_sraq (void) |
2167 | 76a66253 | j_mayer | { |
2168 | 76a66253 | j_mayer | env->spr[SPR_MQ] = rotl32(T0, 32 - (T1 & 0x1FUL)); |
2169 | 76a66253 | j_mayer | if (T1 & 0x20UL) |
2170 | 76a66253 | j_mayer | T0 = -1L;
|
2171 | 76a66253 | j_mayer | else
|
2172 | d9bce9d9 | j_mayer | T0 = (int32_t)T0 >> T1; |
2173 | 76a66253 | j_mayer | RETURN(); |
2174 | 76a66253 | j_mayer | } |
2175 | 76a66253 | j_mayer | |
2176 | 76a66253 | j_mayer | void OPPROTO op_POWER_sre (void) |
2177 | 76a66253 | j_mayer | { |
2178 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2179 | 76a66253 | j_mayer | env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
|
2180 | d9bce9d9 | j_mayer | T0 = (int32_t)T0 >> T1; |
2181 | 76a66253 | j_mayer | RETURN(); |
2182 | 76a66253 | j_mayer | } |
2183 | 76a66253 | j_mayer | |
2184 | 76a66253 | j_mayer | void OPPROTO op_POWER_srea (void) |
2185 | 76a66253 | j_mayer | { |
2186 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2187 | 76a66253 | j_mayer | env->spr[SPR_MQ] = T0 >> T1; |
2188 | d9bce9d9 | j_mayer | T0 = (int32_t)T0 >> T1; |
2189 | 76a66253 | j_mayer | RETURN(); |
2190 | 76a66253 | j_mayer | } |
2191 | 76a66253 | j_mayer | |
2192 | 76a66253 | j_mayer | void OPPROTO op_POWER_sreq (void) |
2193 | 76a66253 | j_mayer | { |
2194 | 76a66253 | j_mayer | uint32_t tmp; |
2195 | 76a66253 | j_mayer | int32_t msk; |
2196 | 76a66253 | j_mayer | |
2197 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2198 | 76a66253 | j_mayer | msk = INT32_MIN >> T1; |
2199 | 76a66253 | j_mayer | tmp = env->spr[SPR_MQ]; |
2200 | 76a66253 | j_mayer | env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
|
2201 | 76a66253 | j_mayer | T0 = T0 >> T1; |
2202 | 76a66253 | j_mayer | T0 |= tmp & msk; |
2203 | 76a66253 | j_mayer | RETURN(); |
2204 | 76a66253 | j_mayer | } |
2205 | 76a66253 | j_mayer | |
2206 | 76a66253 | j_mayer | void OPPROTO op_POWER_srlq (void) |
2207 | 76a66253 | j_mayer | { |
2208 | 76a66253 | j_mayer | uint32_t tmp; |
2209 | 76a66253 | j_mayer | int32_t msk; |
2210 | 76a66253 | j_mayer | |
2211 | 76a66253 | j_mayer | msk = INT32_MIN >> (T1 & 0x1FUL);
|
2212 | 76a66253 | j_mayer | if (T1 & 0x20UL) |
2213 | 76a66253 | j_mayer | msk = ~msk; |
2214 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2215 | 76a66253 | j_mayer | tmp = env->spr[SPR_MQ]; |
2216 | 76a66253 | j_mayer | env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
|
2217 | 76a66253 | j_mayer | T0 = T0 >> T1; |
2218 | 76a66253 | j_mayer | T0 &= msk; |
2219 | 76a66253 | j_mayer | T0 |= tmp & ~msk; |
2220 | 76a66253 | j_mayer | RETURN(); |
2221 | 76a66253 | j_mayer | } |
2222 | 76a66253 | j_mayer | |
2223 | 76a66253 | j_mayer | void OPPROTO op_POWER_srq (void) |
2224 | 76a66253 | j_mayer | { |
2225 | 76a66253 | j_mayer | T1 &= 0x1FUL;
|
2226 | 76a66253 | j_mayer | env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
|
2227 | 76a66253 | j_mayer | T0 = T0 >> T1; |
2228 | 76a66253 | j_mayer | RETURN(); |
2229 | 76a66253 | j_mayer | } |
2230 | 76a66253 | j_mayer | |
2231 | 76a66253 | j_mayer | /* POWER instructions not implemented in PowerPC 601 */
|
2232 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
2233 | 76a66253 | j_mayer | void OPPROTO op_POWER_mfsri (void) |
2234 | 76a66253 | j_mayer | { |
2235 | 76a66253 | j_mayer | T1 = T0 >> 28;
|
2236 | 76a66253 | j_mayer | T0 = env->sr[T1]; |
2237 | 76a66253 | j_mayer | RETURN(); |
2238 | 76a66253 | j_mayer | } |
2239 | 76a66253 | j_mayer | |
2240 | 76a66253 | j_mayer | void OPPROTO op_POWER_rac (void) |
2241 | 76a66253 | j_mayer | { |
2242 | 76a66253 | j_mayer | do_POWER_rac(); |
2243 | 76a66253 | j_mayer | RETURN(); |
2244 | 76a66253 | j_mayer | } |
2245 | 76a66253 | j_mayer | |
2246 | 76a66253 | j_mayer | void OPPROTO op_POWER_rfsvc (void) |
2247 | 76a66253 | j_mayer | { |
2248 | 76a66253 | j_mayer | do_POWER_rfsvc(); |
2249 | 76a66253 | j_mayer | RETURN(); |
2250 | 76a66253 | j_mayer | } |
2251 | 76a66253 | j_mayer | #endif
|
2252 | 76a66253 | j_mayer | |
2253 | 76a66253 | j_mayer | /* PowerPC 602 specific instruction */
|
2254 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
2255 | 76a66253 | j_mayer | void OPPROTO op_602_mfrom (void) |
2256 | 76a66253 | j_mayer | { |
2257 | 76a66253 | j_mayer | do_op_602_mfrom(); |
2258 | 76a66253 | j_mayer | RETURN(); |
2259 | 76a66253 | j_mayer | } |
2260 | 76a66253 | j_mayer | #endif
|
2261 | 76a66253 | j_mayer | |
2262 | 76a66253 | j_mayer | /* PowerPC 4xx specific micro-ops */
|
2263 | 76a66253 | j_mayer | void OPPROTO op_405_add_T0_T2 (void) |
2264 | 76a66253 | j_mayer | { |
2265 | 76a66253 | j_mayer | T0 = (int32_t)T0 + (int32_t)T2; |
2266 | 76a66253 | j_mayer | RETURN(); |
2267 | 76a66253 | j_mayer | } |
2268 | 76a66253 | j_mayer | |
2269 | 76a66253 | j_mayer | void OPPROTO op_405_mulchw (void) |
2270 | 76a66253 | j_mayer | { |
2271 | 76a66253 | j_mayer | T0 = ((int16_t)T0) * ((int16_t)(T1 >> 16));
|
2272 | 76a66253 | j_mayer | RETURN(); |
2273 | 76a66253 | j_mayer | } |
2274 | 76a66253 | j_mayer | |
2275 | 76a66253 | j_mayer | void OPPROTO op_405_mulchwu (void) |
2276 | 76a66253 | j_mayer | { |
2277 | 76a66253 | j_mayer | T0 = ((uint16_t)T0) * ((uint16_t)(T1 >> 16));
|
2278 | 76a66253 | j_mayer | RETURN(); |
2279 | 76a66253 | j_mayer | } |
2280 | 76a66253 | j_mayer | |
2281 | 76a66253 | j_mayer | void OPPROTO op_405_mulhhw (void) |
2282 | 76a66253 | j_mayer | { |
2283 | 76a66253 | j_mayer | T0 = ((int16_t)(T0 >> 16)) * ((int16_t)(T1 >> 16)); |
2284 | 76a66253 | j_mayer | RETURN(); |
2285 | 76a66253 | j_mayer | } |
2286 | 76a66253 | j_mayer | |
2287 | 76a66253 | j_mayer | void OPPROTO op_405_mulhhwu (void) |
2288 | 76a66253 | j_mayer | { |
2289 | 76a66253 | j_mayer | T0 = ((uint16_t)(T0 >> 16)) * ((uint16_t)(T1 >> 16)); |
2290 | 76a66253 | j_mayer | RETURN(); |
2291 | 76a66253 | j_mayer | } |
2292 | 76a66253 | j_mayer | |
2293 | 76a66253 | j_mayer | void OPPROTO op_405_mullhw (void) |
2294 | 76a66253 | j_mayer | { |
2295 | 76a66253 | j_mayer | T0 = ((int16_t)T0) * ((int16_t)T1); |
2296 | 76a66253 | j_mayer | RETURN(); |
2297 | 76a66253 | j_mayer | } |
2298 | 76a66253 | j_mayer | |
2299 | 76a66253 | j_mayer | void OPPROTO op_405_mullhwu (void) |
2300 | 76a66253 | j_mayer | { |
2301 | 76a66253 | j_mayer | T0 = ((uint16_t)T0) * ((uint16_t)T1); |
2302 | 76a66253 | j_mayer | RETURN(); |
2303 | 76a66253 | j_mayer | } |
2304 | 76a66253 | j_mayer | |
2305 | 76a66253 | j_mayer | void OPPROTO op_405_check_ov (void) |
2306 | 76a66253 | j_mayer | { |
2307 | 76a66253 | j_mayer | do_405_check_ov(); |
2308 | 76a66253 | j_mayer | RETURN(); |
2309 | 76a66253 | j_mayer | } |
2310 | 76a66253 | j_mayer | |
2311 | 76a66253 | j_mayer | void OPPROTO op_405_check_sat (void) |
2312 | 76a66253 | j_mayer | { |
2313 | 76a66253 | j_mayer | do_405_check_sat(); |
2314 | 76a66253 | j_mayer | RETURN(); |
2315 | 76a66253 | j_mayer | } |
2316 | 76a66253 | j_mayer | |
2317 | 76a66253 | j_mayer | void OPPROTO op_405_check_ovu (void) |
2318 | 76a66253 | j_mayer | { |
2319 | 76a66253 | j_mayer | if (likely(T0 >= T2)) {
|
2320 | 76a66253 | j_mayer | xer_ov = 0;
|
2321 | 76a66253 | j_mayer | } else {
|
2322 | 76a66253 | j_mayer | xer_ov = 1;
|
2323 | 76a66253 | j_mayer | xer_so = 1;
|
2324 | 76a66253 | j_mayer | } |
2325 | 76a66253 | j_mayer | RETURN(); |
2326 | 76a66253 | j_mayer | } |
2327 | 76a66253 | j_mayer | |
2328 | 76a66253 | j_mayer | void OPPROTO op_405_check_satu (void) |
2329 | 76a66253 | j_mayer | { |
2330 | 76a66253 | j_mayer | if (unlikely(T0 < T2)) {
|
2331 | 76a66253 | j_mayer | /* Saturate result */
|
2332 | 76a66253 | j_mayer | T0 = -1;
|
2333 | 76a66253 | j_mayer | } |
2334 | 76a66253 | j_mayer | RETURN(); |
2335 | 76a66253 | j_mayer | } |
2336 | 76a66253 | j_mayer | |
2337 | a42bd6cc | j_mayer | void OPPROTO op_load_dcr (void) |
2338 | 76a66253 | j_mayer | { |
2339 | a42bd6cc | j_mayer | do_load_dcr(); |
2340 | 76a66253 | j_mayer | RETURN(); |
2341 | 76a66253 | j_mayer | } |
2342 | 76a66253 | j_mayer | |
2343 | a42bd6cc | j_mayer | void OPPROTO op_store_dcr (void) |
2344 | 76a66253 | j_mayer | { |
2345 | a42bd6cc | j_mayer | do_store_dcr(); |
2346 | 76a66253 | j_mayer | RETURN(); |
2347 | 76a66253 | j_mayer | } |
2348 | 76a66253 | j_mayer | |
2349 | a750fc0b | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
2350 | 76a66253 | j_mayer | /* Return from critical interrupt :
|
2351 | 76a66253 | j_mayer | * same as rfi, except nip & MSR are loaded from SRR2/3 instead of SRR0/1
|
2352 | 76a66253 | j_mayer | */
|
2353 | a42bd6cc | j_mayer | void OPPROTO op_40x_rfci (void) |
2354 | a42bd6cc | j_mayer | { |
2355 | a42bd6cc | j_mayer | do_40x_rfci(); |
2356 | a42bd6cc | j_mayer | RETURN(); |
2357 | a42bd6cc | j_mayer | } |
2358 | a42bd6cc | j_mayer | |
2359 | a42bd6cc | j_mayer | void OPPROTO op_rfci (void) |
2360 | a42bd6cc | j_mayer | { |
2361 | a42bd6cc | j_mayer | do_rfci(); |
2362 | a42bd6cc | j_mayer | RETURN(); |
2363 | a42bd6cc | j_mayer | } |
2364 | a42bd6cc | j_mayer | |
2365 | a42bd6cc | j_mayer | void OPPROTO op_rfdi (void) |
2366 | a42bd6cc | j_mayer | { |
2367 | a42bd6cc | j_mayer | do_rfdi(); |
2368 | a42bd6cc | j_mayer | RETURN(); |
2369 | a42bd6cc | j_mayer | } |
2370 | a42bd6cc | j_mayer | |
2371 | a42bd6cc | j_mayer | void OPPROTO op_rfmci (void) |
2372 | 76a66253 | j_mayer | { |
2373 | a42bd6cc | j_mayer | do_rfmci(); |
2374 | 76a66253 | j_mayer | RETURN(); |
2375 | 76a66253 | j_mayer | } |
2376 | 76a66253 | j_mayer | |
2377 | a42bd6cc | j_mayer | void OPPROTO op_wrte (void) |
2378 | 76a66253 | j_mayer | { |
2379 | 76a66253 | j_mayer | msr_ee = T0 >> 16;
|
2380 | 76a66253 | j_mayer | RETURN(); |
2381 | 76a66253 | j_mayer | } |
2382 | 76a66253 | j_mayer | |
2383 | a4bb6c3e | j_mayer | void OPPROTO op_440_tlbre (void) |
2384 | 5eb7995e | j_mayer | { |
2385 | a4bb6c3e | j_mayer | do_440_tlbre(PARAM1); |
2386 | 5eb7995e | j_mayer | RETURN(); |
2387 | 5eb7995e | j_mayer | } |
2388 | 5eb7995e | j_mayer | |
2389 | a4bb6c3e | j_mayer | void OPPROTO op_440_tlbsx (void) |
2390 | 5eb7995e | j_mayer | { |
2391 | a4bb6c3e | j_mayer | do_440_tlbsx(); |
2392 | 5eb7995e | j_mayer | RETURN(); |
2393 | 5eb7995e | j_mayer | } |
2394 | 5eb7995e | j_mayer | |
2395 | a4bb6c3e | j_mayer | void OPPROTO op_440_tlbsx_ (void) |
2396 | 5eb7995e | j_mayer | { |
2397 | a4bb6c3e | j_mayer | do_440_tlbsx_(); |
2398 | 5eb7995e | j_mayer | RETURN(); |
2399 | 5eb7995e | j_mayer | } |
2400 | 5eb7995e | j_mayer | |
2401 | a4bb6c3e | j_mayer | void OPPROTO op_440_tlbwe (void) |
2402 | 5eb7995e | j_mayer | { |
2403 | a4bb6c3e | j_mayer | do_440_tlbwe(PARAM1); |
2404 | 5eb7995e | j_mayer | RETURN(); |
2405 | 5eb7995e | j_mayer | } |
2406 | 5eb7995e | j_mayer | |
2407 | 76a66253 | j_mayer | void OPPROTO op_4xx_tlbre_lo (void) |
2408 | 76a66253 | j_mayer | { |
2409 | 76a66253 | j_mayer | do_4xx_tlbre_lo(); |
2410 | 76a66253 | j_mayer | RETURN(); |
2411 | 76a66253 | j_mayer | } |
2412 | 76a66253 | j_mayer | |
2413 | 76a66253 | j_mayer | void OPPROTO op_4xx_tlbre_hi (void) |
2414 | 76a66253 | j_mayer | { |
2415 | 76a66253 | j_mayer | do_4xx_tlbre_hi(); |
2416 | 76a66253 | j_mayer | RETURN(); |
2417 | 76a66253 | j_mayer | } |
2418 | 76a66253 | j_mayer | |
2419 | 76a66253 | j_mayer | void OPPROTO op_4xx_tlbsx (void) |
2420 | 76a66253 | j_mayer | { |
2421 | 76a66253 | j_mayer | do_4xx_tlbsx(); |
2422 | 76a66253 | j_mayer | RETURN(); |
2423 | 76a66253 | j_mayer | } |
2424 | 76a66253 | j_mayer | |
2425 | 76a66253 | j_mayer | void OPPROTO op_4xx_tlbsx_ (void) |
2426 | 76a66253 | j_mayer | { |
2427 | 76a66253 | j_mayer | do_4xx_tlbsx_(); |
2428 | 76a66253 | j_mayer | RETURN(); |
2429 | 76a66253 | j_mayer | } |
2430 | 76a66253 | j_mayer | |
2431 | 76a66253 | j_mayer | void OPPROTO op_4xx_tlbwe_lo (void) |
2432 | 76a66253 | j_mayer | { |
2433 | 76a66253 | j_mayer | do_4xx_tlbwe_lo(); |
2434 | 76a66253 | j_mayer | RETURN(); |
2435 | 76a66253 | j_mayer | } |
2436 | 76a66253 | j_mayer | |
2437 | 76a66253 | j_mayer | void OPPROTO op_4xx_tlbwe_hi (void) |
2438 | 76a66253 | j_mayer | { |
2439 | 76a66253 | j_mayer | do_4xx_tlbwe_hi(); |
2440 | 76a66253 | j_mayer | RETURN(); |
2441 | 76a66253 | j_mayer | } |
2442 | 76a66253 | j_mayer | #endif
|
2443 | 76a66253 | j_mayer | |
2444 | 76a66253 | j_mayer | /* SPR micro-ops */
|
2445 | 76a66253 | j_mayer | /* 440 specific */
|
2446 | 76a66253 | j_mayer | void OPPROTO op_440_dlmzb (void) |
2447 | 76a66253 | j_mayer | { |
2448 | 76a66253 | j_mayer | do_440_dlmzb(); |
2449 | 76a66253 | j_mayer | RETURN(); |
2450 | 76a66253 | j_mayer | } |
2451 | 76a66253 | j_mayer | |
2452 | 76a66253 | j_mayer | void OPPROTO op_440_dlmzb_update_Rc (void) |
2453 | 76a66253 | j_mayer | { |
2454 | 76a66253 | j_mayer | if (T0 == 8) |
2455 | 76a66253 | j_mayer | T0 = 0x2;
|
2456 | 76a66253 | j_mayer | else if (T0 < 4) |
2457 | 76a66253 | j_mayer | T0 = 0x4;
|
2458 | 76a66253 | j_mayer | else
|
2459 | 76a66253 | j_mayer | T0 = 0x8;
|
2460 | 76a66253 | j_mayer | RETURN(); |
2461 | 76a66253 | j_mayer | } |
2462 | 76a66253 | j_mayer | |
2463 | 76a66253 | j_mayer | #if !defined(CONFIG_USER_ONLY)
|
2464 | 76a66253 | j_mayer | void OPPROTO op_store_pir (void) |
2465 | 3fc6c082 | bellard | { |
2466 | 3fc6c082 | bellard | env->spr[SPR_PIR] = T0 & 0x0000000FUL;
|
2467 | 3fc6c082 | bellard | RETURN(); |
2468 | 3fc6c082 | bellard | } |
2469 | 76a66253 | j_mayer | |
2470 | 76a66253 | j_mayer | void OPPROTO op_load_403_pb (void) |
2471 | 76a66253 | j_mayer | { |
2472 | 76a66253 | j_mayer | do_load_403_pb(PARAM1); |
2473 | 76a66253 | j_mayer | RETURN(); |
2474 | 76a66253 | j_mayer | } |
2475 | 76a66253 | j_mayer | |
2476 | 76a66253 | j_mayer | void OPPROTO op_store_403_pb (void) |
2477 | 76a66253 | j_mayer | { |
2478 | 76a66253 | j_mayer | do_store_403_pb(PARAM1); |
2479 | 76a66253 | j_mayer | RETURN(); |
2480 | 76a66253 | j_mayer | } |
2481 | 76a66253 | j_mayer | |
2482 | 76a66253 | j_mayer | void OPPROTO op_load_40x_pit (void) |
2483 | 76a66253 | j_mayer | { |
2484 | 76a66253 | j_mayer | T0 = load_40x_pit(env); |
2485 | 76a66253 | j_mayer | RETURN(); |
2486 | 76a66253 | j_mayer | } |
2487 | 76a66253 | j_mayer | |
2488 | 76a66253 | j_mayer | void OPPROTO op_store_40x_pit (void) |
2489 | 76a66253 | j_mayer | { |
2490 | 76a66253 | j_mayer | store_40x_pit(env, T0); |
2491 | 76a66253 | j_mayer | RETURN(); |
2492 | 76a66253 | j_mayer | } |
2493 | 76a66253 | j_mayer | |
2494 | 8ecc7913 | j_mayer | void OPPROTO op_store_40x_dbcr0 (void) |
2495 | 8ecc7913 | j_mayer | { |
2496 | 8ecc7913 | j_mayer | store_40x_dbcr0(env, T0); |
2497 | 8ecc7913 | j_mayer | } |
2498 | 8ecc7913 | j_mayer | |
2499 | c294fc58 | j_mayer | void OPPROTO op_store_40x_sler (void) |
2500 | c294fc58 | j_mayer | { |
2501 | c294fc58 | j_mayer | store_40x_sler(env, T0); |
2502 | c294fc58 | j_mayer | RETURN(); |
2503 | c294fc58 | j_mayer | } |
2504 | c294fc58 | j_mayer | |
2505 | 76a66253 | j_mayer | void OPPROTO op_store_booke_tcr (void) |
2506 | 76a66253 | j_mayer | { |
2507 | 76a66253 | j_mayer | store_booke_tcr(env, T0); |
2508 | 76a66253 | j_mayer | RETURN(); |
2509 | 76a66253 | j_mayer | } |
2510 | 76a66253 | j_mayer | |
2511 | 76a66253 | j_mayer | void OPPROTO op_store_booke_tsr (void) |
2512 | 76a66253 | j_mayer | { |
2513 | 76a66253 | j_mayer | store_booke_tsr(env, T0); |
2514 | 76a66253 | j_mayer | RETURN(); |
2515 | 76a66253 | j_mayer | } |
2516 | 0487d6a8 | j_mayer | |
2517 | 76a66253 | j_mayer | #endif /* !defined(CONFIG_USER_ONLY) */ |
2518 | 0487d6a8 | j_mayer | |
2519 | 35cdaad6 | j_mayer | #if defined(TARGET_PPCEMB)
|
2520 | 0487d6a8 | j_mayer | /* SPE extension */
|
2521 | 0487d6a8 | j_mayer | void OPPROTO op_splatw_T1_64 (void) |
2522 | 0487d6a8 | j_mayer | { |
2523 | 0487d6a8 | j_mayer | T1_64 = (T1_64 << 32) | (T1_64 & 0x00000000FFFFFFFFULL); |
2524 | e864cabd | j_mayer | RETURN(); |
2525 | 0487d6a8 | j_mayer | } |
2526 | 0487d6a8 | j_mayer | |
2527 | 0487d6a8 | j_mayer | void OPPROTO op_splatwi_T0_64 (void) |
2528 | 0487d6a8 | j_mayer | { |
2529 | 0487d6a8 | j_mayer | uint64_t tmp = PARAM1; |
2530 | 0487d6a8 | j_mayer | |
2531 | 0487d6a8 | j_mayer | T0_64 = (tmp << 32) | tmp;
|
2532 | e864cabd | j_mayer | RETURN(); |
2533 | 0487d6a8 | j_mayer | } |
2534 | 0487d6a8 | j_mayer | |
2535 | 0487d6a8 | j_mayer | void OPPROTO op_splatwi_T1_64 (void) |
2536 | 0487d6a8 | j_mayer | { |
2537 | 0487d6a8 | j_mayer | uint64_t tmp = PARAM1; |
2538 | 0487d6a8 | j_mayer | |
2539 | 0487d6a8 | j_mayer | T1_64 = (tmp << 32) | tmp;
|
2540 | e864cabd | j_mayer | RETURN(); |
2541 | 0487d6a8 | j_mayer | } |
2542 | 0487d6a8 | j_mayer | |
2543 | 0487d6a8 | j_mayer | void OPPROTO op_extsh_T1_64 (void) |
2544 | 0487d6a8 | j_mayer | { |
2545 | 0487d6a8 | j_mayer | T1_64 = (int32_t)((int16_t)T1_64); |
2546 | 0487d6a8 | j_mayer | RETURN(); |
2547 | 0487d6a8 | j_mayer | } |
2548 | 0487d6a8 | j_mayer | |
2549 | 0487d6a8 | j_mayer | void OPPROTO op_sli16_T1_64 (void) |
2550 | 0487d6a8 | j_mayer | { |
2551 | 0487d6a8 | j_mayer | T1_64 = T1_64 << 16;
|
2552 | 0487d6a8 | j_mayer | RETURN(); |
2553 | 0487d6a8 | j_mayer | } |
2554 | 0487d6a8 | j_mayer | |
2555 | 0487d6a8 | j_mayer | void OPPROTO op_sli32_T1_64 (void) |
2556 | 0487d6a8 | j_mayer | { |
2557 | 0487d6a8 | j_mayer | T1_64 = T1_64 << 32;
|
2558 | 0487d6a8 | j_mayer | RETURN(); |
2559 | 0487d6a8 | j_mayer | } |
2560 | 0487d6a8 | j_mayer | |
2561 | 0487d6a8 | j_mayer | void OPPROTO op_srli32_T1_64 (void) |
2562 | 0487d6a8 | j_mayer | { |
2563 | 0487d6a8 | j_mayer | T1_64 = T1_64 >> 32;
|
2564 | 0487d6a8 | j_mayer | RETURN(); |
2565 | 0487d6a8 | j_mayer | } |
2566 | 0487d6a8 | j_mayer | |
2567 | 0487d6a8 | j_mayer | void OPPROTO op_evsel (void) |
2568 | 0487d6a8 | j_mayer | { |
2569 | 0487d6a8 | j_mayer | do_evsel(); |
2570 | 0487d6a8 | j_mayer | RETURN(); |
2571 | 0487d6a8 | j_mayer | } |
2572 | 0487d6a8 | j_mayer | |
2573 | 0487d6a8 | j_mayer | void OPPROTO op_evaddw (void) |
2574 | 0487d6a8 | j_mayer | { |
2575 | 0487d6a8 | j_mayer | do_evaddw(); |
2576 | 0487d6a8 | j_mayer | RETURN(); |
2577 | 0487d6a8 | j_mayer | } |
2578 | 0487d6a8 | j_mayer | |
2579 | 0487d6a8 | j_mayer | void OPPROTO op_evsubfw (void) |
2580 | 0487d6a8 | j_mayer | { |
2581 | 0487d6a8 | j_mayer | do_evsubfw(); |
2582 | 0487d6a8 | j_mayer | RETURN(); |
2583 | 0487d6a8 | j_mayer | } |
2584 | 0487d6a8 | j_mayer | |
2585 | 0487d6a8 | j_mayer | void OPPROTO op_evneg (void) |
2586 | 0487d6a8 | j_mayer | { |
2587 | 0487d6a8 | j_mayer | do_evneg(); |
2588 | 0487d6a8 | j_mayer | RETURN(); |
2589 | 0487d6a8 | j_mayer | } |
2590 | 0487d6a8 | j_mayer | |
2591 | 0487d6a8 | j_mayer | void OPPROTO op_evabs (void) |
2592 | 0487d6a8 | j_mayer | { |
2593 | 0487d6a8 | j_mayer | do_evabs(); |
2594 | 0487d6a8 | j_mayer | RETURN(); |
2595 | 0487d6a8 | j_mayer | } |
2596 | 0487d6a8 | j_mayer | |
2597 | 0487d6a8 | j_mayer | void OPPROTO op_evextsh (void) |
2598 | 0487d6a8 | j_mayer | { |
2599 | 0487d6a8 | j_mayer | T0_64 = ((uint64_t)((int32_t)(int16_t)(T0_64 >> 32)) << 32) | |
2600 | 0487d6a8 | j_mayer | (uint64_t)((int32_t)(int16_t)T0_64); |
2601 | 0487d6a8 | j_mayer | RETURN(); |
2602 | 0487d6a8 | j_mayer | } |
2603 | 0487d6a8 | j_mayer | |
2604 | 0487d6a8 | j_mayer | void OPPROTO op_evextsb (void) |
2605 | 0487d6a8 | j_mayer | { |
2606 | 0487d6a8 | j_mayer | T0_64 = ((uint64_t)((int32_t)(int8_t)(T0_64 >> 32)) << 32) | |
2607 | 0487d6a8 | j_mayer | (uint64_t)((int32_t)(int8_t)T0_64); |
2608 | 0487d6a8 | j_mayer | RETURN(); |
2609 | 0487d6a8 | j_mayer | } |
2610 | 0487d6a8 | j_mayer | |
2611 | 0487d6a8 | j_mayer | void OPPROTO op_evcntlzw (void) |
2612 | 0487d6a8 | j_mayer | { |
2613 | 0487d6a8 | j_mayer | do_evcntlzw(); |
2614 | 0487d6a8 | j_mayer | RETURN(); |
2615 | 0487d6a8 | j_mayer | } |
2616 | 0487d6a8 | j_mayer | |
2617 | 0487d6a8 | j_mayer | void OPPROTO op_evrndw (void) |
2618 | 0487d6a8 | j_mayer | { |
2619 | 0487d6a8 | j_mayer | do_evrndw(); |
2620 | 0487d6a8 | j_mayer | RETURN(); |
2621 | 0487d6a8 | j_mayer | } |
2622 | 0487d6a8 | j_mayer | |
2623 | 0487d6a8 | j_mayer | void OPPROTO op_brinc (void) |
2624 | 0487d6a8 | j_mayer | { |
2625 | 0487d6a8 | j_mayer | do_brinc(); |
2626 | 0487d6a8 | j_mayer | RETURN(); |
2627 | 0487d6a8 | j_mayer | } |
2628 | 0487d6a8 | j_mayer | |
2629 | 0487d6a8 | j_mayer | void OPPROTO op_evcntlsw (void) |
2630 | 0487d6a8 | j_mayer | { |
2631 | 0487d6a8 | j_mayer | do_evcntlsw(); |
2632 | 0487d6a8 | j_mayer | RETURN(); |
2633 | 0487d6a8 | j_mayer | } |
2634 | 0487d6a8 | j_mayer | |
2635 | 0487d6a8 | j_mayer | void OPPROTO op_evand (void) |
2636 | 0487d6a8 | j_mayer | { |
2637 | 0487d6a8 | j_mayer | T0_64 &= T1_64; |
2638 | 0487d6a8 | j_mayer | RETURN(); |
2639 | 0487d6a8 | j_mayer | } |
2640 | 0487d6a8 | j_mayer | |
2641 | 0487d6a8 | j_mayer | void OPPROTO op_evandc (void) |
2642 | 0487d6a8 | j_mayer | { |
2643 | 0487d6a8 | j_mayer | T0_64 &= ~T1_64; |
2644 | 0487d6a8 | j_mayer | RETURN(); |
2645 | 0487d6a8 | j_mayer | } |
2646 | 0487d6a8 | j_mayer | |
2647 | 0487d6a8 | j_mayer | void OPPROTO op_evor (void) |
2648 | 0487d6a8 | j_mayer | { |
2649 | 0487d6a8 | j_mayer | T0_64 |= T1_64; |
2650 | 0487d6a8 | j_mayer | RETURN(); |
2651 | 0487d6a8 | j_mayer | } |
2652 | 0487d6a8 | j_mayer | |
2653 | 0487d6a8 | j_mayer | void OPPROTO op_evxor (void) |
2654 | 0487d6a8 | j_mayer | { |
2655 | 0487d6a8 | j_mayer | T0_64 ^= T1_64; |
2656 | 0487d6a8 | j_mayer | RETURN(); |
2657 | 0487d6a8 | j_mayer | } |
2658 | 0487d6a8 | j_mayer | |
2659 | 0487d6a8 | j_mayer | void OPPROTO op_eveqv (void) |
2660 | 0487d6a8 | j_mayer | { |
2661 | 0487d6a8 | j_mayer | T0_64 = ~(T0_64 ^ T1_64); |
2662 | 0487d6a8 | j_mayer | RETURN(); |
2663 | 0487d6a8 | j_mayer | } |
2664 | 0487d6a8 | j_mayer | |
2665 | 0487d6a8 | j_mayer | void OPPROTO op_evnor (void) |
2666 | 0487d6a8 | j_mayer | { |
2667 | 0487d6a8 | j_mayer | T0_64 = ~(T0_64 | T1_64); |
2668 | 0487d6a8 | j_mayer | RETURN(); |
2669 | 0487d6a8 | j_mayer | } |
2670 | 0487d6a8 | j_mayer | |
2671 | 0487d6a8 | j_mayer | void OPPROTO op_evorc (void) |
2672 | 0487d6a8 | j_mayer | { |
2673 | 0487d6a8 | j_mayer | T0_64 |= ~T1_64; |
2674 | 0487d6a8 | j_mayer | RETURN(); |
2675 | 0487d6a8 | j_mayer | } |
2676 | 0487d6a8 | j_mayer | |
2677 | 0487d6a8 | j_mayer | void OPPROTO op_evnand (void) |
2678 | 0487d6a8 | j_mayer | { |
2679 | 0487d6a8 | j_mayer | T0_64 = ~(T0_64 & T1_64); |
2680 | 0487d6a8 | j_mayer | RETURN(); |
2681 | 0487d6a8 | j_mayer | } |
2682 | 0487d6a8 | j_mayer | |
2683 | 0487d6a8 | j_mayer | void OPPROTO op_evsrws (void) |
2684 | 0487d6a8 | j_mayer | { |
2685 | 0487d6a8 | j_mayer | do_evsrws(); |
2686 | 0487d6a8 | j_mayer | RETURN(); |
2687 | 0487d6a8 | j_mayer | } |
2688 | 0487d6a8 | j_mayer | |
2689 | 0487d6a8 | j_mayer | void OPPROTO op_evsrwu (void) |
2690 | 0487d6a8 | j_mayer | { |
2691 | 0487d6a8 | j_mayer | do_evsrwu(); |
2692 | 0487d6a8 | j_mayer | RETURN(); |
2693 | 0487d6a8 | j_mayer | } |
2694 | 0487d6a8 | j_mayer | |
2695 | 0487d6a8 | j_mayer | void OPPROTO op_evslw (void) |
2696 | 0487d6a8 | j_mayer | { |
2697 | 0487d6a8 | j_mayer | do_evslw(); |
2698 | 0487d6a8 | j_mayer | RETURN(); |
2699 | 0487d6a8 | j_mayer | } |
2700 | 0487d6a8 | j_mayer | |
2701 | 0487d6a8 | j_mayer | void OPPROTO op_evrlw (void) |
2702 | 0487d6a8 | j_mayer | { |
2703 | 0487d6a8 | j_mayer | do_evrlw(); |
2704 | 0487d6a8 | j_mayer | RETURN(); |
2705 | 0487d6a8 | j_mayer | } |
2706 | 0487d6a8 | j_mayer | |
2707 | 0487d6a8 | j_mayer | void OPPROTO op_evmergelo (void) |
2708 | 0487d6a8 | j_mayer | { |
2709 | 0487d6a8 | j_mayer | T0_64 = (T0_64 << 32) | (T1_64 & 0x00000000FFFFFFFFULL); |
2710 | 0487d6a8 | j_mayer | RETURN(); |
2711 | 0487d6a8 | j_mayer | } |
2712 | 0487d6a8 | j_mayer | |
2713 | 0487d6a8 | j_mayer | void OPPROTO op_evmergehi (void) |
2714 | 0487d6a8 | j_mayer | { |
2715 | 0487d6a8 | j_mayer | T0_64 = (T0_64 & 0xFFFFFFFF00000000ULL) | (T1_64 >> 32); |
2716 | 0487d6a8 | j_mayer | RETURN(); |
2717 | 0487d6a8 | j_mayer | } |
2718 | 0487d6a8 | j_mayer | |
2719 | 0487d6a8 | j_mayer | void OPPROTO op_evmergelohi (void) |
2720 | 0487d6a8 | j_mayer | { |
2721 | 0487d6a8 | j_mayer | T0_64 = (T0_64 << 32) | (T1_64 >> 32); |
2722 | 0487d6a8 | j_mayer | RETURN(); |
2723 | 0487d6a8 | j_mayer | } |
2724 | 0487d6a8 | j_mayer | |
2725 | 0487d6a8 | j_mayer | void OPPROTO op_evmergehilo (void) |
2726 | 0487d6a8 | j_mayer | { |
2727 | 0487d6a8 | j_mayer | T0_64 = (T0_64 & 0xFFFFFFFF00000000ULL) | (T1_64 & 0x00000000FFFFFFFFULL); |
2728 | 0487d6a8 | j_mayer | RETURN(); |
2729 | 0487d6a8 | j_mayer | } |
2730 | 0487d6a8 | j_mayer | |
2731 | 0487d6a8 | j_mayer | void OPPROTO op_evcmpgts (void) |
2732 | 0487d6a8 | j_mayer | { |
2733 | 0487d6a8 | j_mayer | do_evcmpgts(); |
2734 | 0487d6a8 | j_mayer | RETURN(); |
2735 | 0487d6a8 | j_mayer | } |
2736 | 0487d6a8 | j_mayer | |
2737 | 0487d6a8 | j_mayer | void OPPROTO op_evcmpgtu (void) |
2738 | 0487d6a8 | j_mayer | { |
2739 | 0487d6a8 | j_mayer | do_evcmpgtu(); |
2740 | 0487d6a8 | j_mayer | RETURN(); |
2741 | 0487d6a8 | j_mayer | } |
2742 | 0487d6a8 | j_mayer | |
2743 | 0487d6a8 | j_mayer | void OPPROTO op_evcmplts (void) |
2744 | 0487d6a8 | j_mayer | { |
2745 | 0487d6a8 | j_mayer | do_evcmplts(); |
2746 | 0487d6a8 | j_mayer | RETURN(); |
2747 | 0487d6a8 | j_mayer | } |
2748 | 0487d6a8 | j_mayer | |
2749 | 0487d6a8 | j_mayer | void OPPROTO op_evcmpltu (void) |
2750 | 0487d6a8 | j_mayer | { |
2751 | 0487d6a8 | j_mayer | do_evcmpltu(); |
2752 | 0487d6a8 | j_mayer | RETURN(); |
2753 | 0487d6a8 | j_mayer | } |
2754 | 0487d6a8 | j_mayer | |
2755 | 0487d6a8 | j_mayer | void OPPROTO op_evcmpeq (void) |
2756 | 0487d6a8 | j_mayer | { |
2757 | 0487d6a8 | j_mayer | do_evcmpeq(); |
2758 | 0487d6a8 | j_mayer | RETURN(); |
2759 | 0487d6a8 | j_mayer | } |
2760 | 0487d6a8 | j_mayer | |
2761 | 0487d6a8 | j_mayer | void OPPROTO op_evfssub (void) |
2762 | 0487d6a8 | j_mayer | { |
2763 | 0487d6a8 | j_mayer | do_evfssub(); |
2764 | 0487d6a8 | j_mayer | RETURN(); |
2765 | 0487d6a8 | j_mayer | } |
2766 | 0487d6a8 | j_mayer | |
2767 | 0487d6a8 | j_mayer | void OPPROTO op_evfsadd (void) |
2768 | 0487d6a8 | j_mayer | { |
2769 | 0487d6a8 | j_mayer | do_evfsadd(); |
2770 | 0487d6a8 | j_mayer | RETURN(); |
2771 | 0487d6a8 | j_mayer | } |
2772 | 0487d6a8 | j_mayer | |
2773 | 0487d6a8 | j_mayer | void OPPROTO op_evfsnabs (void) |
2774 | 0487d6a8 | j_mayer | { |
2775 | 0487d6a8 | j_mayer | do_evfsnabs(); |
2776 | 0487d6a8 | j_mayer | RETURN(); |
2777 | 0487d6a8 | j_mayer | } |
2778 | 0487d6a8 | j_mayer | |
2779 | 0487d6a8 | j_mayer | void OPPROTO op_evfsabs (void) |
2780 | 0487d6a8 | j_mayer | { |
2781 | 0487d6a8 | j_mayer | do_evfsabs(); |
2782 | 0487d6a8 | j_mayer | RETURN(); |
2783 | 0487d6a8 | j_mayer | } |
2784 | 0487d6a8 | j_mayer | |
2785 | 0487d6a8 | j_mayer | void OPPROTO op_evfsneg (void) |
2786 | 0487d6a8 | j_mayer | { |
2787 | 0487d6a8 | j_mayer | do_evfsneg(); |
2788 | 0487d6a8 | j_mayer | RETURN(); |
2789 | 0487d6a8 | j_mayer | } |
2790 | 0487d6a8 | j_mayer | |
2791 | 0487d6a8 | j_mayer | void OPPROTO op_evfsdiv (void) |
2792 | 0487d6a8 | j_mayer | { |
2793 | 0487d6a8 | j_mayer | do_evfsdiv(); |
2794 | 0487d6a8 | j_mayer | RETURN(); |
2795 | 0487d6a8 | j_mayer | } |
2796 | 0487d6a8 | j_mayer | |
2797 | 0487d6a8 | j_mayer | void OPPROTO op_evfsmul (void) |
2798 | 0487d6a8 | j_mayer | { |
2799 | 0487d6a8 | j_mayer | do_evfsmul(); |
2800 | 0487d6a8 | j_mayer | RETURN(); |
2801 | 0487d6a8 | j_mayer | } |
2802 | 0487d6a8 | j_mayer | |
2803 | 0487d6a8 | j_mayer | void OPPROTO op_evfscmplt (void) |
2804 | 0487d6a8 | j_mayer | { |
2805 | 0487d6a8 | j_mayer | do_evfscmplt(); |
2806 | 0487d6a8 | j_mayer | RETURN(); |
2807 | 0487d6a8 | j_mayer | } |
2808 | 0487d6a8 | j_mayer | |
2809 | 0487d6a8 | j_mayer | void OPPROTO op_evfscmpgt (void) |
2810 | 0487d6a8 | j_mayer | { |
2811 | 0487d6a8 | j_mayer | do_evfscmpgt(); |
2812 | 0487d6a8 | j_mayer | RETURN(); |
2813 | 0487d6a8 | j_mayer | } |
2814 | 0487d6a8 | j_mayer | |
2815 | 0487d6a8 | j_mayer | void OPPROTO op_evfscmpeq (void) |
2816 | 0487d6a8 | j_mayer | { |
2817 | 0487d6a8 | j_mayer | do_evfscmpeq(); |
2818 | 0487d6a8 | j_mayer | RETURN(); |
2819 | 0487d6a8 | j_mayer | } |
2820 | 0487d6a8 | j_mayer | |
2821 | 0487d6a8 | j_mayer | void OPPROTO op_evfscfsi (void) |
2822 | 0487d6a8 | j_mayer | { |
2823 | 0487d6a8 | j_mayer | do_evfscfsi(); |
2824 | 0487d6a8 | j_mayer | RETURN(); |
2825 | 0487d6a8 | j_mayer | } |
2826 | 0487d6a8 | j_mayer | |
2827 | 0487d6a8 | j_mayer | void OPPROTO op_evfscfui (void) |
2828 | 0487d6a8 | j_mayer | { |
2829 | 0487d6a8 | j_mayer | do_evfscfui(); |
2830 | 0487d6a8 | j_mayer | RETURN(); |
2831 | 0487d6a8 | j_mayer | } |
2832 | 0487d6a8 | j_mayer | |
2833 | 0487d6a8 | j_mayer | void OPPROTO op_evfscfsf (void) |
2834 | 0487d6a8 | j_mayer | { |
2835 | 0487d6a8 | j_mayer | do_evfscfsf(); |
2836 | 0487d6a8 | j_mayer | RETURN(); |
2837 | 0487d6a8 | j_mayer | } |
2838 | 0487d6a8 | j_mayer | |
2839 | 0487d6a8 | j_mayer | void OPPROTO op_evfscfuf (void) |
2840 | 0487d6a8 | j_mayer | { |
2841 | 0487d6a8 | j_mayer | do_evfscfuf(); |
2842 | 0487d6a8 | j_mayer | RETURN(); |
2843 | 0487d6a8 | j_mayer | } |
2844 | 0487d6a8 | j_mayer | |
2845 | 0487d6a8 | j_mayer | void OPPROTO op_evfsctsi (void) |
2846 | 0487d6a8 | j_mayer | { |
2847 | 0487d6a8 | j_mayer | do_evfsctsi(); |
2848 | 0487d6a8 | j_mayer | RETURN(); |
2849 | 0487d6a8 | j_mayer | } |
2850 | 0487d6a8 | j_mayer | |
2851 | 0487d6a8 | j_mayer | void OPPROTO op_evfsctui (void) |
2852 | 0487d6a8 | j_mayer | { |
2853 | 0487d6a8 | j_mayer | do_evfsctui(); |
2854 | 0487d6a8 | j_mayer | RETURN(); |
2855 | 0487d6a8 | j_mayer | } |
2856 | 0487d6a8 | j_mayer | |
2857 | 0487d6a8 | j_mayer | void OPPROTO op_evfsctsf (void) |
2858 | 0487d6a8 | j_mayer | { |
2859 | 0487d6a8 | j_mayer | do_evfsctsf(); |
2860 | 0487d6a8 | j_mayer | RETURN(); |
2861 | 0487d6a8 | j_mayer | } |
2862 | 0487d6a8 | j_mayer | |
2863 | 0487d6a8 | j_mayer | void OPPROTO op_evfsctuf (void) |
2864 | 0487d6a8 | j_mayer | { |
2865 | 0487d6a8 | j_mayer | do_evfsctuf(); |
2866 | 0487d6a8 | j_mayer | RETURN(); |
2867 | 0487d6a8 | j_mayer | } |
2868 | 0487d6a8 | j_mayer | |
2869 | 0487d6a8 | j_mayer | void OPPROTO op_evfsctuiz (void) |
2870 | 0487d6a8 | j_mayer | { |
2871 | 0487d6a8 | j_mayer | do_evfsctuiz(); |
2872 | 0487d6a8 | j_mayer | RETURN(); |
2873 | 0487d6a8 | j_mayer | } |
2874 | 0487d6a8 | j_mayer | |
2875 | 0487d6a8 | j_mayer | void OPPROTO op_evfsctsiz (void) |
2876 | 0487d6a8 | j_mayer | { |
2877 | 0487d6a8 | j_mayer | do_evfsctsiz(); |
2878 | 0487d6a8 | j_mayer | RETURN(); |
2879 | 0487d6a8 | j_mayer | } |
2880 | 0487d6a8 | j_mayer | |
2881 | 0487d6a8 | j_mayer | void OPPROTO op_evfststlt (void) |
2882 | 0487d6a8 | j_mayer | { |
2883 | 0487d6a8 | j_mayer | do_evfststlt(); |
2884 | 0487d6a8 | j_mayer | RETURN(); |
2885 | 0487d6a8 | j_mayer | } |
2886 | 0487d6a8 | j_mayer | |
2887 | 0487d6a8 | j_mayer | void OPPROTO op_evfststgt (void) |
2888 | 0487d6a8 | j_mayer | { |
2889 | 0487d6a8 | j_mayer | do_evfststgt(); |
2890 | 0487d6a8 | j_mayer | RETURN(); |
2891 | 0487d6a8 | j_mayer | } |
2892 | 0487d6a8 | j_mayer | |
2893 | 0487d6a8 | j_mayer | void OPPROTO op_evfststeq (void) |
2894 | 0487d6a8 | j_mayer | { |
2895 | 0487d6a8 | j_mayer | do_evfststeq(); |
2896 | 0487d6a8 | j_mayer | RETURN(); |
2897 | 0487d6a8 | j_mayer | } |
2898 | 0487d6a8 | j_mayer | |
2899 | 0487d6a8 | j_mayer | void OPPROTO op_efssub (void) |
2900 | 0487d6a8 | j_mayer | { |
2901 | 0487d6a8 | j_mayer | T0_64 = _do_efssub(T0_64, T1_64); |
2902 | 0487d6a8 | j_mayer | RETURN(); |
2903 | 0487d6a8 | j_mayer | } |
2904 | 0487d6a8 | j_mayer | |
2905 | 0487d6a8 | j_mayer | void OPPROTO op_efsadd (void) |
2906 | 0487d6a8 | j_mayer | { |
2907 | 0487d6a8 | j_mayer | T0_64 = _do_efsadd(T0_64, T1_64); |
2908 | 0487d6a8 | j_mayer | RETURN(); |
2909 | 0487d6a8 | j_mayer | } |
2910 | 0487d6a8 | j_mayer | |
2911 | 0487d6a8 | j_mayer | void OPPROTO op_efsnabs (void) |
2912 | 0487d6a8 | j_mayer | { |
2913 | 0487d6a8 | j_mayer | T0_64 = _do_efsnabs(T0_64); |
2914 | 0487d6a8 | j_mayer | RETURN(); |
2915 | 0487d6a8 | j_mayer | } |
2916 | 0487d6a8 | j_mayer | |
2917 | 0487d6a8 | j_mayer | void OPPROTO op_efsabs (void) |
2918 | 0487d6a8 | j_mayer | { |
2919 | 0487d6a8 | j_mayer | T0_64 = _do_efsabs(T0_64); |
2920 | 0487d6a8 | j_mayer | RETURN(); |
2921 | 0487d6a8 | j_mayer | } |
2922 | 0487d6a8 | j_mayer | |
2923 | 0487d6a8 | j_mayer | void OPPROTO op_efsneg (void) |
2924 | 0487d6a8 | j_mayer | { |
2925 | 0487d6a8 | j_mayer | T0_64 = _do_efsneg(T0_64); |
2926 | 0487d6a8 | j_mayer | RETURN(); |
2927 | 0487d6a8 | j_mayer | } |
2928 | 0487d6a8 | j_mayer | |
2929 | 0487d6a8 | j_mayer | void OPPROTO op_efsdiv (void) |
2930 | 0487d6a8 | j_mayer | { |
2931 | 0487d6a8 | j_mayer | T0_64 = _do_efsdiv(T0_64, T1_64); |
2932 | 0487d6a8 | j_mayer | RETURN(); |
2933 | 0487d6a8 | j_mayer | } |
2934 | 0487d6a8 | j_mayer | |
2935 | 0487d6a8 | j_mayer | void OPPROTO op_efsmul (void) |
2936 | 0487d6a8 | j_mayer | { |
2937 | 0487d6a8 | j_mayer | T0_64 = _do_efsmul(T0_64, T1_64); |
2938 | 0487d6a8 | j_mayer | RETURN(); |
2939 | 0487d6a8 | j_mayer | } |
2940 | 0487d6a8 | j_mayer | |
2941 | 0487d6a8 | j_mayer | void OPPROTO op_efscmplt (void) |
2942 | 0487d6a8 | j_mayer | { |
2943 | 0487d6a8 | j_mayer | do_efscmplt(); |
2944 | 0487d6a8 | j_mayer | RETURN(); |
2945 | 0487d6a8 | j_mayer | } |
2946 | 0487d6a8 | j_mayer | |
2947 | 0487d6a8 | j_mayer | void OPPROTO op_efscmpgt (void) |
2948 | 0487d6a8 | j_mayer | { |
2949 | 0487d6a8 | j_mayer | do_efscmpgt(); |
2950 | 0487d6a8 | j_mayer | RETURN(); |
2951 | 0487d6a8 | j_mayer | } |
2952 | 0487d6a8 | j_mayer | |
2953 | 0487d6a8 | j_mayer | void OPPROTO op_efscfd (void) |
2954 | 0487d6a8 | j_mayer | { |
2955 | 0487d6a8 | j_mayer | do_efscfd(); |
2956 | 0487d6a8 | j_mayer | RETURN(); |
2957 | 0487d6a8 | j_mayer | } |
2958 | 0487d6a8 | j_mayer | |
2959 | 0487d6a8 | j_mayer | void OPPROTO op_efscmpeq (void) |
2960 | 0487d6a8 | j_mayer | { |
2961 | 0487d6a8 | j_mayer | do_efscmpeq(); |
2962 | 0487d6a8 | j_mayer | RETURN(); |
2963 | 0487d6a8 | j_mayer | } |
2964 | 0487d6a8 | j_mayer | |
2965 | 0487d6a8 | j_mayer | void OPPROTO op_efscfsi (void) |
2966 | 0487d6a8 | j_mayer | { |
2967 | 0487d6a8 | j_mayer | do_efscfsi(); |
2968 | 0487d6a8 | j_mayer | RETURN(); |
2969 | 0487d6a8 | j_mayer | } |
2970 | 0487d6a8 | j_mayer | |
2971 | 0487d6a8 | j_mayer | void OPPROTO op_efscfui (void) |
2972 | 0487d6a8 | j_mayer | { |
2973 | 0487d6a8 | j_mayer | do_efscfui(); |
2974 | 0487d6a8 | j_mayer | RETURN(); |
2975 | 0487d6a8 | j_mayer | } |
2976 | 0487d6a8 | j_mayer | |
2977 | 0487d6a8 | j_mayer | void OPPROTO op_efscfsf (void) |
2978 | 0487d6a8 | j_mayer | { |
2979 | 0487d6a8 | j_mayer | do_efscfsf(); |
2980 | 0487d6a8 | j_mayer | RETURN(); |
2981 | 0487d6a8 | j_mayer | } |
2982 | 0487d6a8 | j_mayer | |
2983 | 0487d6a8 | j_mayer | void OPPROTO op_efscfuf (void) |
2984 | 0487d6a8 | j_mayer | { |
2985 | 0487d6a8 | j_mayer | do_efscfuf(); |
2986 | 0487d6a8 | j_mayer | RETURN(); |
2987 | 0487d6a8 | j_mayer | } |
2988 | 0487d6a8 | j_mayer | |
2989 | 0487d6a8 | j_mayer | void OPPROTO op_efsctsi (void) |
2990 | 0487d6a8 | j_mayer | { |
2991 | 0487d6a8 | j_mayer | do_efsctsi(); |
2992 | 0487d6a8 | j_mayer | RETURN(); |
2993 | 0487d6a8 | j_mayer | } |
2994 | 0487d6a8 | j_mayer | |
2995 | 0487d6a8 | j_mayer | void OPPROTO op_efsctui (void) |
2996 | 0487d6a8 | j_mayer | { |
2997 | 0487d6a8 | j_mayer | do_efsctui(); |
2998 | 0487d6a8 | j_mayer | RETURN(); |
2999 | 0487d6a8 | j_mayer | } |
3000 | 0487d6a8 | j_mayer | |
3001 | 0487d6a8 | j_mayer | void OPPROTO op_efsctsf (void) |
3002 | 0487d6a8 | j_mayer | { |
3003 | 0487d6a8 | j_mayer | do_efsctsf(); |
3004 | 0487d6a8 | j_mayer | RETURN(); |
3005 | 0487d6a8 | j_mayer | } |
3006 | 0487d6a8 | j_mayer | |
3007 | 0487d6a8 | j_mayer | void OPPROTO op_efsctuf (void) |
3008 | 0487d6a8 | j_mayer | { |
3009 | 0487d6a8 | j_mayer | do_efsctuf(); |
3010 | 0487d6a8 | j_mayer | RETURN(); |
3011 | 0487d6a8 | j_mayer | } |
3012 | 0487d6a8 | j_mayer | |
3013 | 0487d6a8 | j_mayer | void OPPROTO op_efsctsiz (void) |
3014 | 0487d6a8 | j_mayer | { |
3015 | 0487d6a8 | j_mayer | do_efsctsiz(); |
3016 | 0487d6a8 | j_mayer | RETURN(); |
3017 | 0487d6a8 | j_mayer | } |
3018 | 0487d6a8 | j_mayer | |
3019 | 0487d6a8 | j_mayer | void OPPROTO op_efsctuiz (void) |
3020 | 0487d6a8 | j_mayer | { |
3021 | 0487d6a8 | j_mayer | do_efsctuiz(); |
3022 | 0487d6a8 | j_mayer | RETURN(); |
3023 | 0487d6a8 | j_mayer | } |
3024 | 0487d6a8 | j_mayer | |
3025 | 0487d6a8 | j_mayer | void OPPROTO op_efststlt (void) |
3026 | 0487d6a8 | j_mayer | { |
3027 | 0487d6a8 | j_mayer | T0 = _do_efststlt(T0_64, T1_64); |
3028 | 0487d6a8 | j_mayer | RETURN(); |
3029 | 0487d6a8 | j_mayer | } |
3030 | 0487d6a8 | j_mayer | |
3031 | 0487d6a8 | j_mayer | void OPPROTO op_efststgt (void) |
3032 | 0487d6a8 | j_mayer | { |
3033 | 0487d6a8 | j_mayer | T0 = _do_efststgt(T0_64, T1_64); |
3034 | 0487d6a8 | j_mayer | RETURN(); |
3035 | 0487d6a8 | j_mayer | } |
3036 | 0487d6a8 | j_mayer | |
3037 | 0487d6a8 | j_mayer | void OPPROTO op_efststeq (void) |
3038 | 0487d6a8 | j_mayer | { |
3039 | 0487d6a8 | j_mayer | T0 = _do_efststeq(T0_64, T1_64); |
3040 | 0487d6a8 | j_mayer | RETURN(); |
3041 | 0487d6a8 | j_mayer | } |
3042 | 0487d6a8 | j_mayer | |
3043 | 0487d6a8 | j_mayer | void OPPROTO op_efdsub (void) |
3044 | 0487d6a8 | j_mayer | { |
3045 | 0487d6a8 | j_mayer | union {
|
3046 | 0487d6a8 | j_mayer | uint64_t u; |
3047 | 0487d6a8 | j_mayer | float64 f; |
3048 | 0487d6a8 | j_mayer | } u1, u2; |
3049 | 0487d6a8 | j_mayer | u1.u = T0_64; |
3050 | 0487d6a8 | j_mayer | u2.u = T1_64; |
3051 | 0487d6a8 | j_mayer | u1.f = float64_sub(u1.f, u2.f, &env->spe_status); |
3052 | 0487d6a8 | j_mayer | T0_64 = u1.u; |
3053 | 0487d6a8 | j_mayer | RETURN(); |
3054 | 0487d6a8 | j_mayer | } |
3055 | 0487d6a8 | j_mayer | |
3056 | 0487d6a8 | j_mayer | void OPPROTO op_efdadd (void) |
3057 | 0487d6a8 | j_mayer | { |
3058 | 0487d6a8 | j_mayer | union {
|
3059 | 0487d6a8 | j_mayer | uint64_t u; |
3060 | 0487d6a8 | j_mayer | float64 f; |
3061 | 0487d6a8 | j_mayer | } u1, u2; |
3062 | 0487d6a8 | j_mayer | u1.u = T0_64; |
3063 | 0487d6a8 | j_mayer | u2.u = T1_64; |
3064 | 0487d6a8 | j_mayer | u1.f = float64_add(u1.f, u2.f, &env->spe_status); |
3065 | 0487d6a8 | j_mayer | T0_64 = u1.u; |
3066 | 0487d6a8 | j_mayer | RETURN(); |
3067 | 0487d6a8 | j_mayer | } |
3068 | 0487d6a8 | j_mayer | |
3069 | 0487d6a8 | j_mayer | void OPPROTO op_efdcfsid (void) |
3070 | 0487d6a8 | j_mayer | { |
3071 | 0487d6a8 | j_mayer | do_efdcfsi(); |
3072 | 0487d6a8 | j_mayer | RETURN(); |
3073 | 0487d6a8 | j_mayer | } |
3074 | 0487d6a8 | j_mayer | |
3075 | 0487d6a8 | j_mayer | void OPPROTO op_efdcfuid (void) |
3076 | 0487d6a8 | j_mayer | { |
3077 | 0487d6a8 | j_mayer | do_efdcfui(); |
3078 | 0487d6a8 | j_mayer | RETURN(); |
3079 | 0487d6a8 | j_mayer | } |
3080 | 0487d6a8 | j_mayer | |
3081 | 0487d6a8 | j_mayer | void OPPROTO op_efdnabs (void) |
3082 | 0487d6a8 | j_mayer | { |
3083 | 0487d6a8 | j_mayer | T0_64 |= 0x8000000000000000ULL;
|
3084 | 0487d6a8 | j_mayer | RETURN(); |
3085 | 0487d6a8 | j_mayer | } |
3086 | 0487d6a8 | j_mayer | |
3087 | 0487d6a8 | j_mayer | void OPPROTO op_efdabs (void) |
3088 | 0487d6a8 | j_mayer | { |
3089 | 0487d6a8 | j_mayer | T0_64 &= ~0x8000000000000000ULL;
|
3090 | 0487d6a8 | j_mayer | RETURN(); |
3091 | 0487d6a8 | j_mayer | } |
3092 | 0487d6a8 | j_mayer | |
3093 | 0487d6a8 | j_mayer | void OPPROTO op_efdneg (void) |
3094 | 0487d6a8 | j_mayer | { |
3095 | 0487d6a8 | j_mayer | T0_64 ^= 0x8000000000000000ULL;
|
3096 | 0487d6a8 | j_mayer | RETURN(); |
3097 | 0487d6a8 | j_mayer | } |
3098 | 0487d6a8 | j_mayer | |
3099 | 0487d6a8 | j_mayer | void OPPROTO op_efddiv (void) |
3100 | 0487d6a8 | j_mayer | { |
3101 | 0487d6a8 | j_mayer | union {
|
3102 | 0487d6a8 | j_mayer | uint64_t u; |
3103 | 0487d6a8 | j_mayer | float64 f; |
3104 | 0487d6a8 | j_mayer | } u1, u2; |
3105 | 0487d6a8 | j_mayer | u1.u = T0_64; |
3106 | 0487d6a8 | j_mayer | u2.u = T1_64; |
3107 | 0487d6a8 | j_mayer | u1.f = float64_div(u1.f, u2.f, &env->spe_status); |
3108 | 0487d6a8 | j_mayer | T0_64 = u1.u; |
3109 | 0487d6a8 | j_mayer | RETURN(); |
3110 | 0487d6a8 | j_mayer | } |
3111 | 0487d6a8 | j_mayer | |
3112 | 0487d6a8 | j_mayer | void OPPROTO op_efdmul (void) |
3113 | 0487d6a8 | j_mayer | { |
3114 | 0487d6a8 | j_mayer | union {
|
3115 | 0487d6a8 | j_mayer | uint64_t u; |
3116 | 0487d6a8 | j_mayer | float64 f; |
3117 | 0487d6a8 | j_mayer | } u1, u2; |
3118 | 0487d6a8 | j_mayer | u1.u = T0_64; |
3119 | 0487d6a8 | j_mayer | u2.u = T1_64; |
3120 | 0487d6a8 | j_mayer | u1.f = float64_mul(u1.f, u2.f, &env->spe_status); |
3121 | 0487d6a8 | j_mayer | T0_64 = u1.u; |
3122 | 0487d6a8 | j_mayer | RETURN(); |
3123 | 0487d6a8 | j_mayer | } |
3124 | 0487d6a8 | j_mayer | |
3125 | 0487d6a8 | j_mayer | void OPPROTO op_efdctsidz (void) |
3126 | 0487d6a8 | j_mayer | { |
3127 | 0487d6a8 | j_mayer | do_efdctsiz(); |
3128 | 0487d6a8 | j_mayer | RETURN(); |
3129 | 0487d6a8 | j_mayer | } |
3130 | 0487d6a8 | j_mayer | |
3131 | 0487d6a8 | j_mayer | void OPPROTO op_efdctuidz (void) |
3132 | 0487d6a8 | j_mayer | { |
3133 | 0487d6a8 | j_mayer | do_efdctuiz(); |
3134 | 0487d6a8 | j_mayer | RETURN(); |
3135 | 0487d6a8 | j_mayer | } |
3136 | 0487d6a8 | j_mayer | |
3137 | 0487d6a8 | j_mayer | void OPPROTO op_efdcmplt (void) |
3138 | 0487d6a8 | j_mayer | { |
3139 | 0487d6a8 | j_mayer | do_efdcmplt(); |
3140 | 0487d6a8 | j_mayer | RETURN(); |
3141 | 0487d6a8 | j_mayer | } |
3142 | 0487d6a8 | j_mayer | |
3143 | 0487d6a8 | j_mayer | void OPPROTO op_efdcmpgt (void) |
3144 | 0487d6a8 | j_mayer | { |
3145 | 0487d6a8 | j_mayer | do_efdcmpgt(); |
3146 | 0487d6a8 | j_mayer | RETURN(); |
3147 | 0487d6a8 | j_mayer | } |
3148 | 0487d6a8 | j_mayer | |
3149 | 0487d6a8 | j_mayer | void OPPROTO op_efdcfs (void) |
3150 | 0487d6a8 | j_mayer | { |
3151 | 0487d6a8 | j_mayer | do_efdcfs(); |
3152 | 0487d6a8 | j_mayer | RETURN(); |
3153 | 0487d6a8 | j_mayer | } |
3154 | 0487d6a8 | j_mayer | |
3155 | 0487d6a8 | j_mayer | void OPPROTO op_efdcmpeq (void) |
3156 | 0487d6a8 | j_mayer | { |
3157 | 0487d6a8 | j_mayer | do_efdcmpeq(); |
3158 | 0487d6a8 | j_mayer | RETURN(); |
3159 | 0487d6a8 | j_mayer | } |
3160 | 0487d6a8 | j_mayer | |
3161 | 0487d6a8 | j_mayer | void OPPROTO op_efdcfsi (void) |
3162 | 0487d6a8 | j_mayer | { |
3163 | 0487d6a8 | j_mayer | do_efdcfsi(); |
3164 | 0487d6a8 | j_mayer | RETURN(); |
3165 | 0487d6a8 | j_mayer | } |
3166 | 0487d6a8 | j_mayer | |
3167 | 0487d6a8 | j_mayer | void OPPROTO op_efdcfui (void) |
3168 | 0487d6a8 | j_mayer | { |
3169 | 0487d6a8 | j_mayer | do_efdcfui(); |
3170 | 0487d6a8 | j_mayer | RETURN(); |
3171 | 0487d6a8 | j_mayer | } |
3172 | 0487d6a8 | j_mayer | |
3173 | 0487d6a8 | j_mayer | void OPPROTO op_efdcfsf (void) |
3174 | 0487d6a8 | j_mayer | { |
3175 | 0487d6a8 | j_mayer | do_efdcfsf(); |
3176 | 0487d6a8 | j_mayer | RETURN(); |
3177 | 0487d6a8 | j_mayer | } |
3178 | 0487d6a8 | j_mayer | |
3179 | 0487d6a8 | j_mayer | void OPPROTO op_efdcfuf (void) |
3180 | 0487d6a8 | j_mayer | { |
3181 | 0487d6a8 | j_mayer | do_efdcfuf(); |
3182 | 0487d6a8 | j_mayer | RETURN(); |
3183 | 0487d6a8 | j_mayer | } |
3184 | 0487d6a8 | j_mayer | |
3185 | 0487d6a8 | j_mayer | void OPPROTO op_efdctsi (void) |
3186 | 0487d6a8 | j_mayer | { |
3187 | 0487d6a8 | j_mayer | do_efdctsi(); |
3188 | 0487d6a8 | j_mayer | RETURN(); |
3189 | 0487d6a8 | j_mayer | } |
3190 | 0487d6a8 | j_mayer | |
3191 | 0487d6a8 | j_mayer | void OPPROTO op_efdctui (void) |
3192 | 0487d6a8 | j_mayer | { |
3193 | 0487d6a8 | j_mayer | do_efdctui(); |
3194 | 0487d6a8 | j_mayer | RETURN(); |
3195 | 0487d6a8 | j_mayer | } |
3196 | 0487d6a8 | j_mayer | |
3197 | 0487d6a8 | j_mayer | void OPPROTO op_efdctsf (void) |
3198 | 0487d6a8 | j_mayer | { |
3199 | 0487d6a8 | j_mayer | do_efdctsf(); |
3200 | 0487d6a8 | j_mayer | RETURN(); |
3201 | 0487d6a8 | j_mayer | } |
3202 | 0487d6a8 | j_mayer | |
3203 | 0487d6a8 | j_mayer | void OPPROTO op_efdctuf (void) |
3204 | 0487d6a8 | j_mayer | { |
3205 | 0487d6a8 | j_mayer | do_efdctuf(); |
3206 | 0487d6a8 | j_mayer | RETURN(); |
3207 | 0487d6a8 | j_mayer | } |
3208 | 0487d6a8 | j_mayer | |
3209 | 0487d6a8 | j_mayer | void OPPROTO op_efdctuiz (void) |
3210 | 0487d6a8 | j_mayer | { |
3211 | 0487d6a8 | j_mayer | do_efdctuiz(); |
3212 | 0487d6a8 | j_mayer | RETURN(); |
3213 | 0487d6a8 | j_mayer | } |
3214 | 0487d6a8 | j_mayer | |
3215 | 0487d6a8 | j_mayer | void OPPROTO op_efdctsiz (void) |
3216 | 0487d6a8 | j_mayer | { |
3217 | 0487d6a8 | j_mayer | do_efdctsiz(); |
3218 | 0487d6a8 | j_mayer | RETURN(); |
3219 | 0487d6a8 | j_mayer | } |
3220 | 0487d6a8 | j_mayer | |
3221 | 0487d6a8 | j_mayer | void OPPROTO op_efdtstlt (void) |
3222 | 0487d6a8 | j_mayer | { |
3223 | 0487d6a8 | j_mayer | T0 = _do_efdtstlt(T0_64, T1_64); |
3224 | 0487d6a8 | j_mayer | RETURN(); |
3225 | 0487d6a8 | j_mayer | } |
3226 | 0487d6a8 | j_mayer | |
3227 | 0487d6a8 | j_mayer | void OPPROTO op_efdtstgt (void) |
3228 | 0487d6a8 | j_mayer | { |
3229 | 0487d6a8 | j_mayer | T0 = _do_efdtstgt(T0_64, T1_64); |
3230 | 0487d6a8 | j_mayer | RETURN(); |
3231 | 0487d6a8 | j_mayer | } |
3232 | 0487d6a8 | j_mayer | |
3233 | 0487d6a8 | j_mayer | void OPPROTO op_efdtsteq (void) |
3234 | 0487d6a8 | j_mayer | { |
3235 | 0487d6a8 | j_mayer | T0 = _do_efdtsteq(T0_64, T1_64); |
3236 | 0487d6a8 | j_mayer | RETURN(); |
3237 | 0487d6a8 | j_mayer | } |
3238 | 35cdaad6 | j_mayer | #endif /* defined(TARGET_PPCEMB) */ |