From cb5087cd7403acf31ac24ac4be8e019a51904895 Mon Sep 17 00:00:00 2001
From: John Hauser
John R. Hauser
@@ -29,15 +29,15 @@ The SoftFloat package is documented in the following files in the
John R. Hauser
John R. HauserPackage Overview for Berkeley SoftFloat Release 3a
+Package Overview for Berkeley SoftFloat Release 3b
-2015 October 23
+2016 July 22
diff --git a/README.md b/README.md
index 3a28440..246a6e7 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
-Package Overview for Berkeley SoftFloat Release 3a
+Package Overview for Berkeley SoftFloat Release 3b
==================================================
John R. Hauser
-
+SoftFloat.html
SoftFloat.html
Documentation for using the SoftFloat functions.
-
+SoftFloat-source.html
SoftFloat-source.html
Documentation for building SoftFloat.
-
+SoftFloat-history.html
SoftFloat-history.html
History of the major changes to SoftFloat.
-2015 October 23
+2016 July 22
Berkeley SoftFloat is a software implementation of binary floating-point
-that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat
-is distributed in the form of C source code. Building the SoftFloat sources
+that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat
+is distributed in the form of C source code. Building the SoftFloat sources
generates a library file (typically `softfloat.a` or `libsoftfloat.a`)
containing the floating-point subroutines.
@@ -16,9 +16,9 @@ containing the floating-point subroutines.
The SoftFloat package is documented in the following files in the `doc`
subdirectory:
-* [SoftFloat.html](http://www.jhauser.us/arithmetic/SoftFloat-3a/doc/SoftFloat.html) Documentation for using the SoftFloat functions.
-* [SoftFloat-source.html](http://www.jhauser.us/arithmetic/SoftFloat-3a/doc/SoftFloat-source.html) Documentation for building SoftFloat.
-* [SoftFloat-history.html](http://www.jhauser.us/arithmetic/SoftFloat-3a/doc/SoftFloat-history.html) History of the major changes to SoftFloat.
+* [SoftFloat.html](http://www.jhauser.us/arithmetic/SoftFloat-3b/doc/SoftFloat.html) Documentation for using the SoftFloat functions.
+* [SoftFloat-source.html](http://www.jhauser.us/arithmetic/SoftFloat-3b/doc/SoftFloat-source.html) Documentation for building SoftFloat.
+* [SoftFloat-history.html](http://www.jhauser.us/arithmetic/SoftFloat-3b/doc/SoftFloat-history.html) History of the major changes to SoftFloat.
Other files in the package comprise the source code for SoftFloat.
diff --git a/README.txt b/README.txt
index 0011b11..25fd181 100644
--- a/README.txt
+++ b/README.txt
@@ -1,8 +1,8 @@
-Package Overview for Berkeley SoftFloat Release 3a
+Package Overview for Berkeley SoftFloat Release 3b
John R. Hauser
-2015 October 23
+2016 July 22
Berkeley SoftFloat is a software implementation of binary floating-point
that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat
diff --git a/build/Linux-386-GCC/Makefile b/build/Linux-386-GCC/Makefile
index e21067e..a1be83e 100644
--- a/build/Linux-386-GCC/Makefile
+++ b/build/Linux-386-GCC/Makefile
@@ -2,10 +2,10 @@
#=============================================================================
#
# This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic
-# Package, Release 3a, by John R. Hauser.
+# Package, Release 3b, by John R. Hauser.
#
-# Copyright 2011, 2012, 2013, 2014 The Regents of the University of
-# California. All rights reserved.
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -34,10 +34,11 @@
#
#=============================================================================
-SOURCE_DIR = ../../source
-SPECIALIZE_TYPE = 8086
+SOURCE_DIR ?= ../../source
+SPECIALIZE_TYPE ?= 8086
-SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32
+SOFTFLOAT_OPTS ?= \
+ -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32
DELETE = rm -f
C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
@@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \
s_shiftRightJamM$(OBJ) \
s_shiftRightM$(OBJ) \
s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
s_countLeadingZeros32$(OBJ) \
s_countLeadingZeros64$(OBJ) \
s_addM$(OBJ) \
@@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \
s_subM$(OBJ) \
s_mul64To128M$(OBJ) \
s_mul128MTo256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
s_approxRecipSqrt32_1$(OBJ) \
s_remStepMBy32$(OBJ) \
OBJS_SPECIALIZE = \
softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
s_f32UIToCommonNaN$(OBJ) \
s_commonNaNToF32UI$(OBJ) \
s_propagateNaNF32UI$(OBJ) \
@@ -102,6 +109,12 @@ OBJS_OTHERS = \
s_roundPackMToUI64$(OBJ) \
s_roundPackToI32$(OBJ) \
s_roundPackMToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
s_normSubnormalF32Sig$(OBJ) \
s_roundPackToF32$(OBJ) \
s_normRoundPackToF32$(OBJ) \
@@ -130,22 +143,53 @@ OBJS_OTHERS = \
s_addF128M$(OBJ) \
s_mulAddF128M$(OBJ) \
softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
ui32_to_f32$(OBJ) \
ui32_to_f64$(OBJ) \
ui32_to_extF80M$(OBJ) \
ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
ui64_to_f32$(OBJ) \
ui64_to_f64$(OBJ) \
ui64_to_extF80M$(OBJ) \
ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
i32_to_f32$(OBJ) \
i32_to_f64$(OBJ) \
i32_to_extF80M$(OBJ) \
i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
i64_to_f32$(OBJ) \
i64_to_f64$(OBJ) \
i64_to_extF80M$(OBJ) \
i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
f32_to_ui32$(OBJ) \
f32_to_ui64$(OBJ) \
f32_to_i32$(OBJ) \
@@ -154,6 +198,7 @@ OBJS_OTHERS = \
f32_to_ui64_r_minMag$(OBJ) \
f32_to_i32_r_minMag$(OBJ) \
f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
f32_to_f64$(OBJ) \
f32_to_extF80M$(OBJ) \
f32_to_f128M$(OBJ) \
@@ -180,6 +225,7 @@ OBJS_OTHERS = \
f64_to_ui64_r_minMag$(OBJ) \
f64_to_i32_r_minMag$(OBJ) \
f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
f64_to_f32$(OBJ) \
f64_to_extF80M$(OBJ) \
f64_to_f128M$(OBJ) \
@@ -206,6 +252,7 @@ OBJS_OTHERS = \
extF80M_to_ui64_r_minMag$(OBJ) \
extF80M_to_i32_r_minMag$(OBJ) \
extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
extF80M_to_f32$(OBJ) \
extF80M_to_f64$(OBJ) \
extF80M_to_f128M$(OBJ) \
@@ -230,6 +277,7 @@ OBJS_OTHERS = \
f128M_to_ui64_r_minMag$(OBJ) \
f128M_to_i32_r_minMag$(OBJ) \
f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
f128M_to_f32$(OBJ) \
f128M_to_f64$(OBJ) \
f128M_to_extF80M$(OBJ) \
diff --git a/build/Linux-386-GCC/platform.h b/build/Linux-386-GCC/platform.h
index b3e4720..fadcc25 100644
--- a/build/Linux-386-GCC/platform.h
+++ b/build/Linux-386-GCC/platform.h
@@ -2,10 +2,10 @@
/*============================================================================
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3b, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
+#ifdef __GNUC_STDC_INLINE__
+#define INLINE inline
+#else
#define INLINE extern inline
+#endif
diff --git a/build/Linux-386-SSE2-GCC/Makefile b/build/Linux-386-SSE2-GCC/Makefile
index b0435c5..0b9a0aa 100644
--- a/build/Linux-386-SSE2-GCC/Makefile
+++ b/build/Linux-386-SSE2-GCC/Makefile
@@ -2,10 +2,10 @@
#=============================================================================
#
# This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic
-# Package, Release 3a, by John R. Hauser.
+# Package, Release 3b, by John R. Hauser.
#
-# Copyright 2011, 2012, 2013, 2014 The Regents of the University of
-# California. All rights reserved.
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -34,10 +34,11 @@
#
#=============================================================================
-SOURCE_DIR = ../../source
-SPECIALIZE_TYPE = 8086-SSE
+SOURCE_DIR ?= ../../source
+SPECIALIZE_TYPE ?= 8086-SSE
-SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32
+SOFTFLOAT_OPTS ?= \
+ -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32
DELETE = rm -f
C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
@@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \
s_shiftRightJamM$(OBJ) \
s_shiftRightM$(OBJ) \
s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
s_countLeadingZeros32$(OBJ) \
s_countLeadingZeros64$(OBJ) \
s_addM$(OBJ) \
@@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \
s_subM$(OBJ) \
s_mul64To128M$(OBJ) \
s_mul128MTo256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
s_approxRecipSqrt32_1$(OBJ) \
s_remStepMBy32$(OBJ) \
OBJS_SPECIALIZE = \
softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
s_f32UIToCommonNaN$(OBJ) \
s_commonNaNToF32UI$(OBJ) \
s_propagateNaNF32UI$(OBJ) \
@@ -102,6 +109,12 @@ OBJS_OTHERS = \
s_roundPackMToUI64$(OBJ) \
s_roundPackToI32$(OBJ) \
s_roundPackMToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
s_normSubnormalF32Sig$(OBJ) \
s_roundPackToF32$(OBJ) \
s_normRoundPackToF32$(OBJ) \
@@ -130,22 +143,53 @@ OBJS_OTHERS = \
s_addF128M$(OBJ) \
s_mulAddF128M$(OBJ) \
softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
ui32_to_f32$(OBJ) \
ui32_to_f64$(OBJ) \
ui32_to_extF80M$(OBJ) \
ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
ui64_to_f32$(OBJ) \
ui64_to_f64$(OBJ) \
ui64_to_extF80M$(OBJ) \
ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
i32_to_f32$(OBJ) \
i32_to_f64$(OBJ) \
i32_to_extF80M$(OBJ) \
i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
i64_to_f32$(OBJ) \
i64_to_f64$(OBJ) \
i64_to_extF80M$(OBJ) \
i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
f32_to_ui32$(OBJ) \
f32_to_ui64$(OBJ) \
f32_to_i32$(OBJ) \
@@ -154,6 +198,7 @@ OBJS_OTHERS = \
f32_to_ui64_r_minMag$(OBJ) \
f32_to_i32_r_minMag$(OBJ) \
f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
f32_to_f64$(OBJ) \
f32_to_extF80M$(OBJ) \
f32_to_f128M$(OBJ) \
@@ -180,6 +225,7 @@ OBJS_OTHERS = \
f64_to_ui64_r_minMag$(OBJ) \
f64_to_i32_r_minMag$(OBJ) \
f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
f64_to_f32$(OBJ) \
f64_to_extF80M$(OBJ) \
f64_to_f128M$(OBJ) \
@@ -206,6 +252,7 @@ OBJS_OTHERS = \
extF80M_to_ui64_r_minMag$(OBJ) \
extF80M_to_i32_r_minMag$(OBJ) \
extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
extF80M_to_f32$(OBJ) \
extF80M_to_f64$(OBJ) \
extF80M_to_f128M$(OBJ) \
@@ -230,6 +277,7 @@ OBJS_OTHERS = \
f128M_to_ui64_r_minMag$(OBJ) \
f128M_to_i32_r_minMag$(OBJ) \
f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
f128M_to_f32$(OBJ) \
f128M_to_f64$(OBJ) \
f128M_to_extF80M$(OBJ) \
diff --git a/build/Linux-386-SSE2-GCC/platform.h b/build/Linux-386-SSE2-GCC/platform.h
index b3e4720..fadcc25 100644
--- a/build/Linux-386-SSE2-GCC/platform.h
+++ b/build/Linux-386-SSE2-GCC/platform.h
@@ -2,10 +2,10 @@
/*============================================================================
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3b, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
+#ifdef __GNUC_STDC_INLINE__
+#define INLINE inline
+#else
#define INLINE extern inline
+#endif
diff --git a/build/Linux-x86_64-GCC/Makefile b/build/Linux-x86_64-GCC/Makefile
index 9996139..9c9fd7b 100644
--- a/build/Linux-x86_64-GCC/Makefile
+++ b/build/Linux-x86_64-GCC/Makefile
@@ -2,10 +2,10 @@
#=============================================================================
#
# This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic
-# Package, Release 3a, by John R. Hauser.
+# Package, Release 3b, by John R. Hauser.
#
-# Copyright 2011, 2012, 2013, 2014 The Regents of the University of
-# California. All rights reserved.
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -34,10 +34,11 @@
#
#=============================================================================
-SOURCE_DIR = ../../source
-SPECIALIZE_TYPE = 8086-SSE
+SOURCE_DIR ?= ../../source
+SPECIALIZE_TYPE ?= 8086-SSE
-SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32
+SOFTFLOAT_OPTS ?= \
+ -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32
DELETE = rm -f
C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
@@ -69,6 +70,7 @@ OBJS_PRIMITIVES = \
s_shiftRightJam128Extra$(OBJ) \
s_shiftRightJam256M$(OBJ) \
s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
s_countLeadingZeros32$(OBJ) \
s_countLeadingZeros64$(OBJ) \
s_add128$(OBJ) \
@@ -79,11 +81,16 @@ OBJS_PRIMITIVES = \
s_mul64To128$(OBJ) \
s_mul128By32$(OBJ) \
s_mul128To256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
s_approxRecipSqrt32_1$(OBJ) \
OBJS_SPECIALIZE = \
softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
s_f32UIToCommonNaN$(OBJ) \
s_commonNaNToF32UI$(OBJ) \
s_propagateNaNF32UI$(OBJ) \
@@ -104,6 +111,12 @@ OBJS_OTHERS = \
s_roundPackToUI64$(OBJ) \
s_roundPackToI32$(OBJ) \
s_roundPackToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
s_normSubnormalF32Sig$(OBJ) \
s_roundPackToF32$(OBJ) \
s_normRoundPackToF32$(OBJ) \
@@ -128,30 +141,63 @@ OBJS_OTHERS = \
s_subMagsF128$(OBJ) \
s_mulAddF128$(OBJ) \
softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
ui32_to_f32$(OBJ) \
ui32_to_f64$(OBJ) \
ui32_to_extF80$(OBJ) \
ui32_to_extF80M$(OBJ) \
ui32_to_f128$(OBJ) \
ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
ui64_to_f32$(OBJ) \
ui64_to_f64$(OBJ) \
ui64_to_extF80$(OBJ) \
ui64_to_extF80M$(OBJ) \
ui64_to_f128$(OBJ) \
ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
i32_to_f32$(OBJ) \
i32_to_f64$(OBJ) \
i32_to_extF80$(OBJ) \
i32_to_extF80M$(OBJ) \
i32_to_f128$(OBJ) \
i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
i64_to_f32$(OBJ) \
i64_to_f64$(OBJ) \
i64_to_extF80$(OBJ) \
i64_to_extF80M$(OBJ) \
i64_to_f128$(OBJ) \
i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
f32_to_ui32$(OBJ) \
f32_to_ui64$(OBJ) \
f32_to_i32$(OBJ) \
@@ -160,6 +206,7 @@ OBJS_OTHERS = \
f32_to_ui64_r_minMag$(OBJ) \
f32_to_i32_r_minMag$(OBJ) \
f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
f32_to_f64$(OBJ) \
f32_to_extF80$(OBJ) \
f32_to_extF80M$(OBJ) \
@@ -188,6 +235,7 @@ OBJS_OTHERS = \
f64_to_ui64_r_minMag$(OBJ) \
f64_to_i32_r_minMag$(OBJ) \
f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
f64_to_f32$(OBJ) \
f64_to_extF80$(OBJ) \
f64_to_extF80M$(OBJ) \
@@ -216,6 +264,7 @@ OBJS_OTHERS = \
extF80_to_ui64_r_minMag$(OBJ) \
extF80_to_i32_r_minMag$(OBJ) \
extF80_to_i64_r_minMag$(OBJ) \
+ extF80_to_f16$(OBJ) \
extF80_to_f32$(OBJ) \
extF80_to_f64$(OBJ) \
extF80_to_f128$(OBJ) \
@@ -241,6 +290,7 @@ OBJS_OTHERS = \
extF80M_to_ui64_r_minMag$(OBJ) \
extF80M_to_i32_r_minMag$(OBJ) \
extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
extF80M_to_f32$(OBJ) \
extF80M_to_f64$(OBJ) \
extF80M_to_f128M$(OBJ) \
@@ -265,6 +315,7 @@ OBJS_OTHERS = \
f128_to_ui64_r_minMag$(OBJ) \
f128_to_i32_r_minMag$(OBJ) \
f128_to_i64_r_minMag$(OBJ) \
+ f128_to_f16$(OBJ) \
f128_to_f32$(OBJ) \
f128_to_extF80$(OBJ) \
f128_to_f64$(OBJ) \
@@ -291,6 +342,7 @@ OBJS_OTHERS = \
f128M_to_ui64_r_minMag$(OBJ) \
f128M_to_i32_r_minMag$(OBJ) \
f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
f128M_to_f32$(OBJ) \
f128M_to_extF80M$(OBJ) \
f128M_to_f64$(OBJ) \
diff --git a/build/Linux-x86_64-GCC/platform.h b/build/Linux-x86_64-GCC/platform.h
index b3e4720..fadcc25 100644
--- a/build/Linux-x86_64-GCC/platform.h
+++ b/build/Linux-x86_64-GCC/platform.h
@@ -2,10 +2,10 @@
/*============================================================================
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3b, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
+#ifdef __GNUC_STDC_INLINE__
+#define INLINE inline
+#else
#define INLINE extern inline
+#endif
diff --git a/build/Win32-MinGW/Makefile b/build/Win32-MinGW/Makefile
index e21067e..a1be83e 100644
--- a/build/Win32-MinGW/Makefile
+++ b/build/Win32-MinGW/Makefile
@@ -2,10 +2,10 @@
#=============================================================================
#
# This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic
-# Package, Release 3a, by John R. Hauser.
+# Package, Release 3b, by John R. Hauser.
#
-# Copyright 2011, 2012, 2013, 2014 The Regents of the University of
-# California. All rights reserved.
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -34,10 +34,11 @@
#
#=============================================================================
-SOURCE_DIR = ../../source
-SPECIALIZE_TYPE = 8086
+SOURCE_DIR ?= ../../source
+SPECIALIZE_TYPE ?= 8086
-SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32
+SOFTFLOAT_OPTS ?= \
+ -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32
DELETE = rm -f
C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
@@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \
s_shiftRightJamM$(OBJ) \
s_shiftRightM$(OBJ) \
s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
s_countLeadingZeros32$(OBJ) \
s_countLeadingZeros64$(OBJ) \
s_addM$(OBJ) \
@@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \
s_subM$(OBJ) \
s_mul64To128M$(OBJ) \
s_mul128MTo256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
s_approxRecipSqrt32_1$(OBJ) \
s_remStepMBy32$(OBJ) \
OBJS_SPECIALIZE = \
softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
s_f32UIToCommonNaN$(OBJ) \
s_commonNaNToF32UI$(OBJ) \
s_propagateNaNF32UI$(OBJ) \
@@ -102,6 +109,12 @@ OBJS_OTHERS = \
s_roundPackMToUI64$(OBJ) \
s_roundPackToI32$(OBJ) \
s_roundPackMToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
s_normSubnormalF32Sig$(OBJ) \
s_roundPackToF32$(OBJ) \
s_normRoundPackToF32$(OBJ) \
@@ -130,22 +143,53 @@ OBJS_OTHERS = \
s_addF128M$(OBJ) \
s_mulAddF128M$(OBJ) \
softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
ui32_to_f32$(OBJ) \
ui32_to_f64$(OBJ) \
ui32_to_extF80M$(OBJ) \
ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
ui64_to_f32$(OBJ) \
ui64_to_f64$(OBJ) \
ui64_to_extF80M$(OBJ) \
ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
i32_to_f32$(OBJ) \
i32_to_f64$(OBJ) \
i32_to_extF80M$(OBJ) \
i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
i64_to_f32$(OBJ) \
i64_to_f64$(OBJ) \
i64_to_extF80M$(OBJ) \
i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
f32_to_ui32$(OBJ) \
f32_to_ui64$(OBJ) \
f32_to_i32$(OBJ) \
@@ -154,6 +198,7 @@ OBJS_OTHERS = \
f32_to_ui64_r_minMag$(OBJ) \
f32_to_i32_r_minMag$(OBJ) \
f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
f32_to_f64$(OBJ) \
f32_to_extF80M$(OBJ) \
f32_to_f128M$(OBJ) \
@@ -180,6 +225,7 @@ OBJS_OTHERS = \
f64_to_ui64_r_minMag$(OBJ) \
f64_to_i32_r_minMag$(OBJ) \
f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
f64_to_f32$(OBJ) \
f64_to_extF80M$(OBJ) \
f64_to_f128M$(OBJ) \
@@ -206,6 +252,7 @@ OBJS_OTHERS = \
extF80M_to_ui64_r_minMag$(OBJ) \
extF80M_to_i32_r_minMag$(OBJ) \
extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
extF80M_to_f32$(OBJ) \
extF80M_to_f64$(OBJ) \
extF80M_to_f128M$(OBJ) \
@@ -230,6 +277,7 @@ OBJS_OTHERS = \
f128M_to_ui64_r_minMag$(OBJ) \
f128M_to_i32_r_minMag$(OBJ) \
f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
f128M_to_f32$(OBJ) \
f128M_to_f64$(OBJ) \
f128M_to_extF80M$(OBJ) \
diff --git a/build/Win32-MinGW/platform.h b/build/Win32-MinGW/platform.h
index b3e4720..fadcc25 100644
--- a/build/Win32-MinGW/platform.h
+++ b/build/Win32-MinGW/platform.h
@@ -2,10 +2,10 @@
/*============================================================================
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3b, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
+#ifdef __GNUC_STDC_INLINE__
+#define INLINE inline
+#else
#define INLINE extern inline
+#endif
diff --git a/build/Win32-SSE2-MinGW/Makefile b/build/Win32-SSE2-MinGW/Makefile
index b0435c5..0b9a0aa 100644
--- a/build/Win32-SSE2-MinGW/Makefile
+++ b/build/Win32-SSE2-MinGW/Makefile
@@ -2,10 +2,10 @@
#=============================================================================
#
# This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic
-# Package, Release 3a, by John R. Hauser.
+# Package, Release 3b, by John R. Hauser.
#
-# Copyright 2011, 2012, 2013, 2014 The Regents of the University of
-# California. All rights reserved.
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -34,10 +34,11 @@
#
#=============================================================================
-SOURCE_DIR = ../../source
-SPECIALIZE_TYPE = 8086-SSE
+SOURCE_DIR ?= ../../source
+SPECIALIZE_TYPE ?= 8086-SSE
-SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32
+SOFTFLOAT_OPTS ?= \
+ -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32
DELETE = rm -f
C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
@@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \
s_shiftRightJamM$(OBJ) \
s_shiftRightM$(OBJ) \
s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
s_countLeadingZeros32$(OBJ) \
s_countLeadingZeros64$(OBJ) \
s_addM$(OBJ) \
@@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \
s_subM$(OBJ) \
s_mul64To128M$(OBJ) \
s_mul128MTo256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
s_approxRecipSqrt32_1$(OBJ) \
s_remStepMBy32$(OBJ) \
OBJS_SPECIALIZE = \
softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
s_f32UIToCommonNaN$(OBJ) \
s_commonNaNToF32UI$(OBJ) \
s_propagateNaNF32UI$(OBJ) \
@@ -102,6 +109,12 @@ OBJS_OTHERS = \
s_roundPackMToUI64$(OBJ) \
s_roundPackToI32$(OBJ) \
s_roundPackMToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
s_normSubnormalF32Sig$(OBJ) \
s_roundPackToF32$(OBJ) \
s_normRoundPackToF32$(OBJ) \
@@ -130,22 +143,53 @@ OBJS_OTHERS = \
s_addF128M$(OBJ) \
s_mulAddF128M$(OBJ) \
softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
ui32_to_f32$(OBJ) \
ui32_to_f64$(OBJ) \
ui32_to_extF80M$(OBJ) \
ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
ui64_to_f32$(OBJ) \
ui64_to_f64$(OBJ) \
ui64_to_extF80M$(OBJ) \
ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
i32_to_f32$(OBJ) \
i32_to_f64$(OBJ) \
i32_to_extF80M$(OBJ) \
i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
i64_to_f32$(OBJ) \
i64_to_f64$(OBJ) \
i64_to_extF80M$(OBJ) \
i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
f32_to_ui32$(OBJ) \
f32_to_ui64$(OBJ) \
f32_to_i32$(OBJ) \
@@ -154,6 +198,7 @@ OBJS_OTHERS = \
f32_to_ui64_r_minMag$(OBJ) \
f32_to_i32_r_minMag$(OBJ) \
f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
f32_to_f64$(OBJ) \
f32_to_extF80M$(OBJ) \
f32_to_f128M$(OBJ) \
@@ -180,6 +225,7 @@ OBJS_OTHERS = \
f64_to_ui64_r_minMag$(OBJ) \
f64_to_i32_r_minMag$(OBJ) \
f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
f64_to_f32$(OBJ) \
f64_to_extF80M$(OBJ) \
f64_to_f128M$(OBJ) \
@@ -206,6 +252,7 @@ OBJS_OTHERS = \
extF80M_to_ui64_r_minMag$(OBJ) \
extF80M_to_i32_r_minMag$(OBJ) \
extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
extF80M_to_f32$(OBJ) \
extF80M_to_f64$(OBJ) \
extF80M_to_f128M$(OBJ) \
@@ -230,6 +277,7 @@ OBJS_OTHERS = \
f128M_to_ui64_r_minMag$(OBJ) \
f128M_to_i32_r_minMag$(OBJ) \
f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
f128M_to_f32$(OBJ) \
f128M_to_f64$(OBJ) \
f128M_to_extF80M$(OBJ) \
diff --git a/build/Win32-SSE2-MinGW/platform.h b/build/Win32-SSE2-MinGW/platform.h
index b3e4720..fadcc25 100644
--- a/build/Win32-SSE2-MinGW/platform.h
+++ b/build/Win32-SSE2-MinGW/platform.h
@@ -2,10 +2,10 @@
/*============================================================================
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3b, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
+#ifdef __GNUC_STDC_INLINE__
+#define INLINE inline
+#else
#define INLINE extern inline
+#endif
diff --git a/build/Win64-MinGW-w64/Makefile b/build/Win64-MinGW-w64/Makefile
index 1ca74af..145c03f 100644
--- a/build/Win64-MinGW-w64/Makefile
+++ b/build/Win64-MinGW-w64/Makefile
@@ -2,10 +2,10 @@
#=============================================================================
#
# This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic
-# Package, Release 3a, by John R. Hauser.
+# Package, Release 3b, by John R. Hauser.
#
-# Copyright 2011, 2012, 2013, 2014 The Regents of the University of
-# California. All rights reserved.
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -34,10 +34,11 @@
#
#=============================================================================
-SOURCE_DIR = ../../source
-SPECIALIZE_TYPE = 8086-SSE
+SOURCE_DIR ?= ../../source
+SPECIALIZE_TYPE ?= 8086-SSE
-SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32
+SOFTFLOAT_OPTS ?= \
+ -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32
DELETE = rm -f
C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
@@ -69,6 +70,7 @@ OBJS_PRIMITIVES = \
s_shiftRightJam128Extra$(OBJ) \
s_shiftRightJam256M$(OBJ) \
s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
s_countLeadingZeros32$(OBJ) \
s_countLeadingZeros64$(OBJ) \
s_add128$(OBJ) \
@@ -79,11 +81,16 @@ OBJS_PRIMITIVES = \
s_mul64To128$(OBJ) \
s_mul128By32$(OBJ) \
s_mul128To256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
s_approxRecipSqrt32_1$(OBJ) \
OBJS_SPECIALIZE = \
softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
s_f32UIToCommonNaN$(OBJ) \
s_commonNaNToF32UI$(OBJ) \
s_propagateNaNF32UI$(OBJ) \
@@ -104,6 +111,12 @@ OBJS_OTHERS = \
s_roundPackToUI64$(OBJ) \
s_roundPackToI32$(OBJ) \
s_roundPackToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
s_normSubnormalF32Sig$(OBJ) \
s_roundPackToF32$(OBJ) \
s_normRoundPackToF32$(OBJ) \
@@ -128,30 +141,63 @@ OBJS_OTHERS = \
s_subMagsF128$(OBJ) \
s_mulAddF128$(OBJ) \
softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
ui32_to_f32$(OBJ) \
ui32_to_f64$(OBJ) \
ui32_to_extF80$(OBJ) \
ui32_to_extF80M$(OBJ) \
ui32_to_f128$(OBJ) \
ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
ui64_to_f32$(OBJ) \
ui64_to_f64$(OBJ) \
ui64_to_extF80$(OBJ) \
ui64_to_extF80M$(OBJ) \
ui64_to_f128$(OBJ) \
ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
i32_to_f32$(OBJ) \
i32_to_f64$(OBJ) \
i32_to_extF80$(OBJ) \
i32_to_extF80M$(OBJ) \
i32_to_f128$(OBJ) \
i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
i64_to_f32$(OBJ) \
i64_to_f64$(OBJ) \
i64_to_extF80$(OBJ) \
i64_to_extF80M$(OBJ) \
i64_to_f128$(OBJ) \
i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
f32_to_ui32$(OBJ) \
f32_to_ui64$(OBJ) \
f32_to_i32$(OBJ) \
@@ -160,6 +206,7 @@ OBJS_OTHERS = \
f32_to_ui64_r_minMag$(OBJ) \
f32_to_i32_r_minMag$(OBJ) \
f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
f32_to_f64$(OBJ) \
f32_to_extF80$(OBJ) \
f32_to_extF80M$(OBJ) \
@@ -188,6 +235,7 @@ OBJS_OTHERS = \
f64_to_ui64_r_minMag$(OBJ) \
f64_to_i32_r_minMag$(OBJ) \
f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
f64_to_f32$(OBJ) \
f64_to_extF80$(OBJ) \
f64_to_extF80M$(OBJ) \
@@ -216,6 +264,7 @@ OBJS_OTHERS = \
extF80_to_ui64_r_minMag$(OBJ) \
extF80_to_i32_r_minMag$(OBJ) \
extF80_to_i64_r_minMag$(OBJ) \
+ extF80_to_f16$(OBJ) \
extF80_to_f32$(OBJ) \
extF80_to_f64$(OBJ) \
extF80_to_f128$(OBJ) \
@@ -241,6 +290,7 @@ OBJS_OTHERS = \
extF80M_to_ui64_r_minMag$(OBJ) \
extF80M_to_i32_r_minMag$(OBJ) \
extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
extF80M_to_f32$(OBJ) \
extF80M_to_f64$(OBJ) \
extF80M_to_f128M$(OBJ) \
@@ -265,6 +315,7 @@ OBJS_OTHERS = \
f128_to_ui64_r_minMag$(OBJ) \
f128_to_i32_r_minMag$(OBJ) \
f128_to_i64_r_minMag$(OBJ) \
+ f128_to_f16$(OBJ) \
f128_to_f32$(OBJ) \
f128_to_extF80$(OBJ) \
f128_to_f64$(OBJ) \
@@ -291,6 +342,7 @@ OBJS_OTHERS = \
f128M_to_ui64_r_minMag$(OBJ) \
f128M_to_i32_r_minMag$(OBJ) \
f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
f128M_to_f32$(OBJ) \
f128M_to_extF80M$(OBJ) \
f128M_to_f64$(OBJ) \
diff --git a/build/Win64-MinGW-w64/platform.h b/build/Win64-MinGW-w64/platform.h
index b3e4720..fadcc25 100644
--- a/build/Win64-MinGW-w64/platform.h
+++ b/build/Win64-MinGW-w64/platform.h
@@ -2,10 +2,10 @@
/*============================================================================
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3b, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
+#ifdef __GNUC_STDC_INLINE__
+#define INLINE inline
+#else
#define INLINE extern inline
+#endif
diff --git a/build/template-FAST_INT64/Makefile b/build/template-FAST_INT64/Makefile
index 0f836f9..34673a3 100644
--- a/build/template-FAST_INT64/Makefile
+++ b/build/template-FAST_INT64/Makefile
@@ -2,10 +2,10 @@
#=============================================================================
#
# This Makefile template is part of the SoftFloat IEEE Floating-Point
-# Arithmetic Package, Release 3a, by John R. Hauser.
+# Arithmetic Package, Release 3b, by John R. Hauser.
#
-# Copyright 2011, 2012, 2013, 2014 The Regents of the University of
-# California. All rights reserved.
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -36,10 +36,11 @@
# Edit lines marked with `==>'. See "SoftFloat-source.html".
-==> SOURCE_DIR = ../../source
-==> SPECIALIZE_TYPE = 8086
+==> SOURCE_DIR ?= ../../source
+==> SPECIALIZE_TYPE ?= 8086
-==> SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32
+==> SOFTFLOAT_OPTS ?= \
+==> -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32
==> DELETE = rm -f
==> C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
@@ -70,6 +71,7 @@ OBJS_PRIMITIVES = \
s_shiftRightJam128Extra$(OBJ) \
s_shiftRightJam256M$(OBJ) \
s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
s_countLeadingZeros32$(OBJ) \
s_countLeadingZeros64$(OBJ) \
s_add128$(OBJ) \
@@ -80,11 +82,16 @@ OBJS_PRIMITIVES = \
s_mul64To128$(OBJ) \
s_mul128By32$(OBJ) \
s_mul128To256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
s_approxRecipSqrt32_1$(OBJ) \
OBJS_SPECIALIZE = \
softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
s_f32UIToCommonNaN$(OBJ) \
s_commonNaNToF32UI$(OBJ) \
s_propagateNaNF32UI$(OBJ) \
@@ -105,6 +112,12 @@ OBJS_OTHERS = \
s_roundPackToUI64$(OBJ) \
s_roundPackToI32$(OBJ) \
s_roundPackToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
s_normSubnormalF32Sig$(OBJ) \
s_roundPackToF32$(OBJ) \
s_normRoundPackToF32$(OBJ) \
@@ -129,30 +142,63 @@ OBJS_OTHERS = \
s_subMagsF128$(OBJ) \
s_mulAddF128$(OBJ) \
softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
ui32_to_f32$(OBJ) \
ui32_to_f64$(OBJ) \
ui32_to_extF80$(OBJ) \
ui32_to_extF80M$(OBJ) \
ui32_to_f128$(OBJ) \
ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
ui64_to_f32$(OBJ) \
ui64_to_f64$(OBJ) \
ui64_to_extF80$(OBJ) \
ui64_to_extF80M$(OBJ) \
ui64_to_f128$(OBJ) \
ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
i32_to_f32$(OBJ) \
i32_to_f64$(OBJ) \
i32_to_extF80$(OBJ) \
i32_to_extF80M$(OBJ) \
i32_to_f128$(OBJ) \
i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
i64_to_f32$(OBJ) \
i64_to_f64$(OBJ) \
i64_to_extF80$(OBJ) \
i64_to_extF80M$(OBJ) \
i64_to_f128$(OBJ) \
i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
f32_to_ui32$(OBJ) \
f32_to_ui64$(OBJ) \
f32_to_i32$(OBJ) \
@@ -161,6 +207,7 @@ OBJS_OTHERS = \
f32_to_ui64_r_minMag$(OBJ) \
f32_to_i32_r_minMag$(OBJ) \
f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
f32_to_f64$(OBJ) \
f32_to_extF80$(OBJ) \
f32_to_extF80M$(OBJ) \
@@ -189,6 +236,7 @@ OBJS_OTHERS = \
f64_to_ui64_r_minMag$(OBJ) \
f64_to_i32_r_minMag$(OBJ) \
f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
f64_to_f32$(OBJ) \
f64_to_extF80$(OBJ) \
f64_to_extF80M$(OBJ) \
@@ -217,6 +265,7 @@ OBJS_OTHERS = \
extF80_to_ui64_r_minMag$(OBJ) \
extF80_to_i32_r_minMag$(OBJ) \
extF80_to_i64_r_minMag$(OBJ) \
+ extF80_to_f16$(OBJ) \
extF80_to_f32$(OBJ) \
extF80_to_f64$(OBJ) \
extF80_to_f128$(OBJ) \
@@ -242,6 +291,7 @@ OBJS_OTHERS = \
extF80M_to_ui64_r_minMag$(OBJ) \
extF80M_to_i32_r_minMag$(OBJ) \
extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
extF80M_to_f32$(OBJ) \
extF80M_to_f64$(OBJ) \
extF80M_to_f128M$(OBJ) \
@@ -266,6 +316,7 @@ OBJS_OTHERS = \
f128_to_ui64_r_minMag$(OBJ) \
f128_to_i32_r_minMag$(OBJ) \
f128_to_i64_r_minMag$(OBJ) \
+ f128_to_f16$(OBJ) \
f128_to_f32$(OBJ) \
f128_to_extF80$(OBJ) \
f128_to_f64$(OBJ) \
@@ -292,6 +343,7 @@ OBJS_OTHERS = \
f128M_to_ui64_r_minMag$(OBJ) \
f128M_to_i32_r_minMag$(OBJ) \
f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
f128M_to_f32$(OBJ) \
f128M_to_extF80M$(OBJ) \
f128M_to_f64$(OBJ) \
diff --git a/build/template-FAST_INT64/platform.h b/build/template-FAST_INT64/platform.h
index f4832d2..2aef589 100644
--- a/build/template-FAST_INT64/platform.h
+++ b/build/template-FAST_INT64/platform.h
@@ -2,10 +2,10 @@
/*============================================================================
This C header template is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3b, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -44,3 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*----------------------------------------------------------------------------*/
==> #define INLINE inline
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+==> #define THREAD_LOCAL _Thread_local
+
diff --git a/build/template-not-FAST_INT64/Makefile b/build/template-not-FAST_INT64/Makefile
index 3500fdb..2bdc946 100644
--- a/build/template-not-FAST_INT64/Makefile
+++ b/build/template-not-FAST_INT64/Makefile
@@ -2,10 +2,10 @@
#=============================================================================
#
# This Makefile template is part of the SoftFloat IEEE Floating-Point
-# Arithmetic Package, Release 3a, by John R. Hauser.
+# Arithmetic Package, Release 3b, by John R. Hauser.
#
-# Copyright 2011, 2012, 2013, 2014 The Regents of the University of
-# California. All rights reserved.
+# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University
+# of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -36,10 +36,11 @@
# Edit lines marked with `==>'. See "SoftFloat-source.html".
-==> SOURCE_DIR = ../../source
-==> SPECIALIZE_TYPE = 8086
+==> SOURCE_DIR ?= ../../source
+==> SPECIALIZE_TYPE ?= 8086
-==> SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32
+==> SOFTFLOAT_OPTS ?= \
+==> -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32
==> DELETE = rm -f
==> C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
@@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \
s_shiftRightJamM$(OBJ) \
s_shiftRightM$(OBJ) \
s_countLeadingZeros8$(OBJ) \
+ s_countLeadingZeros16$(OBJ) \
s_countLeadingZeros32$(OBJ) \
s_countLeadingZeros64$(OBJ) \
s_addM$(OBJ) \
@@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \
s_subM$(OBJ) \
s_mul64To128M$(OBJ) \
s_mul128MTo256M$(OBJ) \
+ s_approxRecip_1Ks$(OBJ) \
s_approxRecip32_1$(OBJ) \
+ s_approxRecipSqrt_1Ks$(OBJ) \
s_approxRecipSqrt32_1$(OBJ) \
s_remStepMBy32$(OBJ) \
OBJS_SPECIALIZE = \
softfloat_raiseFlags$(OBJ) \
+ s_f16UIToCommonNaN$(OBJ) \
+ s_commonNaNToF16UI$(OBJ) \
+ s_propagateNaNF16UI$(OBJ) \
s_f32UIToCommonNaN$(OBJ) \
s_commonNaNToF32UI$(OBJ) \
s_propagateNaNF32UI$(OBJ) \
@@ -102,6 +109,12 @@ OBJS_OTHERS = \
s_roundPackMToUI64$(OBJ) \
s_roundPackToI32$(OBJ) \
s_roundPackMToI64$(OBJ) \
+ s_normSubnormalF16Sig$(OBJ) \
+ s_roundPackToF16$(OBJ) \
+ s_normRoundPackToF16$(OBJ) \
+ s_addMagsF16$(OBJ) \
+ s_subMagsF16$(OBJ) \
+ s_mulAddF16$(OBJ) \
s_normSubnormalF32Sig$(OBJ) \
s_roundPackToF32$(OBJ) \
s_normRoundPackToF32$(OBJ) \
@@ -130,22 +143,53 @@ OBJS_OTHERS = \
s_addF128M$(OBJ) \
s_mulAddF128M$(OBJ) \
softfloat_state$(OBJ) \
+ ui32_to_f16$(OBJ) \
ui32_to_f32$(OBJ) \
ui32_to_f64$(OBJ) \
ui32_to_extF80M$(OBJ) \
ui32_to_f128M$(OBJ) \
+ ui64_to_f16$(OBJ) \
ui64_to_f32$(OBJ) \
ui64_to_f64$(OBJ) \
ui64_to_extF80M$(OBJ) \
ui64_to_f128M$(OBJ) \
+ i32_to_f16$(OBJ) \
i32_to_f32$(OBJ) \
i32_to_f64$(OBJ) \
i32_to_extF80M$(OBJ) \
i32_to_f128M$(OBJ) \
+ i64_to_f16$(OBJ) \
i64_to_f32$(OBJ) \
i64_to_f64$(OBJ) \
i64_to_extF80M$(OBJ) \
i64_to_f128M$(OBJ) \
+ f16_to_ui32$(OBJ) \
+ f16_to_ui64$(OBJ) \
+ f16_to_i32$(OBJ) \
+ f16_to_i64$(OBJ) \
+ f16_to_ui32_r_minMag$(OBJ) \
+ f16_to_ui64_r_minMag$(OBJ) \
+ f16_to_i32_r_minMag$(OBJ) \
+ f16_to_i64_r_minMag$(OBJ) \
+ f16_to_f32$(OBJ) \
+ f16_to_f64$(OBJ) \
+ f16_to_extF80M$(OBJ) \
+ f16_to_f128M$(OBJ) \
+ f16_roundToInt$(OBJ) \
+ f16_add$(OBJ) \
+ f16_sub$(OBJ) \
+ f16_mul$(OBJ) \
+ f16_mulAdd$(OBJ) \
+ f16_div$(OBJ) \
+ f16_rem$(OBJ) \
+ f16_sqrt$(OBJ) \
+ f16_eq$(OBJ) \
+ f16_le$(OBJ) \
+ f16_lt$(OBJ) \
+ f16_eq_signaling$(OBJ) \
+ f16_le_quiet$(OBJ) \
+ f16_lt_quiet$(OBJ) \
+ f16_isSignalingNaN$(OBJ) \
f32_to_ui32$(OBJ) \
f32_to_ui64$(OBJ) \
f32_to_i32$(OBJ) \
@@ -154,6 +198,7 @@ OBJS_OTHERS = \
f32_to_ui64_r_minMag$(OBJ) \
f32_to_i32_r_minMag$(OBJ) \
f32_to_i64_r_minMag$(OBJ) \
+ f32_to_f16$(OBJ) \
f32_to_f64$(OBJ) \
f32_to_extF80M$(OBJ) \
f32_to_f128M$(OBJ) \
@@ -180,6 +225,7 @@ OBJS_OTHERS = \
f64_to_ui64_r_minMag$(OBJ) \
f64_to_i32_r_minMag$(OBJ) \
f64_to_i64_r_minMag$(OBJ) \
+ f64_to_f16$(OBJ) \
f64_to_f32$(OBJ) \
f64_to_extF80M$(OBJ) \
f64_to_f128M$(OBJ) \
@@ -206,6 +252,7 @@ OBJS_OTHERS = \
extF80M_to_ui64_r_minMag$(OBJ) \
extF80M_to_i32_r_minMag$(OBJ) \
extF80M_to_i64_r_minMag$(OBJ) \
+ extF80M_to_f16$(OBJ) \
extF80M_to_f32$(OBJ) \
extF80M_to_f64$(OBJ) \
extF80M_to_f128M$(OBJ) \
@@ -230,6 +277,7 @@ OBJS_OTHERS = \
f128M_to_ui64_r_minMag$(OBJ) \
f128M_to_i32_r_minMag$(OBJ) \
f128M_to_i64_r_minMag$(OBJ) \
+ f128M_to_f16$(OBJ) \
f128M_to_f32$(OBJ) \
f128M_to_f64$(OBJ) \
f128M_to_extF80M$(OBJ) \
diff --git a/build/template-not-FAST_INT64/platform.h b/build/template-not-FAST_INT64/platform.h
index f4832d2..2aef589 100644
--- a/build/template-not-FAST_INT64/platform.h
+++ b/build/template-not-FAST_INT64/platform.h
@@ -2,10 +2,10 @@
/*============================================================================
This C header template is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3b, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -44,3 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*----------------------------------------------------------------------------*/
==> #define INLINE inline
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+==> #define THREAD_LOCAL _Thread_local
+
diff --git a/doc/SoftFloat-history.html b/doc/SoftFloat-history.html
index 08cab39..f5f7c91 100644
--- a/doc/SoftFloat-history.html
+++ b/doc/SoftFloat-history.html
@@ -7,14 +7,41 @@
-History of Berkeley SoftFloat, to Release 3a
+History of Berkeley SoftFloat, to Release 3b
-2015 October 23
+2016 July 22
Release 3b (2016 July)
+
+
+
+
+
+
float16_t
).
+
+THREAD_LOCAL
to allow the floating-point
+state (modes and exception flags) to be made per-thread.
+
+make
command.
+
+Release 3a (2015 October)
diff --git a/doc/SoftFloat-source.html b/doc/SoftFloat-source.html
index dff77aa..b69565f 100644
--- a/doc/SoftFloat-source.html
+++ b/doc/SoftFloat-source.html
@@ -7,11 +7,11 @@
-
Berkeley SoftFloat Release 3a: Source Documentation
+Berkeley SoftFloat Release 3b: Source Documentation
-2015 October 23
+2016 July 22
SoftFloat.html
.
+SoftFloat.html
@@ -68,8 +68,8 @@ SoftFloat has been successfully compiled with the GNU C Compiler
SoftFloat.html
.
-The current version of SoftFloat is SoftFloat.html
@@ -148,12 +148,12 @@ Oracle, and Samsung.-The following applies to the whole of SoftFloat
Release 3a as well +The following applies to the whole of SoftFloatRelease 3b as well as to each source file individually.-Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of California. All rights reserved.
@@ -236,9 +236,9 @@ processors. The files in directory8086
give floating-point behavior consistent solely with Intel’s older, 8087-derived floating-point, while those inupdate the behavior of the -non-extended formats ( 8086-SSE
float32_t
,float64_t
, and -float128_t
) to mirror Intel’s more recent Streaming SIMD -Extensions (SSE) and other compatible extensions. +non-extended formats (float16_t
,float32_t
, +float64_t
, andfloat128_t
) to mirror Intel’s +more recent Streaming SIMD Extensions (SSE) and other compatible extensions. If other specializations are attempted, these would be expected to be other subdirectories ofsource
alongside8086
and. @@ -370,9 +370,12 @@ what (if anything) special happens when exceptions are raised; 8086-SSE
how signaling NaNs are distinguished from quiet NaNs; -the default generated quiet NaNs; and +the default generated quiet NaNs; -how NaNs are propagated from function inputs to output. +how NaNs are propagated from function inputs to output; and + +the integer results returned when conversions to integer type raise the +invalid exception. @@ -418,6 +421,13 @@ For very small microprocessors whose buses and registers are 8-bit or16-bit in size, this macro should usually not be defined. Whether this macro should be defined for a32-bit processor may depend on the target machine and the applications that will use SoftFloat. +SOFTFLOAT_FAST_DIV32TO16
++Can be defined to indicate that the target’s division operator + in C (written as/
) is reasonably efficient for +dividing a32-bit unsigned integer by a16-bit +unsigned integer. +Setting this macro may affect the performance of functionf16_div
.SOFTFLOAT_FAST_DIV64TO32
Can be defined to indicate that the target’s division operator @@ -425,7 +435,7 @@ Can be defined to indicate that the target’s division operator dividing a 64-bit unsigned integer by a32-bit unsigned integer. Setting this macro may affect the performance of division, remainder, and -square root operations. +square root operations other thanf16_div
.INLINE_LEVEL
Can be defined to an integer to determine the degree of inlining requested of @@ -443,26 +453,41 @@ inlined. If macro INLINE_LEVEL
is defined with a value of 1 or higher, this macro must be defined; otherwise, this macro is ignored and need not be defined. -For some compilers, this macro can be defined as the single keyword +For compilers that conform to the C Standard’s rules for inline +functions, this macro can be defined as the single keywordinline
. +For other compilers that follow a convention pre-dating the standardization of +inline
, this macro may need to be defined toextern
inline
. -Historically, thegcc
compiler has required that this macro be -defined toextern
inline
. +THREAD_LOCAL
++Can be defined to a sequence of tokens that, when appearing at the start of a +variable declaration, indicates to the C compiler that the variable is +per-thread, meaning that each execution thread gets its own separate +instance of the variable. +This macro is used in header softfloat.h
in the declarations of +variablessoftfloat_roundingMode
, +softfloat_detectTininess
,extF80_roundingPrecision
, +andsoftfloat_exceptionFlags
. +If macroTHREAD_LOCAL
is left undefined, these variables will +default to being ordinary global variables. +Depending on the compiler, possible valid definitions of this macro include +_Thread_local
and__thread
.
-Following the usual custom INLINE_LEVEL
and INLINE
), the content of any
-definition is irrelevant;
+Following the usual custom INLINE_LEVEL
, INLINE
, and
+THREAD_LOCAL
), the content of any definition is irrelevant;
what matters is a macro’s effect on #ifdef
directives.
-It is recommended that any definitions of macros LITTLEENDIAN
and
-INLINE
be made in a build target’s platform.h
-header file, because these macros are expected to be determined inflexibly by
-the target machine and compiler.
+It is recommended that any definitions of macros LITTLEENDIAN
,
+INLINE
, and THREAD_LOCAL
be made in a build
+target’s platform.h
header file, because these macros are
+expected to be determined inflexibly by the target machine and compiler.
The other three macros control optimization and might be better located in the
target’s Makefile (or its equivalent).
primitives.h
.
@@ -505,8 +530,8 @@ declared in primitives.h
.
For example, primitives.h
declares a function called
softfloat_countLeadingZeros32
that takes an unsigned
-<function-name>
<function-name>
testsoftfloat
program by the
same author.
This program is part of the Berkeley TestFloat package available at the Web
page
-http://www.jhauser.us/arithmetic/TestFloat.html
.
+http://www.jhauser.us/arithmetic/TestFloat.html
timesoftfloat
that
measures the speed of SoftFloat’s floating-point functions.
@@ -566,10 +591,10 @@ As supplied, softfloat.h
depends on another header,
softfloat_types.h
, that is not intended for public use but which
must also be visible to the programmer’s compiler.
softfloat.h
is included in a C
-source file, macro SOFTFLOAT_FAST_INT64
must be defined, or not
-defined, consistent with whether this macro was defined when the SoftFloat
-library was built.
+More troubling, at the time softfloat.h
is included in a C source
+file, macros SOFTFLOAT_FAST_INT64
and THREAD_LOCAL
+must be defined, or not defined, consistent with how these macro were defined
+when the SoftFloat library was built.
In the situation that new programs may regularly #include
header
file softfloat.h
, it is recommended that a custom, self-contained
@@ -582,7 +607,7 @@ version of this header file be created that eliminates these issues.
At the time of this writing, the most up-to-date information about SoftFloat
and the latest release can be found at the Web page
-http://www.jhauser.us/arithmetic/SoftFloat.html
.
+http://www.jhauser.us/arithmetic/SoftFloat.html
John R. Hauser
-2015 October 23
+2016 July 22
Berkeley SoftFloat is a software implementation of binary floating-point that
conforms to the IEEE Standard for Floating-Point Arithmetic.
-The current release supports four binary formats:
-The current version of SoftFloat is SoftFloat-history.html
-The functional interface of SoftFloat
Most operations not required by the original 1985 version of the IEEE
Floating-Point Standard but added in the 2008 version are not yet supported in
-SoftFloat
@@ -189,12 +194,12 @@ Oracle, and Samsung.@@ -281,10 +288,14 @@ uint_fast64_t-The following applies to the whole of SoftFloat
Release 3a as well +The following applies to the whole of SoftFloatRelease 3b as well as to each source file individually.-Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of California. All rights reserved.
@@ -257,7 +262,7 @@ Header filesoftfloat.h
depends on standard headersbool
and several integer types. These standard headers have been part of the ISO C Standard Library since 1999. With any recent compiler, they are likely to be supported, even if the compiler -does not claim complete conformance to the ISO C Standard. +does not claim complete conformance to the latest ISO C Standard. For older or nonstandard compilers, a port of SoftFloat may have substitutes for these headers. Headersoftfloat.h
depends only on the namebool
from @@ -273,6 +278,8 @@ int64_t uint_fast8_t uint_fast32_t uint_fast64_t +int_fast32_t +int_fast64_t
-The softfloat.h
header defines four floating-point types:
+The softfloat.h
header defines five floating-point types:
The non-extended types are each exactly the size specified: -
+ ++ float16_t
+ 16-bit half-precision binary format@@ -304,8 +315,9 @@ Motorola format) float32_t
32-bit single-precision binary format
float32_t
, float64_t
, and float128_t
.
+float16_t
, float32_t
, float64_t
, and
+float128_t
.
Aside from these size requirements, the definitions of all these types may
differ for different ports of SoftFloat to specific systems.
A given port of SoftFloat may or may not define some of the floating-point
@@ -364,7 +376,7 @@ comparisons between two values in the same floating-point format.
The following operations required by the 2008 IEEE Floating-Point Standard are
-not supported in SoftFloat
-The following variables control rounding mode, underflow detection, and the
-
These mode variables are covered in the next several subsections. +For some SoftFloat ports, these variables may be per-thread (declared +softfloat_roundingMode
softfloat_detectTininess
extF80_roundingPrecision
thread_local
), meaning that different execution threads have their
+own separate copies of the variables.
softfloat_exceptionFlags
is initialized to all zeros,
meaning no exceptions.
+
+For some SoftFloat ports, softfloat_exceptionFlags
may be
+per-thread (declared thread_local
), meaning that different
+execution threads have their own separate instances of it.
+
An individual exception flag can be cleared with the statement
softfloat_exceptionFlags &= ~softfloat_flag_<exception>;
where <exception>
is the appropriate name.
-To raise a floating-point exception, function softfloat_raise
+To raise a floating-point exception, function softfloat_raiseFlags
should normally be used.
When SoftFloat detects an exception other than inexact, it calls
-softfloat_raise
.
+softfloat_raiseFlags
.
The default version of this function simply raises the corresponding exception
flags.
Particular ports of SoftFloat may support alternate behavior, such as exception
-traps, by modifying the default softfloat_raise
.
-A program may also supply its own softfloat_raise
function to
+traps, by modifying the default softfloat_raiseFlags
.
+A program may also supply its own softfloat_raiseFlags
function to
override the one from the SoftFloat library.
Because inexact results occur frequently under most circumstances (and thus are
hardly exceptional), SoftFloat does not ordinarily call
-softfloat_raise
for inexact exceptions.
+softfloat_raiseFlags
for inexact exceptions.
It does always raise the inexact exception flag as required.
@@ -1367,8 +1380,15 @@ all cases involving rounding.
+ ++ f16
indicates +float16_t
, passed by value@@ -752,24 +777,14 @@ otherwise, it will not be, even if the conversion is inexact. f32
indicates float32_t
, passed by value-Conversions from floating-point to integer raise the invalid exception -if the source value cannot be rounded to a representable integer of the desired -size (32 or 64 bits). -In such a circumstance, if the floating-point input is a NaN or if the -conversion is to an unsigned integer type, the largest positive integer is -returned; -otherwise, the largest integer with the same sign as the input is returned. -The functions that convert to integer types never raise the overflow -exception. -
- --Note that, when converting to an unsigned integer type, if the invalid -exception is raised because the input floating-point value would round to a -negative integer, the value returned is the maximum positive unsigned -integer. -Zero is not returned when the invalid exception is raised, even when -zero is the closest integer to the original floating-point value. +A conversion from floating-point to integer format raises the invalid +exception if the source value cannot be rounded to a representable integer of +the desired size (32 or 64 bits). +In such circumstances, the integer result returned is determined by the +particular port of SoftFloat, although typically this value will be either the +maximum or minimum value of the integer format. +The functions that convert to integer types never raise the floating-point +overflow exception.
@@ -884,11 +899,9 @@ SoftFloat implements fused multiply-add with functions
-Unlike other operations, fused multiple-add is supported only for the -non-extended formats,<float>_mulAdd
float32_t
,float64_t
, and -float128_t
. -No fused multiple-add function is currently provided for the -80-bit double-extended-precision type,extFloat80_t
. +Unlike other operations, fused multiple-add is not supported for the +80-bit double-extended-precision format, +extFloat80_t
.@@ -971,8 +984,8 @@ no rounding. Depending on the relative magnitudes of the operands, the remainder functions can take considerably longer to execute than the other SoftFloat functions. -This is inherent in the remainder operation itself and is not a flaw in the -SoftFloat implementation. +This is an inherent characteristic of the remainder operation itself and is not +a flaw in the SoftFloat implementation.
8.7. Round-to-Integer Functions
@@ -1103,14 +1116,14 @@ bool f128M_isSignalingNaN( const float128_t *aPtr ); SoftFloat provides a single function for raising floating-point exceptions:The-void softfloat_raise( uint_fast8_t exceptions ); +void softfloat_raiseFlags( uint_fast8_t exceptions );exceptions
argument is a mask indicating the set of exceptions to raise. (See earlier section 7, Exceptions and Exception Flags.) In addition to setting the specified exception flags in variable -softfloat_exceptionFlags
, thesoftfloat_raise
+softfloat_exceptionFlags
, thesoftfloat_raiseFlags
function may cause a trap or abort appropriate for the current system. @@ -1216,7 +1229,7 @@ have been renamed as follows:- float_raise
+ softfloat_raise
softfloat_raiseFlags
float32_t
, float64_t
, and float128_t
.
+Fused multiply-add functions have been added for all floating-point formats
+except extFloat80_t
.
+
+
++
float16_t
, is supported.
extFloat80_t
(discussed in
At the time of this writing, the most up-to-date information about SoftFloat
and the latest release can be found at the Web page
-http://www.jhauser.us/arithmetic/SoftFloat.html
.
+http://www.jhauser.us/arithmetic/SoftFloat.html