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