[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 41/46] tcg/optimize: Use fold_masks_zs in fold_xor
From: |
Richard Henderson |
Subject: |
[PATCH 41/46] tcg/optimize: Use fold_masks_zs in fold_xor |
Date: |
Tue, 10 Dec 2024 09:23:56 -0600 |
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);
-}
-
/*
* 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)
--
2.43.0
- Re: [PATCH 35/46] tcg/optimize: Use finish_folding in fold_cmpsel_vec, (continued)
- [PATCH 36/46] tcg/optimize: Use fold_masks_zsa in fold_sextract, Richard Henderson, 2024/12/10
- [PATCH 34/46] tcg/optimize: Use finish_folding in fold_cmp_vec, Richard Henderson, 2024/12/10
- [PATCH 37/46] tcg/optimize: Use fold_masks_zs in fold_shift, Richard Henderson, 2024/12/10
- [PATCH 39/46] tcg/optimize: Use fold_masks_zs in fold_tcg_ld, Richard Henderson, 2024/12/10
- [PATCH 41/46] tcg/optimize: Use fold_masks_zs in fold_xor,
Richard Henderson <=
- [PATCH 42/46] tcg/optimize: Use finish_folding in fold_bitsel_vec, Richard Henderson, 2024/12/10
- [PATCH 40/46] tcg/optimize: Use finish_folding in fold_tcg_ld_memcopy, Richard Henderson, 2024/12/10
- [PATCH 43/46] tcg/optimize: Use finish_folding as default in tcg_optimize, Richard Henderson, 2024/12/10
- [PATCH 45/46] tcg/optimize: Move fold_bitsel_vec into alphabetic sort, Richard Henderson, 2024/12/10