]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
For SSE scalar comparison operations where one operand is in memory,
authorJulian Seward <jseward@acm.org>
Sun, 1 Jan 2006 13:17:38 +0000 (13:17 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 1 Jan 2006 13:17:38 +0000 (13:17 +0000)
do not read more memory than needed.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1521

VEX/priv/guest-amd64/toIR.c

index d3667285bd1210a5b790f2cf73b5aa985cf8fa5e..60ec66982da30f137f9456e1f74ab53e05eecb13 100644 (file)
@@ -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,