summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-12-08 20:23:11 -0600
committerRichard Henderson <richard.henderson@linaro.org>2024-12-24 08:32:15 -0800
commitd151fd34b090ddb40b073f1bd2ac4c893a67d1eb (patch)
tree4548ad047b5e773a9b8a98a1115517aaff047017
parentfa3168ee93e4a9cabe31824f7918bfe4b7a56369 (diff)
downloadfocaccia-qemu-d151fd34b090ddb40b073f1bd2ac4c893a67d1eb.tar.gz
focaccia-qemu-d151fd34b090ddb40b073f1bd2ac4c893a67d1eb.zip
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>
-rw-r--r--tcg/optimize.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 7fe5bd6012..fbaaece152 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -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)