qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH v3 1/2] softfloat: add APIs to handle alternative sNaN propag


From: Frank Chang
Subject: Re: [PATCH v3 1/2] softfloat: add APIs to handle alternative sNaN propagation for fmax/fmin
Date: Sat, 16 Oct 2021 16:51:04 +0800

On Sat, Oct 16, 2021 at 1:00 AM Richard Henderson <richard.henderson@linaro.org> wrote:
On 10/14/21 11:54 PM, frank.chang@sifive.com wrote:
> +        /*
> +         * In IEEE 754-2019, minNum, maxNum, minNumMag and maxNumMag
> +         * are removed and replaced with minimum, minimumNumber, maximum
> +         * and maximumNumber.
> +         * minimumNumber/maximumNumber behavior for SNaN is changed to:
> +         *   If both operands are NaNs, a QNaN is returned.
> +         *   If either operand is a SNaN,
> +         *   an invalid operation exception is signaled,
> +         *   but unless both operands are NaNs,
> +         *   the SNaN is otherwise ignored and not converted to a QNaN.
> +         */
> +        if (!(~flags & (minmax_isnum | minmax_snan_noprop))
> +            && (ab_mask & float_cmask_snan)
> +            && (ab_mask & ~float_cmask_anynan)) {
> +            float_raise(float_flag_invalid, s);
> +            return is_nan(a->cls) ? b : a;
> +        }

This part looks ok.

> +    MINMAX_1(type, maxnum_noprop, minmax_isnum | minmax_snan_noprop) \
> +    MINMAX_1(type, minnum_noprop, minmax_ismin | minmax_isnum |      \
> +                                  minmax_snan_noprop)                \

But here, you have been given names by 754-2019: minimumNumber, maximumNumber, so I think
you should use them.


Agree, that's better than *_noprop().
Will update in my next patchset.

Thanks,
Frank Chang
 

r~

reply via email to

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