aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/CHStone/dfadd
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/CHStone/dfadd')
-rwxr-xr-xbenchmarks/CHStone/dfadd/SPARC-GCC.h88
-rwxr-xr-xbenchmarks/CHStone/dfadd/dfadd.c230
-rwxr-xr-xbenchmarks/CHStone/dfadd/milieu.h53
-rwxr-xr-xbenchmarks/CHStone/dfadd/softfloat-macros146
-rwxr-xr-xbenchmarks/CHStone/dfadd/softfloat-specialize123
-rwxr-xr-xbenchmarks/CHStone/dfadd/softfloat.c417
-rwxr-xr-xbenchmarks/CHStone/dfadd/softfloat.h77
7 files changed, 1134 insertions, 0 deletions
diff --git a/benchmarks/CHStone/dfadd/SPARC-GCC.h b/benchmarks/CHStone/dfadd/SPARC-GCC.h
new file mode 100755
index 0000000..523e274
--- /dev/null
+++ b/benchmarks/CHStone/dfadd/SPARC-GCC.h
@@ -0,0 +1,88 @@
+/*
++--------------------------------------------------------------------------+
+| CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
+| ======================================================================== |
+| |
+| * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
+| H. Takada and K. Ishii |
+| Nagoya University, Japan |
+| |
+| * Remark : |
+| 1. This source code is modified to unify the formats of the benchmark |
+| programs in CHStone. |
+| 2. Test vectors are added for CHStone. |
+| 3. If "main_result" is 0 at the end of the program, the program is |
+| correctly executed. |
+| 4. Please follow the copyright of each benchmark program. |
++--------------------------------------------------------------------------+
+*/
+/*============================================================================
+
+This C header file 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.
+
+=============================================================================*/
+
+/*----------------------------------------------------------------------------
+| Each of the following `typedef's defines the most convenient type that holds
+| integers of at least as many bits as specified. For example, `uint8' should
+| be the most convenient type that can hold unsigned integers of as many as
+| 8 bits. The `flag' type must be able to hold either a 0 or 1. For most
+| implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
+| to the same as `int'.
+*----------------------------------------------------------------------------*/
+typedef int flag;
+typedef int int8;
+typedef int int16;
+
+/*----------------------------------------------------------------------------
+| Each of the following `typedef's defines a type that holds integers
+| of _exactly_ the number of bits specified. For instance, for most
+| implementation of C, `bits16' and `sbits16' should be `typedef'ed to
+| `unsigned short int' and `signed short int' (or `short int'), respectively.
+*----------------------------------------------------------------------------*/
+typedef unsigned short int bits16;
+typedef unsigned int bits32;
+typedef unsigned long long int bits64;
+typedef signed long long int sbits64;
+
+/*----------------------------------------------------------------------------
+| The `LIT64' macro takes as its argument a textual integer literal and
+| if necessary ``marks'' the literal as having a 64-bit integer type.
+| For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
+| appended with the letters `LL' standing for `long long', which is `gcc's
+| name for the 64-bit integer type. Some compilers may allow `LIT64' to be
+| defined as the identity macro: `#define LIT64( a ) a'.
+*----------------------------------------------------------------------------*/
+#define LIT64( a ) a##LL
+
+/*----------------------------------------------------------------------------
+| The macro `INLINE' can be used before functions that should be inlined. If
+| a compiler does not support explicit inlining, this macro should be defined
+| to be `static'.
+*----------------------------------------------------------------------------*/
+#define INLINE
diff --git a/benchmarks/CHStone/dfadd/dfadd.c b/benchmarks/CHStone/dfadd/dfadd.c
new file mode 100755
index 0000000..f364124
--- /dev/null
+++ b/benchmarks/CHStone/dfadd/dfadd.c
@@ -0,0 +1,230 @@
+/*
++--------------------------------------------------------------------------+
+| CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
+| ======================================================================== |
+| |
+| * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
+| H. Takada and K. Ishii |
+| Nagoya University, Japan |
+| |
+| * Remark : |
+| 1. This source code is modified to unify the formats of the benchmark |
+| programs in CHStone. |
+| 2. Test vectors are added for CHStone. |
+| 3. If "main_result" is 0 at the end of the program, the program is |
+| correctly executed. |
+| 4. Please follow the copyright of each benchmark program. |
++--------------------------------------------------------------------------+
+*/
+/*
+ * Copyright (C) 2008
+ * Y. Hara, H. Tomiyama, S. Honda, H. Takada and K. Ishii
+ * Nagoya University, Japan
+ * All rights reserved.
+ *
+ * Disclaimer of Warranty
+ *
+ * These software programs are available to the user without any license fee or
+ * royalty on an "as is" basis. The authors disclaims any and all warranties,
+ * whether express, implied, or statuary, including any implied warranties or
+ * merchantability or of fitness for a particular purpose. In no event shall the
+ * copyright-holder be liable for any incidental, punitive, or consequential damages
+ * of any kind whatsoever arising from the use of these programs. This disclaimer
+ * of warranty extends to the user of these programs and user's customers, employees,
+ * agents, transferees, successors, and assigns.
+ *
+ */
+#include <stdio.h>
+#include "softfloat.c"
+
+double
+ullong_to_double (unsigned long long x)
+{
+ union
+ {
+ double d;
+ unsigned long long ll;
+ } t;
+
+ t.ll = x;
+ return t.d;
+}
+
+/*
++--------------------------------------------------------------------------+
+| * Test Vectors (added for CHStone) |
+| a_input, b_input : input data |
+| z_output : expected output data |
++--------------------------------------------------------------------------+
+*/
+#define N 46
+const float64 a_input[N] = {
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x4000000000000000ULL, /* 2.0 */
+ 0x4000000000000000ULL, /* 2.0 */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0x3FF8000000000000ULL, /* 1.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0x3FF8000000000000ULL, /* 1.5 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xC000000000000000ULL, /* -2.0 */
+ 0xC000000000000000ULL, /* -2.0 */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0x8000000000000000ULL, /* -0.0 */
+ 0xBFF8000000000000ULL, /* -1.5 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0x8000000000000000ULL, /* -0.0 */
+ 0xBFF8000000000000ULL, /* -1.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0x3FF8000000000000ULL, /* 1.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x4000000000000000ULL, /* 2.0 */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0x8000000000000000ULL, /* -0.0 */
+ 0xBFF8000000000000ULL, /* -1.5 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xC000000000000000ULL /* -2.0 */
+};
+
+const float64 b_input[N] = {
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0x3FF8000000000000ULL, /* 1.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x4000000000000000ULL, /* 2.0 */
+ 0x4000000000000000ULL, /* 2.0 */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0x8000000000000000ULL, /* -0.0 */
+ 0xBFF8000000000000ULL, /* -1.5 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xC000000000000000ULL, /* -2.0 */
+ 0xC000000000000000ULL, /* -2.0 */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0x8000000000000000ULL, /* -inf */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xC000000000000000ULL, /* -2.0 */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0x8000000000000000ULL, /* -0.0 */
+ 0xBFF8000000000000ULL, /* -1.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x4000000000000000ULL, /* 2.0 */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0x3FF8000000000000ULL /* 1.5 */
+};
+
+const float64 z_output[N] = {
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x4000000000000000ULL, /* 2.0 */
+ 0x400C000000000000ULL, /* 3.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x4000000000000000ULL, /* 2.0 */
+ 0x400C000000000000ULL, /* 3.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0x4004000000000000ULL, /* 2.5 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xC000000000000000ULL, /* -2.0 */
+ 0xC00C000000000000ULL, /* -3.5 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xC000000000000000ULL, /* -2.0 */
+ 0xC00C000000000000ULL, /* -3.5 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0x8000000000000000ULL, /* -0.0 */
+ 0xC004000000000000ULL, /* -2.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FFFFFFFFFFFFFFFULL, /* nan */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xBFE0000000000000ULL, /* -0.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x3FE0000000000000ULL, /* 0.5 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FFFFFFFFFFFFFFFULL, /* nan */
+ 0x0000000000000000ULL, /* 0.0 */
+ 0x7FF8000000000000ULL, /* nan */
+ 0x7FF0000000000000ULL, /* inf */
+ 0x3FF0000000000000ULL, /* 1.0 */
+ 0x3FE0000000000000ULL, /* 0.5 */
+ 0xFFF8000000000000ULL, /* nan */
+ 0xFFF0000000000000ULL, /* -inf */
+ 0xBFF0000000000000ULL, /* -1.0 */
+ 0xBFE0000000000000ULL /* -0.5 */
+};
+
+int
+main ()
+{
+ int main_result;
+ int i;
+ float64 x1, x2;
+ main_result = 0;
+ for (i = 0; i < N; i++)
+ {
+ float64 result;
+ x1 = a_input[i];
+ x2 = b_input[i];
+ result = float64_add (x1, x2);
+ main_result += (result != z_output[i]);
+
+ printf
+ ("a_input=%016llx b_input=%016llx expected=%016llx output=%016llx (%lf)\n",
+ a_input[i], b_input[i], z_output[i], result,
+ ullong_to_double (result));
+ }
+ printf ("%d\n", main_result);
+ return main_result;
+ }
diff --git a/benchmarks/CHStone/dfadd/milieu.h b/benchmarks/CHStone/dfadd/milieu.h
new file mode 100755
index 0000000..4d92d5e
--- /dev/null
+++ b/benchmarks/CHStone/dfadd/milieu.h
@@ -0,0 +1,53 @@
+/*
++--------------------------------------------------------------------------+
+| CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
+| ======================================================================== |
+| |
+| * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
+| H. Takada and K. Ishii |
+| Nagoya University, Japan |
+| |
+| * Remark : |
+| 1. This source code is modified to unify the formats of the benchmark |
+| programs in CHStone. |
+| 2. Test vectors are added for CHStone. |
+| 3. If "main_result" is 0 at the end of the program, the program is |
+| correctly executed. |
+| 4. Please follow the copyright of each benchmark program. |
++--------------------------------------------------------------------------+
+*/
+/*============================================================================
+
+This C header file 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 common integer types and flags.
+*----------------------------------------------------------------------------*/
+#include "SPARC-GCC.h"
diff --git a/benchmarks/CHStone/dfadd/softfloat-macros b/benchmarks/CHStone/dfadd/softfloat-macros
new file mode 100755
index 0000000..ce88997
--- /dev/null
+++ b/benchmarks/CHStone/dfadd/softfloat-macros
@@ -0,0 +1,146 @@
+/*
++--------------------------------------------------------------------------+
+| CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
+| ======================================================================== |
+| |
+| * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
+| H. Takada and K. Ishii |
+| Nagoya University, Japan |
+| |
+| * Remark : |
+| 1. This source code is modified to unify the formats of the benchmark |
+| programs in CHStone. |
+| 2. Test vectors are added for CHStone. |
+| 3. If "main_result" is 0 at the end of the program, the program is |
+| correctly executed. |
+| 4. Please follow the copyright of each benchmark program. |
++--------------------------------------------------------------------------+
+*/
+/*============================================================================
+
+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 notice) 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.
+
+=============================================================================*/
+
+/*----------------------------------------------------------------------------
+| Shifts `a' right by the number of bits given in `count'. If any nonzero
+| bits are shifted off, they are ``jammed'' into the least significant bit of
+| the result by setting the least significant bit to 1. The value of `count'
+| can be arbitrarily large; in particular, if `count' is greater than 64, the
+| result will be either 0 or 1, depending on whether `a' is zero or nonzero.
+| The result is stored in the location pointed to by `zPtr'.
+*----------------------------------------------------------------------------*/
+
+INLINE void
+shift64RightJamming (bits64 a, int16 count, bits64 * zPtr)
+{
+ bits64 z;
+
+ if (count == 0)
+ {
+ z = a;
+ }
+ else if (count < 64)
+ {
+ z = (a >> count) | ((a << ((-count) & 63)) != 0);
+ }
+ else
+ {
+ z = (a != 0);
+ }
+ *zPtr = z;
+
+}
+
+/*----------------------------------------------------------------------------
+| Returns the number of leading 0 bits before the most-significant 1 bit of
+| `a'. If `a' is zero, 32 is returned.
+*----------------------------------------------------------------------------*/
+
+static int8
+countLeadingZeros32 (bits32 a)
+{
+ static const int8 countLeadingZerosHigh[256] = {
+ 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ int8 shiftCount;
+
+ shiftCount = 0;
+ if (a < 0x10000)
+ {
+ shiftCount += 16;
+ a <<= 16;
+ }
+ if (a < 0x1000000)
+ {
+ shiftCount += 8;
+ a <<= 8;
+ }
+ shiftCount += countLeadingZerosHigh[a >> 24];
+ return shiftCount;
+
+}
+
+/*----------------------------------------------------------------------------
+| Returns the number of leading 0 bits before the most-significant 1 bit of
+| `a'. If `a' is zero, 64 is returned.
+*----------------------------------------------------------------------------*/
+
+static int8
+countLeadingZeros64 (bits64 a)
+{
+ int8 shiftCount;
+
+ shiftCount = 0;
+ if (a < ((bits64) 1) << 32)
+ {
+ shiftCount += 32;
+ }
+ else
+ {
+ a >>= 32;
+ }
+ shiftCount += countLeadingZeros32 (a);
+ return shiftCount;
+
+}
diff --git a/benchmarks/CHStone/dfadd/softfloat-specialize b/benchmarks/CHStone/dfadd/softfloat-specialize
new file mode 100755
index 0000000..3c51059
--- /dev/null
+++ b/benchmarks/CHStone/dfadd/softfloat-specialize
@@ -0,0 +1,123 @@
+/*
++--------------------------------------------------------------------------+
+| CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
+| ======================================================================== |
+| |
+| * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
+| H. Takada and K. Ishii |
+| Nagoya University, Japan |
+| |
+| * Remark : |
+| 1. This source code is modified to unify the formats of the benchmark |
+| programs in CHStone. |
+| 2. Test vectors are added for CHStone. |
+| 3. If "main_result" is 0 at the end of the program, the program is |
+| correctly executed. |
+| 4. Please follow the copyright of each benchmark program. |
++--------------------------------------------------------------------------+
+*/
+/*============================================================================
+
+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.
+
+=============================================================================*/
+
+/*----------------------------------------------------------------------------
+| Underflow tininess-detection mode, statically initialized to default value.
+| (The declaration in `softfloat.h' must match the `int8' type here.)
+*----------------------------------------------------------------------------*/
+#define float_detect_tininess float_tininess_before_rounding
+
+/*----------------------------------------------------------------------------
+| 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
+float_raise (int8 flags)
+{
+ float_exception_flags |= flags;
+
+}
+
+
+/*----------------------------------------------------------------------------
+| The pattern for a default generated double-precision NaN.
+*----------------------------------------------------------------------------*/
+#define float64_default_nan LIT64( 0x7FFFFFFFFFFFFFFF )
+
+/*----------------------------------------------------------------------------
+| Returns 1 if the double-precision floating-point value `a' is a NaN;
+| otherwise returns 0.
+*----------------------------------------------------------------------------*/
+
+flag
+float64_is_nan (float64 a)
+{
+
+ return (LIT64 (0xFFE0000000000000) < (bits64) (a << 1));
+
+}
+
+/*----------------------------------------------------------------------------
+| Returns 1 if the double-precision floating-point value `a' is a signaling
+| NaN; otherwise returns 0.
+*----------------------------------------------------------------------------*/
+
+flag
+float64_is_signaling_nan (float64 a)
+{
+
+ return (((a >> 51) & 0xFFF) == 0xFFE) && (a & LIT64 (0x0007FFFFFFFFFFFF));
+
+}
+
+/*----------------------------------------------------------------------------
+| 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.
+*----------------------------------------------------------------------------*/
+
+static float64
+propagateFloat64NaN (float64 a, float64 b)
+{
+ flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN;
+
+ aIsNaN = float64_is_nan (a);
+ aIsSignalingNaN = float64_is_signaling_nan (a);
+ bIsNaN = float64_is_nan (b);
+ bIsSignalingNaN = float64_is_signaling_nan (b);
+ a |= LIT64 (0x0008000000000000);
+ b |= LIT64 (0x0008000000000000);
+ if (aIsSignalingNaN | bIsSignalingNaN)
+ float_raise (float_flag_invalid);
+ return bIsSignalingNaN ? b : aIsSignalingNaN ? a : bIsNaN ? b : a;
+
+}
diff --git a/benchmarks/CHStone/dfadd/softfloat.c b/benchmarks/CHStone/dfadd/softfloat.c
new file mode 100755
index 0000000..baeedab
--- /dev/null
+++ b/benchmarks/CHStone/dfadd/softfloat.c
@@ -0,0 +1,417 @@
+/*
++--------------------------------------------------------------------------+
+| CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
+| ======================================================================== |
+| |
+| * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
+| H. Takada and K. Ishii |
+| Nagoya University, Japan |
+| |
+| * Remark : |
+| 1. This source code is modified to unify the formats of the benchmark |
+| programs in CHStone. |
+| 2. Test vectors are added for CHStone. |
+| 3. If "main_result" is 0 at the end of the program, the program is |
+| correctly executed. |
+| 4. Please follow the copyright of each benchmark program. |
++--------------------------------------------------------------------------+
+*/
+/*============================================================================
+
+This C source file 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 "milieu.h"
+#include "softfloat.h"
+
+/*----------------------------------------------------------------------------
+| Floating-point rounding mode, extended double-precision rounding precision,
+| and exception flags.
+*----------------------------------------------------------------------------*/
+int8 float_rounding_mode = float_round_nearest_even;
+int8 float_exception_flags = 0;
+
+/*----------------------------------------------------------------------------
+| Primitive arithmetic functions, including multi-word arithmetic, and
+| division and square root approximations. (Can be specialized to target if
+| desired.)
+*----------------------------------------------------------------------------*/
+#include "softfloat-macros"
+
+/*----------------------------------------------------------------------------
+| Functions and definitions to determine: (1) whether tininess for underflow
+| is detected before or after rounding by default, (2) what (if anything)
+| happens when exceptions are raised, (3) how signaling NaNs are distinguished
+| from quiet NaNs, (4) the default generated quiet NaNs, and (5) how NaNs
+| are propagated from function inputs to output. These details are target-
+| specific.
+*----------------------------------------------------------------------------*/
+#include "softfloat-specialize"
+
+/*----------------------------------------------------------------------------
+| Returns the fraction bits of the double-precision floating-point value `a'.
+*----------------------------------------------------------------------------*/
+
+INLINE bits64
+extractFloat64Frac (float64 a)
+{
+
+ return a & LIT64 (0x000FFFFFFFFFFFFF);
+
+}
+
+/*----------------------------------------------------------------------------
+| Returns the exponent bits of the double-precision floating-point value `a'.
+*----------------------------------------------------------------------------*/
+
+INLINE int16
+extractFloat64Exp (float64 a)
+{
+
+ return (a >> 52) & 0x7FF;
+
+}
+
+/*----------------------------------------------------------------------------
+| Returns the sign bit of the double-precision floating-point value `a'.
+*----------------------------------------------------------------------------*/
+
+INLINE flag
+extractFloat64Sign (float64 a)
+{
+
+ return a >> 63;
+
+}
+
+/*----------------------------------------------------------------------------
+| Packs the sign `zSign', exponent `zExp', and significand `zSig' into a
+| double-precision floating-point value, returning the result. After being
+| shifted into the proper positions, the three fields are simply added
+| together to form the result. This means that any integer portion of `zSig'
+| will be added into the exponent. Since a properly normalized significand
+| will have an integer portion equal to 1, the `zExp' input should be 1 less
+| than the desired result exponent whenever `zSig' is a complete, normalized
+| significand.
+*----------------------------------------------------------------------------*/
+
+INLINE float64
+packFloat64 (flag zSign, int16 zExp, bits64 zSig)
+{
+
+ return (((bits64) zSign) << 63) + (((bits64) zExp) << 52) + zSig;
+
+}
+
+/*----------------------------------------------------------------------------
+| Takes an abstract floating-point value having sign `zSign', exponent `zExp',
+| and significand `zSig', and returns the proper double-precision floating-
+| point value corresponding to the abstract input. Ordinarily, the abstract
+| value is simply rounded and packed into the double-precision format, with
+| the inexact exception raised if the abstract input cannot be represented
+| exactly. However, if the abstract value is too large, the overflow and
+| inexact exceptions are raised and an infinity or maximal finite value is
+| returned. If the abstract value is too small, the input value is rounded
+| to a subnormal number, and the underflow and inexact exceptions are raised
+| if the abstract input cannot be represented exactly as a subnormal double-
+| precision floating-point number.
+| The input significand `zSig' has its binary point between bits 62
+| and 61, which is 10 bits to the left of the usual location. This shifted
+| significand must be normalized or smaller. If `zSig' is not normalized,
+| `zExp' must be 0; in that case, the result returned is a subnormal number,
+| and it must not require rounding. In the usual case that `zSig' is
+| normalized, `zExp' must be 1 less than the ``true'' floating-point exponent.
+| The handling of underflow and overflow follows the IEC/IEEE Standard for
+| Binary Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+static float64
+roundAndPackFloat64 (flag zSign, int16 zExp, bits64 zSig)
+{
+ int8 roundingMode;
+ flag roundNearestEven, isTiny;
+ int16 roundIncrement, roundBits;
+
+ roundingMode = float_rounding_mode;
+ roundNearestEven = (roundingMode == float_round_nearest_even);
+ roundIncrement = 0x200;
+ if (!roundNearestEven)
+ {
+ if (roundingMode == float_round_to_zero)
+ {
+ roundIncrement = 0;
+ }
+ else
+ {
+ roundIncrement = 0x3FF;
+ if (zSign)
+ {
+ if (roundingMode == float_round_up)
+ roundIncrement = 0;
+ }
+ else
+ {
+ if (roundingMode == float_round_down)
+ roundIncrement = 0;
+ }
+ }
+ }
+ roundBits = zSig & 0x3FF;
+ if (0x7FD <= (bits16) zExp)
+ {
+ if ((0x7FD < zExp)
+ || ((zExp == 0x7FD) && ((sbits64) (zSig + roundIncrement) < 0)))
+ {
+ float_raise (float_flag_overflow | float_flag_inexact);
+ return packFloat64 (zSign, 0x7FF, 0) - (roundIncrement == 0);
+ }
+ if (zExp < 0)
+ {
+ isTiny = (float_detect_tininess == float_tininess_before_rounding)
+ || (zExp < -1)
+ || (zSig + roundIncrement < LIT64 (0x8000000000000000));
+ shift64RightJamming (zSig, -zExp, &zSig);
+ zExp = 0;
+ roundBits = zSig & 0x3FF;
+ if (isTiny && roundBits)
+ float_raise (float_flag_underflow);
+ }
+ }
+ if (roundBits)
+ float_exception_flags |= float_flag_inexact;
+ zSig = (zSig + roundIncrement) >> 10;
+ zSig &= ~(((roundBits ^ 0x200) == 0) & roundNearestEven);
+ if (zSig == 0)
+ zExp = 0;
+ return packFloat64 (zSign, zExp, zSig);
+
+}
+
+/*----------------------------------------------------------------------------
+| Takes an abstract floating-point value having sign `zSign', exponent `zExp',
+| and significand `zSig', and returns the proper double-precision floating-
+| point value corresponding to the abstract input. This routine is just like
+| `roundAndPackFloat64' except that `zSig' does not have to be normalized.
+| Bit 63 of `zSig' must be zero, and `zExp' must be 1 less than the ``true''
+| floating-point exponent.
+*----------------------------------------------------------------------------*/
+
+static float64
+normalizeRoundAndPackFloat64 (flag zSign, int16 zExp, bits64 zSig)
+{
+ int8 shiftCount;
+
+ shiftCount = countLeadingZeros64 (zSig) - 1;
+ return roundAndPackFloat64 (zSign, zExp - shiftCount, zSig << shiftCount);
+
+}
+
+/*----------------------------------------------------------------------------
+| Returns the result of adding the absolute values of the double-precision
+| floating-point values `a' and `b'. If `zSign' is 1, the sum is negated
+| before being returned. `zSign' is ignored if the result is a NaN.
+| The addition is performed according to the IEC/IEEE Standard for Binary
+| Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+static float64
+addFloat64Sigs (float64 a, float64 b, flag zSign)
+{
+ int16 aExp, bExp, zExp;
+ bits64 aSig, bSig, zSig;
+ int16 expDiff;
+
+ aSig = extractFloat64Frac (a);
+ aExp = extractFloat64Exp (a);
+ bSig = extractFloat64Frac (b);
+ bExp = extractFloat64Exp (b);
+ expDiff = aExp - bExp;
+ aSig <<= 9;
+ bSig <<= 9;
+ if (0 < expDiff)
+ {
+ if (aExp == 0x7FF)
+ {
+ if (aSig)
+ return propagateFloat64NaN (a, b);
+ return a;
+ }
+ if (bExp == 0)
+ --expDiff;
+ else
+ bSig |= LIT64 (0x2000000000000000);
+ shift64RightJamming (bSig, expDiff, &bSig);
+ zExp = aExp;
+ }
+ else if (expDiff < 0)
+ {
+ if (bExp == 0x7FF)
+ {
+ if (bSig)
+ return propagateFloat64NaN (a, b);
+ return packFloat64 (zSign, 0x7FF, 0);
+ }
+ if (aExp == 0)
+ ++expDiff;
+ else
+ {
+ aSig |= LIT64 (0x2000000000000000);
+ }
+ shift64RightJamming (aSig, -expDiff, &aSig);
+ zExp = bExp;
+ }
+ else
+ {
+ if (aExp == 0x7FF)
+ {
+ if (aSig | bSig)
+ return propagateFloat64NaN (a, b);
+ return a;
+ }
+ if (aExp == 0)
+ return packFloat64 (zSign, 0, (aSig + bSig) >> 9);
+ zSig = LIT64 (0x4000000000000000) + aSig + bSig;
+ zExp = aExp;
+ goto roundAndPack;
+ }
+ aSig |= LIT64 (0x2000000000000000);
+ zSig = (aSig + bSig) << 1;
+ --zExp;
+ if ((sbits64) zSig < 0)
+ {
+ zSig = aSig + bSig;
+ ++zExp;
+ }
+roundAndPack:
+ return roundAndPackFloat64 (zSign, zExp, zSig);
+
+}
+
+/*----------------------------------------------------------------------------
+| Returns the result of subtracting the absolute values of the double-
+| precision floating-point values `a' and `b'. If `zSign' is 1, the
+| difference is negated before being returned. `zSign' is ignored if the
+| result is a NaN. The subtraction is performed according to the IEC/IEEE
+| Standard for Binary Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+static float64
+subFloat64Sigs (float64 a, float64 b, flag zSign)
+{
+ int16 aExp, bExp, zExp;
+ bits64 aSig, bSig, zSig;
+ int16 expDiff;
+
+ aSig = extractFloat64Frac (a);
+ aExp = extractFloat64Exp (a);
+ bSig = extractFloat64Frac (b);
+ bExp = extractFloat64Exp (b);
+ expDiff = aExp - bExp;
+ aSig <<= 10;
+ bSig <<= 10;
+ if (0 < expDiff)
+ goto aExpBigger;
+ if (expDiff < 0)
+ goto bExpBigger;
+ if (aExp == 0x7FF)
+ {
+ if (aSig | bSig)
+ return propagateFloat64NaN (a, b);
+ float_raise (float_flag_invalid);
+ return float64_default_nan;
+ }
+ if (aExp == 0)
+ {
+ aExp = 1;
+ bExp = 1;
+ }
+ if (bSig < aSig)
+ goto aBigger;
+ if (aSig < bSig)
+ goto bBigger;
+ return packFloat64 (float_rounding_mode == float_round_down, 0, 0);
+bExpBigger:
+ if (bExp == 0x7FF)
+ {
+ if (bSig)
+ return propagateFloat64NaN (a, b);
+ return packFloat64 (zSign ^ 1, 0x7FF, 0);
+ }
+ if (aExp == 0)
+ ++expDiff;
+ else
+ aSig |= LIT64 (0x4000000000000000);
+ shift64RightJamming (aSig, -expDiff, &aSig);
+ bSig |= LIT64 (0x4000000000000000);
+bBigger:
+ zSig = bSig - aSig;
+ zExp = bExp;
+ zSign ^= 1;
+ goto normalizeRoundAndPack;
+aExpBigger:
+ if (aExp == 0x7FF)
+ {
+ if (aSig)
+ return propagateFloat64NaN (a, b);
+ return a;
+ }
+ if (bExp == 0)
+ --expDiff;
+ else
+ bSig |= LIT64 (0x4000000000000000);
+ shift64RightJamming (bSig, expDiff, &bSig);
+ aSig |= LIT64 (0x4000000000000000);
+aBigger:
+ zSig = aSig - bSig;
+ zExp = aExp;
+normalizeRoundAndPack:
+ --zExp;
+ return normalizeRoundAndPackFloat64 (zSign, zExp, zSig);
+
+}
+
+/*----------------------------------------------------------------------------
+| Returns the result of adding the double-precision floating-point values `a'
+| and `b'. The operation is performed according to the IEC/IEEE Standard for
+| Binary Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+float64
+float64_add (float64 a, float64 b)
+{
+ flag aSign, bSign;
+
+ aSign = extractFloat64Sign (a);
+ bSign = extractFloat64Sign (b);
+ if (aSign == bSign)
+ return addFloat64Sigs (a, b, aSign);
+ else
+ return subFloat64Sigs (a, b, aSign);
+
+}
diff --git a/benchmarks/CHStone/dfadd/softfloat.h b/benchmarks/CHStone/dfadd/softfloat.h
new file mode 100755
index 0000000..6d075ca
--- /dev/null
+++ b/benchmarks/CHStone/dfadd/softfloat.h
@@ -0,0 +1,77 @@
+/*
++--------------------------------------------------------------------------+
+| CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
+| ======================================================================== |
+| |
+| * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
+| H. Takada and K. Ishii |
+| Nagoya University, Japan |
+| |
+| * Remark : |
+| 1. This source code is modified to unify the formats of the benchmark |
+| programs in CHStone. |
+| 2. Test vectors are added for CHStone. |
+| 3. If "main_result" is 0 at the end of the program, the program is |
+| correctly executed. |
+| 4. Please follow the copyright of each benchmark program. |
++--------------------------------------------------------------------------+
+*/
+/*============================================================================
+
+This C header file 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.
+
+=============================================================================*/
+
+/*----------------------------------------------------------------------------
+| Software IEC/IEEE floating-point types.
+*----------------------------------------------------------------------------*/
+typedef unsigned int float32;
+typedef unsigned long long float64;
+
+/*----------------------------------------------------------------------------
+| Software IEC/IEEE floating-point underflow tininess-detection mode.
+*----------------------------------------------------------------------------*/
+#define float_tininess_after_rounding 0
+#define float_tininess_before_rounding 1
+
+/*----------------------------------------------------------------------------
+| Software IEC/IEEE floating-point rounding mode.
+*----------------------------------------------------------------------------*/
+#define float_round_nearest_even 0
+#define float_round_to_zero 1
+#define float_round_up 2
+#define float_round_down 3
+
+/*----------------------------------------------------------------------------
+| Software IEC/IEEE floating-point exception flags.
+*----------------------------------------------------------------------------*/
+#define float_flag_inexact 1
+#define float_flag_divbyzero 2
+#define float_flag_underflow 4
+#define float_flag_overflow 8
+#define float_flag_invalid 16