[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] tcg/s390: Change FACILITY representation
From: |
David Hildenbrand |
Subject: |
Re: [PATCH 1/3] tcg/s390: Change FACILITY representation |
Date: |
Mon, 11 May 2020 11:57:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 08.05.20 17:57, Richard Henderson wrote:
> We will shortly need to be able to check facilities
> beyond the first 64. Instead of explicitly masking
> against s390_facilities, create a FACILITY macro
> that indexes an array.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> tcg/s390/tcg-target.h | 29 ++++++++-------
> tcg/s390/tcg-target.inc.c | 74 +++++++++++++++++++--------------------
> 2 files changed, 52 insertions(+), 51 deletions(-)
>
> diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h
> index 07accabbd1..7ca48457ff 100644
> --- a/tcg/s390/tcg-target.h
> +++ b/tcg/s390/tcg-target.h
> @@ -52,16 +52,19 @@ typedef enum TCGReg {
> /* A list of relevant facilities used by this translator. Some of these
> are required for proper operation, and these are checked at startup. */
>
> -#define FACILITY_ZARCH_ACTIVE (1ULL << (63 - 2))
> -#define FACILITY_LONG_DISP (1ULL << (63 - 18))
> -#define FACILITY_EXT_IMM (1ULL << (63 - 21))
> -#define FACILITY_GEN_INST_EXT (1ULL << (63 - 34))
> -#define FACILITY_LOAD_ON_COND (1ULL << (63 - 45))
> +#define FACILITY_ZARCH_ACTIVE 2
> +#define FACILITY_LONG_DISP 18
> +#define FACILITY_EXT_IMM 21
> +#define FACILITY_GEN_INST_EXT 34
> +#define FACILITY_LOAD_ON_COND 45
> #define FACILITY_FAST_BCR_SER FACILITY_LOAD_ON_COND
> #define FACILITY_DISTINCT_OPS FACILITY_LOAD_ON_COND
> -#define FACILITY_LOAD_ON_COND2 (1ULL << (63 - 53))
> +#define FACILITY_LOAD_ON_COND2 53
>
> -extern uint64_t s390_facilities;
> +extern uint64_t s390_facilities[1];
> +
> +#define FACILITY(X) \
> + ((s390_facilities[FACILITY_##X / 64] >> (63 - FACILITY_##X % 64)) & 1)
I'd have named this "HAVE_FACILITY" or similar.
Apart from that, looks good
Reviewed-by: David Hildenbrand <address@hidden>
--
Thanks,
David / dhildenb
- [PATCH 0/3] tcg/s390: Support host vector operations, Richard Henderson, 2020/05/08
- [PATCH 2/3] tcg/s390: Merge TCG_AREG0 and TCG_REG_CALL_STACK into TCGReg, Richard Henderson, 2020/05/08
- [PATCH 1/3] tcg/s390: Change FACILITY representation, Richard Henderson, 2020/05/08
- Re: [PATCH 1/3] tcg/s390: Change FACILITY representation,
David Hildenbrand <=
- [PATCH 3/3] tcg/s390: Implement vector operations, Richard Henderson, 2020/05/08
- Re: [PATCH 0/3] tcg/s390: Support host vector operations, Richard Henderson, 2020/05/08
- Re: [PATCH 0/3] tcg/s390: Support host vector operations, David Hildenbrand, 2020/05/11