[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 47/48] tcg/optimize: Propagate sign info for bit counting
From: |
Richard Henderson |
Subject: |
[PATCH v2 47/48] tcg/optimize: Propagate sign info for bit counting |
Date: |
Thu, 7 Oct 2021 12:54:55 -0700 |
The results are generally 6 bit unsigned values, though
the count leading and trailing bits may produce any value
for a zero input.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/optimize.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 1c106bfbc3..678e7c1983 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1216,6 +1216,7 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op)
g_assert_not_reached();
}
ctx->z_mask = arg_info(op->args[2])->z_mask | z_mask;
+ ctx->s_mask = smask_from_zmask(z_mask);
return false;
}
@@ -1236,6 +1237,7 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op)
default:
g_assert_not_reached();
}
+ ctx->s_mask = smask_from_zmask(ctx->z_mask);
return false;
}
--
2.25.1
- RE: [PATCH v2 13/48] tcg/optimize: Use a boolean to avoid a mass of continues, (continued)
- [PATCH v2 42/48] tcg/optimize: Add more simplifications for orc, Richard Henderson, 2021/10/07
- [PATCH v2 43/48] tcg/optimize: Stop forcing z_mask to "garbage" for 32-bit values, Richard Henderson, 2021/10/07
- [PATCH v2 40/48] tcg/optimize: Expand fold_addsub2_i32 to 64-bit ops, Richard Henderson, 2021/10/07
- [PATCH v2 41/48] tcg/optimize: Sink commutative operand swapping into fold functions, Richard Henderson, 2021/10/07
- [PATCH v2 45/48] tcg/optimize: Propagate sign info for logical operations, Richard Henderson, 2021/10/07
- [PATCH v2 44/48] tcg/optimize: Optimize sign extensions, Richard Henderson, 2021/10/07
- [PATCH v2 46/48] tcg/optimize: Propagate sign info for setcond, Richard Henderson, 2021/10/07
- [PATCH v2 47/48] tcg/optimize: Propagate sign info for bit counting,
Richard Henderson <=
- [PATCH v2 48/48] tcg/optimize: Propagate sign info for shifting, Richard Henderson, 2021/10/07
- Re: [PATCH v2 00/48] tcg: optimize redundant sign extensions, Richard Henderson, 2021/10/15
- Re: [PATCH v2 00/48] tcg: optimize redundant sign extensions, Alex Bennée, 2021/10/20