From: Florian Krohm Date: Wed, 3 Sep 2025 15:03:08 +0000 (+0000) Subject: ir_opt.c: Algebraic simplification for Iop_Sub. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c93dba5adbd5d;p=thirdparty%2Fvalgrind.git ir_opt.c: Algebraic simplification for Iop_Sub. The simplification rules for IopSub32/64 also apply for Iop_Sub8/16. --- diff --git a/VEX/priv/ir_opt.c b/VEX/priv/ir_opt.c index 84bc4e021..b362be007 100644 --- a/VEX/priv/ir_opt.c +++ b/VEX/priv/ir_opt.c @@ -2654,19 +2654,22 @@ static IRExpr* fold_Expr_WRK ( IRExpr** env, IRExpr* e ) } break; + case Iop_Sub8: + case Iop_Sub16: case Iop_Sub32: case Iop_Sub64: - /* Sub32/Sub64(x,0) ==> x */ + /* Sub8/Sub16/Sub32/Sub64(x,0) ==> x */ if (isZeroU(e->Iex.Binop.arg2)) { e2 = e->Iex.Binop.arg1; break; } - /* Sub32/Sub64(t,t) ==> 0, for some IRTemp t */ + /* Sub8/Sub16/Sub32/Sub64(t,t) ==> 0, for some IRTemp t */ if (sameIRExprs(env, e->Iex.Binop.arg1, e->Iex.Binop.arg2)) { e2 = mkZeroOfPrimopResultType(e->Iex.Binop.op); break; } break; + case Iop_Sub8x16: /* Sub8x16(x,0) ==> x */ if (isZeroV128(e->Iex.Binop.arg2)) {