qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 21/31] target/arm: Implement SVE2 integer absolute difference


From: Richard Henderson
Subject: Re: [PATCH 21/31] target/arm: Implement SVE2 integer absolute difference and accumulate long
Date: Mon, 13 Apr 2020 16:19:39 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 4/13/20 9:15 AM, Laurent Desnogues wrote:
> On Fri, Mar 27, 2020 at 12:18 AM Richard Henderson
> <address@hidden> wrote:
> [...]
>> diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
>> index a3653007ac..a0995d95c7 100644
>> --- a/target/arm/sve_helper.c
>> +++ b/target/arm/sve_helper.c
>> @@ -1216,6 +1216,30 @@ DO_ZZZ_NTB(sve2_eoril_d, uint64_t,     , DO_EOR)
>>
>>  #undef DO_ZZZ_NTB
>>
>> +#define DO_ABAL(NAME, TYPE, TYPEN) \
>> +void HELPER(NAME)(void *vd, void *va, void *vn, void *vm, uint32_t desc) \
>> +{                                                              \
>> +    intptr_t i, opr_sz = simd_oprsz(desc);                     \
>> +    int sel1 = (simd_data(desc) & 1) * sizeof(TYPE);           \
>> +    int sel2 = (simd_data(desc) & 2) * (sizeof(TYPE) / 2);     \
>> +    for (i = 0; i < opr_sz; i += sizeof(TYPE)) {               \
>> +        TYPE nn = (TYPEN)(*(TYPE *)(vn + i) >> sel1);          \
>> +        TYPE mm = (TYPEN)(*(TYPE *)(vm + i) >> sel2);          \
>> +        TYPE aa = *(TYPE *)(va + i);                           \
>> +        *(TYPE *)(vd + i) = DO_ABD(nn, mm) + aa;               \
>> +    }                                                          \
>> +}
> 
> ABAL is either top or bottom not a mix of two.  So only sel1 is needed
> and its multiplicand should be the number of bits of TYPEN.

Yep.

> vd is both a source and a destination so a temporary should be used.

In what way am I not?  Both sources are read before the write.  The operands
are all in columns of the wide type (unlike the addp case you pointed out).


r~



reply via email to

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