[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 04/16] target/arm: Use cpu_*_data_ra for sve_ldst_tlb_fn
From: |
Richard Henderson |
Subject: |
Re: [PATCH 04/16] target/arm: Use cpu_*_data_ra for sve_ldst_tlb_fn |
Date: |
Fri, 17 Apr 2020 19:16:20 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 4/16/20 5:19 AM, Peter Maydell wrote:
> On Wed, 11 Mar 2020 at 06:44, Richard Henderson
> <address@hidden> wrote:
>>
>> Use the "normal" memory access functions, rather than the
>> softmmu internal helper functions directly.
>>
>> Since fb901c905dc3, cpu_mem_index is now a simple extract
>> from env->hflags and not a large computation. Which means
>> that it's now more work to pass around this value than it
>> is to recompute it.
>>
>> This only adjusts the primitives, and does not clean up
>> all of the uses within sve_helper.c.
>>
>> Signed-off-by: Richard Henderson <address@hidden>
>> ---
>> target/arm/sve_helper.c | 241 ++++++++++++++++++----------------------
>> 1 file changed, 107 insertions(+), 134 deletions(-)
>
>> +#ifdef TARGET_WORDS_BIGENDIAN
>> +# define be_bswap16(x) ((uint16_t)(x))
>> +# define be_bswap32(x) ((uint32_t)(x))
>> +# define be_bswap64(x) ((uint64_t)(x))
>> +# define le_bswap16(x) bswap16(x)
>> +# define le_bswap32(x) bswap32(x)
>> +# define le_bswap64(x) bswap64(x)
>> +#else
>> +# define be_bswap16(x) bswap16(x)
>> +# define be_bswap32(x) bswap32(x)
>> +# define be_bswap64(x) bswap64(x)
>> +# define le_bswap16(x) ((uint16_t)(x))
>> +# define le_bswap32(x) ((uint32_t)(x))
>> +# define le_bswap64(x) ((uint64_t)(x))
>> +#endif
>
> Am I confused, or are these just reimplementing
> cpu_to_be16()/cpu_to_le16()/le16_to_cpu()/be16_to_cpu() etc from bswap.h ?
Those depend on HOST_WORDS_BIGENDIAN, this is TARGET_WORDS_BIGENDIAN.
> (It seems a pity to have to lose the memory subsystem handling
> endianness for us.)
It is. I have added a patch to improve the memory subsystem.
r~