Pre-calculate pow table for FXTRACT instruction
This commit is contained in:
@@ -287,6 +287,9 @@ uint8_t reg_30 = 0x00;
|
||||
uint8_t arr[24] = { 0 };
|
||||
uint8_t rcr[8] = { 0 };
|
||||
|
||||
/* Table for FXTRACT. */
|
||||
double exp_pow_table[0x800];
|
||||
|
||||
static int cyrix_addr;
|
||||
|
||||
static void cpu_write(uint16_t addr, uint8_t val, void *priv);
|
||||
|
||||
@@ -36,6 +36,8 @@ extern void fpu_log(const char *fmt, ...);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
extern double exp_pow_table[0x800];
|
||||
|
||||
static int rounding_modes[4] = { FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO };
|
||||
|
||||
#define ST(x) cpu_state.ST[((cpu_state.TOP + (x)) & 7)]
|
||||
|
||||
@@ -46,7 +46,7 @@ opFXTRACT(UNUSED(uint32_t fetchdat))
|
||||
test.eind.d = ST(0);
|
||||
exp80 = test.eind.ll & 0x7ff0000000000000LL;
|
||||
exp80final = (exp80 >> 52) - BIAS64;
|
||||
mant = test.eind.d / (pow(2.0, (double) exp80final));
|
||||
mant = test.eind.d / exp_pow_table[exp80 >> 52];
|
||||
ST(0) = (double) exp80final;
|
||||
FP_TAG_VALID;
|
||||
x87_push(mant);
|
||||
|
||||
Reference in New Issue
Block a user