Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libkern Reduce diffs to upstream: get rid of FLOAT64...



details:   https://anonhg.NetBSD.org/src/rev/d072187a81e7
branches:  trunk
changeset: 938096:d072187a81e7
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Sep 02 04:06:43 2020 +0000

description:
Reduce diffs to upstream: get rid of FLOAT64_{,DE}MANGLE(); it's no longer
used.

diffstat:

 sys/lib/libkern/softfloat.c |  48 +++++++++++---------------------------------
 1 files changed, 12 insertions(+), 36 deletions(-)

diffs (132 lines):

diff -r 44658b56014c -r d072187a81e7 sys/lib/libkern/softfloat.c
--- a/sys/lib/libkern/softfloat.c       Wed Sep 02 03:45:54 2020 +0000
+++ b/sys/lib/libkern/softfloat.c       Wed Sep 02 04:06:43 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.c,v 1.7 2020/09/02 03:45:54 thorpej Exp $ */
+/* $NetBSD: softfloat.c,v 1.8 2020/09/02 04:06:43 thorpej Exp $ */
 
 /*
  * This version hacked for use with gcc -msoft-float by bjh21.
@@ -50,7 +50,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: softfloat.c,v 1.7 2020/09/02 03:45:54 thorpej Exp $");
+__RCSID("$NetBSD: softfloat.c,v 1.8 2020/09/02 04:06:43 thorpej Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef SOFTFLOAT_FOR_GCC
@@ -60,17 +60,6 @@
 #include "milieu.h"
 #include "softfloat.h"
 
-/*
- * Conversions between floats as stored in memory and floats as
- * SoftFloat uses them
- */
-#ifndef FLOAT64_DEMANGLE
-#define FLOAT64_DEMANGLE(a)    (a)
-#endif
-#ifndef FLOAT64_MANGLE
-#define FLOAT64_MANGLE(a)      (a)
-#endif
-
 /*----------------------------------------------------------------------------
 | Floating-point rounding mode, extended double-precision rounding precision,
 | and exception flags.
@@ -406,7 +395,7 @@
 INLINE bits64 extractFloat64Frac( float64 a )
 {
 
-    return FLOAT64_DEMANGLE(a) & LIT64( 0x000FFFFFFFFFFFFF );
+    return a & LIT64( 0x000FFFFFFFFFFFFF );
 
 }
 
@@ -417,7 +406,7 @@
 INLINE int16 extractFloat64Exp( float64 a )
 {
 
-    return ( FLOAT64_DEMANGLE(a)>>52 ) & 0x7FF;
+    return ( a>>52 ) & 0x7FF;
 
 }
 /*----------------------------------------------------------------------------
@@ -427,7 +416,7 @@
 INLINE flag extractFloat64Sign( float64 a )
 {
 
-    return FLOAT64_DEMANGLE(a)>>63;
+    return a>>63;
 
 }
 
@@ -463,8 +452,7 @@
 INLINE float64 packFloat64( flag zSign, int16 zExp, bits64 zSig )
 {
 
-    return FLOAT64_MANGLE( ( ( (bits64) zSign )<<63 ) +
-                          ( ( (bits64) zExp )<<52 ) + zSig );
+    return ( ( (bits64) zSign )<<63 ) + ( ( (bits64) zExp )<<52 ) + zSig;
 
 }
 
@@ -521,9 +509,7 @@
                   && ( (sbits64) ( zSig + roundIncrement ) < 0 ) )
            ) {
             float_raise( float_flag_overflow | float_flag_inexact );
-            return FLOAT64_MANGLE(
-               FLOAT64_DEMANGLE(packFloat64( zSign, 0x7FF, 0 )) -
-               ( roundIncrement == 0 ));
+            return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 );
         }
         if ( zExp < 0 ) {
             isTiny =
@@ -886,7 +872,6 @@
 
 }
 
-
 /*----------------------------------------------------------------------------
 | Returns the sign bit of the quadruple-precision floating-point value `a'.
 *----------------------------------------------------------------------------*/
@@ -3085,8 +3070,7 @@
         }
         return 0;
     }
-    return ( a == b ) ||
-       ( (bits64) ( ( FLOAT64_DEMANGLE(a) | FLOAT64_DEMANGLE(b) )<<1 ) == 0 );
+    return ( a == b ) || ( (bits64) ( ( a | b )<<1 ) == 0 );
 
 }
 
@@ -3109,12 +3093,8 @@
     }
     aSign = extractFloat64Sign( a );
     bSign = extractFloat64Sign( b );
-    if ( aSign != bSign )
-       return aSign ||
-           ( (bits64) ( ( FLOAT64_DEMANGLE(a) | FLOAT64_DEMANGLE(b) )<<1 ) ==
-             0 );
-    return ( a == b ) ||
-       ( aSign ^ ( FLOAT64_DEMANGLE(a) < FLOAT64_DEMANGLE(b) ) );
+    if ( aSign != bSign ) return aSign || ( (bits64) ( ( a | b )<<1 ) == 0 );
+    return ( a == b ) || ( aSign ^ ( a < b ) );
 
 }
 
@@ -3136,12 +3116,8 @@
     }
     aSign = extractFloat64Sign( a );
     bSign = extractFloat64Sign( b );
-    if ( aSign != bSign )
-       return aSign &&
-           ( (bits64) ( ( FLOAT64_DEMANGLE(a) | FLOAT64_DEMANGLE(b) )<<1 ) !=
-             0 );
-    return ( a != b ) &&
-       ( aSign ^ ( FLOAT64_DEMANGLE(a) < FLOAT64_DEMANGLE(b) ) );
+    if ( aSign != bSign ) return aSign && ( (bits64) ( ( a | b )<<1 ) != 0 );
+    return ( a != b ) && ( aSign ^ ( a < b ) );
 
 }
 



Home | Main Index | Thread Index | Old Index