diff mbox series

[11/72] softfloat: Use return_nan in float_to_float

Message ID 20210508014802.892561-12-richard.henderson@linaro.org
State Superseded
Headers show
Series Convert floatx80 and float128 to FloatParts | expand

Commit Message

Richard Henderson May 8, 2021, 1:47 a.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 fpu/softfloat.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

-- 
2.25.1

Comments

Alex Bennée May 10, 2021, 3:10 p.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

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


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


-- 
Alex Bennée
David Hildenbrand May 11, 2021, 10:10 a.m. UTC | #2
On 08.05.21 03:47, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

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

>   1 file changed, 1 insertion(+), 7 deletions(-)

> 

> diff --git a/fpu/softfloat.c b/fpu/softfloat.c

> index 64edb23793..b694e38522 100644

> --- a/fpu/softfloat.c

> +++ b/fpu/softfloat.c

> @@ -1931,13 +1931,7 @@ static FloatParts float_to_float(FloatParts a, const FloatFmt *dstf,

>               break;

>           }

>       } else if (is_nan(a.cls)) {

> -        if (is_snan(a.cls)) {

> -            float_raise(float_flag_invalid, s);

> -            a = parts_silence_nan(a, s);

> -        }

> -        if (s->default_nan_mode) {

> -            return parts_default_nan(s);

> -        }

> +        return return_nan(a, s);

>       }

>       return a;

>   }

> 


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


-- 
Thanks,

David / dhildenb
diff mbox series

Patch

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 64edb23793..b694e38522 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -1931,13 +1931,7 @@  static FloatParts float_to_float(FloatParts a, const FloatFmt *dstf,
             break;
         }
     } else if (is_nan(a.cls)) {
-        if (is_snan(a.cls)) {
-            float_raise(float_flag_invalid, s);
-            a = parts_silence_nan(a, s);
-        }
-        if (s->default_nan_mode) {
-            return parts_default_nan(s);
-        }
+        return return_nan(a, s);
     }
     return a;
 }