[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/46] tcg/optimize: Use fold_masks_zs in fold_movcond
From: |
Richard Henderson |
Subject: |
[PATCH 19/46] tcg/optimize: Use fold_masks_zs in fold_movcond |
Date: |
Tue, 10 Dec 2024 09:23:34 -0600 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/optimize.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 260e3ea072..6d2d55f053 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1874,6 +1874,7 @@ static bool fold_mov(OptContext *ctx, TCGOp *op)
static bool fold_movcond(OptContext *ctx, TCGOp *op)
{
+ uint64_t z_mask, s_mask;
int i;
/* If true and false values are the same, eliminate the cmp. */
@@ -1895,10 +1896,10 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op)
return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[4 - i]);
}
- ctx->z_mask = arg_info(op->args[3])->z_mask
- | arg_info(op->args[4])->z_mask;
- ctx->s_mask = arg_info(op->args[3])->s_mask
- & arg_info(op->args[4])->s_mask;
+ z_mask = arg_info(op->args[3])->z_mask
+ | arg_info(op->args[4])->z_mask;
+ s_mask = arg_info(op->args[3])->s_mask
+ & arg_info(op->args[4])->s_mask;
if (arg_is_const(op->args[3]) && arg_is_const(op->args[4])) {
uint64_t tv = arg_info(op->args[3])->val;
@@ -1941,7 +1942,7 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op)
}
}
}
- return false;
+ return fold_masks_zs(ctx, op, z_mask, s_mask);
}
static bool fold_mul(OptContext *ctx, TCGOp *op)
--
2.43.0
- [PATCH 10/46] tcg/optimize: Use fold_masks_z in fold_ctpop, (continued)
- [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, 2024/12/10
- [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 <=
- [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
- [PATCH 23/46] tcg/optimize: Use fold_masks_zs in fold_nor, Richard Henderson, 2024/12/10
- [PATCH 27/46] tcg/optimize: Use fold_masks_zs in fold_qemu_ld, Richard Henderson, 2024/12/10