ad -= frame_size;
}
} else { /* 68881/68882 */
- int frame_size_real = currprefs.fpu_model == 68882 ? 0x3c : 0x1c;;
+ int frame_size_real = currprefs.fpu_model == 68882 ? 0x3c : 0x1c;
int frame_size = regs.fpu_state == 0 ? 0 : frame_size_real;
uae_u32 frame_id = regs.fpu_state == 0 ? ((frame_size_real - 4) << 16) : (fpu_version << 24) | ((frame_size_real - 4) << 16);
case 0x38: /* FCMP */
{
fpdata t = *dst;
+ uae_u32 status = regs.fpsr;
fpp_sub(&t, src);
+ fpsr_clear_status();
+ fpp_set_fpsr(status);
fpsr_set_result(&t);
return true;
}
#include "uae/vm.h"
#include "newcpu.h"
-static uae_u32 xhex_pi[] ={0x2168c235, 0xc90fdaa2, 0x4000};
+#ifdef JIT
uae_u32 xhex_exp_1[] ={0xa2bb4a9a, 0xadf85458, 0x4000};
-static uae_u32 xhex_l2_e[] ={0x5c17f0bc, 0xb8aa3b29, 0x3fff};
-static uae_u32 xhex_ln_2[] ={0xd1cf79ac, 0xb17217f7, 0x3ffe};
uae_u32 xhex_ln_10[] ={0xaaa8ac17, 0x935d8ddd, 0x4000};
uae_u32 xhex_l10_2[] ={0xfbcff798, 0x9a209a84, 0x3ffd};
uae_u32 xhex_l10_e[] ={0x37287195, 0xde5bd8a9, 0x3ffd};
uae_u32 xhex_1e1024[]={0x81750c17, 0xc9767586, 0x4d48};
uae_u32 xhex_1e2048[]={0xc53d5de5, 0x9e8b3b5d, 0x5a92};
uae_u32 xhex_1e4096[]={0x8a20979b, 0xc4605202, 0x7525};
+double fp_1e8 = 1.0e8;
+float fp_1e0 = 1, fp_1e1 = 10, fp_1e2 = 100, fp_1e4 = 10000;
+#endif
+
+static uae_u32 xhex_pi[] ={0x2168c235, 0xc90fdaa2, 0x4000};
+static uae_u32 xhex_l2_e[] ={0x5c17f0bc, 0xb8aa3b29, 0x3fff};
+static uae_u32 xhex_ln_2[] ={0xd1cf79ac, 0xb17217f7, 0x3ffe};
static uae_u32 xhex_inf[] ={0x00000000, 0x00000000, 0x7fff};
static uae_u32 xhex_nan[] ={0xffffffff, 0xffffffff, 0x7fff};
static uae_u32 xhex_snan[] ={0xffffffff, 0xbfffffff, 0x7fff};
static double *fp_nan = (double *)dhex_nan;
#endif
static const double twoto32 = 4294967296.0;
-double fp_1e8 = 1.0e8;
-float fp_1e0 = 1, fp_1e1 = 10, fp_1e2 = 100, fp_1e4 = 10000;
#define FPCR_ROUNDING_MODE 0x00000030
#define FPCR_ROUND_NEAR 0x00000000
}
static void fp_sglmul(fpdata *a, fpdata *b)
{
+ // not exact
a->fp = a->fp * b->fp;
fpp_roundsgl(a);
}
static void fp_sgldiv(fpdata *a, fpdata *b)
{
+ // not exact
a->fp = a->fp / b->fp;
fpp_roundsgl(a);
}
static floatx80 fxsizes[6];
static floatx80 fxzero;
-static floatx80 fx_1e0, fx_1e1, fx_1e2, fx_1e4, fx_1e8;
static struct float_status fs;
/* Functions for setting host/library modes and getting status */
fpd->fpx = int32_to_floatx80(src, &fs);
}
+
+static inline int32_t extractFloatx80Exp( floatx80 a )
+{
+ return a.high & 0x7FFF;
+}
+static inline uint64_t extractFloatx80Frac( floatx80 a )
+{
+ return a.low;
+}
+
+
/* Functions for rounding */
+static floatx80 fp_to_sgl(floatx80 a)
+{
+ floatx80 v = floatx80_round32(a, &fs);
+ v.high &= 0x7fff;
+ v.high |= a.high & 0x7fff;
+ return v;
+}
+
// round to float with extended precision exponent
static void fp_roundsgl(fpdata *fpd)
{
from_native(fpa, dst);
}
-static inline int32_t extractFloatx80Exp( floatx80 a )
-{
- return a.high & 0x7FFF;
-}
-static inline uint64_t extractFloatx80Frac( floatx80 a )
-{
- return a.low;
-}
-
-
static void fp_abs(fpdata *a, fpdata *dst)
{
uint64_t aSig = extractFloatx80Frac(a->fpx);
#else
*zExpPtr = 1 - shiftCount;
#endif
- *zExpPtr = 1 - shiftCount;
}
/*----------------------------------------------------------------------------
bSig &= LIT64( 0xFFFFFF0000000000 );
zExp = aExp + bExp - 0x3FFE;
mul64To128( aSig, bSig, &zSig0, &zSig1 );
- if ( 0 < (uint64_t) zSig0 ) {
+ if ( 0 < (int64_t) zSig0 ) {
shortShift128Left( zSig0, zSig1, 1, &zSig0, &zSig1 );
--zExp;
}
if ( aSig == 0 ) return packFloatx80( zSign, 0, 0 );
normalizeFloatx80Subnormal( aSig, &aExp, &aSig );
}
- aSig &= LIT64( 0xFFFFFF0000000000 );
- bSig &= LIT64( 0xFFFFFF0000000000 );
+
zExp = aExp - bExp + 0x3FFE;
rem1 = 0;
if ( bSig <= aSig ) {