[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 09/23] target/ppc: Introduce macros to check isa extension
From: |
David Gibson |
Subject: |
Re: [PATCH v5 09/23] target/ppc: Introduce macros to check isa extensions |
Date: |
Tue, 18 May 2021 10:21:53 +1000 |
On Mon, May 17, 2021 at 05:50:11PM -0300, matheus.ferst@eldorado.org.br wrote:
> From: Richard Henderson <richard.henderson@linaro.org>
>
> 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>
> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Applied to ppc-for-6.1, thanks.
> ---
> target/ppc/translate.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index ea200f9637..dc0f5fafc2 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -7750,6 +7750,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"
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- Re: [PATCH v5 04/23] target/ppc: Remove DisasContext.exception, (continued)
- [PATCH v5 05/23] target/ppc: Move single-step check to ppc_tr_tb_stop, matheus . ferst, 2021/05/17
- [PATCH v5 06/23] target/ppc: Tidy exception vs exit_tb, matheus . ferst, 2021/05/17
- [PATCH v5 07/23] target/ppc: Mark helper_raise_exception* as noreturn, matheus . ferst, 2021/05/17
- [PATCH v5 08/23] target/ppc: Use translator_loop_temp_check, matheus . ferst, 2021/05/17
- [PATCH v5 09/23] target/ppc: Introduce macros to check isa extensions, matheus . ferst, 2021/05/17
- Re: [PATCH v5 09/23] target/ppc: Introduce macros to check isa extensions,
David Gibson <=
- [PATCH v5 10/23] target/ppc: Move page crossing check to ppc_tr_translate_insn, matheus . ferst, 2021/05/17
- [PATCH v5 11/23] target/ppc: Add infrastructure for prefixed insns, matheus . ferst, 2021/05/17
- [PATCH v5 12/23] target/ppc: Move ADDI, ADDIS to decodetree, implement PADDI, matheus . ferst, 2021/05/17
- [PATCH v5 13/23] target/ppc: Implement PNOP, matheus . ferst, 2021/05/17
- [PATCH v5 14/23] TCG: add tcg_constant_tl, matheus . ferst, 2021/05/17