aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-08-07 09:36:49 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-08-25 13:02:14 +0200
commitfb3164e412dac312cc472968d049ee1a074dd7d3 (patch)
treead3a2675d4565e1fc4d56771b65ecc401af7c3f0 /target
parent34fe9fa3683a7ff54315c62960eba6eeac2a36ac (diff)
target/mips: Introduce generic TRANS() macro for decodetree helpers
Plain copy/paste of the TRANS() macro introduced in the PPC commit f2aabda8ac9 ("target/ppc: Move D/DS/X-form integer loads to decodetree") to the MIPS target. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210808173018.90960-2-f4bug@amsat.org>
Diffstat (limited to 'target')
-rw-r--r--target/mips/tcg/translate.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h
index c25fad597d..791e3e2c7e 100644
--- a/target/mips/tcg/translate.h
+++ b/target/mips/tcg/translate.h
@@ -202,4 +202,12 @@ bool decode_ext_txx9(DisasContext *ctx, uint32_t insn);
bool decode_ext_tx79(DisasContext *ctx, uint32_t insn);
#endif
+/*
+ * Helpers for implementing sets of trans_* functions.
+ * Defer the implementation of NAME to FUNC, with optional extra arguments.
+ */
+#define TRANS(NAME, FUNC, ...) \
+ static bool trans_##NAME(DisasContext *ctx, arg_##NAME *a) \
+ { return FUNC(ctx, a, __VA_ARGS__); }
+
#endif