[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/14] tcg: Relax requirement for mulu2_i32 on 32-bit
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 11/14] tcg: Relax requirement for mulu2_i32 on 32-bit hosts |
Date: |
Tue, 22 Apr 2014 14:06:01 -0700 |
Instead require either mulu2_i32 or muluh_i32. The code in tcg-op.h
already supports looking for both. Previous incomplete conversion?
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/arm/tcg-target.h | 1 +
tcg/mips/tcg-target.h | 1 +
tcg/ppc/tcg-target.h | 1 +
tcg/tcg.h | 8 +++++++-
tcg/tci/tcg-target.h | 2 ++
5 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
index 3746b6e..35de34e 100644
--- a/tcg/arm/tcg-target.h
+++ b/tcg/arm/tcg-target.h
@@ -79,6 +79,7 @@ extern bool use_idiv_instructions;
#define TCG_TARGET_HAS_nor_i32 0
#define TCG_TARGET_HAS_deposit_i32 1
#define TCG_TARGET_HAS_movcond_i32 1
+#define TCG_TARGET_HAS_mulu2_i32 1
#define TCG_TARGET_HAS_muls2_i32 1
#define TCG_TARGET_HAS_muluh_i32 0
#define TCG_TARGET_HAS_mulsh_i32 0
diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h
index 683c6af..c3822d0 100644
--- a/tcg/mips/tcg-target.h
+++ b/tcg/mips/tcg-target.h
@@ -109,6 +109,7 @@ extern bool use_mips32r2_instructions;
#define TCG_TARGET_HAS_orc_i32 0
#define TCG_TARGET_HAS_eqv_i32 0
#define TCG_TARGET_HAS_nand_i32 0
+#define TCG_TARGET_HAS_mulu2_i32 1
#define TCG_TARGET_HAS_muls2_i32 1
#define TCG_TARGET_HAS_muluh_i32 1
#define TCG_TARGET_HAS_mulsh_i32 1
diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
index e3395e3..1168912 100644
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -95,6 +95,7 @@ typedef enum {
#define TCG_TARGET_HAS_nor_i32 1
#define TCG_TARGET_HAS_deposit_i32 1
#define TCG_TARGET_HAS_movcond_i32 1
+#define TCG_TARGET_HAS_mulu2_i32 1
#define TCG_TARGET_HAS_muls2_i32 0
#define TCG_TARGET_HAS_muluh_i32 0
#define TCG_TARGET_HAS_mulsh_i32 0
diff --git a/tcg/tcg.h b/tcg/tcg.h
index f7efcb4..0bb6677 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -97,7 +97,6 @@ typedef uint64_t TCGRegSet;
/* Turn some undef macros into true macros. */
#define TCG_TARGET_HAS_add2_i32 1
#define TCG_TARGET_HAS_sub2_i32 1
-#define TCG_TARGET_HAS_mulu2_i32 1
#endif
#ifndef TCG_TARGET_deposit_i32_valid
@@ -121,6 +120,13 @@ 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
+
typedef enum TCGOpcode {
#define DEF(name, oargs, iargs, cargs, flags) INDEX_op_ ## name,
#include "tcg-opc.h"
diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h
index 6e1da8c..7869119 100644
--- a/tcg/tci/tcg-target.h
+++ b/tcg/tci/tcg-target.h
@@ -118,6 +118,8 @@
#define TCG_TARGET_HAS_mulu2_i64 0
#define TCG_TARGET_HAS_muluh_i64 0
#define TCG_TARGET_HAS_mulsh_i64 0
+#else
+#define TCG_TARGET_HAS_mulu2_i32 1
#endif /* TCG_TARGET_REG_BITS == 64 */
#define TCG_TARGET_HAS_new_ldst 0
--
1.9.0
- [Qemu-devel] [PULL 03/14] tcg: Mask shift quantities while folding, (continued)
- [Qemu-devel] [PULL 03/14] tcg: Mask shift quantities while folding, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 04/14] tci: Mask shift counts to avoid undefined behavior, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 06/14] tcg: Add TCGType parameter to tcg_target_const_match, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 05/14] tcg: Fix out of range shift in deposit optimizations, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 07/14] tcg-aarch64: Remove w constraint, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 08/14] tcg-ppc64: Use the type parameter to tcg_target_const_match, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 09/14] tcg-sparc: Use the type parameter to tcg_target_const_match, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 10/14] tcg-s390: Remove W constraint, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 12/14] tcg: Use tcg_gen_mulu2_i32 in tcg_gen_muls2_i32, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 11/14] tcg: Relax requirement for mulu2_i32 on 32-bit hosts,
Richard Henderson <=
- [Qemu-devel] [PULL 13/14] tcg: Fix fallback from muls2_i64 to mulu2_i64, Richard Henderson, 2014/04/22
- [Qemu-devel] [PULL 14/14] tcg: Use HOST_WORDS_BIGENDIAN, Richard Henderson, 2014/04/22
- Re: [Qemu-devel] [PULL 00/14] tcg generic queue, Peter Maydell, 2014/04/24