[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/20] target/ppc: Substitute msr_pr macro with new M_MSR_PR
From: |
Richard Henderson |
Subject: |
Re: [PATCH 03/20] target/ppc: Substitute msr_pr macro with new M_MSR_PR macro |
Date: |
Thu, 28 Apr 2022 08:33:14 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 |
On 4/28/22 07:56, Víctor Colombo wrote:
A solution I could think that might be easy is: rename PPC_BIT to
PPC_BIT_ULL (behaves like BIT_ULL but 'inverted'), and create a new
PPC_BIT macro that just inverts the bit value
#define PPC_BIT_ULL(bit) (0x8000000000000000ULL >> (bit))
#define PPC_BIT(bit) (63 - (bit))
There's also room for a big-endian set of registerfield macros.
(Don't forget s390x does the same thing, so "PPC" isn't appropriate
generically.)
Something like
#define BE_FIELD_W(reg, field, regwidth, start, length) \
FIELD(reg, field, regwidth - start - length, length)
#define BE_FIELD32(reg, field, start, length) \
BE_FIELD_(reg, field, 32, start, length)
#define BE_FIELD64(reg, field, start, length) \
BE_FIELD_(reg, field, 64, start, length)
at which point the usual FIELD_EX* and FIELD_DP* macros will work.
r~
[PATCH 04/20] target/ppc: Substitute msr_le macro with new M_MSR_LE macro, Víctor Colombo, 2022/04/22
[PATCH 05/20] target/ppc: Substitute msr_ds macro with new M_MSR_DS macro, Víctor Colombo, 2022/04/22
[PATCH 06/20] target/ppc: Substitute msr_ile macro with new M_MSR_ILE macro, Víctor Colombo, 2022/04/22
[PATCH 07/20] target/ppc: Substitute msr_ee macro with new M_MSR_EE macro, Víctor Colombo, 2022/04/22
[PATCH 08/20] target/ppc: Substitute msr_ce macro with new M_MSR_CE macro, Víctor Colombo, 2022/04/22
[PATCH 10/20] target/ppc: Substitute msr_me macro with new M_MSR_ME macro, Víctor Colombo, 2022/04/22
[PATCH 09/20] target/ppc: Substitute msr_pow macro with new M_MSR_POW macro, Víctor Colombo, 2022/04/22
[PATCH 11/20] target/ppc: Substitute msr_gs macro with new M_MSR_GS macro, Víctor Colombo, 2022/04/22