tcg/optimize: Use fold_masks_z in fold_neg_no_const

Avoid the use of the OptContext slots.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2024-12-08 20:23:11 -06:00
parent fa3168ee93
commit d151fd34b0

View file

@ -2044,14 +2044,9 @@ static bool fold_neg_no_const(OptContext *ctx, TCGOp *op)
{
/* Set to 1 all bits to the left of the rightmost. */
uint64_t z_mask = arg_info(op->args[1])->z_mask;
ctx->z_mask = -(z_mask & -z_mask);
z_mask = -(z_mask & -z_mask);
/*
* Because of fold_sub_to_neg, we want to always return true,
* via finish_folding.
*/
finish_folding(ctx, op);
return true;
return fold_masks_z(ctx, op, z_mask);
}
static bool fold_neg(OptContext *ctx, TCGOp *op)