qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 41/46] tcg/optimize: Use fold_masks_zs in fold_xor


From: Pierrick Bouvier
Subject: Re: [PATCH 41/46] tcg/optimize: Use fold_masks_zs in fold_xor
Date: Tue, 17 Dec 2024 12:45:37 -0800
User-agent: Mozilla Thunderbird

On 12/10/24 07:23, Richard Henderson wrote:
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  tcg/optimize.c | 17 +++++++----------
  1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/tcg/optimize.c b/tcg/optimize.c
index 46116970f3..fec46014be 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1093,11 +1093,6 @@ static bool fold_masks_z(OptContext *ctx, TCGOp *op, 
uint64_t z_mask)
      return fold_masks_zsa(ctx, op, z_mask, smask_from_zmask(z_mask), -1);
  }
-static bool fold_masks(OptContext *ctx, TCGOp *op)
-{
-    return fold_masks_zsa(ctx, op, ctx->z_mask, ctx->s_mask, ctx->a_mask);
-}
-

Not so important, but eliminating this function could be done in its own commit.

  /*
   * Convert @op to NOT, if NOT is supported by the host.
   * Return true f the conversion is successful, which will still
@@ -2758,6 +2753,8 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp 
*op)
static bool fold_xor(OptContext *ctx, TCGOp *op)
  {
+    uint64_t z_mask, s_mask;
+
      if (fold_const2_commutative(ctx, op) ||
          fold_xx_to_i(ctx, op, 0) ||
          fold_xi_to_x(ctx, op, 0) ||
@@ -2765,11 +2762,11 @@ static bool fold_xor(OptContext *ctx, TCGOp *op)
          return true;
      }
- ctx->z_mask = arg_info(op->args[1])->z_mask
-                | arg_info(op->args[2])->z_mask;
-    ctx->s_mask = arg_info(op->args[1])->s_mask
-                & arg_info(op->args[2])->s_mask;
-    return fold_masks(ctx, op);
+    z_mask = arg_info(op->args[1])->z_mask
+           | arg_info(op->args[2])->z_mask;
+    s_mask = arg_info(op->args[1])->s_mask
+           & arg_info(op->args[2])->s_mask;
+    return fold_masks_zs(ctx, op, z_mask, s_mask);
  }
static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op)

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]