]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix up %rflags handling after 64-bit multiplies.
authorJulian Seward <jseward@acm.org>
Thu, 5 May 2005 21:46:50 +0000 (21:46 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 5 May 2005 21:46:50 +0000 (21:46 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1164

VEX/priv/guest-amd64/ghelpers.c
VEX/priv/guest-amd64/toIR.c

index 234259c86559d5ff0f4c98ab23351e072b21dd36..272b8fdd07407b243d3834adcdfd7138a3a4c6d3 100644 (file)
@@ -92,7 +92,6 @@ static void mullS64 ( Long u, Long v, Long* rHi, Long* rLo )
    *rLo = u * v;
 }
 
-#if 0 /* UNUSED */
 static void mullU64 ( ULong u, ULong v, ULong* rHi, ULong* rLo )
 {
    ULong u0, v0, w0;
@@ -109,7 +108,6 @@ static void mullU64 ( ULong u, ULong v, ULong* rHi, ULong* rLo )
    *rHi = u1 * v1 + w2 + (w1 >> 32);
    *rLo = u * v;
 }
-#endif /* UNUSED */
 
 
 static const UChar parity_table[256] = {
@@ -644,6 +642,8 @@ ULong amd64g_calculate_rflags_all_WRK ( ULong cc_op,
       case AMD64G_CC_OP_UMULL:  ACTIONS_UMUL( 32, UInt,   toUInt,
                                                   ULong,  idULong );
 
+      case AMD64G_CC_OP_UMULQ:  ACTIONS_UMULQ;
+
       case AMD64G_CC_OP_SMULB:  ACTIONS_SMUL(  8, Char,   toUChar,
                                                   Short,  toUShort );
       case AMD64G_CC_OP_SMULW:  ACTIONS_SMUL( 16, Short,  toUShort, 
index 4fde72bae60a3f3fc75852a1e11892bdfa612a81..18f9a58eb876f9df22437d6b6d104a296e51a24d 100644 (file)
@@ -3425,7 +3425,7 @@ static void codegen_mulL_A_D ( Int sz, Bool syned,
          IRTemp resHi   = newTemp(Ity_I64);
          IRTemp resLo   = newTemp(Ity_I64);
          IROp   mulOp   = syned ? Iop_MullS64 : Iop_MullU64;
-         UInt   tBaseOp = syned ? AMD64G_CC_OP_SMULQ : AMD64G_CC_OP_UMULQ;
+         UInt   tBaseOp = syned ? AMD64G_CC_OP_SMULB : AMD64G_CC_OP_UMULB;
          setFlags_MUL ( Ity_I64, t1, tmp, tBaseOp );
          assign( res128, binop(mulOp, mkexpr(t1), mkexpr(tmp)) );
          assign( resHi, unop(Iop_128HIto64,mkexpr(res128)));