diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-01-12 22:41:17 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-01-12 22:41:17 +0000 |
commit | d3c617219b663c7cbcd443922c3ee070d16ee613 (patch) | |
tree | d19b9012c180b5656da9db951ada69352410df9a /target-i386 | |
parent | 735a8fd38e86d94f62e732de94e1a137619b9e49 (diff) | |
download | hqemu-d3c617219b663c7cbcd443922c3ee070d16ee613.zip hqemu-d3c617219b663c7cbcd443922c3ee070d16ee613.tar.gz |
fxsr fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1219 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/helper.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c index 5255e96..58530dc 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -2915,11 +2915,11 @@ void helper_fxsave(target_ulong ptr, int data64) fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; fptag = 0; for(i = 0; i < 8; i++) { - fptag |= ((!env->fptags[(env->fpstt + i) & 7]) << i); + fptag |= (env->fptags[i] << i); } stw(ptr, env->fpuc); stw(ptr + 2, fpus); - stw(ptr + 4, fptag); + stw(ptr + 4, fptag ^ 0xff); addr = ptr + 0x20; for(i = 0;i < 8; i++) { @@ -2931,7 +2931,7 @@ void helper_fxsave(target_ulong ptr, int data64) if (env->cr[4] & CR4_OSFXSR_MASK) { /* XXX: finish it */ stl(ptr + 0x18, env->mxcsr); /* mxcsr */ - stl(ptr + 0x1c, 0); /* mxcsr_mask */ + stl(ptr + 0x1c, 0x0000ffff); /* mxcsr_mask */ nb_xmm_regs = 8 << data64; addr = ptr + 0xa0; for(i = 0; i < nb_xmm_regs; i++) { @@ -2950,12 +2950,12 @@ void helper_fxrstor(target_ulong ptr, int data64) env->fpuc = lduw(ptr); fpus = lduw(ptr + 2); - fptag = ldub(ptr + 4); + fptag = lduw(ptr + 4); env->fpstt = (fpus >> 11) & 7; env->fpus = fpus & ~0x3800; fptag ^= 0xff; for(i = 0;i < 8; i++) { - env->fptags[(env->fpstt + i) & 7] = ((fptag >> i) & 1); + env->fptags[i] = ((fptag >> i) & 1); } addr = ptr + 0x20; |