[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/46] tcg/optimize: Use fold_masks_zsa in fold_and
From: |
Richard Henderson |
Subject: |
[PATCH 06/46] tcg/optimize: Use fold_masks_zsa in fold_and |
Date: |
Tue, 10 Dec 2024 09:23:21 -0600 |
Avoid the use of the OptContext slots.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/optimize.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 135b14974f..000ac0f810 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1306,7 +1306,7 @@ static bool fold_add2(OptContext *ctx, TCGOp *op)
static bool fold_and(OptContext *ctx, TCGOp *op)
{
- uint64_t z1, z2;
+ uint64_t z1, z2, z_mask, s_mask, a_mask = -1;
if (fold_const2_commutative(ctx, op) ||
fold_xi_to_i(ctx, op, 0) ||
@@ -1317,24 +1317,24 @@ static bool fold_and(OptContext *ctx, TCGOp *op)
z1 = arg_info(op->args[1])->z_mask;
z2 = arg_info(op->args[2])->z_mask;
- ctx->z_mask = z1 & z2;
+ z_mask = z1 & z2;
/*
* Sign repetitions are perforce all identical, whether they are 1 or 0.
* Bitwise operations preserve the relative quantity of the repetitions.
*/
- ctx->s_mask = arg_info(op->args[1])->s_mask
- & arg_info(op->args[2])->s_mask;
+ s_mask = arg_info(op->args[1])->s_mask
+ & arg_info(op->args[2])->s_mask;
/*
* Known-zeros does not imply known-ones. Therefore unless
* arg2 is constant, we can't infer affected bits from it.
*/
if (arg_is_const(op->args[2])) {
- ctx->a_mask = z1 & ~z2;
+ a_mask = z1 & ~z2;
}
- return fold_masks(ctx, op);
+ return fold_masks_zsa(ctx, op, z_mask, s_mask, a_mask);
}
static bool fold_andc(OptContext *ctx, TCGOp *op)
--
2.43.0
- [PATCH 02/46] tcg/optimize: Copy mask writeback to fold_masks, (continued)
- [PATCH 04/46] tcg/optimize: Use finish_folding in fold_add, fold_add_vec, Richard Henderson, 2024/12/10
- [PATCH 05/46] tcg/optimize: Use finish_folding in fold_addsub2, Richard Henderson, 2024/12/10
- [PATCH 06/46] tcg/optimize: Use fold_masks_zsa in fold_and,
Richard Henderson <=
- [PATCH 07/46] tcg/optimize: Use fold_masks_zsa in fold_andc, Richard Henderson, 2024/12/10
- [PATCH 08/46] tcg/optimize: Use fold_masks_zs in fold_bswap, Richard Henderson, 2024/12/10
- [PATCH 09/46] tcg/optimize: Use fold_masks_z in fold_count_zeros, Richard Henderson, 2024/12/10
- [PATCH 10/46] tcg/optimize: Use fold_masks_z in fold_ctpop, Richard Henderson, 2024/12/10
- [PATCH 12/46] tcg/optimize: Use finish_folding in fold_divide, Richard Henderson, 2024/12/10