They really aren't independent libraries.
- # Determine if this is a required or an optional subproject
-
-
-
- # Determine if there is a group with the same name
-
-
-
- # Create variations of the subproject name suitable for use as a CPP
- # enabled define, a shell enabled variable, and a shell function
-
-
-
-
-
-
-
-
-
-
-
- # Add subproject to our running list
-
- subprojects="$subprojects softfloat_riscv"
-
- # Process the subproject appropriately. If enabled add it to the
- # $enabled_subprojects running shell variable, set a
- # SUBPROJECT_ENABLED C define, and include the appropriate
- # 'subproject.ac'.
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: configuring default subproject : softfloat_riscv" >&5
-$as_echo "$as_me: configuring default subproject : softfloat_riscv" >&6;}
- ac_config_files="$ac_config_files softfloat_riscv.mk:softfloat_riscv/softfloat_riscv.mk.in"
-
- enable_softfloat_riscv_sproj="yes"
- subprojects_enabled="$subprojects_enabled softfloat_riscv"
-
-$as_echo "#define SOFTFLOAT_RISCV_ENABLED /**/" >>confdefs.h
-
-
-
-
-
-
# Output make variables
"riscv.mk") CONFIG_FILES="$CONFIG_FILES riscv.mk:riscv/riscv.mk.in" ;;
"hwacha.mk") CONFIG_FILES="$CONFIG_FILES hwacha.mk:hwacha/hwacha.mk.in" ;;
"softfloat.mk") CONFIG_FILES="$CONFIG_FILES softfloat.mk:softfloat/softfloat.mk.in" ;;
- "softfloat_riscv.mk") CONFIG_FILES="$CONFIG_FILES softfloat_riscv.mk:softfloat_riscv/softfloat_riscv.mk.in" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
# The '*' suffix indicates an optional subproject. The '**' suffix
# indicates an optional subproject which is also the name of a group.
-MCPPBS_SUBPROJECTS([ riscv, hwacha, softfloat, softfloat_riscv ])
+MCPPBS_SUBPROJECTS([ riscv, hwacha, softfloat ])
#-------------------------------------------------------------------------
# MCPPBS subproject groups
get_opcode = $(shell grep ^DECLARE_INSN.*\\\<$(2)\\\> $(1) | sed 's/DECLARE_INSN(.*,\(.*\),.*)/\1/')
riscv_subproject_deps = \
- softfloat_riscv \
softfloat \
hwacha \
--- /dev/null
+
+/*============================================================================
+
+*** FIX.
+
+This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b.
+
+Written by John R. Hauser. This work was made possible in part by the
+International Computer Science Institute, located at Suite 600, 1947 Center
+Street, Berkeley, California 94704. Funding was partially provided by the
+National Science Foundation under grant MIP-9311980. The original version
+of this code was written as part of a project to build a fixed-point vector
+processor in collaboration with the University of California at Berkeley,
+overseen by Profs. Nelson Morgan and John Wawrzynek. More information
+is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
+arithmetic/SoftFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+
+=============================================================================*/
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#define LITTLEENDIAN
+
+#ifndef UINT64_C
+# define UINT64_C(x) (x ## ULL)
+# define INT64_C(x) (x ## LL)
+#endif
--- /dev/null
+\r
+#include <stdint.h>\r
+#include "platform.h"\r
+#include "specialize.h"\r
+\r
+/*----------------------------------------------------------------------------\r
+| Returns the result of converting the canonical NaN `a' to the single-\r
+| precision floating-point format.\r
+*----------------------------------------------------------------------------*/\r
+\r
+uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN a )\r
+{\r
+\r
+ return (uint_fast32_t) a.sign<<31 | 0x7FFFFFFF;\r
+\r
+}\r
+\r
--- /dev/null
+
+#include <stdint.h>
+#include "platform.h"
+#include "specialize.h"
+
+/*----------------------------------------------------------------------------
+| Returns the result of converting the canonical NaN `a' to the double-
+| precision floating-point format.
+*----------------------------------------------------------------------------*/
+
+uint_fast64_t softfloat_commonNaNToF64UI( struct commonNaN a )
+{
+
+ return
+ (uint_fast64_t) a.sign<<63 | UINT64_C( 0x7FFFFFFFFFFFFFFF );
+
+}
+
--- /dev/null
+\r
+#include <stdint.h>\r
+#include "platform.h"\r
+#include "specialize.h"\r
+#include "softfloat.h"\r
+\r
+/*----------------------------------------------------------------------------\r
+| Returns the result of converting the single-precision floating-point NaN\r
+| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid\r
+| exception is raised.\r
+*----------------------------------------------------------------------------*/\r
+struct commonNaN softfloat_f32UIToCommonNaN( uint_fast32_t uiA )\r
+{\r
+ struct commonNaN z;\r
+\r
+ if ( softfloat_isSigNaNF32UI( uiA ) ) {\r
+ softfloat_raiseFlags( softfloat_flag_invalid );\r
+ }\r
+ z.sign = uiA>>31;\r
+ z.v64 = (uint_fast64_t) 0x7FFFF <<41;\r
+ z.v0 = 0;\r
+ return z;\r
+\r
+}\r
+\r
--- /dev/null
+\r
+#include <stdint.h>\r
+#include "platform.h"\r
+#include "specialize.h"\r
+#include "softfloat.h"\r
+\r
+/*----------------------------------------------------------------------------\r
+| Returns the result of converting the double-precision floating-point NaN\r
+| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid\r
+| exception is raised.\r
+*----------------------------------------------------------------------------*/\r
+struct commonNaN softfloat_f64UIToCommonNaN( uint_fast64_t uiA )\r
+{\r
+ struct commonNaN z;\r
+\r
+ if ( softfloat_isSigNaNF64UI( uiA ) ) {\r
+ softfloat_raiseFlags( softfloat_flag_invalid );\r
+ }\r
+ z.sign = uiA>>63;\r
+ z.v64 = (uint_fast64_t) 0xFFFFFFFFFFFFF <<12;\r
+ z.v0 = 0;\r
+ return z;\r
+\r
+}\r
+\r
--- /dev/null
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "specialize.h"
+
+bool softfloat_isSigNaNF32UI( uint_fast32_t ui )
+{
+
+ return ( ( ui>>22 & 0x1FF ) == 0x1FE ) && ( ui & 0x003FFFFF );
+
+}
+
--- /dev/null
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "specialize.h"
+
+bool softfloat_isSigNaNF64UI( uint_fast64_t ui )
+{
+
+ return
+ ( ( ui>>51 & 0xFFF ) == 0xFFE )
+ && ( ui & UINT64_C( 0x0007FFFFFFFFFFFF ) );
+
+}
+
--- /dev/null
+\r
+/*** UPDATE COMMENTS. ***/\r
+\r
+#include <stdbool.h>\r
+#include <stdint.h>\r
+#include "platform.h"\r
+#include "internals.h"\r
+#include "specialize.h"\r
+#include "softfloat.h"\r
+\r
+/*----------------------------------------------------------------------------\r
+| Takes two single-precision floating-point values `a' and `b', one of which\r
+| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a\r
+| signaling NaN, the invalid exception is raised.\r
+*----------------------------------------------------------------------------*/\r
+\r
+uint_fast32_t\r
+ softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB )\r
+{\r
+ if ( softfloat_isSigNaNF32UI( uiA ) | softfloat_isSigNaNF32UI( uiB ) ) {\r
+ softfloat_raiseFlags( softfloat_flag_invalid );\r
+ }\r
+ return defaultNaNF32UI;\r
+}\r
+\r
--- /dev/null
+
+/*** UPDATE COMMENTS. ***/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "internals.h"
+#include "specialize.h"
+#include "softfloat.h"
+
+/*----------------------------------------------------------------------------
+| Takes two double-precision floating-point values `a' and `b', one of which
+| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a
+| signaling NaN, the invalid exception is raised.
+*----------------------------------------------------------------------------*/
+
+uint_fast64_t
+ softfloat_propagateNaNF64UI( uint_fast64_t uiA, uint_fast64_t uiB )
+{
+ if ( softfloat_isSigNaNF64UI( uiA ) | softfloat_isSigNaNF64UI( uiB ) ) {
+ softfloat_raiseFlags( softfloat_flag_invalid );
+ }
+ return defaultNaNF64UI;
+}
+
softfloat_subproject_deps = \
- sotfloat_riscv \
softfloat_hdrs = \
internals.h \
primitives.h \
softfloat.h \
+ softfloat_types.h \
+ platform.h \
+ specialize.h \
softfloat_c_srcs = \
f32_add.c \
ui32_to_f64.c \
ui64_to_f32.c \
ui64_to_f64.c \
+ softfloat_raiseFlags.c \
+ s_commonNaNToF32UI.c \
+ s_commonNaNToF64UI.c \
+ s_f32UIToCommonNaN.c \
+ s_f64UIToCommonNaN.c \
+ s_isSigNaNF32UI.c \
+ s_isSigNaNF64UI.c \
+ s_propagateNaNF32UI.c \
+ s_propagateNaNF64UI.c \
softfloat_test_srcs =
--- /dev/null
+
+/*============================================================================
+
+*** FIX.
+
+This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b.
+
+Written by John R. Hauser. This work was made possible in part by the
+International Computer Science Institute, located at Suite 600, 1947 Center
+Street, Berkeley, California 94704. Funding was partially provided by the
+National Science Foundation under grant MIP-9311980. The original version
+of this code was written as part of a project to build a fixed-point vector
+processor in collaboration with the University of California at Berkeley,
+overseen by Profs. Nelson Morgan and John Wawrzynek. More information
+is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
+arithmetic/SoftFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+
+=============================================================================*/
+
+#include "platform.h"
+#include "softfloat.h"
+
+/*----------------------------------------------------------------------------
+| Raises the exceptions specified by `flags'. Floating-point traps can be
+| defined here if desired. It is currently not possible for such a trap
+| to substitute a result value. If traps are not implemented, this routine
+| should be simply `float_exception_flags |= flags;'.
+*----------------------------------------------------------------------------*/
+
+void softfloat_raiseFlags( int_fast8_t flags )
+{
+
+ softfloat_exceptionFlags |= flags;
+
+}
+
--- /dev/null
+
+#ifndef softfloat_types_h
+#define softfloat_types_h
+
+/*** COMMENTS. ***/
+
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef uint32_t float32_t;
+typedef uint64_t float64_t;
+typedef struct { uint64_t v; uint16_t x; } floatx80_t;
+typedef struct { uint64_t v[ 2 ]; } float128_t;
+
+#endif
+
--- /dev/null
+\r
+/*============================================================================\r
+\r
+*** FIX.\r
+\r
+This C source fragment is part of the SoftFloat IEC/IEEE Floating-point\r
+Arithmetic Package, Release 2b.\r
+\r
+Written by John R. Hauser. This work was made possible in part by the\r
+International Computer Science Institute, located at Suite 600, 1947 Center\r
+Street, Berkeley, California 94704. Funding was partially provided by the\r
+National Science Foundation under grant MIP-9311980. The original version\r
+of this code was written as part of a project to build a fixed-point vector\r
+processor in collaboration with the University of California at Berkeley,\r
+overseen by Profs. Nelson Morgan and John Wawrzynek. More information\r
+is available through the Web page `http://www.cs.berkeley.edu/~jhauser/\r
+arithmetic/SoftFloat.html'.\r
+\r
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has\r
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES\r
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS\r
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,\r
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE\r
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE\r
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR\r
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.\r
+\r
+Derivative works are acceptable, even for commercial purposes, so long as\r
+(1) the source code for the derivative work includes prominent notice that\r
+the work is derivative, and (2) the source code includes prominent notice with\r
+these four paragraphs for those parts of this code that are retained.\r
+\r
+=============================================================================*/\r
+\r
+#include <stdbool.h>\r
+#include <stdint.h>\r
+\r
+/*----------------------------------------------------------------------------\r
+*----------------------------------------------------------------------------*/\r
+#define init_detectTininess softfloat_tininess_beforeRounding;\r
+\r
+/*----------------------------------------------------------------------------\r
+| Structure used to transfer NaN representations from one format to another.\r
+*----------------------------------------------------------------------------*/\r
+struct commonNaN {\r
+ bool sign;\r
+ uint64_t v64, v0;\r
+};\r
+\r
+/*----------------------------------------------------------------------------\r
+| The pattern for a default generated single-precision NaN.\r
+*----------------------------------------------------------------------------*/\r
+#define defaultNaNF32UI 0xFFFFFFFF\r
+\r
+/*----------------------------------------------------------------------------\r
+| Returns 1 if the single-precision floating-point value `a' is a signaling\r
+| NaN; otherwise, returns 0.\r
+*----------------------------------------------------------------------------*/\r
+#if defined INLINE_LEVEL && ( 1 <= INLINE_LEVEL )\r
+INLINE bool softfloat_isSigNaNF32UI( uint_fast32_t ui )\r
+ { return ( ( ui>>22 & 0x1FF ) == 0x1FE ) && ( ui & 0x003FFFFF ); }\r
+#else\r
+bool softfloat_isSigNaNF32UI( uint_fast32_t );\r
+#endif\r
+\r
+/*----------------------------------------------------------------------------\r
+*----------------------------------------------------------------------------*/\r
+struct commonNaN softfloat_f32UIToCommonNaN( uint_fast32_t );\r
+#if defined INLINE_LEVEL && ( 1 <= INLINE_LEVEL )\r
+INLINE uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN a )\r
+ { return (uint_fast32_t) a.sign<<31 | 0x7FFFFFFF; }\r
+#else\r
+uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN );\r
+#endif\r
+\r
+/*----------------------------------------------------------------------------\r
+| Takes two single-precision floating-point values `a' and `b', one of which\r
+| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a\r
+| signaling NaN, the invalid exception is raised.\r
+*----------------------------------------------------------------------------*/\r
+uint_fast32_t softfloat_propagateNaNF32UI( uint_fast32_t, uint_fast32_t );\r
+\r
+/*----------------------------------------------------------------------------\r
+| The pattern for a default generated double-precision NaN.\r
+*----------------------------------------------------------------------------*/\r
+#define defaultNaNF64UI UINT64_C(0xFFFFFFFFFFFFFFFF)\r
+\r
+/*----------------------------------------------------------------------------\r
+*----------------------------------------------------------------------------*/\r
+#if defined INLINE_LEVEL && ( 1 <= INLINE_LEVEL )\r
+INLINE bool softfloat_isSigNaNF64UI( uint_fast64_t ui )\r
+{\r
+ return\r
+ ( ( ui>>51 & 0xFFF ) == 0xFFE )\r
+ && ( ui & UINT64_C( 0x0007FFFFFFFFFFFF ) );\r
+}\r
+#else\r
+bool softfloat_isSigNaNF64UI( uint_fast64_t );\r
+#endif\r
+\r
+/*----------------------------------------------------------------------------\r
+*----------------------------------------------------------------------------*/\r
+/*** MIGHT BE INLINE'D. ***/\r
+struct commonNaN softfloat_f64UIToCommonNaN( uint_fast64_t );\r
+uint_fast64_t softfloat_commonNaNToF64UI( struct commonNaN );\r
+\r
+/*----------------------------------------------------------------------------\r
+| Takes two double-precision floating-point values `a' and `b', one of which\r
+| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a\r
+| signaling NaN, the invalid exception is raised.\r
+*----------------------------------------------------------------------------*/\r
+uint_fast64_t softfloat_propagateNaNF64UI( uint_fast64_t, uint_fast64_t );\r
+\r
+++ /dev/null
-
-/*============================================================================
-
-*** FIX.
-
-This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
-Arithmetic Package, Release 2b.
-
-Written by John R. Hauser. This work was made possible in part by the
-International Computer Science Institute, located at Suite 600, 1947 Center
-Street, Berkeley, California 94704. Funding was partially provided by the
-National Science Foundation under grant MIP-9311980. The original version
-of this code was written as part of a project to build a fixed-point vector
-processor in collaboration with the University of California at Berkeley,
-overseen by Profs. Nelson Morgan and John Wawrzynek. More information
-is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
-arithmetic/SoftFloat.html'.
-
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
-been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
-RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
-AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
-COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
-EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
-INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
-OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
-
-Derivative works are acceptable, even for commercial purposes, so long as
-(1) the source code for the derivative work includes prominent notice that
-the work is derivative, and (2) the source code includes prominent notice with
-these four paragraphs for those parts of this code that are retained.
-
-=============================================================================*/
-
-/*----------------------------------------------------------------------------
-*----------------------------------------------------------------------------*/
-#define LITTLEENDIAN
-
-#ifndef UINT64_C
-# define UINT64_C(x) (x ## ULL)
-# define INT64_C(x) (x ## LL)
-#endif
+++ /dev/null
-\r
-#include <stdint.h>\r
-#include "platform.h"\r
-#include "specialize.h"\r
-\r
-/*----------------------------------------------------------------------------\r
-| Returns the result of converting the canonical NaN `a' to the single-\r
-| precision floating-point format.\r
-*----------------------------------------------------------------------------*/\r
-\r
-uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN a )\r
-{\r
-\r
- return (uint_fast32_t) a.sign<<31 | 0x7FFFFFFF;\r
-\r
-}\r
-\r
+++ /dev/null
-
-#include <stdint.h>
-#include "platform.h"
-#include "specialize.h"
-
-/*----------------------------------------------------------------------------
-| Returns the result of converting the canonical NaN `a' to the double-
-| precision floating-point format.
-*----------------------------------------------------------------------------*/
-
-uint_fast64_t softfloat_commonNaNToF64UI( struct commonNaN a )
-{
-
- return
- (uint_fast64_t) a.sign<<63 | UINT64_C( 0x7FFFFFFFFFFFFFFF );
-
-}
-
+++ /dev/null
-\r
-#include <stdint.h>\r
-#include "platform.h"\r
-#include "specialize.h"\r
-#include "softfloat.h"\r
-\r
-/*----------------------------------------------------------------------------\r
-| Returns the result of converting the single-precision floating-point NaN\r
-| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid\r
-| exception is raised.\r
-*----------------------------------------------------------------------------*/\r
-struct commonNaN softfloat_f32UIToCommonNaN( uint_fast32_t uiA )\r
-{\r
- struct commonNaN z;\r
-\r
- if ( softfloat_isSigNaNF32UI( uiA ) ) {\r
- softfloat_raiseFlags( softfloat_flag_invalid );\r
- }\r
- z.sign = uiA>>31;\r
- z.v64 = (uint_fast64_t) 0x7FFFF <<41;\r
- z.v0 = 0;\r
- return z;\r
-\r
-}\r
-\r
+++ /dev/null
-\r
-#include <stdint.h>\r
-#include "platform.h"\r
-#include "specialize.h"\r
-#include "softfloat.h"\r
-\r
-/*----------------------------------------------------------------------------\r
-| Returns the result of converting the double-precision floating-point NaN\r
-| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid\r
-| exception is raised.\r
-*----------------------------------------------------------------------------*/\r
-struct commonNaN softfloat_f64UIToCommonNaN( uint_fast64_t uiA )\r
-{\r
- struct commonNaN z;\r
-\r
- if ( softfloat_isSigNaNF64UI( uiA ) ) {\r
- softfloat_raiseFlags( softfloat_flag_invalid );\r
- }\r
- z.sign = uiA>>63;\r
- z.v64 = (uint_fast64_t) 0xFFFFFFFFFFFFF <<12;\r
- z.v0 = 0;\r
- return z;\r
-\r
-}\r
-\r
+++ /dev/null
-
-#include <stdbool.h>
-#include <stdint.h>
-#include "platform.h"
-#include "specialize.h"
-
-bool softfloat_isSigNaNF32UI( uint_fast32_t ui )
-{
-
- return ( ( ui>>22 & 0x1FF ) == 0x1FE ) && ( ui & 0x003FFFFF );
-
-}
-
+++ /dev/null
-
-#include <stdbool.h>
-#include <stdint.h>
-#include "platform.h"
-#include "specialize.h"
-
-bool softfloat_isSigNaNF64UI( uint_fast64_t ui )
-{
-
- return
- ( ( ui>>51 & 0xFFF ) == 0xFFE )
- && ( ui & UINT64_C( 0x0007FFFFFFFFFFFF ) );
-
-}
-
+++ /dev/null
-\r
-/*** UPDATE COMMENTS. ***/\r
-\r
-#include <stdbool.h>\r
-#include <stdint.h>\r
-#include "platform.h"\r
-#include "internals.h"\r
-#include "specialize.h"\r
-#include "softfloat.h"\r
-\r
-/*----------------------------------------------------------------------------\r
-| Takes two single-precision floating-point values `a' and `b', one of which\r
-| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a\r
-| signaling NaN, the invalid exception is raised.\r
-*----------------------------------------------------------------------------*/\r
-\r
-uint_fast32_t\r
- softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB )\r
-{\r
- if ( softfloat_isSigNaNF32UI( uiA ) | softfloat_isSigNaNF32UI( uiB ) ) {\r
- softfloat_raiseFlags( softfloat_flag_invalid );\r
- }\r
- return defaultNaNF32UI;\r
-}\r
-\r
+++ /dev/null
-
-/*** UPDATE COMMENTS. ***/
-
-#include <stdbool.h>
-#include <stdint.h>
-#include "platform.h"
-#include "internals.h"
-#include "specialize.h"
-#include "softfloat.h"
-
-/*----------------------------------------------------------------------------
-| Takes two double-precision floating-point values `a' and `b', one of which
-| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a
-| signaling NaN, the invalid exception is raised.
-*----------------------------------------------------------------------------*/
-
-uint_fast64_t
- softfloat_propagateNaNF64UI( uint_fast64_t uiA, uint_fast64_t uiB )
-{
- if ( softfloat_isSigNaNF64UI( uiA ) | softfloat_isSigNaNF64UI( uiB ) ) {
- softfloat_raiseFlags( softfloat_flag_invalid );
- }
- return defaultNaNF64UI;
-}
-
+++ /dev/null
-
-/*============================================================================
-
-*** FIX.
-
-This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
-Arithmetic Package, Release 2b.
-
-Written by John R. Hauser. This work was made possible in part by the
-International Computer Science Institute, located at Suite 600, 1947 Center
-Street, Berkeley, California 94704. Funding was partially provided by the
-National Science Foundation under grant MIP-9311980. The original version
-of this code was written as part of a project to build a fixed-point vector
-processor in collaboration with the University of California at Berkeley,
-overseen by Profs. Nelson Morgan and John Wawrzynek. More information
-is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
-arithmetic/SoftFloat.html'.
-
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
-been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
-RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
-AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
-COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
-EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
-INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
-OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
-
-Derivative works are acceptable, even for commercial purposes, so long as
-(1) the source code for the derivative work includes prominent notice that
-the work is derivative, and (2) the source code includes prominent notice with
-these four paragraphs for those parts of this code that are retained.
-
-=============================================================================*/
-
-#include "platform.h"
-#include "softfloat.h"
-
-/*----------------------------------------------------------------------------
-| Raises the exceptions specified by `flags'. Floating-point traps can be
-| defined here if desired. It is currently not possible for such a trap
-| to substitute a result value. If traps are not implemented, this routine
-| should be simply `float_exception_flags |= flags;'.
-*----------------------------------------------------------------------------*/
-
-void softfloat_raiseFlags( int_fast8_t flags )
-{
-
- softfloat_exceptionFlags |= flags;
-
-}
-
+++ /dev/null
-softfloat_riscv_subproject_deps = \
-
-softfloat_riscv_hdrs = \
- softfloat_types.h \
- platform.h \
- specialize.h \
-
-softfloat_riscv_c_srcs = \
- softfloat_raiseFlags.c \
- s_commonNaNToF32UI.c \
- s_commonNaNToF64UI.c \
- s_f32UIToCommonNaN.c \
- s_f64UIToCommonNaN.c \
- s_isSigNaNF32UI.c \
- s_isSigNaNF64UI.c \
- s_propagateNaNF32UI.c \
- s_propagateNaNF64UI.c \
-
-softfloat_riscv_test_srcs =
-
-softfloat_riscv_install_prog_srcs =
+++ /dev/null
-
-#ifndef softfloat_types_h
-#define softfloat_types_h
-
-/*** COMMENTS. ***/
-
-#include <stdbool.h>
-#include <stdint.h>
-
-typedef uint32_t float32_t;
-typedef uint64_t float64_t;
-typedef struct { uint64_t v; uint16_t x; } floatx80_t;
-typedef struct { uint64_t v[ 2 ]; } float128_t;
-
-#endif
-
+++ /dev/null
-\r
-/*============================================================================\r
-\r
-*** FIX.\r
-\r
-This C source fragment is part of the SoftFloat IEC/IEEE Floating-point\r
-Arithmetic Package, Release 2b.\r
-\r
-Written by John R. Hauser. This work was made possible in part by the\r
-International Computer Science Institute, located at Suite 600, 1947 Center\r
-Street, Berkeley, California 94704. Funding was partially provided by the\r
-National Science Foundation under grant MIP-9311980. The original version\r
-of this code was written as part of a project to build a fixed-point vector\r
-processor in collaboration with the University of California at Berkeley,\r
-overseen by Profs. Nelson Morgan and John Wawrzynek. More information\r
-is available through the Web page `http://www.cs.berkeley.edu/~jhauser/\r
-arithmetic/SoftFloat.html'.\r
-\r
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has\r
-been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES\r
-RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS\r
-AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,\r
-COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE\r
-EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE\r
-INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR\r
-OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.\r
-\r
-Derivative works are acceptable, even for commercial purposes, so long as\r
-(1) the source code for the derivative work includes prominent notice that\r
-the work is derivative, and (2) the source code includes prominent notice with\r
-these four paragraphs for those parts of this code that are retained.\r
-\r
-=============================================================================*/\r
-\r
-#include <stdbool.h>\r
-#include <stdint.h>\r
-\r
-/*----------------------------------------------------------------------------\r
-*----------------------------------------------------------------------------*/\r
-#define init_detectTininess softfloat_tininess_beforeRounding;\r
-\r
-/*----------------------------------------------------------------------------\r
-| Structure used to transfer NaN representations from one format to another.\r
-*----------------------------------------------------------------------------*/\r
-struct commonNaN {\r
- bool sign;\r
- uint64_t v64, v0;\r
-};\r
-\r
-/*----------------------------------------------------------------------------\r
-| The pattern for a default generated single-precision NaN.\r
-*----------------------------------------------------------------------------*/\r
-#define defaultNaNF32UI 0xFFFFFFFF\r
-\r
-/*----------------------------------------------------------------------------\r
-| Returns 1 if the single-precision floating-point value `a' is a signaling\r
-| NaN; otherwise, returns 0.\r
-*----------------------------------------------------------------------------*/\r
-#if defined INLINE_LEVEL && ( 1 <= INLINE_LEVEL )\r
-INLINE bool softfloat_isSigNaNF32UI( uint_fast32_t ui )\r
- { return ( ( ui>>22 & 0x1FF ) == 0x1FE ) && ( ui & 0x003FFFFF ); }\r
-#else\r
-bool softfloat_isSigNaNF32UI( uint_fast32_t );\r
-#endif\r
-\r
-/*----------------------------------------------------------------------------\r
-*----------------------------------------------------------------------------*/\r
-struct commonNaN softfloat_f32UIToCommonNaN( uint_fast32_t );\r
-#if defined INLINE_LEVEL && ( 1 <= INLINE_LEVEL )\r
-INLINE uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN a )\r
- { return (uint_fast32_t) a.sign<<31 | 0x7FFFFFFF; }\r
-#else\r
-uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN );\r
-#endif\r
-\r
-/*----------------------------------------------------------------------------\r
-| Takes two single-precision floating-point values `a' and `b', one of which\r
-| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a\r
-| signaling NaN, the invalid exception is raised.\r
-*----------------------------------------------------------------------------*/\r
-uint_fast32_t softfloat_propagateNaNF32UI( uint_fast32_t, uint_fast32_t );\r
-\r
-/*----------------------------------------------------------------------------\r
-| The pattern for a default generated double-precision NaN.\r
-*----------------------------------------------------------------------------*/\r
-#define defaultNaNF64UI UINT64_C(0xFFFFFFFFFFFFFFFF)\r
-\r
-/*----------------------------------------------------------------------------\r
-*----------------------------------------------------------------------------*/\r
-#if defined INLINE_LEVEL && ( 1 <= INLINE_LEVEL )\r
-INLINE bool softfloat_isSigNaNF64UI( uint_fast64_t ui )\r
-{\r
- return\r
- ( ( ui>>51 & 0xFFF ) == 0xFFE )\r
- && ( ui & UINT64_C( 0x0007FFFFFFFFFFFF ) );\r
-}\r
-#else\r
-bool softfloat_isSigNaNF64UI( uint_fast64_t );\r
-#endif\r
-\r
-/*----------------------------------------------------------------------------\r
-*----------------------------------------------------------------------------*/\r
-/*** MIGHT BE INLINE'D. ***/\r
-struct commonNaN softfloat_f64UIToCommonNaN( uint_fast64_t );\r
-uint_fast64_t softfloat_commonNaNToF64UI( struct commonNaN );\r
-\r
-/*----------------------------------------------------------------------------\r
-| Takes two double-precision floating-point values `a' and `b', one of which\r
-| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a\r
-| signaling NaN, the invalid exception is raised.\r
-*----------------------------------------------------------------------------*/\r
-uint_fast64_t softfloat_propagateNaNF64UI( uint_fast64_t, uint_fast64_t );\r
-\r