[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 52/67] target/arm: Convert FABS, FNEG (vector) to decodetree
From: |
Peter Maydell |
Subject: |
Re: [PATCH 52/67] target/arm: Convert FABS, FNEG (vector) to decodetree |
Date: |
Fri, 6 Dec 2024 16:03:10 +0000 |
On Sun, 1 Dec 2024 at 15:19, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/arm/tcg/translate-a64.c | 61 ++++++++++++++++++----------------
> target/arm/tcg/a64.decode | 7 ++++
> 2 files changed, 39 insertions(+), 29 deletions(-)
>
> diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
> index 613dcdb9a2..31272c1878 100644
> --- a/target/arm/tcg/translate-a64.c
> +++ b/target/arm/tcg/translate-a64.c
> @@ -9153,6 +9153,28 @@ static bool trans_SHLL_v(DisasContext *s, arg_qrr_e *a)
> return true;
> }
>
> +static bool do_fabs_fneg_v(DisasContext *s, arg_qrr_e *a, bool neg)
> +{
> + int check = fp_access_check_vector_hsd(s, a->q, a->esz);
> + uint64_t sign;
> +
> + if (check <= 0) {
> + return check == 0;
> + }
> +
> + sign = 1ull << ((8 << a->esz) - 1);
> + if (neg) {
> + gen_gvec_fn2i(s, a->q, a->rd, a->rn, sign,
> + tcg_gen_gvec_xori, a->esz);
> + } else {
> + gen_gvec_fn2i(s, a->q, a->rd, a->rn, sign - 1,
> + tcg_gen_gvec_andi, a->esz);
> + }
> + return true;
> +}
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Annoying FEAT_AFP wrinkle: for FPCR.AH=1 we will need to make
fabs and fneg not flip the sign bit for NaNs. I guess that means
AH will need to be a tbflags bit so we can generate the nice
vector code for AH=0 and fall back to something else for AH=1.
thanks
-- PMM
- [PATCH 51/67] target/arm: Convert SHLL to decodetree, (continued)
- [PATCH 51/67] target/arm: Convert SHLL to decodetree, Richard Henderson, 2024/12/01
- [PATCH 48/67] target/arm: Convert XTN, SQXTUN, SQXTN, UQXTN to decodetree, Richard Henderson, 2024/12/01
- [PATCH 56/67] target/arm: Convert FCVT* (vector, fixed-point) scalar to decodetree, Richard Henderson, 2024/12/01
- [PATCH 66/67] target/arm: Convert URECPE and URSQRTE to decodetree, Richard Henderson, 2024/12/01
- [PATCH 42/67] target/arm: Convert handle_rev to decodetree, Richard Henderson, 2024/12/01
- [PATCH 52/67] target/arm: Convert FABS, FNEG (vector) to decodetree, Richard Henderson, 2024/12/01
- Re: [PATCH 52/67] target/arm: Convert FABS, FNEG (vector) to decodetree,
Peter Maydell <=
- [PATCH 43/67] target/arm: Move helper_neon_addlp_{s8, s16} to neon_helper.c, Richard Henderson, 2024/12/01
- [PATCH 44/67] target/arm: Introduce gen_gvec_{s,u}{add,ada}lp, Richard Henderson, 2024/12/01
- [PATCH 61/67] target/arm: Convert FCVTZ[SU] (vector, fixed-point) to decodetree, Richard Henderson, 2024/12/01
- [PATCH 65/67] target/arm: Introduce gen_gvec_urecpe, gen_gvec_ursqrte, Richard Henderson, 2024/12/01
- [PATCH 50/67] target/arm: Convert FCVTXN to decodetree, Richard Henderson, 2024/12/01
- [PATCH 53/67] target/arm: Convert FSQRT (vector) to decodetree, Richard Henderson, 2024/12/01