qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Stephen Long <steplong@quicinc.com>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, apazos@quicinc.com
Subject: Re: [PATCH RFC v2] target/arm: Implement SVE2 FLOGB
Date: Tue, 16 Jun 2020 12:33:14 -0700	[thread overview]
Message-ID: <7e1a5f0f-fed1-781b-7c38-7eade05e16f7@linaro.org> (raw)
In-Reply-To: <20200430191405.21641-1-steplong@quicinc.com>

On 4/30/20 12:14 PM, Stephen Long wrote:
> Signed-off-by: Stephen Long <steplong@quicinc.com>
> ---
> 
> I made the changes Richard requested. I took out the status field for
> the helper function.
> 
>  include/fpu/softfloat.h    |  5 +++
>  target/arm/helper-sve.h    |  4 +++
>  target/arm/sve.decode      |  4 +++
>  target/arm/sve_helper.c    | 63 ++++++++++++++++++++++++++++++++++++++
>  target/arm/translate-sve.c |  9 ++++++
>  5 files changed, 85 insertions(+)
> 
> diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
> index ecb8ba0114..275d138145 100644
> --- a/include/fpu/softfloat.h
> +++ b/include/fpu/softfloat.h
> @@ -260,6 +260,11 @@ static inline int float16_is_zero_or_denormal(float16 a)
>      return (float16_val(a) & 0x7c00) == 0;
>  }
>  
> +static inline bool float16_is_normal(float16 a)
> +{
> +    return (((float16_val(a) >> 10) + 1) & 0x1f) >= 2;
> +}

I split this out to its own patch.

> +static int16_t do_float16_logb_as_int(float16 a)
> +{
> +    if (float16_is_normal(a)) {
> +        return extract16(a, 10, 5) - 15;
> +    } else if (float16_is_infinity(a)) {
> +        return INT16_MAX;
> +    } else if (float16_is_any_nan(a) || float16_is_zero(a)) {
> +        return INT16_MIN;
> +    }
> +    // denormal

CODING_STYLE prohibits c++ comments.  Fixed.

> +static bool trans_FLOGB(DisasContext *s, arg_rpr_esz *a)
> +{
> +    static gen_helper_gvec_3 * const fns[] = {
> +        NULL,               gen_helper_flogb_h,
> +        gen_helper_flogb_s, gen_helper_flogb_d
> +    };
> +    return do_sve2_zpz_ool(s, a, fns[a->esz - 1]);

Incorrect subtract in the indexing.  Fixed.

Queued with the above changes.


r~


      reply	other threads:[~2020-06-16 19:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 19:14 [PATCH RFC v2] target/arm: Implement SVE2 FLOGB Stephen Long
2020-06-16 19:33 ` Richard Henderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e1a5f0f-fed1-781b-7c38-7eade05e16f7@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=apazos@quicinc.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steplong@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).