From: Julian Seward Date: Sat, 14 May 2005 02:04:12 +0000 (+0000) Subject: Finally fix the behaviour of MOVQ (xmm -> xmm). X-Git-Tag: svn/VALGRIND_3_0_1^2~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d0f7f146b8f56a07132b9ef1012e1cf781fae62;p=thirdparty%2Fvalgrind.git Finally fix the behaviour of MOVQ (xmm -> xmm). git-svn-id: svn://svn.valgrind.org/vex/trunk@1197 --- diff --git a/VEX/priv/guest-x86/toIR.c b/VEX/priv/guest-x86/toIR.c index d566831809..b61407a985 100644 --- a/VEX/priv/guest-x86/toIR.c +++ b/VEX/priv/guest-x86/toIR.c @@ -9245,6 +9245,7 @@ DisResult disInstr ( /*IN*/ Bool resteerOK, modrm = getIByte(delta+2); if (epartIsReg(modrm)) { /* fall through, awaiting test case */ + /* dst: lo half copied, hi half zeroed */ } else { addr = disAMode ( &alen, sorb, delta+2, dis_buf ); storeLE( mkexpr(addr), @@ -9274,10 +9275,10 @@ DisResult disInstr ( /*IN*/ Bool resteerOK, } /* F3 0F 7E = MOVQ -- move 64 bits from E (mem or lo half xmm) to - G (lo half xmm). If E is mem, upper half of G is zeroed out. */ + G (lo half xmm). Upper half of G is zeroed out. */ /* F2 0F 10 = MOVSD -- move 64 bits from E (mem or lo half xmm) to G (lo half xmm). If E is mem, upper half of G is zeroed out. - (original defn) */ + If E is reg, upper half of G is unchanged. */ if ((insn[0] == 0xF2 && insn[1] == 0x0F && insn[2] == 0x10) || (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x7E)) { vassert(sz == 4); @@ -9285,6 +9286,10 @@ DisResult disInstr ( /*IN*/ Bool resteerOK, if (epartIsReg(modrm)) { putXMMRegLane64( gregOfRM(modrm), 0, getXMMRegLane64( eregOfRM(modrm), 0 )); + if (insn[0] == 0xF3/*MOVQ*/) { + /* zero bits 127:64 */ + putXMMRegLane64( gregOfRM(modrm), 1, mkU64(0) ); + } DIP("movsd %s,%s\n", nameXMMReg(eregOfRM(modrm)), nameXMMReg(gregOfRM(modrm))); delta += 3+1;