diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-12-09 21:13:02 -0600 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2025-06-30 07:42:37 -0600 |
commit | 682d6d57baf43c8f7273c328efa3402943bd557f (patch) | |
tree | ecf4cb881b9a4bd26518374a72a8013d36cda421 | |
parent | 16559c3ecbacab16d471a4a6f5a35f14325c3fe4 (diff) | |
download | qemu-682d6d57baf43c8f7273c328efa3402943bd557f.zip qemu-682d6d57baf43c8f7273c328efa3402943bd557f.tar.gz qemu-682d6d57baf43c8f7273c328efa3402943bd557f.tar.bz2 |
tcg/optimize: Build and use z_bits and o_bits in fold_nor
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r-- | tcg/optimize.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c index 758f7b1..29d1f29 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2231,16 +2231,22 @@ static bool fold_neg(OptContext *ctx, TCGOp *op) static bool fold_nor(OptContext *ctx, TCGOp *op) { - uint64_t s_mask; + uint64_t z_mask, o_mask, s_mask; + TempOptInfo *t1, *t2; if (fold_const2_commutative(ctx, op) || fold_xi_to_not(ctx, op, 0)) { return true; } - s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks_s(ctx, op, s_mask); + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + + z_mask = ~(t1->o_mask | t2->o_mask); + o_mask = ~(t1->z_mask | t2->z_mask); + s_mask = t1->s_mask & t2->s_mask; + + return fold_masks_zos(ctx, op, z_mask, o_mask, s_mask); } static bool fold_not(OptContext *ctx, TCGOp *op) |