On 05/05/2019 15:31, Richard Henderson wrote:
> On 5/5/19 2:27 AM, Mark Cave-Ayland wrote:
>> I've spent a bit of time today going through the functions and it seems that
>> all
>> functions which have an xt parameter, minus a couple of the TEST macros,
>> require the
>> result to be calculated in a local variable first.
>>
>> I think the best solution is still to remove getVSR()/putVSR() but replace
>> them with
>> macros for copying and zeroing like this:
>>
>> #define VSRCPY(d, s) (memcpy(d, s, sizeof(ppc_vsr_t)))
>> #define VSRZERO(d) (memset(d, 0, sizeof(ppc_vsr_t)))
>
> Local variable, yes. But I see no reason for macros.
>
> ppc_vsr_t res = { };
> ...
> *xt = res;
Ah thanks for the hint - I wasn't aware that this could be done in a consistent
way
for structs across all compilers. I'll implement this in the next version of
the series.
ATB,
Mark.