[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 001/114] target/arm: Introduce TRANS, TRANS_FEAT
From: |
Richard Henderson |
Subject: |
[PATCH 001/114] target/arm: Introduce TRANS, TRANS_FEAT |
Date: |
Fri, 27 May 2022 11:17:14 -0700 |
Steal the idea for these leaf function expanders from PowerPC.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate.h | 11 +++++++++++
1 file changed, 11 insertions(+)
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 */
--
2.34.1
- [PATCH 000/114] target/arm: Rewrite sve feature tests, Richard Henderson, 2022/05/27
- [PATCH 001/114] target/arm: Introduce TRANS, TRANS_FEAT,
Richard Henderson <=
- [PATCH 002/114] target/arm: Move null function and sve check into gen_gvec_ool_zz, Richard Henderson, 2022/05/27
- [PATCH 003/114] target/arm: Use TRANS_FEAT for gen_gvec_ool_zz, Richard Henderson, 2022/05/27
- [PATCH 004/114] target/arm: Move null function and sve check into gen_gvec_ool_zzz, Richard Henderson, 2022/05/27
- [PATCH 005/114] target/arm: Introduce gen_gvec_ool_arg_zzz, Richard Henderson, 2022/05/27
- [PATCH 008/114] target/arm: Move null function and sve check into gen_gvec_ool_zzzz, Richard Henderson, 2022/05/27
- [PATCH 007/114] target/arm: Use TRANS_FEAT for do_sve2_zzz_ool, Richard Henderson, 2022/05/27
- [PATCH 009/114] target/arm: Use TRANS_FEAT for gen_gvec_ool_zzzz, Richard Henderson, 2022/05/27
- [PATCH 012/114] target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zzzz, Richard Henderson, 2022/05/27
- [PATCH 010/114] target/arm: Introduce gen_gvec_ool_arg_zzzz, Richard Henderson, 2022/05/27
- [PATCH 011/114] target/arm: Use TRANS_FEAT for do_sve2_zzzz_ool, Richard Henderson, 2022/05/27