[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
- Re: [PATCH 40/67] target/arm: Convert CMGT, CMGE, GMLT, GMLE, CMEQ (zero) to decodetree, (continued)
- [PATCH 57/67] target/arm: Convert [US]CVTF (vector, integer) scalar to decodetree, Richard Henderson, 2024/12/01
- [PATCH 44/67] target/arm: Introduce gen_gvec_{s,u}{add,ada}lp, Richard Henderson, 2024/12/01
- [PATCH 50/67] target/arm: Convert FCVTXN to decodetree, Richard Henderson, 2024/12/01
- [PATCH 46/67] target/arm: Remove helper_neon_{add,sub}l_u{16,32}, 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 54/67] target/arm: Convert FRINT* (vector) to decodetree, Richard Henderson, 2024/12/01
- [PATCH 47/67] target/arm: Introduce clear_vec, Richard Henderson, 2024/12/01
- [PATCH 42/67] target/arm: Convert handle_rev to decodetree, Richard Henderson, 2024/12/01
- [PATCH 60/67] target/arm: Convert [US]CVTF (vector) to decodetree, Richard Henderson, 2024/12/01
- [PATCH 45/67] target/arm: Convert handle_2misc_pairwise to decodetree, Richard Henderson, 2024/12/01