qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [Qemu-devel] [PATCH 5/8] target/ppc: introduce avr_offset


From: Mark Cave-Ayland
Subject: Re: [Qemu-ppc] [Qemu-devel] [PATCH 5/8] target/ppc: introduce avr_offset() function
Date: Tue, 5 Mar 2019 17:16:33 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 03/03/2019 23:29, Richard Henderson wrote:

> On 3/3/19 9:23 AM, Mark Cave-Ayland wrote:
>> All TCG vector operations require pointers to the base address of the vector
>> rather than separate access to the top and bottom 64-bits. Convert
>> the VMX TCG instructions to use a new avr_offset() function instead of
>> avr64_offset(), which can itself be written as a simple wrapper onto
>> vsr_full_offset().
>>
>> After the conversion is complete then avr64_offset() can be removed since its
>> functionality is now completely within get_avr64()/set_avr64().
>>
>> Signed-off-by: Mark Cave-Ayland <address@hidden>
>> ---
>>  target/ppc/cpu.h                    | 12 +++++++++++-
>>  target/ppc/translate/vmx-impl.inc.c | 27 +++++++++++----------------
>>  target/ppc/translate/vsx-impl.inc.c |  5 -----
>>  3 files changed, 22 insertions(+), 22 deletions(-)
>>
>> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
>> index 326593e0e7..89651988ab 100644
>> --- a/target/ppc/cpu.h
>> +++ b/target/ppc/cpu.h
>> @@ -2598,6 +2598,11 @@ static inline int vsrl_offset(int i)
>>      return offsetof(CPUPPCState, vsr[i].u64[1]);
>>  }
>>  
>> +static inline int vsr_full_offset(int i)
>> +{
>> +    return offsetof(CPUPPCState, vsr[i].u64[0]);
>> +}
>> +
>>  static inline uint64_t *cpu_vsrl_ptr(CPUPPCState *env, int i)
>>  {
>>      return (uint64_t *)((uintptr_t)env + vsrl_offset(i));
>> @@ -2613,9 +2618,14 @@ static inline int avrl_offset(int i)
>>      return offsetof(CPUPPCState, vsr[32 + i].VsrD(1));
>>  }
>>  
>> +static inline int avr_offset(int i)
>> +{
>> +    return vsr_full_offset(i + 32);
>> +}
> 
> avr_full_offset?

I chose avr_offset() because once you get to the end of the patchset, 
everything uses
offsets to the first byte of the register regardless of endian except for the 
avr64
functions (i.e. full becomes the new normal which seems like a fairly standard
expectation for offset).

Really though I don't feel too strongly about this, so would you like me to 
rename it
avr_full_offset() to match the existing vsr_full_offset()?



ATB,

Mark.



reply via email to

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