diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2024-12-09 21:35:53 -0600 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-06-30 07:42:37 -0600 |
| commit | 84b399df9abea985089d46fd94da559d83d0e085 (patch) | |
| tree | ae17fe1becd673a5d344082b9236bcaa74b26f31 /tcg/optimize.c | |
| parent | d89504b0477df0ac6ff969b79065d9494cb0e6be (diff) | |
| download | focaccia-qemu-84b399df9abea985089d46fd94da559d83d0e085.tar.gz focaccia-qemu-84b399df9abea985089d46fd94da559d83d0e085.zip | |
tcg/optimize: Build and use one and affected bits in fold_or
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/optimize.c')
| -rw-r--r-- | tcg/optimize.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c index d22396f6d7..ce065d0e22 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2263,7 +2263,7 @@ static bool fold_not(OptContext *ctx, TCGOp *op) static bool fold_or(OptContext *ctx, TCGOp *op) { - uint64_t z_mask, s_mask; + uint64_t z_mask, o_mask, s_mask, a_mask; TempOptInfo *t1, *t2; if (fold_const2_commutative(ctx, op) || @@ -2274,9 +2274,15 @@ static bool fold_or(OptContext *ctx, TCGOp *op) t1 = arg_info(op->args[1]); t2 = arg_info(op->args[2]); + z_mask = t1->z_mask | t2->z_mask; + o_mask = t1->o_mask | t2->o_mask; s_mask = t1->s_mask & t2->s_mask; - return fold_masks_zs(ctx, op, z_mask, s_mask); + + /* Affected bits are those not known one, masked by those known zero. */ + a_mask = ~t1->o_mask & t2->z_mask; + + return fold_masks_zosa(ctx, op, z_mask, o_mask, s_mask, a_mask); } static bool fold_orc(OptContext *ctx, TCGOp *op) |