qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 10/19] fpu/softfloat: re-factor add/sub


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v1 10/19] fpu/softfloat: re-factor add/sub
Date: Mon, 18 Dec 2017 14:18:47 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

On 12/11/2017 04:56 AM, Alex Bennée wrote:
> We can now add float16_add/sub and use the common decompose and
> canonicalize functions to have a single implementation for
> float16/32/64 add and sub functions.
> 
> Signed-off-by: Alex Bennée <address@hidden>

I was involved in writing this, so

Signed-off-by: Richard Henderson <address@hidden>

However,

> +/*
> + * Returns the result of adding the absolute values of the
> + * floating-point values `a' and `b'. If `subtract' is set, the sum is
> + * negated before being returned. `subtract' is ignored if the result
> + * is a NaN. The addition is performed according to the IEC/IEEE
> + * Standard for Binary Floating-Point Arithmetic.
> + */
> +
> +static decomposed_parts add_decomposed(decomposed_parts a, decomposed_parts 
> b,
> +                                       bool subtract, float_status *s)

The comment does not accurately describe what the function does, particularly
wrt subtract.

> +        if (a.cls >= float_class_qnan
> +            ||
> +            b.cls >= float_class_qnan)

Would you please fix this up throughout the patch set?
While I prefer the GNU

  (X
   || Y)

I'm also ok with

  (X ||
   Y)

but || on a line by itself is just weird.


r~



reply via email to

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