[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 01/15] tcg: Avoid recursion in tcg_gen_mulu2_i32
From: |
Richard Henderson |
Subject: |
[PULL v2 01/15] tcg: Avoid recursion in tcg_gen_mulu2_i32 |
Date: |
Mon, 23 Jan 2023 16:04:53 -1000 |
We have a test for one of TCG_TARGET_HAS_mulu2_i32 or
TCG_TARGET_HAS_muluh_i32 being defined, but the test
became non-functional when we changed to always define
all of these macros.
Replace this with a build-time test in tcg_gen_mulu2_i32.
Fixes: 25c4d9cc845 ("tcg: Always define all of the TCGOpcode enum members.")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1435
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 7 -------
tcg/tcg-op.c | 4 +++-
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 6f497172f8..9a0ae7d20b 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -155,13 +155,6 @@ typedef uint64_t TCGRegSet;
#define TCG_TARGET_HAS_rem_i64 0
#endif
-/* For 32-bit targets, some sort of unsigned widening multiply is required. */
-#if TCG_TARGET_REG_BITS == 32 \
- && !(defined(TCG_TARGET_HAS_mulu2_i32) \
- || defined(TCG_TARGET_HAS_muluh_i32))
-# error "Missing unsigned widening multiply"
-#endif
-
#if !defined(TCG_TARGET_HAS_v64) \
&& !defined(TCG_TARGET_HAS_v128) \
&& !defined(TCG_TARGET_HAS_v256)
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 9fa9f1b0fd..326a9180ef 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -874,7 +874,7 @@ void tcg_gen_mulu2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32
arg1, TCGv_i32 arg2)
tcg_gen_op3_i32(INDEX_op_muluh_i32, rh, arg1, arg2);
tcg_gen_mov_i32(rl, t);
tcg_temp_free_i32(t);
- } else {
+ } else if (TCG_TARGET_REG_BITS == 64) {
TCGv_i64 t0 = tcg_temp_new_i64();
TCGv_i64 t1 = tcg_temp_new_i64();
tcg_gen_extu_i32_i64(t0, arg1);
@@ -883,6 +883,8 @@ void tcg_gen_mulu2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32
arg1, TCGv_i32 arg2)
tcg_gen_extr_i64_i32(rl, rh, t0);
tcg_temp_free_i64(t0);
tcg_temp_free_i64(t1);
+ } else {
+ qemu_build_not_reached();
}
}
--
2.34.1
- [PULL v2 00/15] tcg patch queue, Richard Henderson, 2023/01/23
- [PULL v2 02/15] tcg/arm: Use register pair allocation for qemu_{ld, st}_i64, Richard Henderson, 2023/01/23
- [PULL v2 01/15] tcg: Avoid recursion in tcg_gen_mulu2_i32,
Richard Henderson <=
- [PULL v2 03/15] common-user/host/ppc: Implement safe-syscall.inc.S, Richard Henderson, 2023/01/23
- [PULL v2 04/15] linux-user: Implment host/ppc/host-signal.h, Richard Henderson, 2023/01/23
- [PULL v2 05/15] tcg: Mark tcg helpers noinline to avoid an issue with LTO, Richard Henderson, 2023/01/23
- [PULL v2 07/15] target/loongarch: Disassemble jirl properly, Richard Henderson, 2023/01/23
- [PULL v2 06/15] target/loongarch: Enable the disassembler for host tcg, Richard Henderson, 2023/01/23
- [PULL v2 08/15] target/loongarch: Disassemble pcadd* addresses, Richard Henderson, 2023/01/23
- [PULL v2 09/15] tcg/loongarch64: Optimize immediate loading, Richard Henderson, 2023/01/23
- [PULL v2 10/15] tcg/loongarch64: Update tcg-insn-defs.c.inc, Richard Henderson, 2023/01/23
- [PULL v2 11/15] tcg/loongarch64: Introduce tcg_out_addi, Richard Henderson, 2023/01/23
- [PULL v2 12/15] tcg/loongarch64: Improve setcond expansion, Richard Henderson, 2023/01/23