[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/52] tcg: Move TCGHelperInfo and dependencies to tcg/helper-info
From: |
Richard Henderson |
Subject: |
[PULL 19/52] tcg: Move TCGHelperInfo and dependencies to tcg/helper-info.h |
Date: |
Mon, 5 Jun 2023 13:15:15 -0700 |
This will be required outside of tcg-internal.h soon.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/helper-info.h | 59 +++++++++++++++++++++++++++++++++++++++
tcg/tcg-internal.h | 47 +------------------------------
2 files changed, 60 insertions(+), 46 deletions(-)
create mode 100644 include/tcg/helper-info.h
diff --git a/include/tcg/helper-info.h b/include/tcg/helper-info.h
new file mode 100644
index 0000000000..f65f81c2e7
--- /dev/null
+++ b/include/tcg/helper-info.h
@@ -0,0 +1,59 @@
+/*
+ * TCG Helper Infomation Structure
+ *
+ * Copyright (c) 2023 Linaro Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef TCG_HELPER_INFO_H
+#define TCG_HELPER_INFO_H
+
+#ifdef CONFIG_TCG_INTERPRETER
+#include <ffi.h>
+#endif
+
+/*
+ * Describe the calling convention of a given argument type.
+ */
+typedef enum {
+ TCG_CALL_RET_NORMAL, /* by registers */
+ TCG_CALL_RET_BY_REF, /* for i128, by reference */
+ TCG_CALL_RET_BY_VEC, /* for i128, by vector register */
+} TCGCallReturnKind;
+
+typedef enum {
+ TCG_CALL_ARG_NORMAL, /* by registers (continuing onto stack) */
+ TCG_CALL_ARG_EVEN, /* like normal, but skipping odd slots */
+ TCG_CALL_ARG_EXTEND, /* for i32, as a sign/zero-extended i64 */
+ TCG_CALL_ARG_EXTEND_U, /* ... as a zero-extended i64 */
+ TCG_CALL_ARG_EXTEND_S, /* ... as a sign-extended i64 */
+ TCG_CALL_ARG_BY_REF, /* for i128, by reference, first */
+ TCG_CALL_ARG_BY_REF_N, /* ... by reference, subsequent */
+} TCGCallArgumentKind;
+
+typedef struct TCGCallArgumentLoc {
+ TCGCallArgumentKind kind : 8;
+ unsigned arg_slot : 8;
+ unsigned ref_slot : 8;
+ unsigned arg_idx : 4;
+ unsigned tmp_subindex : 2;
+} TCGCallArgumentLoc;
+
+typedef struct TCGHelperInfo {
+ void *func;
+ const char *name;
+#ifdef CONFIG_TCG_INTERPRETER
+ ffi_cif *cif;
+#endif
+ unsigned typemask : 32;
+ unsigned flags : 8;
+ unsigned nr_in : 8;
+ unsigned nr_out : 8;
+ TCGCallReturnKind out_kind : 8;
+
+ /* Maximum physical arguments are constrained by TCG_TYPE_I128. */
+ TCGCallArgumentLoc in[MAX_CALL_IARGS * (128 / TCG_TARGET_REG_BITS)];
+} TCGHelperInfo;
+
+#endif /* TCG_HELPER_INFO_H */
diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h
index 67b698bd5c..fbe62b31b8 100644
--- a/tcg/tcg-internal.h
+++ b/tcg/tcg-internal.h
@@ -25,55 +25,10 @@
#ifndef TCG_INTERNAL_H
#define TCG_INTERNAL_H
-#ifdef CONFIG_TCG_INTERPRETER
-#include <ffi.h>
-#endif
+#include "tcg/helper-info.h"
#define TCG_HIGHWATER 1024
-/*
- * Describe the calling convention of a given argument type.
- */
-typedef enum {
- TCG_CALL_RET_NORMAL, /* by registers */
- TCG_CALL_RET_BY_REF, /* for i128, by reference */
- TCG_CALL_RET_BY_VEC, /* for i128, by vector register */
-} TCGCallReturnKind;
-
-typedef enum {
- TCG_CALL_ARG_NORMAL, /* by registers (continuing onto stack) */
- TCG_CALL_ARG_EVEN, /* like normal, but skipping odd slots */
- TCG_CALL_ARG_EXTEND, /* for i32, as a sign/zero-extended i64 */
- TCG_CALL_ARG_EXTEND_U, /* ... as a zero-extended i64 */
- TCG_CALL_ARG_EXTEND_S, /* ... as a sign-extended i64 */
- TCG_CALL_ARG_BY_REF, /* for i128, by reference, first */
- TCG_CALL_ARG_BY_REF_N, /* ... by reference, subsequent */
-} TCGCallArgumentKind;
-
-typedef struct TCGCallArgumentLoc {
- TCGCallArgumentKind kind : 8;
- unsigned arg_slot : 8;
- unsigned ref_slot : 8;
- unsigned arg_idx : 4;
- unsigned tmp_subindex : 2;
-} TCGCallArgumentLoc;
-
-typedef struct TCGHelperInfo {
- void *func;
- const char *name;
-#ifdef CONFIG_TCG_INTERPRETER
- ffi_cif *cif;
-#endif
- unsigned typemask : 32;
- unsigned flags : 8;
- unsigned nr_in : 8;
- unsigned nr_out : 8;
- TCGCallReturnKind out_kind : 8;
-
- /* Maximum physical arguments are constrained by TCG_TYPE_I128. */
- TCGCallArgumentLoc in[MAX_CALL_IARGS * (128 / TCG_TARGET_REG_BITS)];
-} TCGHelperInfo;
-
extern TCGContext tcg_init_ctx;
extern TCGContext **tcg_ctxs;
extern unsigned int tcg_cur_ctxs;
--
2.34.1
- [PULL 07/52] tcg: Add tlb_fast_offset to TCGContext, (continued)
- [PULL 07/52] tcg: Add tlb_fast_offset to TCGContext, Richard Henderson, 2023/06/05
- [PULL 11/52] tcg: Split out tcg-target-reg-bits.h, Richard Henderson, 2023/06/05
- [PULL 13/52] tcg: Split out tcg/oversized-guest.h, Richard Henderson, 2023/06/05
- [PULL 02/52] tcg/riscv: Remove TARGET_LONG_BITS, TCG_TYPE_TL, Richard Henderson, 2023/06/05
- [PULL 10/52] *: Add missing includes of tcg/tcg.h, Richard Henderson, 2023/06/05
- [PULL 12/52] target/arm: Fix test of TCG_OVERSIZED_GUEST, Richard Henderson, 2023/06/05
- [PULL 14/52] tcg: Move TCGv, dup_const_tl definitions to tcg-op.h, Richard Henderson, 2023/06/05
- [PULL 18/52] tcg: Remove outdated comments in helper-head.h, Richard Henderson, 2023/06/05
- [PULL 17/52] target/hexagon: Include helper-gen.h where needed, Richard Henderson, 2023/06/05
- [PULL 16/52] target/arm: Include helper-gen.h in translator.h, Richard Henderson, 2023/06/05
- [PULL 19/52] tcg: Move TCGHelperInfo and dependencies to tcg/helper-info.h,
Richard Henderson <=
- [PULL 21/52] tcg: Move temp_idx and tcgv_i32_temp debug out of line, Richard Henderson, 2023/06/05
- [PULL 25/52] target/sh4: Emit insn_start for each insn in gUSA region, Richard Henderson, 2023/06/05
- [PULL 26/52] tcg: Add insn_start_words to TCGContext, Richard Henderson, 2023/06/05
- [PULL 27/52] tcg: Add guest_mo to TCGContext, Richard Henderson, 2023/06/05
- [PULL 32/52] exec-all: Widen TranslationBlock pc and cs_base to 64-bits, Richard Henderson, 2023/06/05
- [PULL 24/52] tcg: Split helper-proto.h, Richard Henderson, 2023/06/05
- [PULL 28/52] tcg: Move TLB_FLAGS_MASK check out of get_alignment_bits, Richard Henderson, 2023/06/05
- [PULL 29/52] tcg: Split tcg/tcg-op-gvec.h, Richard Henderson, 2023/06/05
- [PULL 35/52] accel/tcg: Move most of gen-icount.h into translator.c, Richard Henderson, 2023/06/05
- [PULL 33/52] tcg: Spit out exec/translation-block.h, Richard Henderson, 2023/06/05