From 8107e7f0843b6b05fa66105edf38cb1110381241 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sat, 16 Aug 2008 12:19:30 +0000 Subject: [PATCH] Fixed restore of FCS field --- bochs/cpu/sse_move.cc | 8 ++++---- bochs/cpu/xsave.cc | 12 +++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/bochs/cpu/sse_move.cc b/bochs/cpu/sse_move.cc index b96590a5d..af947672b 100644 --- a/bochs/cpu/sse_move.cc +++ b/bochs/cpu/sse_move.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: sse_move.cc,v 1.94 2008-08-08 09:22:48 sshwarts Exp $ +// $Id: sse_move.cc,v 1.95 2008-08-16 12:19:30 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman @@ -199,7 +199,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXSAVE(bxInstruction_c *i) else #endif { - xmm.xmm32u(2) = (Bit32u)(BX_CPU_THIS_PTR the_i387.fip) & 0xffffffff; + xmm.xmm32u(2) = (Bit32u)(BX_CPU_THIS_PTR the_i387.fip); xmm.xmm32u(3) = (BX_CPU_THIS_PTR the_i387.fcs); } @@ -225,7 +225,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXSAVE(bxInstruction_c *i) else #endif { - xmm.xmm32u(0) = (Bit32u)(BX_CPU_THIS_PTR the_i387.fdp) & 0xffffffff; + xmm.xmm32u(0) = (Bit32u)(BX_CPU_THIS_PTR the_i387.fdp); xmm.xmm32u(1) = (BX_CPU_THIS_PTR the_i387.fds); } @@ -314,7 +314,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXRSTOR(bxInstruction_c *i) #endif { BX_CPU_THIS_PTR the_i387.fip = xmm.xmm32u(2); - BX_CPU_THIS_PTR the_i387.fcs = xmm.xmm16u(5); + BX_CPU_THIS_PTR the_i387.fcs = xmm.xmm16u(6); } Bit32u tag_byte = xmm.xmmubyte(4); diff --git a/bochs/cpu/xsave.cc b/bochs/cpu/xsave.cc index fa0110c1f..7646bdad6 100755 --- a/bochs/cpu/xsave.cc +++ b/bochs/cpu/xsave.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: xsave.cc,v 1.13 2008-08-08 09:22:49 sshwarts Exp $ +// $Id: xsave.cc,v 1.14 2008-08-16 12:19:30 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008 Stanislav Shwartsman @@ -84,7 +84,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XSAVE(bxInstruction_c *i) else #endif { - xmm.xmm32u(2) = (Bit32u)(BX_CPU_THIS_PTR the_i387.fip) & 0xffffffff; + xmm.xmm32u(2) = (Bit32u)(BX_CPU_THIS_PTR the_i387.fip); xmm.xmm32u(3) = (BX_CPU_THIS_PTR the_i387.fcs); } @@ -107,10 +107,8 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XSAVE(bxInstruction_c *i) else #endif { - write_virtual_dword(i->seg(), eaddr + 16, - (Bit32u)(BX_CPU_THIS_PTR the_i387.fdp & 0xffffffff)); - write_virtual_dword(i->seg(), eaddr + 20, - (Bit32u)(BX_CPU_THIS_PTR the_i387.fds)); + write_virtual_dword(i->seg(), eaddr + 16, (Bit32u) BX_CPU_THIS_PTR the_i387.fdp); + write_virtual_dword(i->seg(), eaddr + 20, (Bit32u) BX_CPU_THIS_PTR the_i387.fds); } /* do not touch MXCSR state */ @@ -213,7 +211,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XRSTOR(bxInstruction_c *i) #endif { BX_CPU_THIS_PTR the_i387.fip = xmm.xmm32u(2); - BX_CPU_THIS_PTR the_i387.fcs = xmm.xmm16u(5); + BX_CPU_THIS_PTR the_i387.fcs = xmm.xmm16u(6); } Bit32u tag_byte = xmm.xmmubyte(4);