[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 21/31] target/arm: Implement SVE2 integer absolute difference
From: |
Laurent Desnogues |
Subject: |
Re: [PATCH 21/31] target/arm: Implement SVE2 integer absolute difference and accumulate long |
Date: |
Tue, 14 Apr 2020 09:04:36 +0200 |
On Tue, Apr 14, 2020 at 1:19 AM Richard Henderson
<address@hidden> wrote:
>
> 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).
You're right, sorry.
Laurent