[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/46] tcg/optimize: Use fold_and and fold_masks_z in fold_deposi
From: |
Richard Henderson |
Subject: |
[PATCH 11/46] tcg/optimize: Use fold_and and fold_masks_z in fold_deposit |
Date: |
Tue, 10 Dec 2024 09:23:26 -0600 |
When we fold to and, use fold_and, which sets s_mask
and a_mask more intelligently than we do for the
rest of deposit.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/optimize.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 424ed7674d..4d5fa04199 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1620,6 +1620,7 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op)
static bool fold_deposit(OptContext *ctx, TCGOp *op)
{
TCGOpcode and_opc;
+ uint64_t z_mask;
if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) {
uint64_t t1 = arg_info(op->args[1])->val;
@@ -1647,8 +1648,7 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op)
op->opc = and_opc;
op->args[1] = op->args[2];
op->args[2] = arg_new_constant(ctx, mask);
- ctx->z_mask = mask & arg_info(op->args[1])->z_mask;
- return false;
+ return fold_and(ctx, op);
}
/* Inserting zero into a value. */
@@ -1657,14 +1657,12 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op)
op->opc = and_opc;
op->args[2] = arg_new_constant(ctx, mask);
- ctx->z_mask = mask & arg_info(op->args[1])->z_mask;
- return false;
+ return fold_and(ctx, op);
}
- ctx->z_mask = deposit64(arg_info(op->args[1])->z_mask,
- op->args[3], op->args[4],
- arg_info(op->args[2])->z_mask);
- return false;
+ z_mask = deposit64(arg_info(op->args[1])->z_mask, op->args[3], op->args[4],
+ arg_info(op->args[2])->z_mask);
+ return fold_masks_z(ctx, op, z_mask);
}
static bool fold_divide(OptContext *ctx, TCGOp *op)
--
2.43.0
- [PATCH 07/46] tcg/optimize: Use fold_masks_zsa in fold_andc, (continued)
- [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
- [PATCH 11/46] tcg/optimize: Use fold_and and fold_masks_z in fold_deposit,
Richard Henderson <=
- [PATCH 18/46] tcg/optimize: Use fold_masks_zsa in fold_extu, Richard Henderson, 2024/12/10
- [PATCH 16/46] tcg/optimize: Use finish_folding in fold_extract2, Richard Henderson, 2024/12/10
- [PATCH 19/46] tcg/optimize: Use fold_masks_zs in fold_movcond, Richard Henderson, 2024/12/10
- [PATCH 20/46] tcg/optimize: Use finish_folding in fold_mul*, Richard Henderson, 2024/12/10
- [PATCH 26/46] tcg/optimize: Use fold_masks_zs in fold_orc, Richard Henderson, 2024/12/10