diff --git a/bochs/cpu/mmx.cc b/bochs/cpu/mmx.cc index 245d03a5b..5ea4a8e5b 100644 --- a/bochs/cpu/mmx.cc +++ b/bochs/cpu/mmx.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: mmx.cc,v 1.87 2009-10-24 11:17:51 sshwarts Exp $ +// $Id: mmx.cc,v 1.88 2009-11-13 09:55:22 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2009 Stanislav Shwartsman @@ -2617,11 +2617,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MASKMOVQ_PqPRq(bxInstruction_c *i) rdi = DI; } - if (MMXUQ(mask) == 0) return; - /* do read-modify-write for efficiency */ MMXUQ(tmp) = read_RMW_virtual_qword(i->seg(), rdi); + if (MMXUQ(mask) == 0) return; + if(MMXUB0(mask) & 0x80) MMXUB0(tmp) = MMXUB0(op); if(MMXUB1(mask) & 0x80) MMXUB1(tmp) = MMXUB1(op); if(MMXUB2(mask) & 0x80) MMXUB2(tmp) = MMXUB2(op); diff --git a/bochs/cpu/sse_move.cc b/bochs/cpu/sse_move.cc index 69ffe3e8a..0cf3ec2d3 100644 --- a/bochs/cpu/sse_move.cc +++ b/bochs/cpu/sse_move.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: sse_move.cc,v 1.102 2009-10-27 20:03:35 sshwarts Exp $ +// $Id: sse_move.cc,v 1.103 2009-11-13 09:55:22 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003-2009 Stanislav Shwartsman @@ -832,12 +832,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MASKMOVDQU_VdqUdq(bxInstruction_c *i) rdi = DI; } - /* no data will be written to memory if mask is all 0s */ - if ((mask.xmm64u(0) | mask.xmm64u(1)) == 0) return; - /* implement as read-modify-write for efficiency */ read_virtual_dqword(i->seg(), rdi, (Bit8u *) &temp); + /* no data will be written to memory if mask is all 0s */ + if ((mask.xmm64u(0) | mask.xmm64u(1)) == 0) return; + for(unsigned j=0; j<16; j++) { if(mask.xmmubyte(j) & 0x80) temp.xmmubyte(j) = op.xmmubyte(j); }