]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a folding rule for 32Sto64.
authorJulian Seward <jseward@acm.org>
Thu, 29 Jul 2010 16:12:41 +0000 (16:12 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 29 Jul 2010 16:12:41 +0000 (16:12 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1996

VEX/priv/ir_opt.c

index 2b08efd37b90060026ce13430016532a883c2674..018cb51de2743dcb9d3c84a4e9c9c7ce0e4b785f 100644 (file)
@@ -1078,7 +1078,13 @@ static IRExpr* fold_Expr ( IRExpr* e )
                     0xFFFFFFFFULL 
                     & e->Iex.Unop.arg->Iex.Const.con->Ico.U32));
             break;
-
+         case Iop_32Sto64: {
+            /* signed */ Long s64 = e->Iex.Unop.arg->Iex.Const.con->Ico.U32;
+            s64 <<= 32;
+            s64 >>= 32;
+            e2 = IRExpr_Const(IRConst_U64((ULong)s64));
+            break;
+         }
          case Iop_CmpNEZ8:
             e2 = IRExpr_Const(IRConst_U1(toBool(
                     0 !=