From: Julian Seward Date: Thu, 5 May 2005 21:46:50 +0000 (+0000) Subject: Fix up %rflags handling after 64-bit multiplies. X-Git-Tag: svn/VALGRIND_3_0_1^2~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=965153836d93ff4f791f73e3ecf8049215418263;p=thirdparty%2Fvalgrind.git Fix up %rflags handling after 64-bit multiplies. git-svn-id: svn://svn.valgrind.org/vex/trunk@1164 --- diff --git a/VEX/priv/guest-amd64/ghelpers.c b/VEX/priv/guest-amd64/ghelpers.c index 234259c865..272b8fdd07 100644 --- a/VEX/priv/guest-amd64/ghelpers.c +++ b/VEX/priv/guest-amd64/ghelpers.c @@ -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, diff --git a/VEX/priv/guest-amd64/toIR.c b/VEX/priv/guest-amd64/toIR.c index 4fde72bae6..18f9a58eb8 100644 --- a/VEX/priv/guest-amd64/toIR.c +++ b/VEX/priv/guest-amd64/toIR.c @@ -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)));