[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 22/30] target/ppc: Introduce macros to check isa extensions
From: |
Richard Henderson |
Subject: |
[PATCH v3 22/30] target/ppc: Introduce macros to check isa extensions |
Date: |
Thu, 29 Apr 2021 18:15:35 -0700 |
These will be used by the decodetree trans_* functions
to early-exit when the instruction set is not enabled.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/ppc/translate.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 112afd02d5..cde12e9d38 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -6876,6 +6876,32 @@ static inline void set_avr64(int regno, TCGv_i64 src,
bool high)
tcg_gen_st_i64(src, cpu_env, avr64_offset(regno, high));
}
+/*
+ * Helpers for trans_* functions to check for specific insns flags.
+ * Use token pasting to ensure that we use the proper flag with the
+ * proper variable.
+ */
+#define REQUIRE_INSNS_FLAGS(CTX, NAME) \
+ do { \
+ if (((CTX)->insns_flags & PPC_##NAME) == 0) { \
+ return false; \
+ } \
+ } while (0)
+
+#define REQUIRE_INSNS_FLAGS2(CTX, NAME) \
+ do { \
+ if (((CTX)->insns_flags2 & PPC2_##NAME) == 0) { \
+ return false; \
+ } \
+ } while (0)
+
+/* Then special-case the check for 64-bit so that we elide code for ppc32. */
+#if TARGET_LONG_BITS == 32
+# define REQUIRE_64BIT(CTX) return false
+#else
+# define REQUIRE_64BIT(CTX) REQUIRE_INSNS_FLAGS(CTX, 64B)
+#endif
+
#include "translate/fp-impl.c.inc"
#include "translate/vmx-impl.c.inc"
--
2.25.1
- [PATCH v3 10/30] target/ppc: Simplify gen_debug_exception, (continued)
- [PATCH v3 10/30] target/ppc: Simplify gen_debug_exception, Richard Henderson, 2021/04/29
- [PATCH v3 12/30] target/ppc: Replace POWERPC_EXCP_SYNC with DISAS_EXIT, Richard Henderson, 2021/04/29
- [PATCH v3 13/30] target/ppc: Remove unnecessary gen_io_end calls, Richard Henderson, 2021/04/29
- [PATCH v3 14/30] target/ppc: Introduce gen_icount_io_start, Richard Henderson, 2021/04/29
- [PATCH v3 15/30] target/ppc: Replace POWERPC_EXCP_STOP with DISAS_EXIT_UPDATE, Richard Henderson, 2021/04/29
- [PATCH v3 16/30] target/ppc: Replace POWERPC_EXCP_BRANCH with DISAS_NORETURN, Richard Henderson, 2021/04/29
- [PATCH v3 08/30] target/ppc: Remove special case for POWERPC_SYSCALL, Richard Henderson, 2021/04/29
- [PATCH v3 11/30] target/ppc: Introduce DISAS_{EXIT,CHAIN}{,_UPDATE}, Richard Henderson, 2021/04/29
- [PATCH v3 17/30] target/ppc: Remove DisasContext.exception, Richard Henderson, 2021/04/29
- [PATCH v3 22/30] target/ppc: Introduce macros to check isa extensions,
Richard Henderson <=
- [PATCH v3 18/30] target/ppc: Move single-step check to ppc_tr_tb_stop, Richard Henderson, 2021/04/29
- [PATCH v3 20/30] target/ppc: Mark helper_raise_exception* as noreturn, Richard Henderson, 2021/04/29
- [PATCH v3 07/30] target/ppc: Move DISAS_NORETURN setting into gen_exception*, Richard Henderson, 2021/04/29
- [PATCH v3 23/30] target/ppc: Add infrastructure for prefixed insns, Richard Henderson, 2021/04/29
- [PATCH v3 21/30] target/ppc: Use translator_loop_temp_check, Richard Henderson, 2021/04/29
- [PATCH v3 19/30] target/ppc: Tidy exception vs exit_tb, Richard Henderson, 2021/04/29
- [PATCH v3 24/30] target/ppc: Move page crossing check to ppc_tr_translate_insn, Richard Henderson, 2021/04/29
- [PATCH v3 28/30] target/ppc: Implement prefixed integer load instructions, Richard Henderson, 2021/04/29
- [PATCH v3 29/30] target/ppc: Move D/DS/X-form integer stores to decodetree, Richard Henderson, 2021/04/29