qemu-ppc
[Top][All Lists]
Advanced

[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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]