[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/33] target/mips: Introduce generic TRANS_CHECK() for decodetre
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 09/33] target/mips: Introduce generic TRANS_CHECK() for decodetree helpers |
Date: |
Sat, 23 Oct 2021 23:47:39 +0200 |
Similar to the TRANS() macro introduced in commit fb3164e412d,
introduce TRANS_CHECK() which takes a boolean expression as
argument.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/tcg/translate.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h
index 6111493651f..3ef09cc50c9 100644
--- a/target/mips/tcg/translate.h
+++ b/target/mips/tcg/translate.h
@@ -224,6 +224,15 @@ bool decode_ext_vr54xx(DisasContext *ctx, uint32_t insn);
static bool trans_##NAME(DisasContext *ctx, arg_##NAME *a) \
{ return FUNC(ctx, a, __VA_ARGS__); }
+#define TRANS_CHECK(NAME, CHECK_EXPR, FUNC, ...) \
+ static bool trans_##NAME(DisasContext *ctx, arg_##NAME *a) \
+ { \
+ if (!(CHECK_EXPR)) { \
+ return false; \
+ } \
+ return FUNC(ctx, a, __VA_ARGS__); \
+ }
+
static inline bool cpu_is_bigendian(DisasContext *ctx)
{
return extract32(ctx->CP0_Config0, CP0C0_BE, 1);
--
2.31.1
- [PATCH 03/33] target/mips: Fix MSA MSUBV.B opcode, (continued)
- [PATCH 03/33] target/mips: Fix MSA MSUBV.B opcode, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 04/33] tests/tcg/mips: Run MSA opcodes tests on user-mode emulation, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 05/33] target/mips: Have check_msa_access() return a boolean, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 06/33] target/mips: Use enum definitions from CPUMIPSMSADataFormat enum, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 07/33] target/mips: Rename sa16 -> sa, bz_df -> bz -> bz_v, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 08/33] target/mips: Convert MSA LDI opcode to decodetree, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 09/33] target/mips: Introduce generic TRANS_CHECK() for decodetree helpers,
Philippe Mathieu-Daudé <=
- [PATCH 10/33] target/mips: Extract df_extract() helper, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 11/33] target/mips: Convert MSA I5 instruction format to decodetree, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 12/33] target/mips: Convert MSA BIT instruction format to decodetree, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 13/33] target/mips: Convert MSA SHF opcode to decodetree, Philippe Mathieu-Daudé, 2021/10/23
- [PATCH 14/33] target/mips: Convert MSA I8 instruction format to decodetree, Philippe Mathieu-Daudé, 2021/10/23