On Fri, Mar 27, 2020 at 12:17 AM Richard Henderson <richard.hender...@linaro.org> wrote: [...] > diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c > index 7d7a59f620..44503626e4 100644 > --- a/target/arm/sve_helper.c > +++ b/target/arm/sve_helper.c > @@ -1131,6 +1131,36 @@ DO_ZZZ_TB(sve2_uabdl_d, uint64_t, uint32_t, DO_ABD) > > #undef DO_ZZZ_TB > > +#define DO_ZZZ_WTB(NAME, TYPE, TYPEN, OP) \ > +void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \ > +{ \ > + intptr_t i, opr_sz = simd_oprsz(desc); \ > + int sel2 = (simd_data(desc) & 1) * sizeof(TYPE); \ > + for (i = 0; i < opr_sz; i += sizeof(TYPE)) { \ > + TYPE nn = *(TYPE *)(vn + i); \ > + TYPE mm = (TYPEN)(*(TYPE *)(vm + i) >> sel2); \ > + *(TYPE *)(vd + i) = OP(nn, mm); \ > + } \ > +}
For sel2 the multiplicand should be the number of bits of TYPEN. Laurent