diff mbox series

[14/72] softfloat: Do not produce a default_nan from parts_silence_nan

Message ID 20210508014802.892561-15-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
Require default_nan_mode to be set instead.

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

---
 fpu/softfloat-specialize.c.inc | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
2.25.1

Comments

David Hildenbrand May 11, 2021, 10:16 a.m. UTC | #1
On 08.05.21 03:47, Richard Henderson wrote:
> Require default_nan_mode to be set instead.

> 

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

> ---

>   fpu/softfloat-specialize.c.inc | 11 +++++------

>   1 file changed, 5 insertions(+), 6 deletions(-)

> 

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

> index 487b29155c..5988830c16 100644

> --- a/fpu/softfloat-specialize.c.inc

> +++ b/fpu/softfloat-specialize.c.inc

> @@ -180,16 +180,15 @@ static FloatParts parts_default_nan(float_status *status)

>   static FloatParts parts_silence_nan(FloatParts a, float_status *status)

>   {

>       g_assert(!no_signaling_nans(status));

> -#if defined(TARGET_HPPA)

> -    a.frac &= ~(1ULL << (DECOMPOSED_BINARY_POINT - 1));

> -    a.frac |= 1ULL << (DECOMPOSED_BINARY_POINT - 2);

> -#else

> +    g_assert(!status->default_nan_mode);

> +

> +    /* The only snan_bit_is_one target without default_nan_mode is HPPA. */

>       if (snan_bit_is_one(status)) {

> -        return parts_default_nan(status);

> +        a.frac &= ~(1ULL << (DECOMPOSED_BINARY_POINT - 1));

> +        a.frac |= 1ULL << (DECOMPOSED_BINARY_POINT - 2);

>       } else {

>           a.frac |= 1ULL << (DECOMPOSED_BINARY_POINT - 1);

>       }

> -#endif

>       a.cls = float_class_qnan;

>       return a;

>   }

> 


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


-- 
Thanks,

David / dhildenb
Alex Bennée May 11, 2021, 10:32 a.m. UTC | #2
Richard Henderson <richard.henderson@linaro.org> writes:

> Require default_nan_mode to be set instead.

>

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


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



-- 
Alex Bennée
diff mbox series

Patch

diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc
index 487b29155c..5988830c16 100644
--- a/fpu/softfloat-specialize.c.inc
+++ b/fpu/softfloat-specialize.c.inc
@@ -180,16 +180,15 @@  static FloatParts parts_default_nan(float_status *status)
 static FloatParts parts_silence_nan(FloatParts a, float_status *status)
 {
     g_assert(!no_signaling_nans(status));
-#if defined(TARGET_HPPA)
-    a.frac &= ~(1ULL << (DECOMPOSED_BINARY_POINT - 1));
-    a.frac |= 1ULL << (DECOMPOSED_BINARY_POINT - 2);
-#else
+    g_assert(!status->default_nan_mode);
+
+    /* The only snan_bit_is_one target without default_nan_mode is HPPA. */
     if (snan_bit_is_one(status)) {
-        return parts_default_nan(status);
+        a.frac &= ~(1ULL << (DECOMPOSED_BINARY_POINT - 1));
+        a.frac |= 1ULL << (DECOMPOSED_BINARY_POINT - 2);
     } else {
         a.frac |= 1ULL << (DECOMPOSED_BINARY_POINT - 1);
     }
-#endif
     a.cls = float_class_qnan;
     return a;
 }