diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-05-27 11:17:14 -0700 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-05-30 17:05:04 +0100 |
commit | 05a546429f23841988c353d6ed7a1908cd209292 (patch) | |
tree | 64bcde846fbe57d8bcd3891156815df0f964c9d0 /target/arm/translate.h | |
parent | fd71f258bc0d245b2223bf3032c0ebc82f8a3463 (diff) |
target/arm: Introduce TRANS, TRANS_FEAT
Steal the idea for these leaf function expanders from PowerPC.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220527181907.189259-2-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/translate.h')
-rw-r--r-- | target/arm/translate.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target/arm/translate.h b/target/arm/translate.h index 6f0ebdc88e..9f0bb270c5 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -576,4 +576,15 @@ static inline MemOp finalize_memop(DisasContext *s, MemOp opc) */ uint64_t asimd_imm_const(uint32_t imm, int cmode, int op); +/* + * 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 *s, arg_##NAME *a) \ + { return FUNC(s, __VA_ARGS__); } +#define TRANS_FEAT(NAME, FEAT, FUNC, ...) \ + static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \ + { return dc_isar_feature(FEAT, s) && FUNC(s, __VA_ARGS__); } + #endif /* TARGET_ARM_TRANSLATE_H */ |