]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix rounding mode check and instruction stxvl
authorCarl Love <cel@us.ibm.com>
Mon, 3 Oct 2016 15:30:46 +0000 (15:30 +0000)
committerCarl Love <cel@us.ibm.com>
Mon, 3 Oct 2016 15:30:46 +0000 (15:30 +0000)
In BE mode, the function FPU_rounding_mode_isOdd() has the assert
  vassert(mode->Iex.Const.con->Ico.U8 == 0x8);
The value was set using mkU32 but in BE mode the U8 maps to the upper
bits in the memory location not the lower bits.  The comparison was
fixed by changing the .U8 to .U32 to be consistent with how the field
was set.

The stxvl instruction called the 64-bit NOT not the 128-bit NOT when
calculating the store_val.

The stxvx instruction the temp word values were initialized I32 not I64.
Not sure why this wasn't caught on LE.

bugzilla  369175

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

VEX/priv/guest_ppc_toIR.c
VEX/priv/host_ppc_isel.c

index 712d2d514ea8f9a49541d95cb1c10fd178275fd8..c5e2e5009e6e6f4362c6d82b96b5bd8dc27b252e 100644 (file)
@@ -20181,10 +20181,10 @@ dis_vx_store ( UInt theInstr )
    {
       UInt ea_off = 0;
       IRExpr* irx_addr;
-      IRTemp word0 = newTemp( Ity_I32 );
-      IRTemp word1 = newTemp( Ity_I32 );
-      IRTemp word2 = newTemp( Ity_I32 );
-      IRTemp word3 = newTemp( Ity_I32 );
+      IRTemp word0 = newTemp( Ity_I64 );
+      IRTemp word1 = newTemp( Ity_I64 );
+      IRTemp word2 = newTemp( Ity_I64 );
+      IRTemp word3 = newTemp( Ity_I64 );
       DIP("stxvx %d,r%u,r%u\n", (UInt)XS, rA_addr, rB_addr);
 
       assign( word0,  binop( Iop_Shr64,
@@ -20346,7 +20346,7 @@ dis_vx_store ( UInt theInstr )
                                       mkexpr( shift ) ),
                                mkexpr( nb_mask ) ),
                         binop( Iop_AndV128,
-                               unop( Iop_Not64, mkexpr( nb_mask ) ),
+                               unop( Iop_NotV128, mkexpr( nb_mask ) ),
                                mkexpr( current_mem) ) ) );
 
       } else {
index 9887f27ece32d96ff70b69c8bf4fca6d09d13438..07f519d409188098f696522185fb37534bedab1e 100644 (file)
@@ -1238,7 +1238,7 @@ Bool FPU_rounding_mode_isOdd (IRExpr* mode) {
       return False;
 
    vassert(mode->Iex.Const.con->tag == Ico_U32);
-   vassert(mode->Iex.Const.con->Ico.U8 == 0x8);
+   vassert(mode->Iex.Const.con->Ico.U32 == 0x8);
    return True;
 }