On Fri, 30 Apr 2021 at 21:33, Richard Henderson <richard.hender...@linaro.org> wrote: > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > target/arm/helper-sve.h | 54 ++++++++++++++++++++++++++++++++++++++ > target/arm/sve.decode | 11 ++++++++ > target/arm/sve_helper.c | 39 +++++++++++++++++++++++++++ > target/arm/translate-sve.c | 8 ++++++ > 4 files changed, 112 insertions(+) > diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c > index 7eff204c3b..3703b96eb4 100644 > --- a/target/arm/sve_helper.c > +++ b/target/arm/sve_helper.c > @@ -639,6 +639,45 @@ DO_ZPZZ(sve2_uqrshl_zpzz_h, uint16_t, H1_2, do_uqrshl_h) > DO_ZPZZ(sve2_uqrshl_zpzz_s, uint32_t, H1_4, do_uqrshl_s) > DO_ZPZZ_D(sve2_uqrshl_zpzz_d, uint64_t, do_uqrshl_d) > > +#define DO_HADD_BHS(n, m) (((int64_t)n + m) >> 1) > +#define DO_HADD_D(n, m) ((n >> 1) + (m >> 1) + (n & m & 1)) > + > +DO_ZPZZ(sve2_shadd_zpzz_b, int8_t, H1_2, DO_HADD_BHS) > +DO_ZPZZ(sve2_shadd_zpzz_h, int16_t, H1_2, DO_HADD_BHS) > +DO_ZPZZ(sve2_shadd_zpzz_s, int32_t, H1_4, DO_HADD_BHS) > +DO_ZPZZ_D(sve2_shadd_zpzz_d, int64_t, DO_HADD_D)
More dubious use of H1_2 in the _b forms. otherwise Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM