qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v6 15/82] target/arm: Implement SVE2 bitwise shift left long


From: Peter Maydell
Subject: Re: [PATCH v6 15/82] target/arm: Implement SVE2 bitwise shift left long
Date: Tue, 11 May 2021 13:40:44 +0100

On Fri, 30 Apr 2021 at 21:41, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/helper-sve.h    |   8 ++
>  target/arm/sve.decode      |   8 ++
>  target/arm/sve_helper.c    |  26 ++++++
>  target/arm/translate-sve.c | 159 +++++++++++++++++++++++++++++++++++++
>  4 files changed, 201 insertions(+)

> diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
> index f30f3722af..73aa670a77 100644
> --- a/target/arm/sve_helper.c
> +++ b/target/arm/sve_helper.c
> @@ -625,6 +625,8 @@ DO_ZPZZ(sve2_sqrshl_zpzz_h, int16_t, H1_2, do_sqrshl_h)
>  DO_ZPZZ(sve2_sqrshl_zpzz_s, int32_t, H1_4, do_sqrshl_s)
>  DO_ZPZZ_D(sve2_sqrshl_zpzz_d, int64_t, do_sqrshl_d)
>
> +#undef do_sqrshl_d
> +
>  #define do_uqrshl_b(n, m) \
>     ({ uint32_t discard; do_uqrshl_bhs(n, (int8_t)m, 8, true, &discard); })
>  #define do_uqrshl_h(n, m) \
> @@ -639,6 +641,8 @@ 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)
>
> +#undef 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))

These undefs look like they should be in some other patch.

> +static void gen_ushll_i64(unsigned vece, TCGv_i64 d, TCGv_i64 n, int imm)
> +{
> +    int halfbits = 4 << vece;
> +    int top = imm & 1;
> +    int shl = (imm >> 1);
> +    int shift;
> +    uint64_t mask;
> +
> +    mask = MAKE_64BIT_MASK(0, halfbits);
> +    mask <<= shl;
> +    mask = dup_const(vece, mask);
> +
> +    shift = shl - top * halfbits;
> +    if (shift < 0) {
> +        tcg_gen_shri_i64(d, n, -shift);
> +    } else {
> +        tcg_gen_shri_i64(d, n, shift);

Should these really both be right-shifts ?

> +    }
> +    tcg_gen_andi_i64(d, d, mask);
> +}

Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM



reply via email to

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