On 4/13/20 9:15 AM, Laurent Desnogues wrote: > On Fri, Mar 27, 2020 at 12:18 AM Richard Henderson > <richard.hender...@linaro.org> 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~