[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/68] tcg: Add type and flags arguments to tcg_op_supported
From: |
Richard Henderson |
Subject: |
[PULL 07/68] tcg: Add type and flags arguments to tcg_op_supported |
Date: |
Fri, 17 Jan 2025 10:23:55 -0800 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 7 ++++++-
tcg/tcg.c | 11 +++++++----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 238c55c9ac..ac0a080b15 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -834,7 +834,12 @@ typedef struct TCGTargetOpDef {
const char *args_ct_str[TCG_MAX_OP_ARGS];
} TCGTargetOpDef;
-bool tcg_op_supported(TCGOpcode op);
+/*
+ * tcg_op_supported:
+ * Query if @op, for @type and @flags, is supported by the host
+ * on which we are currently executing.
+ */
+bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags);
void tcg_gen_call0(void *func, TCGHelperInfo *, TCGTemp *ret);
void tcg_gen_call1(void *func, TCGHelperInfo *, TCGTemp *ret, TCGTemp *);
diff --git a/tcg/tcg.c b/tcg/tcg.c
index f2bbff8079..43293ca255 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1931,9 +1931,11 @@ TCGTemp *tcgv_i32_temp(TCGv_i32 v)
}
#endif /* CONFIG_DEBUG_TCG */
-/* Return true if OP may appear in the opcode stream.
- Test the runtime variable that controls each opcode. */
-bool tcg_op_supported(TCGOpcode op)
+/*
+ * Return true if OP may appear in the opcode stream with TYPE.
+ * Test the runtime variable that controls each opcode.
+ */
+bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags)
{
const bool have_vec
= TCG_TARGET_HAS_v64 | TCG_TARGET_HAS_v128 | TCG_TARGET_HAS_v256;
@@ -6243,7 +6245,8 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb,
uint64_t pc_start)
/* fall through */
default:
/* Sanity check that we've not introduced any unhandled opcodes. */
- tcg_debug_assert(tcg_op_supported(opc));
+ tcg_debug_assert(tcg_op_supported(opc, TCGOP_TYPE(op),
+ TCGOP_FLAGS(op)));
/* Note: in order to speed up the code, it would be much
faster to have specialized register allocator functions for
some common argument patterns */
--
2.43.0
- [PULL 02/68] tcg: Move call abi parameters from tcg-target.h to tcg-target.c.inc, (continued)
- [PULL 02/68] tcg: Move call abi parameters from tcg-target.h to tcg-target.c.inc, Richard Henderson, 2025/01/17
- [PULL 03/68] tcg: Replace TCGOP_VECL with TCGOP_TYPE, Richard Henderson, 2025/01/17
- [PULL 04/68] tcg: Move tcg_op_insert_{after, before} decls to tcg-internal.h, Richard Henderson, 2025/01/17
- [PULL 05/68] tcg: Copy TCGOP_TYPE in tcg_op_insert_{after,before}, Richard Henderson, 2025/01/17
- [PULL 08/68] target/arm: Do not test TCG_TARGET_HAS_bitsel_vec, Richard Henderson, 2025/01/17
- [PULL 10/68] target/tricore: Use tcg_op_supported, Richard Henderson, 2025/01/17
- [PULL 14/68] target/i386: Use tcg_op_supported, Richard Henderson, 2025/01/17
- [PULL 09/68] target/arm: Use tcg_op_supported, Richard Henderson, 2025/01/17
- [PULL 12/68] target/i386: Remove TCG_TARGET_extract_tl_valid, Richard Henderson, 2025/01/17
- [PULL 13/68] target/i386: Use tcg_op_deposit_valid, Richard Henderson, 2025/01/17
- [PULL 07/68] tcg: Add type and flags arguments to tcg_op_supported,
Richard Henderson <=
- [PULL 16/68] tcg: Rename tcg-target.opc.h to tcg-target-opc.h.inc, Richard Henderson, 2025/01/17
- [PULL 17/68] tcg/tci: Move TCI specific opcodes to tcg-target-opc.h.inc, Richard Henderson, 2025/01/17
- [PULL 11/68] tcg: Add tcg_op_deposit_valid, Richard Henderson, 2025/01/17
- [PULL 15/68] tcg: Remove TCG_TARGET_NEED_LDST_LABELS and TCG_TARGET_NEED_POOL_LABELS, Richard Henderson, 2025/01/17
- [PULL 18/68] tcg: Move fallback tcg_can_emit_vec_op out of line, Richard Henderson, 2025/01/17
- [PULL 22/68] tcg/arm: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 21/68] tcg/aarch64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 20/68] tcg: Extract default TCG_TARGET_HAS_foo definitions to 'tcg-has.h', Richard Henderson, 2025/01/17
- [PULL 19/68] tcg/ppc: Remove TCGPowerISA enum, Richard Henderson, 2025/01/17
- [PULL 23/68] tcg/i386: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17