diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-01-08 18:58:29 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-01-08 18:58:29 +0000 |
commit | 664e0f195adda3cf01b40d8d1aa79bbc24ad5fab (patch) | |
tree | 475f61c819e3a40a476e49c2760dfd43f06438c8 /target-i386/helper.c | |
parent | 085339a12b448a64527ce4fdb6e1d43addbb16dc (diff) |
MMX/SSE support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1205 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r-- | target-i386/helper.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c index 2567657a7f..9907f8e0b0 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -2444,7 +2444,7 @@ void helper_fldt_ST0_A0(void) { int new_fpstt; new_fpstt = (env->fpstt - 1) & 7; - env->fpregs[new_fpstt] = helper_fldt(A0); + env->fpregs[new_fpstt].d = helper_fldt(A0); env->fpstt = new_fpstt; env->fptags[new_fpstt] = 0; /* validate stack entry */ } @@ -2804,9 +2804,10 @@ void helper_fstenv(target_ulong ptr, int data32) if (env->fptags[i]) { fptag |= 3; } else { - tmp.d = env->fpregs[i]; + tmp.d = env->fpregs[i].d; exp = EXPD(tmp); mant = MANTD(tmp); + printf("mant=%llx exp=%x\n", mant, exp); if (exp == 0 && mant == 0) { /* zero */ fptag |= 1; @@ -2930,7 +2931,7 @@ void helper_fxsave(target_ulong ptr, int data64) if (env->cr[4] & CR4_OSFXSR_MASK) { /* XXX: finish it */ - stl(ptr + 0x18, 0); /* mxcsr */ + stl(ptr + 0x18, env->mxcsr); /* mxcsr */ stl(ptr + 0x1c, 0); /* mxcsr_mask */ nb_xmm_regs = 8 << data64; addr = ptr + 0xa0; @@ -2967,7 +2968,7 @@ void helper_fxrstor(target_ulong ptr, int data64) if (env->cr[4] & CR4_OSFXSR_MASK) { /* XXX: finish it, endianness */ - //ldl(ptr + 0x18); + env->mxcsr = ldl(ptr + 0x18); //ldl(ptr + 0x1c); nb_xmm_regs = 8 << data64; addr = ptr + 0xa0; @@ -3209,6 +3210,23 @@ void helper_idivq_EAX_T0(void) #endif +/* XXX: do it */ +int fpu_isnan(double a) +{ + return 0; +} + +float approx_rsqrt(float a) +{ + return 1.0 / sqrt(a); +} + +float approx_rcp(float a) +{ + return 1.0 / a; +} + + #if !defined(CONFIG_USER_ONLY) #define MMUSUFFIX _mmu |