qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target/mips: Fix minor bug in FPU


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] target/mips: Fix minor bug in FPU
Date: Mon, 18 Mar 2019 18:30:42 +0000

On Mon, 18 Mar 2019 at 18:26, Mateja Marjanovic
<address@hidden> wrote:
>
> From: Mateja Marjanovic <address@hidden>
>
> Wrong type of NaN was generated for IEEE754-2008 by maddf and
> msubf insturctions when the arguments were inf, zero, nan or
> zero, inf, nan respectively.
>
> Signed-off-by: Mateja Marjanovic <address@hidden>

> @@ -519,6 +519,14 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass 
> b_cls, FloatClass c_cls,
>              return 2;
>          }
>      } else {
> +        /*
> +         * For MIPS systems that conform to IEEE754-2008, the (inf,zero,qnan)
> +         * case sets InvalidOp and returns the default NaN
> +         */
> +        if (infzero) {
> +            float_raise(float_flag_invalid, status);
> +            return 2;

The comment says we return the default NaN, but the code says
we return the input NaN (ie the input value 'c'). Which is correct?

> +        }
>          /* Prefer sNaN over qNaN, in the c, a, b order. */
>          if (is_snan(c_cls)) {
>              return 2;

thanks
-- PMM



reply via email to

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