[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 39/68] tcg: Validate op supported in opcode_args_ct
From: |
Richard Henderson |
Subject: |
[PULL 39/68] tcg: Validate op supported in opcode_args_ct |
Date: |
Fri, 17 Jan 2025 10:24:27 -0800 |
We should have checked that the op is supported before
emitting it. The backend cannot be expected to have a
constraint set for unsupported ops.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tcg.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 32975fe298..b9119a1ec7 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -3367,6 +3367,10 @@ static const TCGArgConstraint *opcode_args_ct(const
TCGOp *op)
const TCGOpDef *def = &tcg_op_defs[op->opc];
TCGConstraintSetIndex con_set;
+#ifdef CONFIG_DEBUG_TCG
+ assert(tcg_op_supported(op->opc, TCGOP_TYPE(op), TCGOP_FLAGS(op)));
+#endif
+
if (def->nb_iargs + def->nb_oargs == 0) {
return NULL;
}
--
2.43.0
- [PULL 31/68] tcg: Include 'tcg-target-has.h' once in 'tcg-has.h', (continued)
- [PULL 31/68] tcg: Include 'tcg-target-has.h' once in 'tcg-has.h', Richard Henderson, 2025/01/17
- [PULL 32/68] tcg: Only include 'tcg-has.h' when necessary, Richard Henderson, 2025/01/17
- [PULL 35/68] tcg: Change have_vec to has_type in tcg_op_supported, Richard Henderson, 2025/01/17
- [PULL 37/68] tcg: Remove args_ct from TCGOpDef, Richard Henderson, 2025/01/17
- [PULL 28/68] tcg/s390x: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 29/68] tcg/sparc64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 34/68] tcg: Use C_NotImplemented in tcg_target_op_def, Richard Henderson, 2025/01/17
- [PULL 33/68] tcg: Split out tcg-target-mo.h, Richard Henderson, 2025/01/17
- [PULL 38/68] tcg: Constify tcg_op_defs, Richard Henderson, 2025/01/17
- [PULL 36/68] tcg: Reorg process_op_defs, Richard Henderson, 2025/01/17
- [PULL 39/68] tcg: Validate op supported in opcode_args_ct,
Richard Henderson <=
- [PULL 41/68] tcg: Pass type and flags to tcg_target_op_def, Richard Henderson, 2025/01/17
- [PULL 40/68] tcg: Add TCG_OPF_NOT_PRESENT to opcodes without inputs or outputs, Richard Henderson, 2025/01/17
- [PULL 42/68] tcg: Add TCGType argument to tcg_out_op, Richard Henderson, 2025/01/17
- [PULL 43/68] tcg: Remove TCG_OPF_64BIT, Richard Henderson, 2025/01/17
- [PULL 45/68] tcg: Replace IMPLVEC with TCG_OPF_VECTOR, Richard Henderson, 2025/01/17
- [PULL 48/68] tcg/i386: Fold the ext{8, 16, 32}[us] cases into {s}extract, Richard Henderson, 2025/01/17
- [PULL 44/68] tcg: Drop implementation checks from tcg-opc.h, Richard Henderson, 2025/01/17
- [PULL 46/68] tcg/mips: Expand bswap unconditionally, Richard Henderson, 2025/01/17
- [PULL 50/68] tcg/aarch64: Expand extract with offset 0 with andi, Richard Henderson, 2025/01/17
- [PULL 52/68] tcg/loongarch64: Fold the ext{8, 16, 32}[us] cases into {s}extract, Richard Henderson, 2025/01/17