[PATCH 09/46] tcg/optimize: Use fold_masks_z in fold_count_zeros

Richard Henderson posted 46 patches 5 months ago
There is a newer version of this series
[PATCH 09/46] tcg/optimize: Use fold_masks_z in fold_count_zeros
Posted by Richard Henderson 5 months ago
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/optimize.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tcg/optimize.c b/tcg/optimize.c
index 3363ebd48c..c97ec10989 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1088,7 +1088,6 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op,
     return fold_masks_zsa(ctx, op, z_mask, s_mask, -1);
 }
 
-__attribute__((unused))
 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);
@@ -1592,9 +1591,9 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op)
     default:
         g_assert_not_reached();
     }
-    ctx->z_mask = arg_info(op->args[2])->z_mask | z_mask;
-    ctx->s_mask = smask_from_zmask(ctx->z_mask);
-    return false;
+    z_mask |= arg_info(op->args[2])->z_mask;
+
+    return fold_masks_z(ctx, op, z_mask);
 }
 
 static bool fold_ctpop(OptContext *ctx, TCGOp *op)
-- 
2.43.0
Re: [PATCH 09/46] tcg/optimize: Use fold_masks_z in fold_count_zeros
Posted by Pierrick Bouvier 4 months, 3 weeks ago
On 12/10/24 07:23, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/optimize.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index 3363ebd48c..c97ec10989 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
> @@ -1088,7 +1088,6 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op,
>       return fold_masks_zsa(ctx, op, z_mask, s_mask, -1);
>   }
>   
> -__attribute__((unused))
>   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);
> @@ -1592,9 +1591,9 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op)
>       default:
>           g_assert_not_reached();
>       }
> -    ctx->z_mask = arg_info(op->args[2])->z_mask | z_mask;
> -    ctx->s_mask = smask_from_zmask(ctx->z_mask);
> -    return false;
> +    z_mask |= arg_info(op->args[2])->z_mask;
> +
> +    return fold_masks_z(ctx, op, z_mask);
>   }
>   
>   static bool fold_ctpop(OptContext *ctx, TCGOp *op)

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