From: Philippe Mathieu-Daudé Date: Sat, 7 Aug 2021 07:36:49 +0000 (+0200) Subject: target/mips: Introduce generic TRANS() macro for decodetree helpers X-Git-Tag: v6.2.0-rc0~134^2~22 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fb3164e412dac312cc472968d049ee1a074dd7d3;p=users%2Fdwmw2%2Fqemu.git 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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210808173018.90960-2-f4bug@amsat.org> --- 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