root / target-i386 / ops_template.h @ 977d5710
History | View | Annotate | Download (13.1 kB)
1 |
/*
|
---|---|
2 |
* i386 micro operations (included several times to generate
|
3 |
* different operand sizes)
|
4 |
*
|
5 |
* Copyright (c) 2003 Fabrice Bellard
|
6 |
*
|
7 |
* This library is free software; you can redistribute it and/or
|
8 |
* modify it under the terms of the GNU Lesser General Public
|
9 |
* License as published by the Free Software Foundation; either
|
10 |
* version 2 of the License, or (at your option) any later version.
|
11 |
*
|
12 |
* This library is distributed in the hope that it will be useful,
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15 |
* Lesser General Public License for more details.
|
16 |
*
|
17 |
* You should have received a copy of the GNU Lesser General Public
|
18 |
* License along with this library; if not, write to the Free Software
|
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
20 |
*/
|
21 |
#define DATA_BITS (1 << (3 + SHIFT)) |
22 |
#define SHIFT_MASK (DATA_BITS - 1) |
23 |
#define SIGN_MASK (((target_ulong)1) << (DATA_BITS - 1)) |
24 |
#if DATA_BITS <= 32 |
25 |
#define SHIFT1_MASK 0x1f |
26 |
#else
|
27 |
#define SHIFT1_MASK 0x3f |
28 |
#endif
|
29 |
|
30 |
#if DATA_BITS == 8 |
31 |
#define SUFFIX b
|
32 |
#define DATA_TYPE uint8_t
|
33 |
#define DATA_STYPE int8_t
|
34 |
#define DATA_MASK 0xff |
35 |
#elif DATA_BITS == 16 |
36 |
#define SUFFIX w
|
37 |
#define DATA_TYPE uint16_t
|
38 |
#define DATA_STYPE int16_t
|
39 |
#define DATA_MASK 0xffff |
40 |
#elif DATA_BITS == 32 |
41 |
#define SUFFIX l
|
42 |
#define DATA_TYPE uint32_t
|
43 |
#define DATA_STYPE int32_t
|
44 |
#define DATA_MASK 0xffffffff |
45 |
#elif DATA_BITS == 64 |
46 |
#define SUFFIX q
|
47 |
#define DATA_TYPE uint64_t
|
48 |
#define DATA_STYPE int64_t
|
49 |
#define DATA_MASK 0xffffffffffffffffULL |
50 |
#else
|
51 |
#error unhandled operand size
|
52 |
#endif
|
53 |
|
54 |
/* dynamic flags computation */
|
55 |
|
56 |
static int glue(compute_all_add, SUFFIX)(void) |
57 |
{ |
58 |
int cf, pf, af, zf, sf, of;
|
59 |
target_long src1, src2; |
60 |
src1 = CC_SRC; |
61 |
src2 = CC_DST - CC_SRC; |
62 |
cf = (DATA_TYPE)CC_DST < (DATA_TYPE)src1; |
63 |
pf = parity_table[(uint8_t)CC_DST]; |
64 |
af = (CC_DST ^ src1 ^ src2) & 0x10;
|
65 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
66 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
67 |
of = lshift((src1 ^ src2 ^ -1) & (src1 ^ CC_DST), 12 - DATA_BITS) & CC_O; |
68 |
return cf | pf | af | zf | sf | of;
|
69 |
} |
70 |
|
71 |
static int glue(compute_c_add, SUFFIX)(void) |
72 |
{ |
73 |
int cf;
|
74 |
target_long src1; |
75 |
src1 = CC_SRC; |
76 |
cf = (DATA_TYPE)CC_DST < (DATA_TYPE)src1; |
77 |
return cf;
|
78 |
} |
79 |
|
80 |
static int glue(compute_all_adc, SUFFIX)(void) |
81 |
{ |
82 |
int cf, pf, af, zf, sf, of;
|
83 |
target_long src1, src2; |
84 |
src1 = CC_SRC; |
85 |
src2 = CC_DST - CC_SRC - 1;
|
86 |
cf = (DATA_TYPE)CC_DST <= (DATA_TYPE)src1; |
87 |
pf = parity_table[(uint8_t)CC_DST]; |
88 |
af = (CC_DST ^ src1 ^ src2) & 0x10;
|
89 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
90 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
91 |
of = lshift((src1 ^ src2 ^ -1) & (src1 ^ CC_DST), 12 - DATA_BITS) & CC_O; |
92 |
return cf | pf | af | zf | sf | of;
|
93 |
} |
94 |
|
95 |
static int glue(compute_c_adc, SUFFIX)(void) |
96 |
{ |
97 |
int cf;
|
98 |
target_long src1; |
99 |
src1 = CC_SRC; |
100 |
cf = (DATA_TYPE)CC_DST <= (DATA_TYPE)src1; |
101 |
return cf;
|
102 |
} |
103 |
|
104 |
static int glue(compute_all_sub, SUFFIX)(void) |
105 |
{ |
106 |
int cf, pf, af, zf, sf, of;
|
107 |
target_long src1, src2; |
108 |
src1 = CC_DST + CC_SRC; |
109 |
src2 = CC_SRC; |
110 |
cf = (DATA_TYPE)src1 < (DATA_TYPE)src2; |
111 |
pf = parity_table[(uint8_t)CC_DST]; |
112 |
af = (CC_DST ^ src1 ^ src2) & 0x10;
|
113 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
114 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
115 |
of = lshift((src1 ^ src2) & (src1 ^ CC_DST), 12 - DATA_BITS) & CC_O;
|
116 |
return cf | pf | af | zf | sf | of;
|
117 |
} |
118 |
|
119 |
static int glue(compute_c_sub, SUFFIX)(void) |
120 |
{ |
121 |
int cf;
|
122 |
target_long src1, src2; |
123 |
src1 = CC_DST + CC_SRC; |
124 |
src2 = CC_SRC; |
125 |
cf = (DATA_TYPE)src1 < (DATA_TYPE)src2; |
126 |
return cf;
|
127 |
} |
128 |
|
129 |
static int glue(compute_all_sbb, SUFFIX)(void) |
130 |
{ |
131 |
int cf, pf, af, zf, sf, of;
|
132 |
target_long src1, src2; |
133 |
src1 = CC_DST + CC_SRC + 1;
|
134 |
src2 = CC_SRC; |
135 |
cf = (DATA_TYPE)src1 <= (DATA_TYPE)src2; |
136 |
pf = parity_table[(uint8_t)CC_DST]; |
137 |
af = (CC_DST ^ src1 ^ src2) & 0x10;
|
138 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
139 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
140 |
of = lshift((src1 ^ src2) & (src1 ^ CC_DST), 12 - DATA_BITS) & CC_O;
|
141 |
return cf | pf | af | zf | sf | of;
|
142 |
} |
143 |
|
144 |
static int glue(compute_c_sbb, SUFFIX)(void) |
145 |
{ |
146 |
int cf;
|
147 |
target_long src1, src2; |
148 |
src1 = CC_DST + CC_SRC + 1;
|
149 |
src2 = CC_SRC; |
150 |
cf = (DATA_TYPE)src1 <= (DATA_TYPE)src2; |
151 |
return cf;
|
152 |
} |
153 |
|
154 |
static int glue(compute_all_logic, SUFFIX)(void) |
155 |
{ |
156 |
int cf, pf, af, zf, sf, of;
|
157 |
cf = 0;
|
158 |
pf = parity_table[(uint8_t)CC_DST]; |
159 |
af = 0;
|
160 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
161 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
162 |
of = 0;
|
163 |
return cf | pf | af | zf | sf | of;
|
164 |
} |
165 |
|
166 |
static int glue(compute_c_logic, SUFFIX)(void) |
167 |
{ |
168 |
return 0; |
169 |
} |
170 |
|
171 |
static int glue(compute_all_inc, SUFFIX)(void) |
172 |
{ |
173 |
int cf, pf, af, zf, sf, of;
|
174 |
target_long src1, src2; |
175 |
src1 = CC_DST - 1;
|
176 |
src2 = 1;
|
177 |
cf = CC_SRC; |
178 |
pf = parity_table[(uint8_t)CC_DST]; |
179 |
af = (CC_DST ^ src1 ^ src2) & 0x10;
|
180 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
181 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
182 |
of = ((CC_DST & DATA_MASK) == SIGN_MASK) << 11;
|
183 |
return cf | pf | af | zf | sf | of;
|
184 |
} |
185 |
|
186 |
#if DATA_BITS == 32 |
187 |
static int glue(compute_c_inc, SUFFIX)(void) |
188 |
{ |
189 |
return CC_SRC;
|
190 |
} |
191 |
#endif
|
192 |
|
193 |
static int glue(compute_all_dec, SUFFIX)(void) |
194 |
{ |
195 |
int cf, pf, af, zf, sf, of;
|
196 |
target_long src1, src2; |
197 |
src1 = CC_DST + 1;
|
198 |
src2 = 1;
|
199 |
cf = CC_SRC; |
200 |
pf = parity_table[(uint8_t)CC_DST]; |
201 |
af = (CC_DST ^ src1 ^ src2) & 0x10;
|
202 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
203 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
204 |
of = ((CC_DST & DATA_MASK) == ((target_ulong)SIGN_MASK - 1)) << 11; |
205 |
return cf | pf | af | zf | sf | of;
|
206 |
} |
207 |
|
208 |
static int glue(compute_all_shl, SUFFIX)(void) |
209 |
{ |
210 |
int cf, pf, af, zf, sf, of;
|
211 |
cf = (CC_SRC >> (DATA_BITS - 1)) & CC_C;
|
212 |
pf = parity_table[(uint8_t)CC_DST]; |
213 |
af = 0; /* undefined */ |
214 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
215 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
216 |
/* of is defined if shift count == 1 */
|
217 |
of = lshift(CC_SRC ^ CC_DST, 12 - DATA_BITS) & CC_O;
|
218 |
return cf | pf | af | zf | sf | of;
|
219 |
} |
220 |
|
221 |
static int glue(compute_c_shl, SUFFIX)(void) |
222 |
{ |
223 |
return (CC_SRC >> (DATA_BITS - 1)) & CC_C; |
224 |
} |
225 |
|
226 |
#if DATA_BITS == 32 |
227 |
static int glue(compute_c_sar, SUFFIX)(void) |
228 |
{ |
229 |
return CC_SRC & 1; |
230 |
} |
231 |
#endif
|
232 |
|
233 |
static int glue(compute_all_sar, SUFFIX)(void) |
234 |
{ |
235 |
int cf, pf, af, zf, sf, of;
|
236 |
cf = CC_SRC & 1;
|
237 |
pf = parity_table[(uint8_t)CC_DST]; |
238 |
af = 0; /* undefined */ |
239 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
240 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
241 |
/* of is defined if shift count == 1 */
|
242 |
of = lshift(CC_SRC ^ CC_DST, 12 - DATA_BITS) & CC_O;
|
243 |
return cf | pf | af | zf | sf | of;
|
244 |
} |
245 |
|
246 |
#if DATA_BITS == 32 |
247 |
static int glue(compute_c_mul, SUFFIX)(void) |
248 |
{ |
249 |
int cf;
|
250 |
cf = (CC_SRC != 0);
|
251 |
return cf;
|
252 |
} |
253 |
#endif
|
254 |
|
255 |
/* NOTE: we compute the flags like the P4. On olders CPUs, only OF and
|
256 |
CF are modified and it is slower to do that. */
|
257 |
static int glue(compute_all_mul, SUFFIX)(void) |
258 |
{ |
259 |
int cf, pf, af, zf, sf, of;
|
260 |
cf = (CC_SRC != 0);
|
261 |
pf = parity_table[(uint8_t)CC_DST]; |
262 |
af = 0; /* undefined */ |
263 |
zf = ((DATA_TYPE)CC_DST == 0) << 6; |
264 |
sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80; |
265 |
of = cf << 11;
|
266 |
return cf | pf | af | zf | sf | of;
|
267 |
} |
268 |
|
269 |
/* various optimized jumps cases */
|
270 |
|
271 |
void OPPROTO glue(op_jb_sub, SUFFIX)(void) |
272 |
{ |
273 |
target_long src1, src2; |
274 |
src1 = CC_DST + CC_SRC; |
275 |
src2 = CC_SRC; |
276 |
|
277 |
if ((DATA_TYPE)src1 < (DATA_TYPE)src2)
|
278 |
GOTO_LABEL_PARAM(1);
|
279 |
FORCE_RET(); |
280 |
} |
281 |
|
282 |
void OPPROTO glue(op_jz_sub, SUFFIX)(void) |
283 |
{ |
284 |
if ((DATA_TYPE)CC_DST == 0) |
285 |
GOTO_LABEL_PARAM(1);
|
286 |
FORCE_RET(); |
287 |
} |
288 |
|
289 |
void OPPROTO glue(op_jnz_sub, SUFFIX)(void) |
290 |
{ |
291 |
if ((DATA_TYPE)CC_DST != 0) |
292 |
GOTO_LABEL_PARAM(1);
|
293 |
FORCE_RET(); |
294 |
} |
295 |
|
296 |
void OPPROTO glue(op_jbe_sub, SUFFIX)(void) |
297 |
{ |
298 |
target_long src1, src2; |
299 |
src1 = CC_DST + CC_SRC; |
300 |
src2 = CC_SRC; |
301 |
|
302 |
if ((DATA_TYPE)src1 <= (DATA_TYPE)src2)
|
303 |
GOTO_LABEL_PARAM(1);
|
304 |
FORCE_RET(); |
305 |
} |
306 |
|
307 |
void OPPROTO glue(op_js_sub, SUFFIX)(void) |
308 |
{ |
309 |
if (CC_DST & SIGN_MASK)
|
310 |
GOTO_LABEL_PARAM(1);
|
311 |
FORCE_RET(); |
312 |
} |
313 |
|
314 |
void OPPROTO glue(op_jl_sub, SUFFIX)(void) |
315 |
{ |
316 |
target_long src1, src2; |
317 |
src1 = CC_DST + CC_SRC; |
318 |
src2 = CC_SRC; |
319 |
|
320 |
if ((DATA_STYPE)src1 < (DATA_STYPE)src2)
|
321 |
GOTO_LABEL_PARAM(1);
|
322 |
FORCE_RET(); |
323 |
} |
324 |
|
325 |
void OPPROTO glue(op_jle_sub, SUFFIX)(void) |
326 |
{ |
327 |
target_long src1, src2; |
328 |
src1 = CC_DST + CC_SRC; |
329 |
src2 = CC_SRC; |
330 |
|
331 |
if ((DATA_STYPE)src1 <= (DATA_STYPE)src2)
|
332 |
GOTO_LABEL_PARAM(1);
|
333 |
FORCE_RET(); |
334 |
} |
335 |
|
336 |
/* oldies */
|
337 |
|
338 |
#if DATA_BITS >= 16 |
339 |
|
340 |
void OPPROTO glue(op_loopnz, SUFFIX)(void) |
341 |
{ |
342 |
int eflags;
|
343 |
eflags = cc_table[CC_OP].compute_all(); |
344 |
if ((DATA_TYPE)ECX != 0 && !(eflags & CC_Z)) |
345 |
GOTO_LABEL_PARAM(1);
|
346 |
FORCE_RET(); |
347 |
} |
348 |
|
349 |
void OPPROTO glue(op_loopz, SUFFIX)(void) |
350 |
{ |
351 |
int eflags;
|
352 |
eflags = cc_table[CC_OP].compute_all(); |
353 |
if ((DATA_TYPE)ECX != 0 && (eflags & CC_Z)) |
354 |
GOTO_LABEL_PARAM(1);
|
355 |
FORCE_RET(); |
356 |
} |
357 |
|
358 |
void OPPROTO glue(op_jz_ecx, SUFFIX)(void) |
359 |
{ |
360 |
if ((DATA_TYPE)ECX == 0) |
361 |
GOTO_LABEL_PARAM(1);
|
362 |
FORCE_RET(); |
363 |
} |
364 |
|
365 |
void OPPROTO glue(op_jnz_ecx, SUFFIX)(void) |
366 |
{ |
367 |
if ((DATA_TYPE)ECX != 0) |
368 |
GOTO_LABEL_PARAM(1);
|
369 |
FORCE_RET(); |
370 |
} |
371 |
|
372 |
#endif
|
373 |
|
374 |
/* various optimized set cases */
|
375 |
|
376 |
void OPPROTO glue(op_setb_T0_sub, SUFFIX)(void) |
377 |
{ |
378 |
target_long src1, src2; |
379 |
src1 = CC_DST + CC_SRC; |
380 |
src2 = CC_SRC; |
381 |
|
382 |
T0 = ((DATA_TYPE)src1 < (DATA_TYPE)src2); |
383 |
} |
384 |
|
385 |
void OPPROTO glue(op_setz_T0_sub, SUFFIX)(void) |
386 |
{ |
387 |
T0 = ((DATA_TYPE)CC_DST == 0);
|
388 |
} |
389 |
|
390 |
void OPPROTO glue(op_setbe_T0_sub, SUFFIX)(void) |
391 |
{ |
392 |
target_long src1, src2; |
393 |
src1 = CC_DST + CC_SRC; |
394 |
src2 = CC_SRC; |
395 |
|
396 |
T0 = ((DATA_TYPE)src1 <= (DATA_TYPE)src2); |
397 |
} |
398 |
|
399 |
void OPPROTO glue(op_sets_T0_sub, SUFFIX)(void) |
400 |
{ |
401 |
T0 = lshift(CC_DST, -(DATA_BITS - 1)) & 1; |
402 |
} |
403 |
|
404 |
void OPPROTO glue(op_setl_T0_sub, SUFFIX)(void) |
405 |
{ |
406 |
target_long src1, src2; |
407 |
src1 = CC_DST + CC_SRC; |
408 |
src2 = CC_SRC; |
409 |
|
410 |
T0 = ((DATA_STYPE)src1 < (DATA_STYPE)src2); |
411 |
} |
412 |
|
413 |
void OPPROTO glue(op_setle_T0_sub, SUFFIX)(void) |
414 |
{ |
415 |
target_long src1, src2; |
416 |
src1 = CC_DST + CC_SRC; |
417 |
src2 = CC_SRC; |
418 |
|
419 |
T0 = ((DATA_STYPE)src1 <= (DATA_STYPE)src2); |
420 |
} |
421 |
|
422 |
/* shifts */
|
423 |
|
424 |
void OPPROTO glue(glue(op_shl, SUFFIX), _T0_T1)(void) |
425 |
{ |
426 |
int count;
|
427 |
count = T1 & SHIFT1_MASK; |
428 |
T0 = T0 << count; |
429 |
FORCE_RET(); |
430 |
} |
431 |
|
432 |
void OPPROTO glue(glue(op_shr, SUFFIX), _T0_T1)(void) |
433 |
{ |
434 |
int count;
|
435 |
count = T1 & SHIFT1_MASK; |
436 |
T0 &= DATA_MASK; |
437 |
T0 = T0 >> count; |
438 |
FORCE_RET(); |
439 |
} |
440 |
|
441 |
void OPPROTO glue(glue(op_sar, SUFFIX), _T0_T1)(void) |
442 |
{ |
443 |
int count;
|
444 |
target_long src; |
445 |
|
446 |
count = T1 & SHIFT1_MASK; |
447 |
src = (DATA_STYPE)T0; |
448 |
T0 = src >> count; |
449 |
FORCE_RET(); |
450 |
} |
451 |
|
452 |
#undef MEM_WRITE
|
453 |
#include "ops_template_mem.h" |
454 |
|
455 |
#define MEM_WRITE 0 |
456 |
#include "ops_template_mem.h" |
457 |
|
458 |
#if !defined(CONFIG_USER_ONLY)
|
459 |
#define MEM_WRITE 1 |
460 |
#include "ops_template_mem.h" |
461 |
|
462 |
#define MEM_WRITE 2 |
463 |
#include "ops_template_mem.h" |
464 |
#endif
|
465 |
|
466 |
/* bit operations */
|
467 |
#if DATA_BITS >= 16 |
468 |
|
469 |
void OPPROTO glue(glue(op_bt, SUFFIX), _T0_T1_cc)(void) |
470 |
{ |
471 |
int count;
|
472 |
count = T1 & SHIFT_MASK; |
473 |
CC_SRC = T0 >> count; |
474 |
} |
475 |
|
476 |
void OPPROTO glue(glue(op_bts, SUFFIX), _T0_T1_cc)(void) |
477 |
{ |
478 |
int count;
|
479 |
count = T1 & SHIFT_MASK; |
480 |
T1 = T0 >> count; |
481 |
T0 |= (((target_long)1) << count);
|
482 |
} |
483 |
|
484 |
void OPPROTO glue(glue(op_btr, SUFFIX), _T0_T1_cc)(void) |
485 |
{ |
486 |
int count;
|
487 |
count = T1 & SHIFT_MASK; |
488 |
T1 = T0 >> count; |
489 |
T0 &= ~(((target_long)1) << count);
|
490 |
} |
491 |
|
492 |
void OPPROTO glue(glue(op_btc, SUFFIX), _T0_T1_cc)(void) |
493 |
{ |
494 |
int count;
|
495 |
count = T1 & SHIFT_MASK; |
496 |
T1 = T0 >> count; |
497 |
T0 ^= (((target_long)1) << count);
|
498 |
} |
499 |
|
500 |
void OPPROTO glue(glue(op_add_bit, SUFFIX), _A0_T1)(void) |
501 |
{ |
502 |
A0 += ((DATA_STYPE)T1 >> (3 + SHIFT)) << SHIFT;
|
503 |
} |
504 |
|
505 |
void OPPROTO glue(glue(op_bsf, SUFFIX), _T0_cc)(void) |
506 |
{ |
507 |
int count;
|
508 |
target_long res; |
509 |
|
510 |
res = T0 & DATA_MASK; |
511 |
if (res != 0) { |
512 |
count = 0;
|
513 |
while ((res & 1) == 0) { |
514 |
count++; |
515 |
res >>= 1;
|
516 |
} |
517 |
T1 = count; |
518 |
CC_DST = 1; /* ZF = 0 */ |
519 |
} else {
|
520 |
CC_DST = 0; /* ZF = 1 */ |
521 |
} |
522 |
FORCE_RET(); |
523 |
} |
524 |
|
525 |
void OPPROTO glue(glue(op_bsr, SUFFIX), _T0_cc)(void) |
526 |
{ |
527 |
int count;
|
528 |
target_long res; |
529 |
|
530 |
res = T0 & DATA_MASK; |
531 |
if (res != 0) { |
532 |
count = DATA_BITS - 1;
|
533 |
while ((res & SIGN_MASK) == 0) { |
534 |
count--; |
535 |
res <<= 1;
|
536 |
} |
537 |
T1 = count; |
538 |
CC_DST = 1; /* ZF = 0 */ |
539 |
} else {
|
540 |
CC_DST = 0; /* ZF = 1 */ |
541 |
} |
542 |
FORCE_RET(); |
543 |
} |
544 |
|
545 |
#endif
|
546 |
|
547 |
#if DATA_BITS == 32 |
548 |
void OPPROTO op_update_bt_cc(void) |
549 |
{ |
550 |
CC_SRC = T1; |
551 |
} |
552 |
#endif
|
553 |
|
554 |
/* string operations */
|
555 |
|
556 |
void OPPROTO glue(op_movl_T0_Dshift, SUFFIX)(void) |
557 |
{ |
558 |
T0 = DF << SHIFT; |
559 |
} |
560 |
|
561 |
/* port I/O */
|
562 |
#if DATA_BITS <= 32 |
563 |
void OPPROTO glue(glue(op_out, SUFFIX), _T0_T1)(void) |
564 |
{ |
565 |
glue(cpu_out, SUFFIX)(env, T0, T1 & DATA_MASK); |
566 |
} |
567 |
|
568 |
void OPPROTO glue(glue(op_in, SUFFIX), _T0_T1)(void) |
569 |
{ |
570 |
T1 = glue(cpu_in, SUFFIX)(env, T0); |
571 |
} |
572 |
|
573 |
void OPPROTO glue(glue(op_in, SUFFIX), _DX_T0)(void) |
574 |
{ |
575 |
T0 = glue(cpu_in, SUFFIX)(env, EDX & 0xffff);
|
576 |
} |
577 |
|
578 |
void OPPROTO glue(glue(op_out, SUFFIX), _DX_T0)(void) |
579 |
{ |
580 |
glue(cpu_out, SUFFIX)(env, EDX & 0xffff, T0);
|
581 |
} |
582 |
|
583 |
void OPPROTO glue(glue(op_check_io, SUFFIX), _T0)(void) |
584 |
{ |
585 |
glue(glue(check_io, SUFFIX), _T0)(); |
586 |
} |
587 |
|
588 |
void OPPROTO glue(glue(op_check_io, SUFFIX), _DX)(void) |
589 |
{ |
590 |
glue(glue(check_io, SUFFIX), _DX)(); |
591 |
} |
592 |
#endif
|
593 |
|
594 |
#undef DATA_BITS
|
595 |
#undef SHIFT_MASK
|
596 |
#undef SHIFT1_MASK
|
597 |
#undef SIGN_MASK
|
598 |
#undef DATA_TYPE
|
599 |
#undef DATA_STYPE
|
600 |
#undef DATA_MASK
|
601 |
#undef SUFFIX
|