]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Minor cleanups.
authorJulian Seward <jseward@acm.org>
Mon, 2 May 2005 15:52:44 +0000 (15:52 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 2 May 2005 15:52:44 +0000 (15:52 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1154

VEX/priv/guest-amd64/ghelpers.c
VEX/priv/host-amd64/isel.c
VEX/priv/ir/iropt.c

index a179af804cca3ed3c0a79a7bb8963bf5c37c0d9c..f63cbbfdbb16279763e52a9cb3cafa4f5966ed40 100644 (file)
@@ -836,9 +836,9 @@ ULong LibVEX_GuestAMD64_get_rflags ( /*IN*/VexGuestAMD64State* vex_state )
 
 static Bool isU64 ( IRExpr* e, ULong n )
 {
-   return e->tag == Iex_Const
-          && e->Iex.Const.con->tag == Ico_U64
-          && e->Iex.Const.con->Ico.U64 == n;
+   return toBool( e->tag == Iex_Const
+                  && e->Iex.Const.con->tag == Ico_U64
+                  && e->Iex.Const.con->Ico.U64 == n );
 }
 
 IRExpr* guest_amd64_spechelper ( HChar* function_name,
index 80912407bd7d787f3ceb01ce09d75147f61fcd49..8b1de2c69263fd111c6398f5f907276f7fdc37e2 100644 (file)
@@ -83,16 +83,6 @@ static IRExpr* binop ( IROp op, IRExpr* a1, IRExpr* a2 )
    return IRExpr_Binop(op, a1, a2);
 }
 
-//.. static IRExpr* mkU64 ( ULong i )
-//.. {
-//..    return IRExpr_Const(IRConst_U64(i));
-//.. }
-
-static IRExpr* mkU32 ( UInt i )
-{
-   return IRExpr_Const(IRConst_U32(i));
-}
-
 static IRExpr* bind ( Int binder )
 {
    return IRExpr_Binder(binder);
@@ -1197,8 +1187,8 @@ static HReg iselIntExpr_R_wrk ( ISelEnv* env, IRExpr* e )
          case Iop_16Uto32: {
             HReg dst     = newVRegI(env);
             HReg src     = iselIntExpr_R(env, e->Iex.Unop.arg);
-            Bool srcIs16 = e->Iex.Unop.op==Iop_16Uto32
-                           || e->Iex.Unop.op==Iop_16Uto64;
+            Bool srcIs16 = toBool( e->Iex.Unop.op==Iop_16Uto32
+                                   || e->Iex.Unop.op==Iop_16Uto64 );
             UInt mask    = srcIs16 ? 0xFFFF : 0xFF;
             addInstr(env, mk_iMOVsd_RR(src,dst) );
             addInstr(env, AMD64Instr_Alu64R(Aalu_AND,
@@ -1212,8 +1202,8 @@ static HReg iselIntExpr_R_wrk ( ISelEnv* env, IRExpr* e )
          case Iop_16Sto64: {
             HReg dst     = newVRegI(env);
             HReg src     = iselIntExpr_R(env, e->Iex.Unop.arg);
-            Bool srcIs16 = e->Iex.Unop.op==Iop_16Sto32
-                           || e->Iex.Unop.op==Iop_16Sto64;
+            Bool srcIs16 = toBool( e->Iex.Unop.op==Iop_16Sto32
+                                   || e->Iex.Unop.op==Iop_16Sto64 );
             UInt amt     = srcIs16 ? 48 : 56;
             addInstr(env, mk_iMOVsd_RR(src,dst) );
             addInstr(env, AMD64Instr_Sh64(Ash_SHL, amt, AMD64RM_Reg(dst)));
index 0832bc1904d4645fd11a4ce6c234fba03fbdd6c3..45df01c8375b8e596ad5149a839a0c06c3c74343 100644 (file)
@@ -964,8 +964,8 @@ static IRExpr* fold_Expr ( IRExpr* e )
                     - (e->Iex.Unop.arg->Iex.Const.con->Ico.U32)));
             break;
          case Iop_Neg8:
-            e2 = IRExpr_Const(IRConst_U8(
-                    - (e->Iex.Unop.arg->Iex.Const.con->Ico.U8)));
+            e2 = IRExpr_Const(IRConst_U8(toUChar(
+                    - (e->Iex.Unop.arg->Iex.Const.con->Ico.U8))));
             break;
 
          case Iop_64to8: {