[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/36] tcg: Move TCG_{LOW,HIGH} to tcg-internal.h
From: |
Richard Henderson |
Subject: |
[PATCH v2 10/36] tcg: Move TCG_{LOW,HIGH} to tcg-internal.h |
Date: |
Fri, 21 Oct 2022 17:15:23 +1000 |
Move the error-generating fallback from tcg-op.c, and
replace "_link_error" with modern QEMU_ERROR markup.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 12 ------------
tcg/tcg-internal.h | 14 ++++++++++++++
tcg/tcg-op.c | 10 +---------
3 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 5c2254ce9f..d207bc47be 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -737,18 +737,6 @@ static inline TCGv_vec temp_tcgv_vec(TCGTemp *t)
return (TCGv_vec)temp_tcgv_i32(t);
}
-#if TCG_TARGET_REG_BITS == 32
-static inline TCGv_i32 TCGV_LOW(TCGv_i64 t)
-{
- return temp_tcgv_i32(tcgv_i64_temp(t));
-}
-
-static inline TCGv_i32 TCGV_HIGH(TCGv_i64 t)
-{
- return temp_tcgv_i32(tcgv_i64_temp(t) + 1);
-}
-#endif
-
static inline TCGArg tcg_get_insn_param(TCGOp *op, int arg)
{
return op->args[arg];
diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h
index cc82088d52..a9ea27f67a 100644
--- a/tcg/tcg-internal.h
+++ b/tcg/tcg-internal.h
@@ -59,4 +59,18 @@ static inline unsigned tcg_call_flags(TCGOp *op)
return tcg_call_info(op)->flags;
}
+#if TCG_TARGET_REG_BITS == 32
+static inline TCGv_i32 TCGV_LOW(TCGv_i64 t)
+{
+ return temp_tcgv_i32(tcgv_i64_temp(t));
+}
+static inline TCGv_i32 TCGV_HIGH(TCGv_i64 t)
+{
+ return temp_tcgv_i32(tcgv_i64_temp(t) + 1);
+}
+#else
+extern TCGv_i32 TCGV_LOW(TCGv_i64) QEMU_ERROR("32-bit code path is reachable");
+extern TCGv_i32 TCGV_HIGH(TCGv_i64) QEMU_ERROR("32-bit code path is
reachable");
+#endif
+
#endif /* TCG_INTERNAL_H */
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 019fab00cc..3ed98ffa01 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -28,16 +28,8 @@
#include "tcg/tcg-op.h"
#include "tcg/tcg-mo.h"
#include "exec/plugin-gen.h"
+#include "tcg-internal.h"
-/* Reduce the number of ifdefs below. This assumes that all uses of
- TCGV_HIGH and TCGV_LOW are properly protected by a conditional that
- the compiler can eliminate. */
-#if TCG_TARGET_REG_BITS == 64
-extern TCGv_i32 TCGV_LOW_link_error(TCGv_i64);
-extern TCGv_i32 TCGV_HIGH_link_error(TCGv_i64);
-#define TCGV_LOW TCGV_LOW_link_error
-#define TCGV_HIGH TCGV_HIGH_link_error
-#endif
void tcg_gen_op1(TCGOpcode opc, TCGArg a1)
{
--
2.34.1
- [PATCH v2 01/36] include/qemu/atomic128: Support 16-byte atomic read/write for Intel AVX, (continued)
- [PATCH v2 01/36] include/qemu/atomic128: Support 16-byte atomic read/write for Intel AVX, Richard Henderson, 2022/10/21
- [PATCH v2 04/36] tcg/s390x: Use register pair allocation for div and mulu2, Richard Henderson, 2022/10/21
- [PATCH v2 06/36] meson: Move CONFIG_TCG_INTERPRETER to config_host, Richard Henderson, 2022/10/21
- [PATCH v2 05/36] tcg/arm: Use register pair allocation for qemu_{ld, st}_i64, Richard Henderson, 2022/10/21
- [PATCH v2 02/36] tcg: Tidy tcg_reg_alloc_op, Richard Henderson, 2022/10/21
- [PATCH v2 03/36] tcg: Introduce paired register allocation, Richard Henderson, 2022/10/21
- [PATCH v2 07/36] tcg: Remove TCG_TARGET_STACK_GROWSUP, Richard Henderson, 2022/10/21
- [PATCH v2 08/36] accel/tcg: Set cflags_next_tb in cpu_common_initfn, Richard Henderson, 2022/10/21
- [PATCH v2 09/36] target/sparc: Avoid TCGV_{LOW,HIGH}, Richard Henderson, 2022/10/21
- [PATCH v2 10/36] tcg: Move TCG_{LOW,HIGH} to tcg-internal.h,
Richard Henderson <=
- [PATCH v2 12/36] tcg: Simplify calls to temp_sync vs mem_coherent, Richard Henderson, 2022/10/21
- [PATCH v2 11/36] tcg: Add temp_subindex to TCGTemp, Richard Henderson, 2022/10/21
- [PATCH v2 16/36] tcg: Introduce TCGCallReturnKind and TCGCallArgumentKind, Richard Henderson, 2022/10/21
- [PATCH v2 14/36] tcg: Move TCG_TYPE_COUNT outside enum, Richard Henderson, 2022/10/21
- [PATCH v2 19/36] tcg: Use TCG_CALL_ARG_EVEN for TCI special case, Richard Henderson, 2022/10/21
- [PATCH v2 15/36] tcg: Introduce tcg_type_size, Richard Henderson, 2022/10/21
- [PATCH v2 17/36] tcg: Replace TCG_TARGET_CALL_ALIGN_ARGS with TCG_TARGET_CALL_ARG_I64, Richard Henderson, 2022/10/21
- [PATCH v2 21/36] tcg: Move ffi_cif pointer into TCGHelperInfo, Richard Henderson, 2022/10/21