]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Finally fix the behaviour of MOVQ (xmm -> xmm).
authorJulian Seward <jseward@acm.org>
Sat, 14 May 2005 02:04:12 +0000 (02:04 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 14 May 2005 02:04:12 +0000 (02:04 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1197

VEX/priv/guest-x86/toIR.c

index d566831809f71a072354601f858c8efa4a8ed974..b61407a98590b896709c29093e01bca9b77c53a2 100644 (file)
@@ -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;