On 27/9/26 10:58, Richard Henderson wrote:
Signed-off-by: Richard Henderson <[email protected]>
---
include/tcg/tcg-op-common.h | 2 --
include/tcg/tcg-op-def.h.inc | 1 +
tcg/tcg-op.c | 30 ++++++++++--------------------
3 files changed, 11 insertions(+), 22 deletions(-)
+void tcg_gen_shli(TCGType type, TCGTemp *dst, TCGTemp *src1, int64_t src2)
+{
+ tcg_debug_assert(src2 >= 0 && src2 < tcg_type_size(type) * 8);
Can we add a tcg_type_bits() helper?
+ if (src2 == 0) {
+ tcg_gen_mov(type, dst, src1);
+ } else {
+ tcg_gen_shl(type, dst, src1, tcg_constant_internal(type, src2));
+ }
+}
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>