19 |
*/ |
*/ |
20 |
#include "exec-i386.h" |
#include "exec-i386.h" |
21 |
|
|
|
uint8_t parity_table[256] = { |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, |
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, |
|
|
}; |
|
|
|
|
|
/* modulo 17 table */ |
|
|
const uint8_t rclw_table[32] = { |
|
|
0, 1, 2, 3, 4, 5, 6, 7, |
|
|
8, 9,10,11,12,13,14,15, |
|
|
16, 0, 1, 2, 3, 4, 5, 6, |
|
|
7, 8, 9,10,11,12,13,14, |
|
|
}; |
|
|
|
|
|
/* modulo 9 table */ |
|
|
const uint8_t rclb_table[32] = { |
|
|
0, 1, 2, 3, 4, 5, 6, 7, |
|
|
8, 0, 1, 2, 3, 4, 5, 6, |
|
|
7, 8, 0, 1, 2, 3, 4, 5, |
|
|
6, 7, 8, 0, 1, 2, 3, 4, |
|
|
}; |
|
|
|
|
22 |
/* n must be a constant to be efficient */ |
/* n must be a constant to be efficient */ |
23 |
static inline int lshift(int x, int n) |
static inline int lshift(int x, int n) |
24 |
{ |
{ |
573 |
helper_cmpxchg8b(); |
helper_cmpxchg8b(); |
574 |
} |
} |
575 |
|
|
|
#if defined(__powerpc__) |
|
|
|
|
|
/* on PowerPC we patch the jump instruction directly */ |
|
|
#define JUMP_TB(tbparam, n, eip)\ |
|
|
do {\ |
|
|
static void __attribute__((unused)) *__op_label ## n = &&label ## n;\ |
|
|
asm volatile ("b %0" : : "i" (&__op_jmp ## n));\ |
|
|
label ## n:\ |
|
|
T0 = (long)(tbparam) + (n);\ |
|
|
EIP = eip;\ |
|
|
} while (0) |
|
|
|
|
|
#else |
|
|
|
|
|
/* jump to next block operations (more portable code, does not need |
|
|
cache flushing, but slower because of indirect jump) */ |
|
|
#define JUMP_TB(tbparam, n, eip)\ |
|
|
do {\ |
|
|
static void __attribute__((unused)) *__op_label ## n = &&label ## n;\ |
|
|
goto *(void *)(((TranslationBlock *)tbparam)->tb_next[n]);\ |
|
|
label ## n:\ |
|
|
T0 = (long)(tbparam) + (n);\ |
|
|
EIP = eip;\ |
|
|
} while (0) |
|
|
|
|
|
#endif |
|
|
|
|
576 |
void OPPROTO op_jmp_tb_next(void) |
void OPPROTO op_jmp_tb_next(void) |
577 |
{ |
{ |
578 |
JUMP_TB(PARAM1, 0, PARAM2); |
JUMP_TB(PARAM1, 0, PARAM2); |
1483 |
|
|
1484 |
d = ST0; |
d = ST0; |
1485 |
val = lrint(d); |
val = lrint(d); |
1486 |
|
if (val != (int16_t)val) |
1487 |
|
val = -32768; |
1488 |
stw((void *)A0, val); |
stw((void *)A0, val); |
1489 |
} |
} |
1490 |
|
|