[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 68/82] target/arm: Implement SVE2 FLOGB
From: |
Peter Maydell |
Subject: |
Re: [PATCH v6 68/82] target/arm: Implement SVE2 FLOGB |
Date: |
Thu, 13 May 2021 15:18:11 +0100 |
On Fri, 30 Apr 2021 at 22:24, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> From: Stephen Long <steplong@quicinc.com>
>
> Signed-off-by: Stephen Long <steplong@quicinc.com>
> Message-Id: <20200430191405.21641-1-steplong@quicinc.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> v2: Fixed esz index and c++ comments
> v3: Fixed denormal arithmetic and raise invalid.
> +static int64_t do_float64_logb_as_int(float64 a, float_status *s)
> +{
> + if (float64_is_normal(a)) {
> + return extract64(a, 52, 11) - 1023;
> + } else if (float64_is_infinity(a)) {
> + return INT64_MAX;
> + } else if (float64_is_any_nan(a) || float64_is_zero(a)) {
> + float_raise(float_flag_invalid, s);
> + return INT64_MIN;
> + } else {
> + /* denormal (see above) */
> + return -1023 + 12 - clz64(extract64(a, 0, 52));
> + }
> +}
These don't look like they're handling denormal inputs quite right:
* should raise the input-denormal exception
* should flush-to-zero if that is enabled
thanks
-- PMM
- Re: [PATCH v6 68/82] target/arm: Implement SVE2 FLOGB,
Peter Maydell <=