diff mbox series

[v2,03/10] softfloat: Tidy a * b + inf return

Message ID 20200925152047.709901-4-richard.henderson@linaro.org
State Superseded
Headers show
Series softfloat: Implement float128_muladd | expand

Commit Message

Richard Henderson Sept. 25, 2020, 3:20 p.m. UTC
No reason to set values in 'a', when we already
have float_class_inf in 'c', and can flip that sign.

Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 fpu/softfloat.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Alex Bennée Oct. 16, 2020, 9:40 a.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> No reason to set values in 'a', when we already

> have float_class_inf in 'c', and can flip that sign.

>

> Reviewed-by: David Hildenbrand <david@redhat.com>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


-- 
Alex Bennée
Philippe Mathieu-Daudé Oct. 16, 2020, 5:04 p.m. UTC | #2
On 9/25/20 5:20 PM, Richard Henderson wrote:
> No reason to set values in 'a', when we already

> have float_class_inf in 'c', and can flip that sign.

> 

> Reviewed-by: David Hildenbrand <david@redhat.com>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>   fpu/softfloat.c | 5 ++---

>   1 file changed, 2 insertions(+), 3 deletions(-)


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff mbox series

Patch

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 67cfa0fd82..9db55d2b11 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -1380,9 +1380,8 @@  static FloatParts muladd_floats(FloatParts a, FloatParts b, FloatParts c,
             s->float_exception_flags |= float_flag_invalid;
             return parts_default_nan(s);
         } else {
-            a.cls = float_class_inf;
-            a.sign = c.sign ^ sign_flip;
-            return a;
+            c.sign ^= sign_flip;
+            return c;
         }
     }