From: Julian Seward Date: Sun, 1 Jan 2006 13:17:38 +0000 (+0000) Subject: For SSE scalar comparison operations where one operand is in memory, X-Git-Tag: svn/VALGRIND_3_2_3^2~138 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47235640711c9473092c0c551724b6810d671d3d;p=thirdparty%2Fvalgrind.git For SSE scalar comparison operations where one operand is in memory, do not read more memory than needed. git-svn-id: svn://svn.valgrind.org/vex/trunk@1521 --- diff --git a/VEX/priv/guest-amd64/toIR.c b/VEX/priv/guest-amd64/toIR.c index d3667285bd..60ec66982d 100644 --- a/VEX/priv/guest-amd64/toIR.c +++ b/VEX/priv/guest-amd64/toIR.c @@ -7601,7 +7601,7 @@ static void findSSECmpOp ( Bool* needNot, IROp* op, vpanic("findSSECmpOp(amd64,guest)"); } -/* Handles SSE 32F comparisons. */ +/* Handles SSE 32F/64F comparisons. */ static ULong dis_SSEcmp_E_to_G ( Prefix pfx, Long delta, HChar* opname, Bool all_lanes, Int sz ) @@ -7629,8 +7629,15 @@ static ULong dis_SSEcmp_E_to_G ( Prefix pfx, Long delta, addr = disAMode ( &alen, pfx, delta, dis_buf, 1 ); imm8 = getUChar(delta+alen); findSSECmpOp(&needNot, &op, imm8, all_lanes, sz); - assign( plain, binop(op, getXMMReg(gregOfRexRM(pfx,rm)), - loadLE(Ity_V128, mkexpr(addr))) ); + assign( plain, + binop( + op, + getXMMReg(gregOfRexRM(pfx,rm)), + all_lanes ? loadLE(Ity_V128, mkexpr(addr)) + : sz == 8 ? unop( Iop_64UtoV128, loadLE(Ity_I64, mkexpr(addr))) + : /*sz==4*/ unop( Iop_32UtoV128, loadLE(Ity_I32, mkexpr(addr))) + ) + ); delta += alen+1; DIP("%s $%d,%s,%s\n", opname, (Int)imm8,