aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hauser <jhauser@eecs.berkeley.edu>2014-11-28 21:07:26 -0800
committerJohn Hauser <jhauser@eecs.berkeley.edu>2014-11-28 21:07:26 -0800
commitd6feb3fa41c6b7ba1b5444ad147d8623138512c2 (patch)
tree09dd66c114bcc759fd86de0279c91a21d356235b
downloadberkeley-testfloat-3-d6feb3fa41c6b7ba1b5444ad147d8623138512c2.zip
berkeley-testfloat-3-d6feb3fa41c6b7ba1b5444ad147d8623138512c2.tar.gz
berkeley-testfloat-3-d6feb3fa41c6b7ba1b5444ad147d8623138512c2.tar.bz2
First draft of RC for Release 3, to start review process.
-rw-r--r--COPYING.txt34
-rw-r--r--README.html82
-rw-r--r--README.txt27
-rw-r--r--build/Linux-386-GCC/Makefile285
-rw-r--r--build/Linux-386-GCC/platform.h42
-rw-r--r--doc/TestFloat-general.html989
-rw-r--r--doc/TestFloat-history.html156
-rw-r--r--doc/TestFloat-source.html546
-rw-r--r--doc/testfloat.html259
-rw-r--r--doc/testfloat_gen.html341
-rw-r--r--doc/testfloat_ver.html250
-rw-r--r--doc/testsoftfloat.html229
-rw-r--r--doc/timesoftfloat.html202
-rw-r--r--source/fail.c56
-rw-r--r--source/fail.h38
-rw-r--r--source/functionInfos.c212
-rw-r--r--source/functions.h230
-rw-r--r--source/functions_common.c54
-rw-r--r--source/genCases.h99
-rw-r--r--source/genCases_common.c55
-rw-r--r--source/genCases_extF80.c917
-rw-r--r--source/genCases_f128.c1087
-rw-r--r--source/genCases_f32.c661
-rw-r--r--source/genCases_f64.c801
-rw-r--r--source/genCases_i32.c359
-rw-r--r--source/genCases_i64.c551
-rw-r--r--source/genCases_ui32.c320
-rw-r--r--source/genCases_ui64.c480
-rw-r--r--source/genCases_writeTestsTotal.c60
-rw-r--r--source/genLoops.c2224
-rw-r--r--source/genLoops.h277
-rw-r--r--source/random.c135
-rw-r--r--source/random.h46
-rw-r--r--source/readHex.c187
-rw-r--r--source/readHex.h43
-rw-r--r--source/slowfloat.c3098
-rw-r--r--source/slowfloat.h220
-rw-r--r--source/standardFunctionInfos.c355
-rw-r--r--source/subj-C/subjfloat.c734
-rw-r--r--source/subj-C/subjfloat_config.h94
-rw-r--r--source/subjfloat.h392
-rw-r--r--source/subjfloat_functions.c1410
-rw-r--r--source/testLoops.h466
-rw-r--r--source/testLoops_common.c44
-rw-r--r--source/test_a_extF80_z_f128.c104
-rw-r--r--source/test_a_extF80_z_f32.c104
-rw-r--r--source/test_a_extF80_z_f64.c104
-rw-r--r--source/test_a_extF80_z_i32_rx.c106
-rw-r--r--source/test_a_extF80_z_i32_x.c105
-rw-r--r--source/test_a_extF80_z_i64_rx.c106
-rw-r--r--source/test_a_extF80_z_i64_x.c105
-rw-r--r--source/test_a_extF80_z_ui32_rx.c106
-rw-r--r--source/test_a_extF80_z_ui32_x.c105
-rw-r--r--source/test_a_extF80_z_ui64_rx.c106
-rw-r--r--source/test_a_extF80_z_ui64_x.c105
-rw-r--r--source/test_a_f128_z_extF80.c104
-rw-r--r--source/test_a_f128_z_f32.c104
-rw-r--r--source/test_a_f128_z_f64.c104
-rw-r--r--source/test_a_f128_z_i32_rx.c106
-rw-r--r--source/test_a_f128_z_i32_x.c105
-rw-r--r--source/test_a_f128_z_i64_rx.c106
-rw-r--r--source/test_a_f128_z_i64_x.c105
-rw-r--r--source/test_a_f128_z_ui32_rx.c106
-rw-r--r--source/test_a_f128_z_ui32_x.c105
-rw-r--r--source/test_a_f128_z_ui64_rx.c106
-rw-r--r--source/test_a_f128_z_ui64_x.c105
-rw-r--r--source/test_a_f32_z_extF80.c103
-rw-r--r--source/test_a_f32_z_f128.c103
-rw-r--r--source/test_a_f32_z_f64.c97
-rw-r--r--source/test_a_f32_z_i32_rx.c101
-rw-r--r--source/test_a_f32_z_i32_x.c100
-rw-r--r--source/test_a_f32_z_i64_rx.c102
-rw-r--r--source/test_a_f32_z_i64_x.c101
-rw-r--r--source/test_a_f32_z_ui32_rx.c101
-rw-r--r--source/test_a_f32_z_ui32_x.c100
-rw-r--r--source/test_a_f32_z_ui64_rx.c101
-rw-r--r--source/test_a_f32_z_ui64_x.c100
-rw-r--r--source/test_a_f64_z_extF80.c103
-rw-r--r--source/test_a_f64_z_f128.c103
-rw-r--r--source/test_a_f64_z_f32.c97
-rw-r--r--source/test_a_f64_z_i32_rx.c101
-rw-r--r--source/test_a_f64_z_i32_x.c100
-rw-r--r--source/test_a_f64_z_i64_rx.c102
-rw-r--r--source/test_a_f64_z_i64_x.c101
-rw-r--r--source/test_a_f64_z_ui32_rx.c101
-rw-r--r--source/test_a_f64_z_ui32_x.c100
-rw-r--r--source/test_a_f64_z_ui64_rx.c101
-rw-r--r--source/test_a_f64_z_ui64_x.c100
-rw-r--r--source/test_a_i32_z_extF80.c98
-rw-r--r--source/test_a_i32_z_f128.c98
-rw-r--r--source/test_a_i32_z_f32.c92
-rw-r--r--source/test_a_i32_z_f64.c92
-rw-r--r--source/test_a_i64_z_extF80.c98
-rw-r--r--source/test_a_i64_z_f128.c98
-rw-r--r--source/test_a_i64_z_f32.c92
-rw-r--r--source/test_a_i64_z_f64.c92
-rw-r--r--source/test_a_ui32_z_extF80.c98
-rw-r--r--source/test_a_ui32_z_f128.c98
-rw-r--r--source/test_a_ui32_z_f32.c92
-rw-r--r--source/test_a_ui32_z_f64.c92
-rw-r--r--source/test_a_ui64_z_extF80.c98
-rw-r--r--source/test_a_ui64_z_f128.c98
-rw-r--r--source/test_a_ui64_z_f32.c92
-rw-r--r--source/test_a_ui64_z_f64.c92
-rw-r--r--source/test_ab_extF80_z_bool.c101
-rw-r--r--source/test_ab_f128_z_bool.c101
-rw-r--r--source/test_ab_f32_z_bool.c96
-rw-r--r--source/test_ab_f64_z_bool.c96
-rw-r--r--source/test_abcz_f128.c126
-rw-r--r--source/test_abcz_f32.c104
-rw-r--r--source/test_abcz_f64.c104
-rw-r--r--source/test_abz_extF80.c110
-rw-r--r--source/test_abz_f128.c106
-rw-r--r--source/test_abz_f32.c101
-rw-r--r--source/test_abz_f64.c101
-rw-r--r--source/test_az_extF80.c104
-rw-r--r--source/test_az_extF80_rx.c109
-rw-r--r--source/test_az_f128.c104
-rw-r--r--source/test_az_f128_rx.c107
-rw-r--r--source/test_az_f32.c97
-rw-r--r--source/test_az_f32_rx.c102
-rw-r--r--source/test_az_f64.c97
-rw-r--r--source/test_az_f64_rx.c102
-rw-r--r--source/testfloat.c1351
-rw-r--r--source/testfloat_gen.c762
-rw-r--r--source/testfloat_ver.c622
-rw-r--r--source/testsoftfloat.c938
-rw-r--r--source/timesoftfloat.c3958
-rw-r--r--source/uint128.c96
-rw-r--r--source/uint128.h63
-rw-r--r--source/verCases.h141
-rw-r--r--source/verCases_common.c133
-rw-r--r--source/verCases_writeFunctionName.c73
-rw-r--r--source/verLoops.c4141
-rw-r--r--source/verLoops.h251
-rw-r--r--source/writeCase.h91
-rw-r--r--source/writeCase_a_extF80M.c52
-rw-r--r--source/writeCase_a_f128M.c52
-rw-r--r--source/writeCase_a_f32.c48
-rw-r--r--source/writeCase_a_f64.c48
-rw-r--r--source/writeCase_a_ui32.c48
-rw-r--r--source/writeCase_a_ui64.c48
-rw-r--r--source/writeCase_ab_extF80M.c59
-rw-r--r--source/writeCase_ab_f128M.c56
-rw-r--r--source/writeCase_ab_f32.c50
-rw-r--r--source/writeCase_ab_f64.c50
-rw-r--r--source/writeCase_abc_extF80M.c62
-rw-r--r--source/writeCase_abc_f128M.c62
-rw-r--r--source/writeCase_abc_f32.c54
-rw-r--r--source/writeCase_abc_f64.c54
-rw-r--r--source/writeCase_z_bool.c56
-rw-r--r--source/writeCase_z_extF80M.c64
-rw-r--r--source/writeCase_z_f128M.c64
-rw-r--r--source/writeCase_z_f32.c60
-rw-r--r--source/writeCase_z_f64.c60
-rw-r--r--source/writeCase_z_ui32.c59
-rw-r--r--source/writeCase_z_ui64.c59
-rw-r--r--source/writeHex.c193
-rw-r--r--source/writeHex.h53
159 files changed, 41196 insertions, 0 deletions
diff --git a/COPYING.txt b/COPYING.txt
new file mode 100644
index 0000000..c7d4700
--- /dev/null
+++ b/COPYING.txt
@@ -0,0 +1,34 @@
+
+License for Berkeley TestFloat Release 3
+
+John R. Hauser
+2014 ________
+
+The following applies to the whole of TestFloat Release 3 as well as to each
+source file individually.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and
+binary forms, with or without modification, are permitted provided that the
+following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in
+the documentation and/or other materials provided with the distribution.
+Neither the name of the Regents nor the names of its contributors may be
+used to endorse or promote products derived from this software without
+specific prior written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
diff --git a/README.html b/README.html
new file mode 100644
index 0000000..8831206
--- /dev/null
+++ b/README.html
@@ -0,0 +1,82 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>Berkeley TestFloat Package Overview</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Package Overview for Berkeley TestFloat Release 3</H1>
+
+<P>
+John R. Hauser<BR>
+2014 ________<BR>
+</P>
+
+<P>
+Berkeley TestFloat is ___.
+***
+TestFloat is distributed in the form of C source code.
+Building the TestFloat sources creates ___.
+</P>
+
+<P>
+The TestFloat package is documented in the following files in the
+<CODE>doc</CODE> subdirectory:
+<BLOCKQUOTE>
+<TABLE>
+<TR>
+<TD><A HREF="doc/TestFloat-general.html"><CODE>TestFloat-general.html</CODE></A></TD>
+<TD>
+General documentation for understanding and using the TestFloat programs.
+</TD>
+</TR>
+<TD><A HREF="doc/testfloat_gen.html"><CODE>testfloat_gen.html</CODE></A></TD>
+<TD>
+Specific documentation for the <CODE>testfloat_gen</CODE> program.
+</TD>
+</TR>
+<TR>
+<TD><A HREF="doc/testfloat_ver.html"><CODE>testfloat_ver.html</CODE></A></TD>
+<TD>
+Specific documentation for the <CODE>testfloat_ver</CODE> program.
+</TD>
+</TR>
+<TR>
+<TD><A HREF="doc/testfloat.html"><CODE>testfloat.html</CODE></A></TD>
+<TD>
+Specific documentation for the all-in-one <CODE>testfloat</CODE> program.
+</TD>
+</TR>
+<TR>
+<TD><A HREF="doc/testsoftfloat.html"><CODE>testsoftfloat.html</CODE></A></TD>
+<TD>
+Specific documentation for the <CODE>testsoftfloat</CODE> program.
+</TD>
+</TR>
+<TR>
+<TD><A HREF="doc/timesoftfloat.html"><CODE>timesoftfloat.html</CODE></A></TD>
+<TD>
+Specific documentation for the <CODE>timesoftfloat</CODE> program.
+</TD>
+</TR>
+<TR>
+<TD><A HREF="doc/TestFloat-source.html"><CODE>TestFloat-source.html</CODE></A></TD>
+<TD>
+Documentation for building TestFloat.
+</TD>
+</TR>
+<TR>
+<TD><A HREF="doc/TestFloat-history.html"><CODE>TestFloat-history.html</CODE></A><CODE>&nbsp;&nbsp;&nbsp;</CODE></TD>
+<TD>
+History of the major changes to TestFloat.
+</TD>
+</TR>
+</TABLE>
+</BLOCKQUOTE>
+Other files in the package comprise the source code for TestFloat.
+</P>
+
+</BODY>
+
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..1f98497
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,27 @@
+
+Package Overview for Berkeley TestFloat Release 3
+
+John R. Hauser
+2014 ________
+
+Berkeley TestFloat is ___.
+***
+TestFloat
+is distributed in the form of C source code. Building the TestFloat sources
+creates ___.
+
+The TestFloat package is documented in the following files in the "doc"
+subdirectory:
+
+ TestFloat-general.html General documentation for understanding and using
+ the TestFloat programs.
+ testfloat_gen.html \
+ testfloat_ver.html | Specific documentation for each TestFloat
+ testfloat.html | program.
+ testsoftfloat.html |
+ timesoftfloat.html /
+ TestFloat-source.html Documentation for building TestFloat.
+ TestFloat-history.html History of the major changes to TestFloat.
+
+Other files in the package comprise the source code for TestFloat.
+
diff --git a/build/Linux-386-GCC/Makefile b/build/Linux-386-GCC/Makefile
new file mode 100644
index 0000000..3108628
--- /dev/null
+++ b/build/Linux-386-GCC/Makefile
@@ -0,0 +1,285 @@
+
+SOURCE_DIR = ../../source
+SOFTFLOAT_DIR = ../../../berkeley-softfloat-rc3
+SOFTFLOAT_INCLUDE_DIR = $(SOFTFLOAT_DIR)/source/include
+PLATFORM = Linux-386-GCC
+
+SOFTFLOAT_H = \
+ $(SOFTFLOAT_INCLUDE_DIR)/softfloat_types.h \
+ $(SOFTFLOAT_INCLUDE_DIR)/softfloat.h
+SOFTFLOAT_LIB = $(SOFTFLOAT_DIR)/build/$(PLATFORM)/softfloat$(LIB)
+
+TYPE_OPTS = -DEXTFLOAT80 -DFLOAT128
+
+DELETE = rm -f
+C_INCLUDES = -I. -I$(SOURCE_DIR) -I$(SOFTFLOAT_INCLUDE_DIR)
+COMPILE_C = \
+ gcc -c -Werror-implicit-function-declaration $(TYPE_OPTS) $(C_INCLUDES) -O2 \
+ -o $@
+COMPILE_SLOWFLOAT_C = \
+ gcc -c -Werror-implicit-function-declaration $(TYPE_OPTS) $(C_INCLUDES) -O3 \
+ -o $@
+MAKELIB = ar crs $@
+LINK = gcc -o $@
+
+OBJ = .o
+LIB = .a
+EXE =
+
+.PHONY: all
+all: \
+ testsoftfloat$(EXE) \
+ timesoftfloat$(EXE) \
+ testfloat_gen$(EXE) \
+ testfloat_ver$(EXE) \
+ testfloat$(EXE) \
+
+OBJS_GENCASES = \
+ genCases_ui32$(OBJ) \
+ genCases_ui64$(OBJ) \
+ genCases_i32$(OBJ) \
+ genCases_i64$(OBJ) \
+ genCases_f32$(OBJ) \
+ genCases_f64$(OBJ) \
+ genCases_extF80$(OBJ) \
+ genCases_f128$(OBJ) \
+
+OBJS_WRITECASE = \
+ writeCase_a_ui32$(OBJ) \
+ writeCase_a_ui64$(OBJ) \
+ writeCase_a_f32$(OBJ) \
+ writeCase_ab_f32$(OBJ) \
+ writeCase_abc_f32$(OBJ) \
+ writeCase_a_f64$(OBJ) \
+ writeCase_ab_f64$(OBJ) \
+ writeCase_abc_f64$(OBJ) \
+ writeCase_a_extF80M$(OBJ) \
+ writeCase_ab_extF80M$(OBJ) \
+ writeCase_abc_extF80M$(OBJ) \
+ writeCase_a_f128M$(OBJ) \
+ writeCase_ab_f128M$(OBJ) \
+ writeCase_abc_f128M$(OBJ) \
+ writeCase_z_bool$(OBJ) \
+ writeCase_z_ui32$(OBJ) \
+ writeCase_z_ui64$(OBJ) \
+ writeCase_z_f32$(OBJ) \
+ writeCase_z_f64$(OBJ) \
+ writeCase_z_extF80M$(OBJ) \
+ writeCase_z_f128M$(OBJ) \
+
+OBJS_TEST = \
+ test_a_ui32_z_f32$(OBJ) \
+ test_a_ui32_z_f64$(OBJ) \
+ test_a_ui32_z_extF80$(OBJ) \
+ test_a_ui32_z_f128$(OBJ) \
+ test_a_ui64_z_f32$(OBJ) \
+ test_a_ui64_z_f64$(OBJ) \
+ test_a_ui64_z_extF80$(OBJ) \
+ test_a_ui64_z_f128$(OBJ) \
+ test_a_i32_z_f32$(OBJ) \
+ test_a_i32_z_f64$(OBJ) \
+ test_a_i32_z_extF80$(OBJ) \
+ test_a_i32_z_f128$(OBJ) \
+ test_a_i64_z_f32$(OBJ) \
+ test_a_i64_z_f64$(OBJ) \
+ test_a_i64_z_extF80$(OBJ) \
+ test_a_i64_z_f128$(OBJ) \
+ test_a_f32_z_ui32_rx$(OBJ) \
+ test_a_f32_z_ui64_rx$(OBJ) \
+ test_a_f32_z_i32_rx$(OBJ) \
+ test_a_f32_z_i64_rx$(OBJ) \
+ test_a_f32_z_ui32_x$(OBJ) \
+ test_a_f32_z_ui64_x$(OBJ) \
+ test_a_f32_z_i32_x$(OBJ) \
+ test_a_f32_z_i64_x$(OBJ) \
+ test_a_f32_z_f64$(OBJ) \
+ test_a_f32_z_extF80$(OBJ) \
+ test_a_f32_z_f128$(OBJ) \
+ test_az_f32$(OBJ) \
+ test_az_f32_rx$(OBJ) \
+ test_abz_f32$(OBJ) \
+ test_abcz_f32$(OBJ) \
+ test_ab_f32_z_bool$(OBJ) \
+ test_a_f64_z_ui32_rx$(OBJ) \
+ test_a_f64_z_ui64_rx$(OBJ) \
+ test_a_f64_z_i32_rx$(OBJ) \
+ test_a_f64_z_i64_rx$(OBJ) \
+ test_a_f64_z_ui32_x$(OBJ) \
+ test_a_f64_z_ui64_x$(OBJ) \
+ test_a_f64_z_i32_x$(OBJ) \
+ test_a_f64_z_i64_x$(OBJ) \
+ test_a_f64_z_f32$(OBJ) \
+ test_a_f64_z_extF80$(OBJ) \
+ test_a_f64_z_f128$(OBJ) \
+ test_az_f64$(OBJ) \
+ test_az_f64_rx$(OBJ) \
+ test_abz_f64$(OBJ) \
+ test_abcz_f64$(OBJ) \
+ test_ab_f64_z_bool$(OBJ) \
+ test_a_extF80_z_ui32_rx$(OBJ) \
+ test_a_extF80_z_ui64_rx$(OBJ) \
+ test_a_extF80_z_i32_rx$(OBJ) \
+ test_a_extF80_z_i64_rx$(OBJ) \
+ test_a_extF80_z_ui32_x$(OBJ) \
+ test_a_extF80_z_ui64_x$(OBJ) \
+ test_a_extF80_z_i32_x$(OBJ) \
+ test_a_extF80_z_i64_x$(OBJ) \
+ test_a_extF80_z_f32$(OBJ) \
+ test_a_extF80_z_f64$(OBJ) \
+ test_a_extF80_z_f128$(OBJ) \
+ test_az_extF80$(OBJ) \
+ test_az_extF80_rx$(OBJ) \
+ test_abz_extF80$(OBJ) \
+ test_ab_extF80_z_bool$(OBJ) \
+ test_a_f128_z_ui32_rx$(OBJ) \
+ test_a_f128_z_ui64_rx$(OBJ) \
+ test_a_f128_z_i32_rx$(OBJ) \
+ test_a_f128_z_i64_rx$(OBJ) \
+ test_a_f128_z_ui32_x$(OBJ) \
+ test_a_f128_z_ui64_x$(OBJ) \
+ test_a_f128_z_i32_x$(OBJ) \
+ test_a_f128_z_i64_x$(OBJ) \
+ test_a_f128_z_f32$(OBJ) \
+ test_a_f128_z_f64$(OBJ) \
+ test_a_f128_z_extF80$(OBJ) \
+ test_az_f128$(OBJ) \
+ test_az_f128_rx$(OBJ) \
+ test_abz_f128$(OBJ) \
+ test_abcz_f128$(OBJ) \
+ test_ab_f128_z_bool$(OBJ) \
+
+OBJS_LIB = \
+ uint128$(OBJ) \
+ fail$(OBJ) \
+ functions_common$(OBJ) \
+ functionInfos$(OBJ) \
+ standardFunctionInfos$(OBJ) \
+ random$(OBJ) \
+ genCases_common$(OBJ) \
+ $(OBJS_GENCASES) \
+ genCases_writeTestsTotal$(OBJ) \
+ verCases_common$(OBJ) \
+ verCases_writeFunctionName$(OBJ) \
+ readHex$(OBJ) \
+ writeHex$(OBJ) \
+ $(OBJS_WRITECASE) \
+ testLoops_common$(OBJ) \
+ $(OBJS_TEST) \
+
+uint128$(OBJ): platform.h $(SOURCE_DIR)/uint128.h
+fail$(OBJ): $(SOURCE_DIR)/fail.h
+functions_common$(OBJ): $(SOFTFLOAT_H) $(SOURCE_DIR)/functions.h
+functionInfos$(OBJ): $(SOURCE_DIR)/functions.h
+random$(OBJ): $(SOURCE_DIR)/random.h
+genCases_common$(OBJ): $(SOURCE_DIR)/fail.h $(SOURCE_DIR)/genCases.h
+$(OBJS_GENCASES): \
+ $(SOURCE_DIR)/random.h $(SOFTFLOAT_H) $(SOURCE_DIR)/genCases.h
+genCases_f128$(OBJ): platform.h $(SOURCE_DIR)/uint128.h
+genCases_writeTestsTotal$(OBJ): $(SOURCE_DIR)/genCases.h
+verCases_common$(OBJ): $(SOURCE_DIR)/verCases.h
+verCases_writeFunctionName$(OBJ): $(SOURCE_DIR)/verCases.h
+readHex$(OBJ): $(SOURCE_DIR)/readHex.h
+writeHex$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) $(SOURCE_DIR)/writeHex.h
+writeCase_common$(OBJ): $(SOURCE_DIR)/writeCase.h
+$(OBJS_WRITECASE): \
+ $(SOFTFLOAT_H) $(SOURCE_DIR)/writeHex.h $(SOURCE_DIR)/writeCase.h
+testLoops_common$(OBJ): $(SOURCE_DIR)/testLoops.h
+$(OBJS_TEST): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) $(SOURCE_DIR)/genCases.h \
+ $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h $(SOURCE_DIR)/testLoops.h
+$(OBJS_LIB): %$(OBJ): $(SOURCE_DIR)/%.c
+ $(COMPILE_C) $(SOURCE_DIR)/$*.c
+testfloat$(LIB): $(OBJS_LIB)
+ $(MAKELIB) $^
+#*** RESTORE:
+# standardFunctionInfos$(OBJ): $(SOURCE_DIR)/functions.h
+
+OBJS_TESTSOFTFLOAT = slowfloat$(OBJ) testsoftfloat$(OBJ)
+
+slowfloat$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) $(SOURCE_DIR)/slowfloat.h \
+ $(SOURCE_DIR)/slowfloat.c
+ $(COMPILE_SLOWFLOAT_C) $(SOURCE_DIR)/slowfloat.c
+testsoftfloat$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/slowfloat.h $(SOURCE_DIR)/functions.h \
+ $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h \
+ $(SOURCE_DIR)/testLoops.h $(SOURCE_DIR)/testsoftfloat.c
+ $(COMPILE_C) $(SOURCE_DIR)/testsoftfloat.c
+
+testsoftfloat$(EXE): $(OBJS_TESTSOFTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^
+
+OBJS_TIMESOFTFLOAT = timesoftfloat$(OBJ)
+
+timesoftfloat$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/timesoftfloat.c
+ $(COMPILE_C) $(SOURCE_DIR)/timesoftfloat.c
+
+timesoftfloat$(EXE): $(OBJS_TIMESOFTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^
+
+OBJS_TESTFLOAT_GEN = genLoops$(OBJ) testfloat_gen$(OBJ)
+
+genLoops$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/writeHex.h $(SOURCE_DIR)/genLoops.h \
+ $(SOURCE_DIR)/genLoops.c
+ $(COMPILE_C) $(SOURCE_DIR)/genLoops.c
+testfloat_gen$(OBJ): \
+ $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) $(SOURCE_DIR)/functions.h \
+ $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/genLoops.h \
+ $(SOURCE_DIR)/testfloat_gen.c
+ $(COMPILE_C) $(SOURCE_DIR)/testfloat_gen.c
+
+testfloat_gen$(EXE): $(OBJS_TESTFLOAT_GEN) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^
+
+OBJS_TESTFLOAT_VER = verLoops$(OBJ) testfloat_ver$(OBJ)
+
+verLoops$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/readHex.h $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h \
+ $(SOURCE_DIR)/verLoops.h $(SOURCE_DIR)/verLoops.c
+ $(COMPILE_C) $(SOURCE_DIR)/verLoops.c
+testfloat_ver$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/verCases.h \
+ $(SOURCE_DIR)/writeCase.h $(SOURCE_DIR)/verLoops.h \
+ $(SOURCE_DIR)/testfloat_ver.c
+ $(COMPILE_C) $(SOURCE_DIR)/testfloat_ver.c
+
+testfloat_ver$(EXE): $(OBJS_TESTFLOAT_VER) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^
+
+OBJS_TESTFLOAT = systfloat$(OBJ) systfloat_functions$(OBJ) testfloat$(OBJ)
+
+systfloat$(OBJ): \
+ $(SOFTFLOAT_H) $(SOURCE_DIR)/systfloat_config.h $(SOURCE_DIR)/systfloat.h \
+ $(SOURCE_DIR)/systfloat.c
+ $(COMPILE_C) $(SOURCE_DIR)/systfloat.c
+systfloat_functions$(OBJ): \
+ $(SOURCE_DIR)/systfloat_config.h $(SOURCE_DIR)/systfloat.h \
+ $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/systfloat_functions.c
+ $(COMPILE_C) $(SOURCE_DIR)/systfloat_functions.c
+testfloat$(OBJ): \
+ platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
+ $(SOURCE_DIR)/systfloat_config.h $(SOURCE_DIR)/systfloat.h \
+ $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/verCases.h \
+ $(SOURCE_DIR)/writeCase.h $(SOURCE_DIR)/testLoops.h $(SOURCE_DIR)/testfloat.c
+ $(COMPILE_C) $(SOURCE_DIR)/testfloat.c
+
+testfloat$(EXE): $(OBJS_TESTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
+ $(LINK) $^ -lm
+
+.PHONY: clean
+clean:
+ $(DELETE) $(OBJS_LIB) testfloat$(LIB)
+ $(DELETE) $(OBJS_TESTSOFTFLOAT) testsoftfloat$(EXE)
+ $(DELETE) $(OBJS_TIMESOFTFLOAT) timesoftfloat$(EXE)
+ $(DELETE) $(OBJS_TESTFLOAT_GEN) testfloat_gen$(EXE)
+ $(DELETE) $(OBJS_TESTFLOAT_VER) testfloat_ver$(EXE)
+ $(DELETE) $(OBJS_TESTFLOAT) testfloat$(EXE)
+
diff --git a/build/Linux-386-GCC/platform.h b/build/Linux-386-GCC/platform.h
new file mode 100644
index 0000000..2ea4f73
--- /dev/null
+++ b/build/Linux-386-GCC/platform.h
@@ -0,0 +1,42 @@
+
+/*============================================================================
+
+*** FIX.
+
+This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b.
+
+Written by John R. Hauser. This work was made possible in part by the
+International Computer Science Institute, located at Suite 600, 1947 Center
+Street, Berkeley, California 94704. Funding was partially provided by the
+National Science Foundation under grant MIP-9311980. The original version
+of this code was written as part of a project to build a fixed-point vector
+processor in collaboration with the University of California at Berkeley,
+overseen by Profs. Nelson Morgan and John Wawrzynek. More information
+is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
+arithmetic/SoftFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+
+=============================================================================*/
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#define LITTLEENDIAN 1
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#define INLINE extern inline
+
diff --git a/doc/TestFloat-general.html b/doc/TestFloat-general.html
new file mode 100644
index 0000000..1618d4a
--- /dev/null
+++ b/doc/TestFloat-general.html
@@ -0,0 +1,989 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>Berkeley TestFloat General Documentation</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Berkeley TestFloat Release 3: General Documentation</H1>
+
+<P>
+John R. Hauser<BR>
+2014 ______<BR>
+</P>
+
+<P>
+*** CONTENT DONE.
+</P>
+
+<P>
+*** REPLACE QUOTATION MARKS.
+<BR>
+*** REPLACE APOSTROPHES.
+<BR>
+*** REPLACE EM DASH.
+</P>
+
+
+<H2>Contents</H2>
+
+<P>
+*** CHECK.<BR>
+*** FIX FORMATTING.
+</P>
+
+<PRE>
+ Introduction
+ Limitations
+ Acknowledgments and License
+ What TestFloat Does
+ Executing TestFloat
+ Operations Tested by TestFloat
+ Conversion Operations
+ Basic Arithmetic Operations
+ Fused Multiply-Add Operations
+ Remainder Operations
+ Round-to-Integer Operations
+ Comparison Operations
+ Interpreting TestFloat Output
+ Variations Allowed by the IEEE Floating-Point Standard
+ Underflow
+ NaNs
+ Conversions to Integer
+ Contact Information
+</PRE>
+
+
+<H2>1. Introduction</H2>
+
+<P>
+Berkeley TestFloat is a small collection of programs for testing that an
+implementation of binary floating-point conforms to the IEEE Standard for
+Floating-Point Arithmetic.
+All operations required by the original 1985 version of the IEEE Floating-Point
+Standard can be tested, except for conversions to and from decimal.
+The following binary formats can be tested: <NOBR>32-bit</NOBR>
+single-precision, <NOBR>64-bit</NOBR> double-precision, <NOBR>80-bit</NOBR>
+double-extended-precision, and/or <NOBR>128-bit</NOBR> quadruple-precision.
+TestFloat cannot test decimal floating-point.
+</P>
+
+<P>
+Included in the TestFloat package are the <CODE>testsoftfloat</CODE> and
+<CODE>timesoftfloat</CODE> programs for testing the Berkeley SoftFloat software
+implementation of floating-point and for measuring its speed.
+Information about SoftFloat can be found at the SoftFloat Web page,
+<A HREF="http://www.jhauser.us/arithmetic/SoftFloat.html"><CODE>http://www.jhauser.us/arithmetic/SoftFloat.html</CODE></A>.
+The <CODE>testsoftfloat</CODE> and <CODE>timesoftfloat</CODE> programs are
+expected to be of interest only to people compiling the SoftFloat sources.
+</P>
+
+<P>
+This document explains how to use the TestFloat programs.
+It does not attempt to define or explain much of the IEEE Floating-Point
+Standard.
+Details about the standard are available elsewhere.
+</P>
+
+<P>
+The current version of TestFloat is <NOBR>Release 3</NOBR>.
+The set of TestFloat programs as well as the programs' arguments and behavior
+have changed some compared to earlier TestFloat releases.
+</P>
+
+
+<H2>2. Limitations</H2>
+
+<P>
+TestFloat output is not always easily interpreted.
+Detailed knowledge of the IEEE Floating-Point Standard and its vagaries is
+needed to use TestFloat responsibly.
+</P>
+
+<P>
+TestFloat performs relatively simple tests designed to check the fundamental
+soundness of the floating-point under test.
+TestFloat may also at times manage to find rarer and more subtle bugs, but it
+will probably only find such bugs by chance.
+Software that purposefully seeks out various kinds of subtle floating-point
+bugs can be found through links posted on the TestFloat Web page
+(<A HREF="http://www.jhauser.us/arithmetic/TestFloat.html"><CODE>http://www.jhauser.us/arithmetic/TestFloat.html</CODE></A>).
+</P>
+
+
+<H2>3. Acknowledgments and License</H2>
+
+<P>
+The TestFloat package was written by me, <NOBR>John R.</NOBR> Hauser.
+<NOBR>Release 3</NOBR> of TestFloat is a completely new implementation
+supplanting earlier releases.
+This project was done in the employ of the University of California, Berkeley,
+within the Department of Electrical Engineering and Computer Sciences, first
+for the Parallel Computing Laboratory (Par Lab) and then for the ASPIRE Lab.
+The work was officially overseen by Prof. Krste Asanovic, with funding provided
+by these sources:
+<BLOCKQUOTE>
+<TABLE>
+<TR>
+<TD><NOBR>Par Lab:</NOBR></TD>
+<TD>
+Microsoft (Award #024263), Intel (Award #024894), and U.C. Discovery
+(Award #DIG07-10227), with additional support from Par Lab affiliates Nokia,
+NVIDIA, Oracle, and Samsung.
+</TD>
+</TR>
+<TR>
+<TD><NOBR>ASPIRE Lab:</NOBR></TD>
+<TD>
+DARPA PERFECT program (Award #HR0011-12-2-0016), with additional support from
+ASPIRE industrial sponsor Intel and ASPIRE affiliates Google, Nokia, NVIDIA,
+Oracle, and Samsung.
+</TD>
+</TR>
+</TABLE>
+</BLOCKQUOTE>
+</P>
+
+<P>
+The following applies to the whole of TestFloat <NOBR>Release 3</NOBR> as well
+as to each source file individually.
+</P>
+
+<P>
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents).
+All Rights Reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+</P>
+
+<P>
+Redistributions of source code must retain the above copyright notice, this
+list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution.
+Neither the name of the Regents nor the names of its contributors may be used
+to endorse or promote products derived from this software without specific
+prior written permission.
+</P>
+
+<P>
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF
+THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+</P>
+
+<P>
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS
+PROVIDED "<NOBR>AS IS</NOBR>".
+REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ENHANCEMENTS, OR MODIFICATIONS.
+</P>
+
+
+<H2>4. What TestFloat Does</H2>
+
+<P>
+TestFloat is designed to test a floating-point implementation by comparing its
+behavior with that of TestFloat's own internal floating-point implemented in
+software.
+For each operation to be tested, the TestFloat programs can generate a large
+number of test cases, made up of simple pattern tests intermixed with weighted
+random inputs.
+The cases generated should be adequate for testing carry chain propagations,
+plus the rounding of addition, subtraction, multiplication, and simple
+operations like conversions.
+TestFloat makes a point of checking all boundary cases of the arithmetic,
+including underflows, overflows, invalid operations, subnormal inputs, zeros
+(positive and negative), infinities, and NaNs.
+For the interesting operations like addition and multiplication, millions of
+test cases may be checked.
+</P>
+
+<P>
+TestFloat is not remarkably good at testing difficult rounding cases for
+division and square root.
+It also makes no attempt to find bugs specific to SRT division and the like
+(such as the infamous Pentium division bug).
+Software that tests for such failures can be found through links on the
+TestFloat Web page,
+<A HREF="http://www.jhauser.us/arithmetic/TestFloat.html"><CODE>http://www.jhauser.us/arithmetic/TestFloat.html</CODE></A>.
+</P>
+
+<P>
+NOTE!<BR>
+It is the responsibility of the user to verify that the discrepancies TestFloat
+finds actually represent faults in the implementation being tested.
+Advice to help with this task is provided later in this document.
+Furthermore, even if TestFloat finds no fault with a floating-point
+implementation, that in no way guarantees that the implementation is bug-free.
+</P>
+
+<P>
+For each operation, TestFloat can test all five rounding modes defined by the
+IEEE Floating-Point Standard.
+TestFloat verifies not only that the numeric results of an operation are
+correct, but also that the proper floating-point exception flags are raised.
+All five exception flags are tested, including the <I>inexact</I> flag.
+TestFloat does not attempt to verify that the floating-point exception flags
+are actually implemented as sticky flags.
+</P>
+
+<P>
+For the <NOBR>80-bit</NOBR> double-extended-precision format, TestFloat can
+test the addition, subtraction, multiplication, division, and square root
+operations at all three of the standard rounding precisions.
+The rounding precision can be set to <NOBR>32 bits</NOBR>, equivalent to
+single-precision, to <NOBR>64 bits</NOBR>, equivalent to double-precision, or
+to the full <NOBR>80 bits</NOBR> of the double-extended-precision.
+Rounding precision control can be applied only to the double-extended-precision
+format and only for the five basic arithmetic operations: addition,
+subtraction, multiplication, division, and square root.
+Other operations can be tested only at full precision.
+</P>
+
+<P>
+As a rule, TestFloat is not particular about the bit patterns of NaNs that
+appear as operation results.
+Any NaN is considered as good a result as another.
+This laxness can be overridden so that TestFloat checks for particular bit
+patterns within NaN results.
+See <NOBR>section 8</NOBR> below, <I>Variations Allowed by the IEEE
+Floating-Point Standard</I>, plus the <CODE>-checkNaNs</CODE> option documented
+for programs <CODE>testfloat_ver</CODE> and <CODE>testfloat</CODE>.
+</P>
+
+<P>
+TestFloat normally compares an implementation of floating-point against the
+Berkeley SoftFloat software implementation of floating-point, also created by
+me.
+The SoftFloat functions are linked into each TestFloat program's executable.
+Information about SoftFloat can be found at the Web page
+<A HREF="http://www.jhauser.us/arithmetic/SoftFloat.html"><CODE>http://www.jhauser.us/arithmetic/SoftFloat.html</CODE></A>.
+</P>
+
+<P>
+For testing SoftFloat itself, the TestFloat package includes a
+<CODE>testsoftfloat</CODE> program that compares SoftFloat's floating-point
+against <EM>another</EM> software floating-point implementation.
+The second software floating-point is simpler and slower than SoftFloat, and is
+completely independent of SoftFloat.
+Although the second software floating-point cannot be guaranteed to be
+bug-free, the chance that it would mimic any of SoftFloat's bugs is low.
+Consequently, an error in one or the other floating-point version should appear
+as an unexpected difference between the two implementations.
+Note that testing SoftFloat should be necessary only when compiling a new
+TestFloat executable or when compiling SoftFloat for some other reason.
+</P>
+
+
+<H2>5. Executing TestFloat</H2>
+
+<P>
+The TestFloat package consists of five programs, all intended to be executed
+from a command-line interpreter:
+<BLOCKQUOTE>
+<TABLE>
+<TR>
+<TD>
+<A HREF="testfloat_gen.html"><CODE>testfloat_gen</CODE></A><CODE>&nbsp;&nbsp;&nbsp;</CODE>
+</TD>
+<TD>
+Generates test cases for a specific floating-point operation.
+</TD>
+</TR>
+<TR>
+<TD><A HREF="testfloat_ver.html"><CODE>testfloat_ver</CODE></A></TD>
+<TD>
+Verifies whether the results from executing a floating-point operation are as
+expected.
+</TD>
+</TR>
+<TR>
+<TD><A HREF="testfloat.html"><CODE>testfloat</CODE></A></TD>
+<TD>
+An all-in-one program that generates test cases, executes floating-point
+operations, and verifies whether the results match expectations.
+</TD>
+</TR>
+<TR>
+<TD>
+<A HREF="testsoftfloat.html"><CODE>testsoftfloat</CODE></A><CODE>&nbsp;&nbsp;&nbsp;</CODE>
+</TD>
+<TD>
+Like <CODE>testfloat</CODE>, but for testing SoftFloat.
+</TD>
+</TR>
+<TR>
+<TD>
+<A HREF="timesoftfloat.html"><CODE>timesoftfloat</CODE></A><CODE>&nbsp;&nbsp;&nbsp;</CODE>
+</TD>
+<TD>
+A program for measuring the speed of SoftFloat (included in the TestFloat
+package for convenience).
+</TD>
+</TR>
+</TABLE>
+</BLOCKQUOTE>
+Each program has its own page of documentation that can be opened through the
+links in the table above.
+</P>
+
+<P>
+To test a floating-point implementation other than SoftFloat, one of three
+different methods can be used.
+The first method pipes output from <CODE>testfloat_gen</CODE> to a program
+that:
+<NOBR>(a) reads</NOBR> the incoming test cases, <NOBR>(b) invokes</NOBR> the
+floating-point operation being tested, and <NOBR>(c) writes</NOBR> the
+operation results to output.
+These results can then be piped to <CODE>testfloat_ver</CODE> to be checked for
+correctness.
+Assuming a vertical bar (<CODE>|</CODE>) indicates a pipe between programs, the
+complete process could be written as a single command like so:
+<PRE>
+ testfloat_gen ... &lt;type&gt; | &lt;program-that-invokes-op&gt; | testfloat_ver ... &lt;function&gt;
+</PRE>
+The program in the middle is not supplied by TestFloat but must be created
+independently.
+If for some reason this program cannot take command-line arguments, the
+<CODE>-prefix</CODE> option of <CODE>testfloat_gen</CODE> can communicate
+parameters through the pipe.
+</P>
+
+<P>
+A second method for running TestFloat is similar but has
+<CODE>testfloat_gen</CODE> supply not only the test inputs but also the
+expected results for each case.
+With this additional information, the job done by <CODE>testfloat_ver</CODE>
+can be folded into the invoking program to give the following command:
+<PRE>
+ testfloat_gen ... &lt;function&gt; | &lt;program-that-invokes-op-and-compares-results&gt;
+</PRE>
+Again, the program that actually invokes the floating-point operation is not
+supplied by TestFloat but must be created independently.
+Depending on circumstance, it may be preferable either to let
+<CODE>testfloat_ver</CODE> check and report suspected errors (first method) or
+to include this step in the invoking program (second method).
+</P>
+
+<P>
+The third way to use TestFloat is the all-in-one <CODE>testfloat</CODE>
+program.
+This program can perform all the steps of creating test cases, invoking the
+floating-point operation, checking the results, and reporting suspected errors.
+However, for this to be possible, <CODE>testfloat</CODE> must be compiled to
+contain the method for invoking the floating-point operations to test.
+Each build of <CODE>testfloat</CODE> is therefore capable of testing
+<EM>only</EM> the floating-point implementation it was built to invoke.
+To test a new implementation of floating-point, a new <CODE>testfloat</CODE>
+must be created, linked to that specific implementation.
+By comparison, the <CODE>testfloat_gen</CODE> and <CODE>testfloat_ver</CODE>
+programs are entirely generic;
+one instance is usable for testing any floating-point implementation, because
+implementation-specific details are segregated in the custom program that
+follows <CODE>testfloat_gen</CODE>.
+</P>
+
+<P>
+Program <CODE>testsoftfloat</CODE> is another all-in-one program specifically
+for testing SoftFloat.
+</P>
+
+<P>
+Programs <CODE>testfloat_ver</CODE>, <CODE>testfloat</CODE>, and
+<CODE>testsoftfloat</CODE> all report status and error information in a common
+way.
+As it executes, each of these programs writes status information to the
+standard error output, which should be the screen by default.
+In order for this status to be displayed properly, the standard error stream
+should not be redirected to a file.
+Any discrepancies that are found are written to the standard output stream,
+which is easily redirected to a file if desired.
+Unless redirected, reported errors will appear intermixed with the ongoing
+status information in the output.
+</P>
+
+
+<H2>6. Operations Tested by TestFloat</H2>
+
+<P>
+TestFloat can test all operations required by the original 1985 IEEE
+Floating-Point Standard except for conversions to and from decimal.
+These operations are:
+<UL>
+<LI>
+conversions among the supported floating-point formats, and also between
+integers (<NOBR>32-bit</NOBR> and <NOBR>64-bit</NOBR>, signed and unsigned) and
+any of the floating-point formats;
+<LI>
+for each floating-point format, the usual addition, subtraction,
+multiplication, division, and square root operations;
+<LI>
+for each format, the floating-point remainder operation defined by the IEEE
+Standard;
+<LI>
+for each format, a ``round to integer'' operation that rounds to the nearest
+integer value in the same format; and
+<LI>
+comparisons between two values in the same floating-point format.
+</UL>
+In addition, TestFloat can also test
+<UL>
+<LI>
+for each floating-point format except <NOBR>80-bit</NOBR>
+double-extended-precision, the fused multiply-add operation defined by the 2008
+IEEE Standard.
+</UL>
+</P>
+
+<P>
+More information about all these operations is given below.
+In the operation names used by TestFloat, <NOBR>32-bit</NOBR> single-precision
+is called <CODE>f32</CODE>, <NOBR>64-bit</NOBR> double-precision is
+<CODE>f64</CODE>, <NOBR>80-bit</NOBR> double-extended-precision is
+<CODE>extF80</CODE>, and <NOBR>128-bit</NOBR> quadruple-precision is
+<CODE>f128</CODE>.
+TestFloat generally uses the same names for operations as Berkeley SoftFloat,
+except that TestFloat's names never include the <CODE>M</CODE> that SoftFloat
+uses to indicate that values are passed through pointers.
+</P>
+
+<H3>6.1. Conversion Operations</H3>
+
+<P>
+All conversions among the floating-point formats and all conversions between a
+floating-point format and <NOBR>32-bit</NOBR> and <NOBR>64-bit</NOBR> integers
+can be tested.
+The conversion operations are:
+<PRE>
+ ui32_to_f32 ui64_to_f32 i32_to_f32 i64_to_f32
+ ui32_to_f64 ui64_to_f64 i32_to_f64 i64_to_f64
+ ui32_to_extF80 ui64_to_extF80 i32_to_extF80 i64_to_extF80
+ ui32_to_f128 ui64_to_f128 i32_to_f128 i64_to_f128
+
+ f32_to_ui32 f64_to_ui32 extF80_to_ui32 f128_to_ui32
+ f32_to_ui64 f64_to_ui64 extF80_to_ui64 f128_to_ui64
+ f32_to_i32 f64_to_i32 extF80_to_i32 f128_to_i32
+ f32_to_i64 f64_to_i64 extF80_to_i64 f128_to_i64
+
+ f32_to_f64 f64_to_f32 extF80_to_f32 f128_to_f32
+ f32_to_extF80 f64_to_extF80 extF80_to_f64 f128_to_f64
+ f32_to_f128 f64_to_f128 extF80_to_f128 f128_to_extF80
+</PRE>
+Abbreviations <CODE>ui32</CODE> and <CODE>ui64</CODE> indicate
+<NOBR>32-bit</NOBR> and <NOBR>64-bit</NOBR> unsigned integer types, while
+<CODE>i32</CODE> and <CODE>i64</CODE> indicate their signed counterparts.
+These conversions all round according to the current rounding mode as relevant.
+Conversions from a smaller to a larger floating-point format are always exact
+and so require no rounding.
+Likewise, conversions from <NOBR>32-bit</NOBR> integers to <NOBR>64-bit</NOBR>
+double-precision or to any larger floating-point format are also exact, as are
+conversions from <NOBR>64-bit</NOBR> integers to <NOBR>80-bit</NOBR>
+double-extended-precision and <NOBR>128-bit</NOBR> quadruple-precision.
+</P>
+
+<P>
+For the all-in-one <CODE>testfloat</CODE> program, this list of conversion
+operations requires amendment.
+For <CODE>testfloat</CODE> only, conversions to an integer type have names that
+explicitly specify the rounding mode and treatment of inexactness.
+Thus, instead of
+<PRE>
+ &lt;float&gt;_to_&lt;int&gt;
+</PRE>
+as listed above, operations converting to integer type have names of these
+forms:
+<PRE>
+ &lt;float&gt;_to_&lt;int&gt;_r_&lt;round&gt;
+ &lt;float&gt;_to_&lt;int&gt;_rx_&lt;round&gt;
+</PRE>
+The <CODE>&lt;round&gt;</CODE> component is one of `<CODE>near_even</CODE>',
+`<CODE>near_maxMag</CODE>', `<CODE>minMag</CODE>', `<CODE>min</CODE>', or
+`<CODE>max</CODE>', choosing the rounding mode.
+Any other indication of rounding mode is ignored.
+The operations with `<CODE>_r_</CODE>' in their names never raise the
+<I>inexact</I> exception, while those with `<CODE>_rx_</CODE>' raise the
+<I>inexact</I> exception whenever the result is not exact.
+</P>
+
+<P>
+TestFloat assumes that conversions from floating-point to an integer type
+should raise the <I>invalid</I> exception if the input cannot be rounded to an
+integer representable by the result format.
+In such a circumstance, if the result type is an unsigned integer, TestFloat
+expects the result of the operation to be the type's largest integer value.
+If the result type is a signed integer and conversion overflows, TestFloat
+expects the result to be the largest-magnitude integer with the same sign as
+the input.
+Lastly, when a NaN is converted to a signed integer type, TestFloat allows
+either the largest postive or largest-magnitude negative integer to be
+returned.
+Conversions to integer types are expected never to raise the <I>overflow</I>
+exception.
+</P>
+
+<H3>6.2. Basic Arithmetic Operations</H3>
+
+<P>
+The following standard arithmetic operations can be tested:
+<PRE>
+ f32_add f32_sub f32_mul f32_div f32_sqrt
+ f64_add f64_sub f64_mul f64_div f64_sqrt
+ extF80_add extF80_sub extF80_mul extF80_div extF80_sqrt
+ f128_add f128_sub f128_mul f128_div f128_sqrt
+</PRE>
+The double-extended-precision (<CODE>extF80</CODE>) operations can be rounded
+to reduced precision under rounding precision control.
+</P>
+
+<H3>6.3. Fused Multiply-Add Operations</H3>
+
+<P>
+For all floating-point formats except <NOBR>80-bit</NOBR>
+double-extended-precision, TestFloat can test the fused multiply-add operation
+defined by the 2008 IEEE Floating-Point Standard.
+The fused multiply-add operations are:
+<PRE>
+ f32_mulAdd
+ f64_mulAdd
+ f128_mulAdd
+</PRE>
+</P>
+
+<P>
+If one of the multiplication operands is infinite and the other is zero,
+TestFloat expects the fused multiply-add operation to raise the <I>invalid</I>
+exception even if the third operand is a NaN.
+</P>
+
+<H3>6.4. Remainder Operations</H3>
+
+<P>
+For each format, TestFloat can test the IEEE Standard's remainder operation.
+These operations are:
+<PRE>
+ f32_rem
+ f64_rem
+ extF80_rem
+ f128_rem
+</PRE>
+The remainder operations are always exact and so require no rounding.
+</P>
+
+<H3>6.5. Round-to-Integer Operations</H3>
+
+<P>
+For each format, TestFloat can test the IEEE Standard's round-to-integer
+operation.
+For most TestFloat programs, these operations are:
+<PRE>
+ f32_roundToInt
+ f64_roundToInt
+ extF80_roundToInt
+ f128_roundToInt
+</PRE>
+</P>
+
+<P>
+Just as for conversions to integer types (<NOBR>section 6.1</NOBR> above), the
+all-in-one <CODE>testfloat</CODE> program is again an exception.
+For <CODE>testfloat</CODE> only, the round-to-integer operations have names of
+these forms:
+<PRE>
+ &lt;float&gt;_roundToInt_r_&lt;round&gt;
+ &lt;float&gt;_roundToInt_x
+</PRE>
+For the `<CODE>_r_</CODE>' versions, the <I>inexact</I> exception is never
+raised, and the <CODE>&lt;round&gt;</CODE> component specifies the rounding
+mode as one of `<CODE>near_even</CODE>', `<CODE>near_maxMag</CODE>',
+`<CODE>minMag</CODE>', `<CODE>min</CODE>', or `<CODE>max</CODE>'.
+The usual indication of rounding mode is ignored.
+In contrast, the `<CODE>_x</CODE>' versions accept the usual indication of
+rounding mode and raise the <I>inexact</I> exception whenever the result is not
+exact.
+This irregular system follows the IEEE Standard's precise specification for the
+round-to-integer operations.
+</P>
+
+<H3>6.6. Comparison Operations</H3>
+
+<P>
+The following floating-point comparison operations can be tested:
+<PRE>
+ f32_eq f32_le f32_lt
+ f64_eq f64_le f64_lt
+ extF80_eq extF80_le extF80_lt
+ f128_eq f128_le f128_lt
+</PRE>
+The abbreviation <CODE>eq</CODE> stands for ``equal'' (=), <CODE>le</CODE>
+stands for ``less than or equal'' (&le;), and <CODE>lt</CODE> stands for
+``less than'' (&lt;).
+</P>
+
+<P>
+The IEEE Standard specifies that, by default, the less-than-or-equal and
+less-than comparisons raise the <I>invalid</I> exception if either input is any
+kind of NaN.
+The equality comparisons, on the other hand, are defined by default to raise
+the <I>invalid</I> exception only for signaling NaNs, not for quiet NaNs.
+For completeness, the following additional operations can be tested if
+supported:
+<PRE>
+ f32_eq_signaling f32_le_quiet f32_lt_quiet
+ f64_eq_signaling f64_le_quiet f64_lt_quiet
+ extF80_eq_signaling extF80_le_quiet extF80_lt_quiet
+ f128_eq_signaling f128_le_quiet f128_lt_quiet
+</PRE>
+The <CODE>signaling</CODE> equality comparisons are identical to the standard
+operations except that the <I>invalid</I> exception should be raised for any
+NaN input.
+Similarly, the <CODE>quiet</CODE> comparison operations should be identical to
+their counterparts except that the <I>invalid</I> exception is not raised for
+quiet NaNs.
+</P>
+
+<P>
+Obviously, no comparison operations ever require rounding.
+Any rounding mode is ignored.
+</P>
+
+
+<H2>7. Interpreting TestFloat Output</H2>
+
+<P>
+The ``errors'' reported by TestFloat programs may or may not really represent
+errors in the system being tested.
+For each test case tried, the results from the floating-point implementation
+being tested could differ from the expected results for several reasons:
+<UL>
+<LI>
+The IEEE Floating-Point Standard allows for some variation in how conforming
+floating-point behaves.
+Two implementations can sometimes give different results without either being
+incorrect.
+<LI>
+The trusted floating-point emulation could be faulty.
+This could be because there is a bug in the way the enulation is coded, or
+because a mistake was made when the code was compiled for the current system.
+<LI>
+The TestFloat program may not work properly, reporting differences that do not
+exist.
+<LI>
+Lastly, the floating-point being tested could actually be faulty.
+</UL>
+It is the responsibility of the user to determine the causes for the
+discrepancies that are reported.
+Making this determination can require detailed knowledge about the IEEE
+Standard.
+Assuming TestFloat is working properly, any differences found will be due to
+either the first or last of the reasons above.
+Variations in the IEEE Standard that could lead to false error reports are
+discussed in <NOBR>section 8</NOBR>, <I>Variations Allowed by the IEEE
+Floating-Point Standard</I>.
+</P>
+
+<P>
+For each reported error (or apparent error), a line of text is written to the
+default output.
+If a line would be longer than 79 characters, it is divided.
+The first part of each error line begins in the leftmost column, and any
+subsequent ``continuation'' lines are indented with a tab.
+</P>
+
+<P>
+Each error reported is of the form:
+<PRE>
+ &lt;inputs&gt; => &lt;observed-output&gt; expected: &lt;expected-output&gt;
+</PRE>
+The <CODE>&lt;inputs&gt;</CODE> are the inputs to the operation.
+Each output (observed and expected) is shown as a pair: the result value
+first, followed by the exception flags.
+</P>
+
+<P>
+For example, two typical error lines could be
+<PRE>
+ 800.7FFF00 87F.000100 => 001.000000 ...ux expected: 001.000000 ....x
+ 081.000004 000.1FFFFF => 001.000000 ...ux expected: 001.000000 ....x
+</PRE>
+In the first line, the inputs are <CODE>800.7FFF00</CODE> and
+<CODE>87F.000100</CODE>, and the observed result is <CODE>001.000000</CODE>
+with flags <CODE>...ux</CODE>.
+The trusted emulation result is the same but with different flags,
+<CODE>....x</CODE>.
+Items such as <CODE>800.7FFF00</CODE> composed of hexadecimal digits and a
+single period represent floating-point values (here <NOBR>32-bit</NOBR>
+single-precision).
+The two instances above were reported as errors because the exception flag
+results differ.
+</P>
+
+<P>
+Aside from the exception flags, there are nine data types that may be
+represented.
+Four are floating-point types: <NOBR>32-bit</NOBR> single-precision,
+<NOBR>64-bit</NOBR> double-precision, <NOBR>80-bit</NOBR>
+double-extended-precision, and <NOBR>128-bit</NOBR> quadruple-precision.
+The remaining five types are <NOBR>32-bit</NOBR> and <NOBR>64-bit</NOBR>
+unsigned integers, <NOBR>32-bit</NOBR> and <NOBR>64-bit</NOBR> two's-complement
+signed integers, and Boolean values (the results of comparison operations).
+Boolean values are represented as a single character, either a <CODE>0</CODE>
+or a <CODE>1</CODE>.
+<NOBR>32-bit</NOBR> integers are represented as 8 hexadecimal digits.
+Thus, for a signed <NOBR>32-bit</NOBR> integer, <CODE>FFFFFFFF</CODE> is -1,
+and <CODE>7FFFFFFF</CODE> is the largest positive value.
+<NOBR>64-bit</NOBR> integers are the same except with 16 hexadecimal digits.
+</P>
+
+<P>
+Floating-point values are written in a correspondingly primitive form.
+Values of the <NOBR>64-bit</NOBR> double-precision format are represented by 16
+hexadecimal digits that give the raw bits of the floating-point encoding.
+A period separates the 3rd and 4th hexadecimal digits to mark the division
+between the exponent bits and fraction bits.
+Some notable <NOBR>64-bit</NOBR> double-precision values include:
+<PRE>
+ 000.0000000000000 +0
+ 3FF.0000000000000 1
+ 400.0000000000000 2
+ 7FF.0000000000000 +infinity
+
+ 800.0000000000000 -0
+ BFF.0000000000000 -1
+ C00.0000000000000 -2
+ FFF.0000000000000 -infinity
+
+ 3FE.FFFFFFFFFFFFF largest representable number less than +1
+</PRE>
+The following categories are easily distinguished (assuming the
+<CODE>x</CODE>s are not all 0):
+<PRE>
+ 000.xxxxxxxxxxxxx positive subnormal (denormalized) numbers
+ 7FF.xxxxxxxxxxxxx positive NaNs
+ 800.xxxxxxxxxxxxx negative subnormal numbers
+ FFF.xxxxxxxxxxxxx negative NaNs
+</PRE>
+</P>
+
+<P>
+<NOBR>128-bit</NOBR> quadruple-precision values are written the same except
+with 4 hexadecimal digits for the sign and exponent and 28 for the fraction.
+Notable values include:
+<PRE>
+ 0000.0000000000000000000000000000 +0
+ 3FFF.0000000000000000000000000000 1
+ 4000.0000000000000000000000000000 2
+ 7FFF.0000000000000000000000000000 +infinity
+
+ 8000.0000000000000000000000000000 -0
+ BFFF.0000000000000000000000000000 -1
+ C000.0000000000000000000000000000 -2
+ FFFF.0000000000000000000000000000 -infinity
+
+ 3FFE.FFFFFFFFFFFFFFFFFFFFFFFFFFFF largest representable number
+ less than +1
+</PRE>
+</P>
+
+<P>
+<NOBR>80-bit</NOBR> double-extended-precision values are a little unusual in
+that the leading bit of precision is not hidden as with other formats.
+When correctly encoded, the leading significand bit of an <NOBR>80-bit</NOBR>
+double-extended-precision value will be 0 if the value is zero or subnormal,
+and will be 1 otherwise.
+Hence, the same values listed above appear in <NOBR>80-bit</NOBR>
+double-extended-precision as follows (note the leading <CODE>8</CODE> digit in
+the significands):
+<PRE>
+ 0000.0000000000000000 +0
+ 3FFF.8000000000000000 1
+ 4000.8000000000000000 2
+ 7FFF.8000000000000000 +infinity
+
+ 8000.0000000000000000 -0
+ BFFF.8000000000000000 -1
+ C000.8000000000000000 -2
+ FFFF.8000000000000000 -infinity
+
+ 3FFE.FFFFFFFFFFFFFFFF largest representable number less than +1
+</PRE>
+</P>
+
+<P>
+The representation of <NOBR>32-bit</NOBR> single-precision values is unusual
+for a different reason.
+Because the subfields of standard <NOBR>32-bit</NOBR> single-precision do not
+fall on neat <NOBR>4-bit</NOBR> boundaries, single-precision outputs are
+slightly perturbed.
+These are written as 9 hexadecimal digits, with a period separating the 3rd and
+4th hexadecimal digits.
+Broken out into bits, the 9 hexademical digits cover the <NOBR>32-bit</NOBR>
+single-precision subfields as follows:
+<PRE>
+ x000 .... .... . .... .... .... .... .... .... sign (1 bit)
+ .... xxxx xxxx . .... .... .... .... .... .... exponent (8 bits)
+ .... .... .... . 0xxx xxxx xxxx xxxx xxxx xxxx fraction (23 bits)
+</PRE>
+As shown in this schematic, the first hexadecimal digit contains only the sign,
+and will be either <CODE>0</CODE> <NOBR>or <CODE>8</CODE></NOBR>.
+The next two digits give the biased exponent as an <NOBR>8-bit</NOBR> integer.
+This is followed by a period and 6 hexadecimal digits of fraction.
+The most significant hexadecimal digit of the fraction can be at most
+<NOBR>a <CODE>7</CODE></NOBR>.
+</P>
+
+<P>
+Notable single-precision values include:
+<PRE>
+ 000.000000 +0
+ 07F.000000 1
+ 080.000000 2
+ 0FF.000000 +infinity
+
+ 800.000000 -0
+ 87F.000000 -1
+ 880.000000 -2
+ 8FF.000000 -infinity
+
+ 07E.7FFFFF largest representable number less than +1
+</PRE>
+Again, certain categories are easily distinguished (assuming the
+<CODE>x</CODE>s are not all 0):
+<PRE>
+ 000.xxxxxx positive subnormal (denormalized) numbers
+ 0FF.xxxxxx positive NaNs
+ 800.xxxxxx negative subnormal numbers
+ 8FF.xxxxxx negative NaNs
+</PRE>
+</P>
+
+<P>
+Lastly, exception flag values are represented by five characters, one character
+per flag.
+Each flag is written as either a letter or a period (<CODE>.</CODE>) according
+to whether the flag was set or not by the operation.
+A period indicates the flag was not set.
+The letter used to indicate a set flag depends on the flag:
+<PRE>
+ v invalid exception
+ i infinite exception ("divide by zero")
+ o overflow exception
+ u underflow exception
+ x inexact exception
+</PRE>
+For example, the notation <CODE>...ux</CODE> indicates that the
+<I>underflow</I> and <I>inexact</I> exception flags were set and that the other
+three flags (<I>invalid</I>, <I>infinite</I>, and <I>overflow</I>) were not
+set.
+The exception flags are always written following the value returned as the
+result of the operation.
+</P>
+
+
+<H2>8. Variations Allowed by the IEEE Floating-Point Standard</H2>
+
+<P>
+The IEEE Floating-Point Standard admits some variation among conforming
+implementations.
+Because TestFloat expects the two implementations being compared to deliver
+bit-for-bit identical results under most circumstances, this leeway in the
+standard can result in false errors being reported if the two implementations
+do not make the same choices everywhere the standard provides an option.
+</P>
+
+<H3>8.1. Underflow</H3>
+
+<P>
+The standard specifies that the <I>underflow</I> exception flag is to be raised
+when two conditions are met simultaneously:
+<NOBR>(1) <I>tininess</I></NOBR> and <NOBR>(2) <I>loss of accuracy</I></NOBR>.
+</P>
+
+<P>
+A result is tiny when its magnitude is nonzero yet smaller than any normalized
+floating-point number.
+The standard allows tininess to be determined either before or after a result
+is rounded to the destination precision.
+If tininess is detected before rounding, some borderline cases will be flagged
+as underflows even though the result after rounding actually lies within the
+normal floating-point range.
+By detecting tininess after rounding, a system can avoid some unnecessary
+signaling of underflow.
+All the TestFloat programs support options <CODE>-tininessbefore</CODE> and
+<CODE>-tininessafter</CODE> to control whether TestFloat expects tininess on
+underflow to be detected before or after rounding.
+One or the other is selected as the default when TestFloat is compiled, but
+these command options allow the default to be overridden.
+</P>
+
+<P>
+Loss of accuracy occurs when the subnormal format is not sufficient to
+represent an underflowed result accurately.
+The original 1985 version of the IEEE Standard allowed loss of accuracy to be
+detected either as an <I>inexact result</I> or as a
+<I>denormalization loss</I>;
+however, few if any systems ever chose the latter.
+The latest standard requires that loss of accuracy be detected as an inexact
+result, and TestFloat can test only for this case.
+</P>
+
+<H3>8.2. NaNs</H3>
+
+<P>
+The IEEE Standard gives the floating-point formats a large number of NaN
+encodings and specifies that NaNs are to be returned as results under certain
+conditions.
+However, the standard allows an implementation almost complete freedom over
+<EM>which</EM> NaN to return in each situation.
+</P>
+
+<P>
+By default, TestFloat does not check the bit patterns of NaN results.
+When the result of an operation should be a NaN, any NaN is considered as good
+as another.
+This laxness can be overridden with the <CODE>-checkNaNs</CODE> option of
+programs <CODE>testfloat_ver</CODE> and <CODE>testfloat</CODE>.
+In order for this option to be sensible, TestFloat must have been compiled so
+that its internal floating-point implementation (SoftFloat) generates the
+proper NaN results for the system being tested.
+</P>
+
+<H3>8.3. Conversions to Integer</H3>
+
+<P>
+Conversion of a floating-point value to an integer format will fail if the
+source value is a NaN or if it is too large.
+The IEEE Standard does not specify what value should be returned as the integer
+result in these cases.
+Moreover, according to the standard, the <I>invalid</I> exception can be raised
+or an unspecified alternative mechanism may be used to signal such cases.
+</P>
+
+<P>
+TestFloat assumes that conversions to integer will raise the <I>invalid</I>
+exception if the source value cannot be rounded to a representable integer.
+In such cases, TestFloat expects the result value to be the largest-magnitude
+positive or negative integer as detailed earlier in <NOBR>section 6.1</NOBR>,
+<I>Conversion Operations</I>.
+The current version of TestFloat provides no means to alter these expectations.
+</P>
+
+
+<H2>9. Contact Information</H2>
+
+<P>
+At the time of this writing, the most up-to-date information about TestFloat
+and the latest release can be found at the Web page
+<A HREF="http://www.jhauser.us/arithmetic/TestFloat.html"><CODE>http://www.jhauser.us/arithmetic/TestFloat.html</CODE></A>.
+</P>
+
+
+</BODY>
+
diff --git a/doc/TestFloat-history.html b/doc/TestFloat-history.html
new file mode 100644
index 0000000..daed701
--- /dev/null
+++ b/doc/TestFloat-history.html
@@ -0,0 +1,156 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>Berkeley TestFloat History</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>History of Berkeley TestFloat, to Release 3</H1>
+
+<P>
+John R. Hauser<BR>
+2014 _____<BR>
+</P>
+
+<P>
+*** CONTENT DONE.
+</P>
+
+<P>
+*** REPLACE QUOTATION MARKS.
+</P>
+
+<P>
+Releases of Berkeley TestFloat parallel those of Berkeley SoftFloat, on which
+TestFloat is based.
+Each TestFloat release necessarily incorporates all bug fixes from the
+corresponding release of SoftFloat.
+</P>
+
+
+<H3>Release 3 (2014 December)</H3>
+
+<UL>
+
+<LI>
+Complete rewrite, funded by the University of California, Berkeley.
+Visible changes included different names for testable functions and options.
+
+<LI>
+Reinstated separate programs for generating test cases
+(<CODE>testfloat_ver</CODE>) and verifying test results
+(<CODE>testfloat_gen</CODE>), as alternatives to the all-in-one
+<CODE>testfloat</CODE> program (which remained supported).
+
+<LI>
+Added support for testing conversions between floating-point and unsigned
+integers, both <NOBR>32-bit</NOBR> and <NOBR>64-bit</NOBR>.
+
+<LI>
+Added support for testing a fused multiply-add operation, for all testable
+floating-point formats except <NOBR>80-bit</NOBR> double-extended-precision.
+
+<LI>
+Added support for testing a fifth rounding mode, <CODE>near_maxMag</CODE>
+(round to nearest, with ties to maximum magnitude, away from zero).
+
+<LI>
+Added <CODE>timesoftfloat</CODE> (previously found in the Berkeley SoftFloat
+package).
+
+</UL>
+
+
+<H3>Release 2c (2014 December)</H3>
+
+<UL>
+
+<LI>
+Improved wording for the legal restrictions on using TestFloat releases
+<NOBR>through 2c</NOBR>.
+
+</UL>
+
+
+<P>
+There was never a <NOBR>Release 2b</NOBR>.
+</P>
+
+
+<H3>Release 2a (1998 December)</H3>
+
+<UL>
+
+<LI>
+Added support for testing conversions between floating-point and
+<NOBR>64-bit</NOBR> signed integers.
+
+<LI>
+Improved the Makefiles.
+
+</UL>
+
+
+<H3>Release 2 (1997 June)</H3>
+
+<UL>
+
+<LI>
+Integrated the generation of test cases and the checking of system results into
+a single program.
+(Before they were separate programs, normally joined by explicit command-line
+pipes.)
+
+<LI>
+Improved the sequence of test cases.
+
+<LI>
+Added support for testing <NOBR>80-bit</NOBR> double-extended-precision and
+<NOBR>128-bit</NOBR> quadruple precision.
+
+<LI>
+Made program output more readable, and added new command arguments.
+
+<LI>
+Reduced dependence on the quality of the standard <CODE>rand</CODE> function
+for generating test cases.
+(Previously naively expected <CODE>rand</CODE> to be able to generate good
+random bits for the entire machine word width.)
+
+<LI>
+Created <CODE>testsoftfloat</CODE>, with its own simpler complete software
+floating-point (``slowfloat'') for comparison purposes.
+
+<LI>
+Made some changes to the source file structure, including renaming
+<CODE>environment.h</CODE> to <CODE>milieu.h</CODE> (to avoid confusion with
+environment variables).
+
+</UL>
+
+
+<H3>Release 1a (1996 July)</H3>
+
+<UL>
+
+<LI>
+Added the <CODE>-tininessbefore</CODE> and <CODE>-tininessafter</CODE> options
+to control whether tininess should be detected before or after rounding.
+
+</UL>
+
+
+<H3>Release 1 (1996 July)</H3>
+
+<UL>
+
+<LI>
+Original release.
+
+</UL>
+
+
+</BODY>
+
diff --git a/doc/TestFloat-source.html b/doc/TestFloat-source.html
new file mode 100644
index 0000000..a875479
--- /dev/null
+++ b/doc/TestFloat-source.html
@@ -0,0 +1,546 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>Berkeley TestFloat Source Documentation</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Berkeley TestFloat Release 3: Source Documentation</H1>
+
+<P>
+John R. Hauser<BR>
+2014 _____<BR>
+</P>
+
+<P>
+*** CONTENT DONE.
+</P>
+
+<P>
+*** REPLACE QUOTATION MARKS.
+</P>
+
+
+<H2>Contents</H2>
+
+<P>
+*** CHECK.<BR>
+*** FIX FORMATTING.
+</P>
+
+<BLOCKQUOTE>
+1. Introduction<BR>
+2. Limitations<BR>
+3. Acknowledgments and License<BR>
+4. TestFloat Package Directory Structure<BR>
+5. Dependence on Berkeley SoftFloat<BR>
+6. Issues for Porting TestFloat to a New Target<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;6.1. Standard Headers <CODE>&lt;stdbool.h&gt;</CODE> and <CODE>&lt;stdint.h&gt;</CODE><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;6.2. Standard Header <CODE>&lt;fenv.h&gt;</CODE><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;6.3. Macros for Build Options<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;6.4. Specializing the <CODE>testfloat</CODE> Program<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;6.5. Improving the Random Number Functions<BR>
+7. Contact Information<BR>
+</BLOCKQUOTE>
+
+
+<H2>1. Introduction</H2>
+
+<P>
+This document gives information needed for compiling and/or porting Berkeley
+TestFloat, a small collection of programs for testing that an implementation of
+binary floating-point conforms to the IEEE Standard for Floating-Point
+Arithmetic.
+For basic documentation about TestFloat refer to
+<A HREF="TestFloat-general.html"><CODE>TestFloat-general.html</CODE></A>.
+</P>
+
+<P>
+The source code for TestFloat is intended to be relatively machine-independent.
+Most programs in the TestFloat package should be compilable with any
+ISO-standard C compiler that also supports <NOBR>64-bit</NOBR> integers.
+If the all-in-one <CODE>testfloat</CODE> program will be used to test a new
+floating-point implementation, additional effort will likely be required to
+retarget that program to invoke the new floating-point operations.
+TestFloat has been successfully compiled with the GNU C Compiler
+(<CODE>gcc</CODE>) for several platforms.
+</P>
+
+<P>
+<NOBR>Release 3</NOBR> of TestFloat is a complete rewrite relative to
+<NOBR>Release 2</NOBR> or earlier.
+</P>
+
+<P>
+TestFloat depends on Berkeley SoftFloat, which is a software implementation of
+binary floating-point that conforms to the IEEE Standard for Floating-Point
+Arithmetic.
+SoftFloat is not included with the TestFloat sources.
+It can be obtained from the Web page
+<A HREF="http://www.jhauser.us/arithmetic/SoftFloat.html"><CODE>http://www.jhauser.us/arithmetic/SoftFloat.html</CODE></A>.
+</P>
+
+
+<H2>2. Limitations</H2>
+
+<P>
+TestFloat assumes the computer has an addressable byte size of either 8 or
+<NOBR>16 bits</NOBR>.
+(Nearly all computers in use today have <NOBR>8-bit</NOBR> bytes.)
+</P>
+
+<P>
+TestFloat is written entirely <NOBR>in C</NOBR>.
+The C compiler used must conform at a minimum to the 1989 ANSI standard for the
+C language (same as the 1990 ISO standard) and must in addition support basic
+arithmetic on <NOBR>64-bit</NOBR> integers.
+Earlier releases of TestFloat were capable of testing <NOBR>32-bit</NOBR>
+single-precision and <NOBR>64-bit</NOBR> double-precision floating-point
+without requiring compiler support for <NOBR>64-bit</NOBR> integers, but this
+option is not supported with <NOBR>Release 3</NOBR>.
+Since 1999, ISO standards for C have mandated compiler support for
+<NOBR>64-bit</NOBR> integers.
+A compiler conforming to the 1999 C Standard or later is recommended but not
+strictly required.
+</P>
+
+<P>
+<NOBR>C Standard</NOBR> header files <CODE>&lt;stdbool.h&gt;</CODE> and
+<CODE>&lt;stdint.h&gt;</CODE> are required for defining standard Boolean and
+integer types.
+If these headers are not supplied with the C compiler, minimal substitutes must
+be provided.
+TestFloat's dependence on these headers is detailed later in
+<NOBR>section 6.1</NOBR>, <I>Standard Headers <CODE>&lt;stdbool.h&gt;</CODE>
+and <CODE>&lt;stdint.h&gt;</CODE></I>.
+</P>
+
+
+<H2>3. Acknowledgments and License</H2>
+
+<P>
+The TestFloat package was written by me, <NOBR>John R.</NOBR> Hauser.
+<NOBR>Release 3</NOBR> of TestFloat is a completely new implementation
+supplanting earlier releases.
+This project was done in the employ of the University of California, Berkeley,
+within the Department of Electrical Engineering and Computer Sciences, first
+for the Parallel Computing Laboratory (Par Lab) and then for the ASPIRE Lab.
+The work was officially overseen by Prof. Krste Asanovic, with funding provided
+by these sources:
+<BLOCKQUOTE>
+<TABLE>
+<TR>
+<TD><NOBR>Par Lab:</NOBR></TD>
+<TD>
+Microsoft (Award #024263), Intel (Award #024894), and U.C. Discovery
+(Award #DIG07-10227), with additional support from Par Lab affiliates Nokia,
+NVIDIA, Oracle, and Samsung.
+</TD>
+</TR>
+<TR>
+<TD><NOBR>ASPIRE Lab:</NOBR></TD>
+<TD>
+DARPA PERFECT program (Award #HR0011-12-2-0016), with additional support from
+ASPIRE industrial sponsor Intel and ASPIRE affiliates Google, Nokia, NVIDIA,
+Oracle, and Samsung.
+</TD>
+</TR>
+</TABLE>
+</BLOCKQUOTE>
+</P>
+
+<P>
+The following applies to the whole of TestFloat <NOBR>Release 3</NOBR> as well
+as to each source file individually.
+</P>
+
+<P>
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents).
+All Rights Reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+</P>
+
+<P>
+Redistributions of source code must retain the above copyright notice, this
+list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution.
+Neither the name of the Regents nor the names of its contributors may be used
+to endorse or promote products derived from this software without specific
+prior written permission.
+</P>
+
+<P>
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF
+THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+</P>
+
+<P>
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS
+PROVIDED "<NOBR>AS IS</NOBR>".
+REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ENHANCEMENTS, OR MODIFICATIONS.
+</P>
+
+
+<H2>4. TestFloat Package Directory Structure</H2>
+
+<P>
+Because TestFloat is targeted to multiple platforms, its source code is
+slightly scattered between target-specific and target-independent directories
+and files.
+The supplied directory structure is as follows:
+<PRE>
+ doc
+ source
+ subj-C
+ build
+ template
+ Win32-MinGW
+ Linux-386-GCC
+</PRE>
+The majority of the TestFloat sources are provided in the <CODE>source</CODE>
+directory.
+The <NOBR><CODE>subj-C</CODE></NOBR> subdirectory contains the sources that
+configure the all-in-one <CODE>testfloat</CODE> program to test the C
+compiler's implementation of the standard C types <CODE>float</CODE>,
+<CODE>double</CODE>, and possibly <CODE>long</CODE> <CODE>double</CODE>.
+The `<CODE>subj</CODE>' in <NOBR><CODE>subj-C</CODE></NOBR> is an abbreviation
+of <I>subject</I>, referring to the floating-point that is the subject of the
+test.
+If <CODE>testfloat</CODE> is retargeted to test other floating-point
+implementations, the corresponding source files would be expected to be in
+other subdirectories alongside <NOBR><CODE>subj-C</CODE></NOBR>, with names of
+the form <NOBR><CODE>subj-&lt;target&gt;</CODE></NOBR>.
+More about retargeting <CODE>testfloat</CODE> is found in
+<NOBR>section 6.4</NOBR>, <I>Specializing the <CODE>testfloat</CODE>
+Program</I>.
+</P>
+
+<P>
+The <CODE>build</CODE> directory is intended to contain a subdirectory for each
+target platform for which builds of the TestFloat programs may be created.
+For each build target, the target's subdirectory is where all derived object
+files and the completed TestFloat executables are created.
+The <CODE>template</CODE> subdirectory is not an actual build target but
+contains sample files for creating new target directories.
+</P>
+
+<P>
+Ignoring the <CODE>template</CODE> directory, the supplied target directories
+are intended to follow a naming system of
+<NOBR><CODE>&lt;execution-environment&gt;-&lt;compiler&gt;</CODE></NOBR>.
+For the example targets,
+<NOBR><CODE>&lt;execution-environment&gt;</CODE></NOBR> is <CODE>Win32</CODE>
+and <CODE>Linux-386</CODE>, and <NOBR><CODE>&lt;compiler&gt;</CODE></NOBR> is
+<CODE>MinGW</CODE> and <CODE>GCC</CODE>, respectively.
+</P>
+
+<P>
+As supplied, each target directory contains two files:
+<PRE>
+ Makefile
+ platform.h
+</PRE>
+The provided <CODE>Makefile</CODE> is written for GNU <CODE>make</CODE>.
+A build of TestFloat for the specific target is begun by executing the
+<CODE>make</CODE> command with the target directory as the current directory.
+A completely different build tool can be used if an appropriate
+<CODE>Makefile</CODE> equivalent is created.
+</P>
+
+<P>
+The <CODE>platform.h</CODE> header file exists to provide a location for
+additional C declarations specific to the build target.
+Every C source file of TestFloat contains a <CODE>#include</CODE> for
+<CODE>platform.h</CODE>.
+In many cases, the contents of <CODE>platform.h</CODE> can be as simple as one
+or two lines of code.
+If the target's compiler or library has bugs or other shortcomings, workarounds
+for these issues may be possible with target-specific declarations in
+<CODE>platform.h</CODE>, without the need to modify the main TestFloat sources.
+</P>
+
+<P>
+It may not be necessary to build all of the TestFloat programs.
+For testing a floating-point implementation, typically
+<CODE>testfloat_gen</CODE> and <CODE>testfloat</CODE> will not both be used,
+and <CODE>testfloat_ver</CODE> may not be needed either.
+The Makefile (or equivalent) can be modified not to create unneeded programs.
+This may be especially relevant for the all-in-one test program
+<CODE>testfloat</CODE>, which might not build without special attention.
+</P>
+
+
+<H2>5. Dependence on Berkeley SoftFloat</H2>
+
+<P>
+In addition to the distributed sources, TestFloat depends on the existence of a
+compatible Berkeley SoftFloat library and the corresponding header file
+<CODE>softfloat.h</CODE>.
+As mentioned earlier, SoftFloat is a separate package available at Web page
+<A HREF="http://www.jhauser.us/arithmetic/SoftFloat.html"><CODE>http://www.jhauser.us/arithmetic/SoftFloat.html</CODE></A>.
+The SoftFloat library must be compiled before the TestFloat programs can be
+built.
+In the example Makefiles, the locations of the SoftFloat header files and
+pre-compiled library are specified by these macros:
+<BLOCKQUOTE>
+<DL>
+<DT><CODE>SOFTFLOAT_INCLUDE_DIR</CODE>
+<DD>
+The path of the directory containing <CODE>softfloat.h</CODE>, as well as other
+nonstandard header files referenced by <CODE>softfloat.h</CODE>, if any.
+<DT><CODE>SOFTFLOAT_H</CODE>
+<DD>
+A list of the full paths of all SoftFloat header files needed by SoftFloat
+clients. This list must include <CODE>softfloat.h</CODE> and may also include
+other header files referenced by <CODE>softfloat.h</CODE>, such as
+<CODE>softfloat_types.h</CODE>.
+This macro is used only to establish build dependencies between the SoftFloat
+header files and TestFloat's source files, in case the SoftFloat header files
+are changed.
+<DT><CODE>SOFTFLOAT_LIB</CODE>
+<DD>
+The full path of the compiled SoftFloat library (usually
+<CODE>softfloat.a</CODE>).
+</DL>
+</BLOCKQUOTE>
+</P>
+
+
+<H2>6. Issues for Porting TestFloat to a New Target</H2>
+
+<H3>6.1. Standard Headers <CODE>&lt;stdbool.h&gt;</CODE> and <CODE>&lt;stdint.h&gt;</CODE></H3>
+
+<P>
+The TestFloat sources make use of standard headers
+<CODE>&lt;stdbool.h&gt;</CODE> and <CODE>&lt;stdint.h&gt;</CODE>, which have
+been part of the ISO C Standard Library since 1999.
+With any recent compiler, these standard headers are likely to be supported,
+even if the compiler does not claim complete conformance to the latest ISO C
+Standard.
+For older or nonstandard compilers, substitutes for
+<CODE>&lt;stdbool.h&gt;</CODE> and <CODE>&lt;stdint.h&gt;</CODE> may need to be
+created.
+TestFloat depends on these names from <CODE>&lt;stdbool.h&gt;</CODE>:
+<PRE>
+ bool
+ true
+ false
+</PRE>
+and on these names from <CODE>&lt;stdint.h&gt;</CODE>:
+<PRE>
+ uint16_t
+ uint32_t
+ uint64_t
+ int32_t
+ int64_t
+ UINT64_C
+ INT64_C
+ uint_least8_t
+ uint_fast8_t
+ uint_fast16_t
+ uint_fast32_t
+ uint_fast64_t
+ int_fast16_t
+ int_fast32_t
+ int_fast64_t
+</PRE>
+</P>
+
+
+<H3>6.2. Standard Header <CODE>&lt;fenv.h&gt;</CODE></H3>
+
+<P>
+Because the supplied all-in-one <CODE>testfloat</CODE> program tests the
+floating-point operations of the C language, it uses the facilities provided by
+standard C header <CODE>&lt;fenv.h&gt;</CODE> to access the floating-point
+environment of C, in particular to set the rounding mode and to access the
+floating-point exception flags.
+Like <CODE>&lt;stdbool.h&gt;</CODE> and <CODE>&lt;stdint.h&gt;</CODE>,
+<CODE>&lt;fenv.h&gt;</CODE> has been part of the ISO C Standard Library since
+1999, but older or nonstandard C compilers may not support it.
+</P>
+
+<P>
+Some form of standard header <CODE>&lt;fenv.h&gt;</CODE> is needed only if the
+<CODE>testfloat</CODE> program is wanted <EM>and</EM> the program will not be
+retargeted to invoke a floating-point implementation in a way that bypasses the
+standard C environment.
+Typically, if <CODE>testfloat</CODE> is wanted, it will be retargeted to invoke
+a new floating-point implementation directly, making
+<CODE>&lt;fenv.h&gt;</CODE> irrelevant.
+For more about retargeting <CODE>testfloat</CODE>, see <NOBR>section 6.4</NOBR>
+below, <I>Specializing the <CODE>testfloat</CODE> Program</I>.
+</P>
+
+
+<H3>6.3. Macros for Build Options</H3>
+
+<P>
+The TestFloat source files are affected by a few C preprocessor macros:
+<BLOCKQUOTE>
+<DL>
+<DT><CODE>LITTLEENDIAN</CODE>
+<DD>
+Must be defined for little-endian machines;
+must not be defined for big-endian machines.
+<DT><CODE>EXTFLOAT80</CODE>
+<DD>
+Must be defined if the TestFloat programs are to support the
+<NOBR>80-bit</NOBR> double-extended-precision floating-point format.
+<DT><CODE>FLOAT128</CODE>
+<DD>
+Must be defined if the TestFloat programs are to support the
+<NOBR>128-bit</NOBR> quadruple-precision floating-point format.
+</DL>
+</BLOCKQUOTE>
+Following the usual custom <NOBR>for C</NOBR>, the content of a macro's
+definition is irrelevant;
+what matters is a macro's effect on <CODE>#ifdef</CODE> directives.
+</P>
+
+<P>
+It is recommended that any definition of macro <CODE>LITTLEENDIAN</CODE> be
+made in a build target's <CODE>platform.h</CODE> header file, because
+endianness is expected to be determined inflexibly by the target machine.
+On the other hand, the <CODE>EXTFLOAT80</CODE> and <CODE>FLOAT128</CODE> macros
+are not dictated by the target and hence might be better located in the
+target's Makefile (or its equivalent).
+</P>
+
+
+<H3>6.4. Specializing the <CODE>testfloat</CODE> Program</H3>
+
+<P>
+The supplied sources for the all-in-one <CODE>testfloat</CODE> program cause
+<CODE>testfloat</CODE> to test the C compiler's <CODE>float</CODE> and
+<CODE>double</CODE> types for C operations <CODE>+</CODE>, <CODE>-</CODE>,
+<CODE>*</CODE>, <CODE>/</CODE>, etc.
+The supplied version is also capable of testing C type <CODE>long</CODE>
+<CODE>double</CODE> if the sources are compiled with one of these macros
+defined:
+<BLOCKQUOTE>
+<DL>
+<DT><CODE>LONG_DOUBLE_IS_EXTFLOAT80</CODE>
+<DD>
+Indicates that type <CODE>long</CODE> <CODE>double</CODE> is
+<NOBR>80-bit</NOBR> double-extended-precision floating-point.
+<DT><CODE>LONG_DOUBLE_IS_FLOAT128</CODE>
+<DD>
+Indicates that type <CODE>long</CODE> <CODE>double</CODE> is
+<NOBR>128-bit</NOBR> quadruple-precision floating-point.
+</DL>
+</BLOCKQUOTE>
+By default, <CODE>testfloat</CODE> assumes that only the IEEE Standard's
+original four rounding modes (<CODE>near_even</CODE>, <CODE>minMag</CODE>,
+<CODE>min</CODE>, and <CODE>max</CODE>) are supported by the floating-point
+being tested.
+If the fifth rounding mode, <CODE>near_maxMag</CODE>, is also supported, an
+additional macro can be defined:
+<BLOCKQUOTE>
+<DL>
+<DT><CODE>SUBJFLOAT_ROUND_NEAR_MAXMAG</CODE>
+<DD>
+Indicates that the subject floating-point supports rounding mode
+<CODE>near_maxMag</CODE> (nearest/away).
+</DL>
+</BLOCKQUOTE>
+</P>
+
+<P>
+To test a new and/or different implementation of floating-point,
+<CODE>testfloat</CODE> must normally be retargeted to invoke this other
+floating-point instead of C's floating-point.
+Two source files define the functions that <CODE>testfloat</CODE> uses to
+invoke floating-point operations for testing:
+<PRE>
+ subjfloat_config.h
+ subjfloat.c
+</PRE>
+For the default target of testing C's floating-point, these files are contained
+in directory <NOBR><CODE>source/subj-C</CODE></NOBR> as discussed earlier.
+For a different subject floating-point, it is recommended that appropriate
+versions of <CODE>subjfloat_config.h</CODE> and <CODE>subjfloat.c</CODE> be
+stored in a sibling <NOBR><CODE>subj-&lt;target&gt;</CODE></NOBR> directory,
+where <CODE>&lt;target&gt;</CODE> names the particular target.
+</P>
+
+<P>
+Header file <CODE>subjfloat_config.h</CODE> defines a macro of the form
+<CODE>SUBJ_*</CODE> for each subject function supported.
+For example, if function <CODE>subj_f32_add</CODE> exists to perform
+<NOBR>32-bit</NOBR> floating-point addition, then
+<CODE>subjfloat_config.h</CODE> should have a definition for macro
+<CODE>SUBJ_F32_ADD</CODE>.
+The actual function <CODE>subj_f32_add</CODE> is expected to be defined in
+<CODE>subjfloat.c</CODE>, along with all other subject functions.
+A common header file, <CODE>subjfloat.h</CODE>, (not target-specific) provides
+prototype declarations for all possible subject functions that
+<CODE>testfloat</CODE> may be compiled to test, whether actually existing or
+not.
+(There is no penalty for the header to declare prototypes of nonexistent
+functions that are never called.)
+For a specific build of <CODE>testfloat</CODE>, the <CODE>-list</CODE> option
+will list all subject functions that the <CODE>testfloat</CODE> program is able
+to invoke and thus test.
+</P>
+
+<P>
+In the source code as supplied, macros <CODE>LONG_DOUBLE_IS_EXTFLOAT80</CODE>
+and <CODE>LONG_DOUBLE_IS_FLOAT128</CODE> affect only the target-specific source
+files in <NOBR><CODE>source/subj-C</CODE></NOBR>, so these macros can be
+ignored for any other subject floating-point that does not depend on them.
+On the other hand, macro <CODE>SUBJFLOAT_ROUND_NEAR_MAXMAG</CODE> always
+determines whether the <CODE>testfloat</CODE> program attempts to test rounding
+mode <CODE>near_maxMag</CODE>, regardless of the subject floating-point.
+</P>
+
+
+<H3>6.5. Improving the Random Number Functions</H3>
+
+<P>
+If you are serious about using TestFloat for testing floating-point, you should
+consider replacing the random number functions in <CODE>random.c</CODE>.
+The supplied random number functions are built on top of the standard C
+<CODE>rand</CODE> function.
+Because function <CODE>rand</CODE> is rather poor on some systems, the
+functions in <CODE>random.c</CODE> assume very little about the quality of
+<CODE>rand</CODE>.
+As a result, <CODE>rand</CODE> is called more frequently than it might need to
+be, shortening the time before random number sequences repeat, and possibly
+wasting time as well.
+If <CODE>rand</CODE> is better on a given target platform, or if another,
+better random number generator is available (such as <CODE>rand48</CODE> on
+most UNIX-derived systems), TestFloat can be improved by overriding the given
+<CODE>random.c</CODE> with a target-specific one.
+</P>
+
+<P>
+Rather than modifying the supplied file <CODE>random.c</CODE>, it is
+recommended instead that a new, alternate file be created and the target's
+Makefile be modified to refer to that alternate file in place of
+<CODE>random.c</CODE>.
+</P>
+
+
+<H2>7. Contact Information</H2>
+
+<P>
+At the time of this writing, the most up-to-date information about TestFloat
+and the latest release can be found at the Web page
+<A HREF="http://www.jhauser.us/arithmetic/TestFloat.html"><CODE>http://www.jhauser.us/arithmetic/TestFloat.html</CODE></A>.
+</P>
+
+
+</BODY>
+
diff --git a/doc/testfloat.html b/doc/testfloat.html
new file mode 100644
index 0000000..7779214
--- /dev/null
+++ b/doc/testfloat.html
@@ -0,0 +1,259 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>testfloat</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Berkeley TestFloat Release 3: <CODE>testfloat</CODE></H1>
+
+<P>
+John R. Hauser<BR>
+2014 ______<BR>
+</P>
+
+<P>
+*** CONTENT DONE.
+</P>
+
+<P>
+*** REPLACE QUOTATION MARKS.
+<BR>
+*** REPLACE APOSTROPHES.
+<BR>
+*** REPLACE EM DASH.
+</P>
+
+
+<H2>Overview</H2>
+
+<P>
+The <CODE>testfloat</CODE> program tests an implementation of floating-point
+arithmetic for conformity to the IEEE Standard for Binary Floating-Point
+Arithmetic.
+<CODE>testfloat</CODE> is part of the Berkeley TestFloat package, a small
+collection of programs for performing such tests.
+For general information about TestFloat, see file
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+</P>
+
+<P>
+The <CODE>testfloat</CODE> program is an all-in-one tool for testing
+floating-point arithmetic.
+It generates test operand values, invokes a floating-point operation with the
+generated operands, and examines the corresponding computed results, reporting
+unexpected results as likely errors.
+While the processes of generating inputs and examining results are generic, a
+particular build of <CODE>testfloat</CODE> is limited to testing only the one
+implementation of floating-point it has been compiled to invoke.
+For example, while one instance of <CODE>testfloat</CODE> might be compiled to
+execute a computer's hardware instruction for floating-point addition, a
+different version might be compiled to call a subroutine called
+<CODE>myAddFloat</CODE> that is linked into the <CODE>testfloat</CODE> program.
+To test a new implementation of floating-point (a new set of machine
+instructions or a new set of subroutines), a new <CODE>testfloat</CODE> must be
+compiled containing the code needed to invoke the new floating-point.
+</P>
+
+<P>
+The default build of <CODE>testfloat</CODE> assumes that C types
+<CODE>float</CODE> and <CODE>double</CODE> are <NOBR>32-bit</NOBR> and
+<NOBR>64-bit</NOBR> binary floating-point types conforming to the IEEE
+Standard, and tests the C operations of <CODE>+</CODE>, <CODE>-</CODE>,
+<CODE>*</CODE>, <CODE>/</CODE>, type conversions, etc.
+This tests the floating-point arithmetic seen by C programs.
+Depending on the compiler and the options selected during compilation, this may
+or may not be the same as the computer's floating-point hardware, if any.
+</P>
+
+<P>
+The <CODE>testfloat</CODE> program will ordinarily test an operation for all
+rounding modes defined by the IEEE Floating-Point Standard, one after the
+other.
+If the rounding mode is not supposed to have any affect on the results--for
+instance, some operations do not require rounding--only the nearest/even
+rounding mode is checked.
+For double-extended-precision operations affected by rounding precision
+control, <CODE>testfloat</CODE> also tests all three rounding precision modes,
+one after the other.
+Testing can be limited to a single rounding mode and/or rounding precision with
+appropriate command-line options.
+</P>
+
+<P>
+For more about the operation of <CODE>testfloat</CODE> and how to interpret its
+output, refer to
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+</P>
+
+
+<H2>Command Syntax</H2>
+
+<P>
+The <CODE>testfloat</CODE> program is executed as a command with this syntax:
+<PRE>
+ testfloat [&lt;option&gt;...] &lt;function&gt;
+</PRE>
+Square brackets (<CODE>[ ]</CODE>) denote optional arguments,
+<CODE>&lt;option&gt;</CODE> is a supported option, and
+<CODE>&lt;function&gt;</CODE> is the name of either a testable operation or a
+function set.
+The available options and function sets are documented below.
+The <CODE>-list</CODE> option can be used to obtain a list of all testable
+operations for a given build of <CODE>testfloat</CODE>.
+If <CODE>testfloat</CODE> is executed without any arguments, a summary of usage
+is written.
+</P>
+
+
+<H2>Options</H2>
+
+<P>
+The <CODE>testfloat</CODE> program accepts several command options.
+If mutually contradictory options are given, the last one has priority.
+</P>
+
+<H3><CODE>-help</CODE></H3>
+
+<P>
+The <CODE>-help</CODE> option causes a summary of program usage to be written,
+after which the program exits.
+</P>
+
+<H3><CODE>-list</CODE></H3>
+
+<P>
+The <CODE>-list</CODE> option causes a list of testable operations to be
+written, after which the program exits.
+The set of testable operations is just the set of operations that this build of
+<CODE>testfloat</CODE> has some way to invoke for testing.
+</P>
+
+<H3><CODE>-level &lt;num&gt;</CODE></H3>
+
+<P>
+The <CODE>-level</CODE> option sets the level of testing.
+The argument to <CODE>-level</CODE> can be either 1 <NOBR>or 2</NOBR>.
+The default is <NOBR>level 1</NOBR>.
+Level 2 performs many more tests than <NOBR>level 1</NOBR> and thus can reveal
+bugs not found by <NOBR>level 1</NOBR>.
+</P>
+
+<H3><CODE>-errors &lt;num&gt;</CODE></H3>
+
+<P>
+The <CODE>-errors</CODE> option instructs <CODE>testfloat</CODE> to report no
+more than the specified number of errors for any combination of operation,
+rounding mode, etc.
+The argument to <CODE>-errors</CODE> must be a nonnegative decimal integer.
+Once the specified number of error reports has been generated,
+<CODE>testfloat</CODE> ends the current test and begins the next one, if any.
+The default is <NOBR><CODE>-errors</CODE> <CODE>20</CODE></NOBR>.
+</P>
+
+<P>
+Against intuition, <NOBR><CODE>-errors</CODE> <CODE>0</CODE></NOBR> causes
+<CODE>testfloat</CODE> to report every error it finds.
+</P>
+
+<H3><CODE>-errorstop</CODE></H3>
+
+<P>
+The <CODE>-errorstop</CODE> option causes the program to exit after the first
+operation for which any errors are reported.
+</P>
+
+<H3><CODE>-forever</CODE></H3>
+
+<P>
+The <CODE>-forever</CODE> option causes a single operation to be repeatedly
+tested.
+Only one rounding mode and/or rounding precision can be tested in a single
+execution.
+If not specified, the rounding mode defaults to nearest/even.
+For <NOBR>80-bit</NOBR> double-extended-precision operations, the rounding
+precision defaults to full double-extended precision.
+The testing level is set to 2 by this option.
+</P>
+
+<H3><CODE>-checkNaNs</CODE></H3>
+
+<P>
+The <CODE>-checkNaNs</CODE> option causes <CODE>testfloat</CODE> to verify the
+bitwise correctness of NaN results.
+In order for this option to be sensible, <CODE>testfloat</CODE> must have been
+compiled so that its internal reference implementation of floating-point
+(SoftFloat) generates the proper NaN results for the system being tested.
+</P>
+
+<H3><CODE>-precision32, -precision64, -precision80</CODE></H3>
+
+<P>
+For <NOBR>80-bit</NOBR> double-extended-precision operations affected by
+rounding precision control, the <CODE>-precision32</CODE> option restricts
+testing to only the cases in which the rounding precision is
+<NOBR>32 bits</NOBR>, equivalent to <NOBR>32-bit</NOBR> single-precision.
+The other rounding precision choices are not tested.
+Likewise, <CODE>-precision64</CODE> fixes the rounding precision to
+<NOBR>64 bits</NOBR>, equivalent to <NOBR>64-bit</NOBR> double-precision, and
+<CODE>-precision80</CODE> fixes the rounding precision to the full
+<NOBR>80 bits</NOBR> of the double-extended-precision format.
+All these options are ignored for operations not affected by rounding precision
+control.
+</P>
+
+<P>
+The precision-control options may not be accepted at all if no
+double-extended-precision operations are testable.
+</P>
+
+<H3><CODE>-rnear_even, -rnear_maxMag, -rminMag, -rmin, -rmax</CODE></H3>
+
+<P>
+The <CODE>-rnear_even</CODE> option restricts testing to only the cases in
+which the rounding mode is nearest/even.
+The other rounding mode choices are not tested.
+Likewise, <CODE>-rnear_maxMag</CODE> forces rounding to nearest/maximum
+magnitude (nearest-away), <CODE>-rminMag</CODE> forces rounding to minimum
+magnitude (toward zero), <CODE>-rmin</CODE> forces rounding to minimum (down,
+toward negative infinity), and <CODE>-rmax</CODE> forces rounding to maximum
+(up, toward positive infinity).
+These options are ignored for operations that are exact and thus do not round.
+</P>
+
+<H3><CODE>-tininessbefore, -tininessafter</CODE></H3>
+
+<P>
+The <CODE>-tininessbefore</CODE> option indicates that the floating-point
+implementation being tested detects tininess on underflow before rounding.
+The <CODE>-tininessafter</CODE> option indicates that tininess is detected
+after rounding.
+The <CODE>testfloat</CODE> program alters its expectations accordingly.
+These options override the default selected when <CODE>testfloat</CODE> was
+compiled.
+Choosing the wrong one of these two options should cause error reports for some
+(but not all) operations.
+</P>
+
+
+<H2>Function Sets</H2>
+
+<P>
+Just as <CODE>testfloat</CODE> can test an operation for all five rounding
+modes in sequence, multiple operations can be tested with a single execution of
+<CODE>testfloat</CODE>.
+Two sets are recognized: <CODE>-all1</CODE> and <CODE>-all2</CODE>.
+The set <CODE>-all1</CODE> comprises all one-operand operations, while
+<CODE>-all2</CODE> is all two-operand operations.
+A function set is used in place of an operation name in the
+<CODE>testfloat</CODE> command line, such as
+<PRE>
+ testfloat [&lt;option&gt;...] -all1
+</PRE>
+</P>
+
+
+</BODY>
+
diff --git a/doc/testfloat_gen.html b/doc/testfloat_gen.html
new file mode 100644
index 0000000..43e6d20
--- /dev/null
+++ b/doc/testfloat_gen.html
@@ -0,0 +1,341 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>testfloat_gen</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Berkeley TestFloat Release 3: <CODE>testfloat_gen</CODE></H1>
+
+<P>
+John R. Hauser<BR>
+2014 ______<BR>
+</P>
+
+<P>
+*** CONTENT DONE.
+</P>
+
+<P>
+*** REPLACE QUOTATION MARKS.
+<BR>
+*** REPLACE APOSTROPHES.
+<BR>
+*** REPLACE EM DASH.
+</P>
+
+
+<H2>Overview</H2>
+
+<P>
+The <CODE>testfloat_gen</CODE> program generates test cases for testing that an
+implementation of floating-point arithmetic conforms to the IEEE Standard for
+Binary Floating-Point Arithmetic.
+<CODE>testfloat_gen</CODE> is part of the Berkeley TestFloat package, a small
+collection of programs for performing such tests.
+For general information about TestFloat, see file
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+</P>
+
+<P>
+A single execution of <CODE>testfloat_gen</CODE> generates test cases for only
+a single floating-point operation and associated options.
+The <CODE>testfloat_gen</CODE> program must be repeatedly executed to generate
+test cases for each operation to be tested.
+</P>
+
+<P>
+<CODE>testfloat_gen</CODE> writes the test cases it generates to standard
+output.
+This output can either be captured in a file through redirection, or be piped
+to another program that exercises a floating-point operation using the test
+cases as they are supplied.
+Depending on use, the total output from <CODE>testfloat_gen</CODE> can be
+large, so piping to another program may be the best choice to avoid consuming
+inordinate file space.
+The format of <CODE>testfloat_gen</CODE>'s output is raw hexadecimal text,
+described in the section below titled <I>Output Format</I>.
+</P>
+
+
+<H2>Command Syntax</H2>
+
+<P>
+The <CODE>testfloat_gen</CODE> program is executed as a command in one of these
+forms:
+<PRE>
+ testfloat_gen [&lt;option&gt;...] &lt;type&gt;
+ testfloat_gen [&lt;option&gt;...] &lt;function&gt;
+</PRE>
+Square brackets (<CODE>[ ]</CODE>) denote optional arguments, and
+<CODE>&lt;option&gt;</CODE> is a supported option, documented below.
+A <CODE>testfloat_gen</CODE> command expects either a <CODE>&lt;type&gt;</CODE>
+specifying the type and number of output or a <CODE>&lt;function&gt;</CODE>
+naming a floating-point operation.
+If <CODE>testfloat_gen</CODE> is executed without any arguments, a summary of
+usage is written.
+</P>
+
+<P>
+A <CODE>&lt;type&gt;</CODE> can be one of the following:
+<BLOCKQUOTE>
+<TABLE>
+<TR>
+<TD><CODE>ui32</CODE></TD>
+<TD>unsigned <NOBR>32-bit</NOBR> integers</TD>
+</TR>
+<TR>
+<TD><CODE>ui64</CODE></TD>
+<TD>unsigned <NOBR>64-bit</NOBR> integers</TD>
+</TR>
+<TR>
+<TD><CODE>i32</CODE></TD>
+<TD>signed <NOBR>32-bit</NOBR> integers</TD>
+</TR>
+<TR>
+<TD><CODE>i64</CODE></TD>
+<TD>signed <NOBR>64-bit</NOBR> integers</TD>
+</TR>
+<TR>
+<TD><CODE>f32 [&lt;num&gt;]</CODE></TD>
+<TD>one or more <NOBR>32-bit</NOBR> single-precision floating-point values</TD>
+</TR>
+<TR>
+<TD><CODE>f64 [&lt;num&gt;]</CODE></TD>
+<TD>one or more <NOBR>64-bit</NOBR> double-precision floating-point values</TD>
+</TR>
+<TR>
+<TD><CODE>extF80 [&lt;num&gt;]&nbsp;&nbsp;&nbsp;</CODE></TD>
+<TD>one or more <NOBR>80-bit</NOBR> double-extended-precision floating-point
+values</TD>
+</TR>
+<TR>
+<TD><CODE>f128 [&lt;num&gt;]</CODE></TD>
+<TD>one or more <NOBR>128-bit</NOBR> quadruple-precision floating-point
+values</TD>
+</TR>
+</TABLE>
+</BLOCKQUOTE>
+Optional <CODE>&lt;num&gt;</CODE> is one of 1, 2, <NOBR>or 3</NOBR>.
+If a <CODE>&lt;type&gt;</CODE> is given without <CODE>&lt;num&gt;</CODE> (such
+as <CODE>ui32</CODE> or <CODE>f64</CODE>), <CODE>testfloat_gen</CODE> outputs a
+list of values of the specified type, one value per line, appropriate for
+testing a floating-point operation with exactly one operand of the given type.
+If a floating-point type and number are given (such as
+<NOBR><CODE>f32</CODE> <CODE>2</CODE></NOBR> or
+<NOBR><CODE>extF80</CODE> <CODE>1</CODE></NOBR>), <CODE>testfloat_gen</CODE>
+outputs the specified number of values per line, appropriate for testing a
+floating-point operation with that number of operands.
+Although the exact operation being tested is not specified, the test cases
+output by <CODE>testfloat_gen</CODE> cover all standard floating-point
+operations, to the degree explained in
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+</P>
+
+<P>
+If a <CODE>&lt;function&gt;</CODE> operation name is given, then each line of
+output from <CODE>testfloat_gen</CODE> contains not only the operands for that
+operation (as would be generated by an appropriate <CODE>&lt;type&gt;</CODE>
+argument) but also the expected results as determined by
+<CODE>testfloat_gen</CODE>'s internal floating-point emulation (SoftFloat).
+The available operation names are listed in
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+In all cases, floating-point operations have two results:
+first, a value, which may be floating-point, integer, or Boolean, and, second,
+the floating-point exception flags raised by the operation.
+If the output from a tested floating-point operation does not match the
+expected output specified by <CODE>testfloat_gen</CODE>, this may or may not
+indicate an error in the floating-point operation.
+For further explanation, see
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>,
+especially the section titled <I>Variations Allowed by the IEEE Floating-Point
+Standard</I>.
+</P>
+
+
+<H2>Options</H2>
+
+<P>
+The <CODE>testfloat_gen</CODE> program accepts several command options.
+If mutually contradictory options are given, the last one has priority.
+</P>
+
+<H3><CODE>-help</CODE></H3>
+
+<P>
+The <CODE>-help</CODE> option causes a summary of program usage to be written,
+after which the program exits.
+</P>
+
+<H3><CODE>-prefix &lt;text&gt;</CODE></H3>
+
+<P>
+The <CODE>-prefix</CODE> option causes <CODE>testfloat_gen</CODE> to write the
+supplied text argument verbatim as the first line of output before any test
+cases.
+This can be used, for example, to indicate to a downstream program what kind of
+test to perform for the test cases that follow.
+</P>
+
+<H3><CODE>-level &lt;num&gt;</CODE></H3>
+
+<P>
+The <CODE>-level</CODE> option sets the level of testing.
+The argument to <CODE>-level</CODE> can be either 1 <NOBR>or 2</NOBR>.
+The default is <NOBR>level 1</NOBR>.
+<NOBR>Level 2</NOBR> causes many more test cases to be generated, with better
+coverage, than <NOBR>level 1</NOBR>.
+</P>
+
+<H3><CODE>-n &lt;num&gt;</CODE></H3>
+
+<P>
+Option <CODE>-n</CODE> specifies the number of test cases to generate.
+For each <CODE>&lt;type&gt;</CODE> or <CODE>&lt;function&gt;</CODE> and each
+testing level (set by <CODE>-level</CODE>), there is a minimum value that
+<CODE>testfloat_gen</CODE> will accept for <CODE>&lt;num&gt;</CODE>.
+If no <CODE>-n</CODE> option is given, the number of test cases generated by
+<CODE>testfloat_gen</CODE> equals the minimum value acceptable for the
+<CODE>-n</CODE> argument.
+Option <CODE>-n</CODE> cannot be used to reduce this number, but can increase
+it, without changing the testing level.
+</P>
+
+<H3><CODE>-forever</CODE></H3>
+
+<P>
+The <CODE>-forever</CODE> option causes test cases to be generated
+indefinitely, without limit (until the program is terminated by some external
+cause).
+The testing level is set to 2 by this option.
+</P>
+
+<H3><CODE>-precision32, -precision64, -precision80</CODE></H3>
+
+<P>
+When a <CODE>&lt;function&gt;</CODE> is specified that is an
+<NOBR>80-bit</NOBR> double-extended-precision operation affected by rounding
+precision control, the <CODE>-precision32</CODE> option sets the rounding
+precision to <NOBR>32 bits</NOBR>, equivalent to <NOBR>32-bit</NOBR>
+single-precision.
+Likewise, <CODE>-precision64</CODE> sets the rounding precision to
+<NOBR>64 bits</NOBR>, equivalent to <NOBR>64-bit</NOBR> double-precision, and
+<CODE>-precision80</CODE> sets the rounding precision to the full
+<NOBR>80 bits</NOBR> of the double-extended-precision format.
+All these options are ignored for operations not affected by rounding precision
+control.
+When rounding precision is applicable but not specified, the default is the
+full <NOBR>80 bits</NOBR>, same as <CODE>-precision80</CODE>.
+</P>
+
+<H3><CODE>-rnear_even, -rnear_maxMag, -rminMag, -rmin, -rmax</CODE></H3>
+
+<P>
+When a <CODE>&lt;function&gt;</CODE> is specified that requires rounding, the
+<CODE>-rnear_even</CODE> option sets the rounding mode to nearest/even;
+<CODE>-rnear_maxMag</CODE> sets rounding to nearest/maximum magnitude
+(nearest-away);
+<CODE>-rminMag</CODE> sets rounding to minimum magnitude (toward zero);
+<CODE>-rmin</CODE> sets rounding to minimum (down, toward negative infinity);
+and <CODE>-rmax</CODE> sets rounding to maximum (up, toward positive infinity).
+These options are ignored for operations that are exact and thus do not round.
+When rounding mode is relevant but not specified, the default is to round to
+nearest/even, same as <CODE>-rnear_even</CODE>.
+</P>
+
+<H3><CODE>-tininessbefore, -tininessafter</CODE></H3>
+
+<P>
+When a <CODE>&lt;function&gt;</CODE> is specified that requires rounding, the
+<CODE>-tininessbefore</CODE> option indicates that tininess on underflow will
+be detected before rounding, while <CODE>-tininessafter</CODE> indicates that
+tininess on underflow will be detected after rounding.
+These options are ignored for operations that are exact and thus do not round.
+When the method of tininess detection matters but is not specified, the default
+is to detect tininess on underflow before rounding, same as
+<CODE>-tininessbefore</CODE>.
+</P>
+
+<H3><CODE>-notexact, -exact</CODE></H3>
+
+<P>
+When a <CODE>&lt;function&gt;</CODE> is specified that rounds to an integer
+(either conversion to an integer type or a <CODE>roundToInt</CODE> operation),
+the <CODE>-notexact</CODE> option indicates that the <I>inexact</I> exception
+flag is never raised, while <CODE>-exact</CODE> indicates that the
+<I>inexact</I> exception flag is to be raised if the result is inexact.
+For other operations, these options are ignored.
+If neither option is specified, the default is not to raise the <I>inexact</I>
+exception flag when rounding to an integer, same as <CODE>-notexact</CODE>.
+</P>
+
+
+<H2>Output Format</H2>
+
+<P>
+For each test case generated, <CODE>testfloat_gen</CODE> writes a single line
+of text to standard output.
+When the <CODE>testfloat_gen</CODE> command is given a
+<CODE>&lt;type&gt;</CODE> argument, each test case consists of either one
+integer value or one, two, or three floating-point values.
+Each value is written to output as a raw hexadecimal number.
+When there is more than one value per line, they are separated by spaces.
+For example, output from executing
+<PRE>
+ testfloat_gen f64 2
+</PRE>
+might look like this:
+<PRE>
+ 3F90EB5825D6851E C3E0080080000000
+ 41E3C00000000000 C182024F8AE474A8
+ 7FD80FFFFFFFFFFF 7FEFFFFFFFFFFF80
+ 3FFFED6A25C534BE 3CA1000000020000
+ ...
+</PRE>
+with each hexadecimal number being one <NOBR>64-bit</NOBR> floating-point
+value.
+Note that, for floating-point values, the sign and exponent are at the
+most-significant end of the number.
+Thus, for the first number on the first line above, the leading hexadecimal
+digits <CODE>3F9</CODE> are the sign and encoded exponent of the
+<NOBR>64-bit</NOBR> floating-point value, and the remaining digits are the
+encoded significand.
+</P>
+
+<P>
+When <CODE>testfloat_gen</CODE> is given a <CODE>&lt;function&gt;</CODE>
+operation name, each line of output has not only the operands for the operation
+but also the expected output, consisting of a result value and the exception
+flags that are raised.
+For example, the output from
+<PRE>
+ testfloat_gen f64_add
+</PRE>
+could include these lines:
+<PRE>
+ 3F90EB5825D6851E C3E0080080000000 C3E0080080000000 01
+ 41E3C00000000000 C182024F8AE474A8 41E377F6C1D46E2D 01
+ 7FD80FFFFFFFFFFF 7FEFFFFFFFFFFF80 7FF0000000000000 05
+ 3FFFED6A25C534BE 3CA1000000020000 3FFFED6A25C534BF 01
+ ...
+</PRE>
+On each line, the first two numbers are the operands for the floating-point
+addition, and the third and fourth numbers are the expected floating-point
+result (the sum) and the exception flags raised.
+Exception flags are encoded with one bit per flag as follows:
+<BLOCKQUOTE>
+<TABLE>
+<TR><TD>bit 0</TD><TD>&nbsp;&nbsp;&nbsp;</TD><TD><I>inexact</I> exception</TD></TR>
+<TR><TD>bit 1</TD><TD> </TD><TD><I>underflow</I> exception</TD></TR>
+<TR><TD>bit 2</TD><TD> </TD><TD><I>overflow</I> exception</TD></TR>
+<TR><TD>bit 3</TD><TD> </TD><TD><I>infinite</I> exception ("divide by zero")</TD></TR>
+<TR><TD>bit 4</TD><TD> </TD><TD><I>invalid</I> exception</TD></TR>
+</TABLE>
+</BLOCKQUOTE>
+</P>
+
+
+</BODY>
+
diff --git a/doc/testfloat_ver.html b/doc/testfloat_ver.html
new file mode 100644
index 0000000..4d1540e
--- /dev/null
+++ b/doc/testfloat_ver.html
@@ -0,0 +1,250 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>testfloat_ver</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Berkeley TestFloat Release 3: <CODE>testfloat_ver</CODE></H1>
+
+<P>
+John R. Hauser<BR>
+2014 ______<BR>
+</P>
+
+<P>
+*** CONTENT DONE.
+</P>
+
+<P>
+*** REPLACE QUOTATION MARKS.
+<BR>
+*** REPLACE APOSTROPHES.
+<BR>
+*** REPLACE EM DASH.
+</P>
+
+
+<H2>Overview</H2>
+
+<P>
+The <CODE>testfloat_ver</CODE> program takes test-case results obtained from
+exercising an implementation of floating-point arithmetic and verifies that
+those results conform to the IEEE Standard for Binary Floating-Point
+Arithmetic.
+<CODE>testfloat_ver</CODE> is part of the Berkeley TestFloat package, a small
+collection of programs for performing such tests.
+For general information about TestFloat, see file
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+</P>
+
+<P>
+A single execution of <CODE>testfloat_ver</CODE> verifies results for only a
+single floating-point operation and associated options.
+The <CODE>testfloat_ver</CODE> program must be repeatedly executed to verify
+results for each operation to be tested.
+</P>
+
+<P>
+The test cases to be verified are read by <CODE>testfloat_ver</CODE> from
+standard input.
+This input will typically be piped from another program that, for each test
+case, invokes the floating-point operation and writes out the results.
+The format of <CODE>testfloat_ver</CODE>'s input is raw hexadecimal text,
+described in the section below titled <I>Input Format</I>.
+</P>
+
+<P>
+For each test case given to it, <CODE>testfloat_ver</CODE> examines the
+computed results and reports any unexpected results as likely errors.
+
+For more about the operation of <CODE>testfloat_ver</CODE> and how to interpret
+its output, refer to
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+</P>
+
+
+<H2>Command Syntax</H2>
+
+<P>
+The <CODE>testfloat_ver</CODE> program is executed as a command with this
+syntax:
+<PRE>
+ testfloat_ver [&lt;option&gt;...] &lt;function&gt;
+</PRE>
+Square brackets (<CODE>[ ]</CODE>) denote optional arguments,
+<CODE>&lt;option&gt;</CODE> is a supported option, and
+<CODE>&lt;function&gt;</CODE> is the name of a testable operation.
+The available options are documented below.
+The testable operation names are listed in
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+If <CODE>testfloat_ver</CODE> is executed without any arguments, a summary of
+usage is written.
+</P>
+
+
+<H2>Options</H2>
+
+<P>
+The <CODE>testfloat_ver</CODE> program accepts several command options.
+If mutually contradictory options are given, the last one has priority.
+</P>
+
+<H3><CODE>-help</CODE></H3>
+
+<P>
+The <CODE>-help</CODE> option causes a summary of program usage to be written,
+after which the program exits.
+</P>
+
+<H3><CODE>-errors &lt;num&gt;</CODE></H3>
+
+<P>
+The <CODE>-errors</CODE> option instructs <CODE>testfloat_ver</CODE> to report
+no more than the specified number of errors.
+The argument to <CODE>-errors</CODE> must be a nonnegative decimal integer.
+Once the specified number of error reports has been generated, the program
+exits.
+The default is <NOBR><CODE>-errors</CODE> <CODE>20</CODE></NOBR>.
+</P>
+
+<P>
+Against intuition, <NOBR><CODE>-errors</CODE> <CODE>0</CODE></NOBR> causes
+<CODE>testfloat_ver</CODE> to continue for any number of errors.
+</P>
+
+<H3><CODE>-checkNaNs</CODE></H3>
+
+<P>
+The <CODE>-checkNaNs</CODE> option causes <CODE>testfloat_ver</CODE> to verify
+the bitwise correctness of NaN results.
+In order for this option to be sensible, <CODE>testfloat_ver</CODE> must have
+been compiled so that its internal reference implementation of floating-point
+(SoftFloat) generates the proper NaN results for the system being tested.
+</P>
+
+<H3><CODE>-precision32, -precision64, -precision80</CODE></H3>
+
+<P>
+When <CODE>&lt;function&gt;</CODE> is an <NOBR>80-bit</NOBR>
+double-extended-precision operation affected by rounding precision control, the
+<CODE>-precision32</CODE> option indicates that the rounding precision should
+be <NOBR>32 bits</NOBR>, equivalent to <NOBR>32-bit</NOBR> single-precision.
+Likewise, <CODE>-precision64</CODE> indicates that the rounding precision
+should be <NOBR>64 bits</NOBR>, equivalent to <NOBR>64-bit</NOBR>
+double-precision, and <CODE>-precision80</CODE> indicates that the rounding
+precision should be the full <NOBR>80 bits</NOBR> of the
+double-extended-precision format.
+All these options are ignored for operations not affected by rounding precision
+control.
+When rounding precision is applicable but not specified, the default assumption
+is the full <NOBR>80 bits</NOBR>, same as <CODE>-precision80</CODE>.
+</P>
+
+<H3><CODE>-rnear_even, -rnear_maxMag, -rminMag, -rmin, -rmax</CODE></H3>
+
+<P>
+When <CODE>&lt;function&gt;</CODE> is an operation that requires rounding, the
+<CODE>-rnear_even</CODE> option indicates that rounding should be to
+nearest/even, <CODE>-rnear_maxMag</CODE> indicates rounding to nearest/maximum
+magnitude (nearest-away), <CODE>-rminMag</CODE> indicates rounding to minimum
+magnitude (toward zero), <CODE>-rmin</CODE> indicates rounding to minimum
+(down, toward negative infinity), and <CODE>-rmax</CODE> indicates rounding to
+maximum (up, toward positive infinity).
+These options are ignored for operations that are exact and thus do not round.
+When rounding mode is relevant but not specified, the default assumption is
+rounding to nearest/even, same as <CODE>-rnear_even</CODE>.
+</P>
+
+<H3><CODE>-tininessbefore, -tininessafter</CODE></H3>
+
+<P>
+When <CODE>&lt;function&gt;</CODE> is an operation that requires rounding, the
+<CODE>-tininessbefore</CODE> option indicates that tininess on underflow should
+be detected before rounding, while <CODE>-tininessafter</CODE> indicates that
+tininess on underflow should be detected after rounding.
+These options are ignored for operations that are exact and thus do not round.
+When the method of tininess detection matters but is not specified, the default
+assumption is that tininess should be detected before rounding, same as
+<CODE>-tininessbefore</CODE>.
+</P>
+
+<H3><CODE>-notexact, -exact</CODE></H3>
+
+<P>
+When <CODE>&lt;function&gt;</CODE> is an operation that rounds to an integer
+(either conversion to an integer type or a <CODE>roundToInt</CODE> operation),
+the <CODE>-notexact</CODE> option indicates that the <I>inexact</I> exception
+flag should never be raised, while <CODE>-exact</CODE> indicates that the
+<I>inexact</I> exception flag should be raised when the result is inexact.
+For other operations, these options are ignored.
+If neither option is specified, the default assumption is that the
+<I>inexact</I> exception flag should not be raised when rounding to an integer,
+same as <CODE>-notexact</CODE>.
+</P>
+
+
+<H2>Input Format</H2>
+
+<P>
+For a given <CODE>&lt;function&gt;</CODE> argument, the input format expected
+by <CODE>testfloat_ver</CODE> is the same as the output generated by program
+<A HREF="testfloat_gen.html"><NOBR><CODE>testfloat_gen</CODE></NOBR></A> for
+the same argument.
+</P>
+
+<P>
+Input to <CODE>testfloat_ver</CODE> is expected to be text, with each line
+containing the data for one test case.
+The number of input lines thus equals the number of test cases.
+A single test case is organized as follows: first are the operands for the
+operation, next is the result value obtained, and last is a number indicating
+the exception flags that were raised.
+These values are all expected to be provided as raw hexadecimal numbers
+separated on the line by spaces.
+For example, for the command
+<PRE>
+ testfloat_ver f64_add
+</PRE>
+valid input could include these lines:
+<PRE>
+ 3F90EB5825D6851E C3E0080080000000 C3E0080080000000 01
+ 41E3C00000000000 C182024F8AE474A8 41E377F6C1D46E2D 01
+ 7FD80FFFFFFFFFFF 7FEFFFFFFFFFFF80 7FF0000000000000 05
+ 3FFFED6A25C534BE 3CA1000000020000 3FFFED6A25C534BF 01
+ ...
+</PRE>
+On each line above, the first two hexadecimal numbers represent the
+<NOBR>64-bit</NOBR> floating-point operands, the third hexadecimal number is
+the <NOBR>64-bit</NOBR> floating-point result of the operation (the sum), and
+the last hexadecimal number gives the exception flags that were raised by the
+operation.
+</P>
+
+<P>
+Note that, for floating-point values, the sign and exponent are at the
+most-significant end of the number.
+Thus, for the first number on the first line above, the leading hexadecimal
+digits <CODE>3F9</CODE> are the sign and encoded exponent of the
+<NOBR>64-bit</NOBR> floating-point value, and the remaining digits are the
+encoded significand.
+</P>
+
+<P>
+Exception flags are encoded with one bit per flag as follows:
+<BLOCKQUOTE>
+<TABLE>
+<TR><TD>bit 0</TD><TD>&nbsp;&nbsp;&nbsp;</TD><TD><I>inexact</I> exception</TD></TR>
+<TR><TD>bit 1</TD><TD> </TD><TD><I>underflow</I> exception</TD></TR>
+<TR><TD>bit 2</TD><TD> </TD><TD><I>overflow</I> exception</TD></TR>
+<TR><TD>bit 3</TD><TD> </TD><TD><I>infinite</I> exception ("divide by zero")</TD></TR>
+<TR><TD>bit 4</TD><TD> </TD><TD><I>invalid</I> exception</TD></TR>
+</TABLE>
+</BLOCKQUOTE>
+</P>
+
+
+</BODY>
+
diff --git a/doc/testsoftfloat.html b/doc/testsoftfloat.html
new file mode 100644
index 0000000..49215de
--- /dev/null
+++ b/doc/testsoftfloat.html
@@ -0,0 +1,229 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>testsoftfloat</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Berkeley TestFloat Release 3: <CODE>testsoftfloat</CODE></H1>
+
+<P>
+John R. Hauser<BR>
+2014 ______<BR>
+</P>
+
+<P>
+*** CONTENT DONE.
+</P>
+
+<P>
+*** REPLACE QUOTATION MARKS.
+<BR>
+*** REPLACE APOSTROPHES.
+<BR>
+*** REPLACE EM DASH.
+</P>
+
+
+<H2>Overview</H2>
+
+<P>
+The <CODE>testsoftfloat</CODE> program tests that a build of the Berkeley
+SoftFloat library conforms to the IEEE Standard for Binary Floating-Point
+Arithmetic as expected.
+Program <CODE>testsoftfloat</CODE> is part of the Berkeley TestFloat package, a
+small collection of programs for performing such tests.
+For general information about TestFloat, as well as for basics about the
+operation of <CODE>testsoftfloat</CODE> and how to interpret its output, see
+file
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+</P>
+
+<P>
+Note that, even if there are no bugs in the source code for SoftFloat (not
+guaranteed), a build of SoftFloat might still fail due to an issue with the
+build process, such as an incompatible compiler option or a compiler bug.
+</P>
+
+<P>
+The <CODE>testsoftfloat</CODE> program will ordinarily test a function for all
+rounding modes defined by the IEEE Floating-Point Standard, one after the
+other.
+If an operation is not supposed to require rounding, it will by default be
+tested only with the rounding mode set to <CODE>near_even</CODE>
+(nearest/even).
+In the same way, if an operation is affected by the way in which underflow
+tininess is detected, <CODE>testsoftfloat</CODE> tests the function with
+tininess detected both before rounding and after rounding.
+For <NOBR>80-bit</NOBR> double-extended-precision operations affected by
+rounding precision control, <CODE>testsoftfloat</CODE> also tests the function
+for all three rounding precision modes, one after the other.
+Testing can be limited to a single rounding mode, a single tininess mode,
+and/or a single rounding precision with appropriate command-line options.
+</P>
+
+
+<H2>Command Syntax</H2>
+
+<P>
+The <CODE>testsoftfloat</CODE> program is executed as a command with this
+syntax:
+<PRE>
+ testsoftfloat [&lt;option&gt;...] &lt;function&gt;
+</PRE>
+Square brackets (<CODE>[ ]</CODE>) denote optional arguments,
+<CODE>&lt;option&gt;</CODE> is a supported option, and
+<CODE>&lt;function&gt;</CODE> is the name of either a testable function or a
+function set.
+The available options and function sets are documented below.
+If <CODE>testsoftfloat</CODE> is executed without any arguments, a summary of
+usage is written.
+</P>
+
+
+<H2>Options</H2>
+
+<P>
+The <CODE>testsoftfloat</CODE> program accepts several command options.
+If mutually contradictory options are given, the last one has priority.
+</P>
+
+<H3><CODE>-help</CODE></H3>
+
+<P>
+The <CODE>-help</CODE> option causes a summary of program usage to be written,
+after which the program exits.
+</P>
+
+<H3><CODE>-level &lt;num&gt;</CODE></H3>
+
+<P>
+The <CODE>-level</CODE> option sets the level of testing.
+The argument to <CODE>-level</CODE> can be either 1 <NOBR>or 2</NOBR>.
+The default is <NOBR>level 1</NOBR>.
+Level 2 performs many more tests than <NOBR>level 1</NOBR> and thus can reveal
+bugs not found by <NOBR>level 1</NOBR>.
+</P>
+
+<H3><CODE>-errors &lt;num&gt;</CODE></H3>
+
+<P>
+The <CODE>-errors</CODE> option instructs <CODE>testsoftfloat</CODE> to report
+no more than the specified number of errors for any combination of function,
+rounding mode, etc.
+The argument to <CODE>-errors</CODE> must be a nonnegative decimal integer.
+Once the specified number of error reports has been generated,
+<CODE>testsoftfloat</CODE> ends the current test and begins the next one, if
+any.
+The default is <NOBR><CODE>-errors</CODE> <CODE>20</CODE></NOBR>.
+</P>
+
+<P>
+Against intuition, <NOBR><CODE>-errors</CODE> <CODE>0</CODE></NOBR> causes
+<CODE>testsoftfloat</CODE> to report every error it finds.
+</P>
+
+<H3><CODE>-errorstop</CODE></H3>
+
+<P>
+The <CODE>-errorstop</CODE> option causes the program to exit after the first
+function for which any errors are reported.
+</P>
+
+<H3><CODE>-forever</CODE></H3>
+
+<P>
+The <CODE>-forever</CODE> option causes a single function to be repeatedly
+tested.
+Only one rounding mode and/or rounding precision can be tested in a single
+execution.
+If not specified, the rounding mode defaults to nearest/even.
+For <NOBR>80-bit</NOBR> double-extended-precision functions, the rounding
+precision defaults to full double-extended precision.
+The testing level is set to 2 by this option.
+</P>
+
+<H3><CODE>-precision32, -precision64, -precision80</CODE></H3>
+
+<P>
+For <NOBR>80-bit</NOBR> double-extended-precision funcions affected by
+rounding precision control, the <CODE>-precision32</CODE> option restricts
+testing to only the cases in which the rounding precision is
+<NOBR>32 bits</NOBR>, equivalent to <NOBR>32-bit</NOBR> single-precision.
+The other rounding precision choices are not tested.
+Likewise, <CODE>-precision64</CODE> fixes the rounding precision to
+<NOBR>64 bits</NOBR>, equivalent to <NOBR>64-bit</NOBR> double-precision;
+and <CODE>-precision80</CODE> fixes the rounding precision to the full
+<NOBR>80 bits</NOBR> of the double-extended-precision format.
+All these options are ignored for operations not affected by rounding precision
+control.
+</P>
+
+<H3><CODE>-rnear_even, -rnear_maxMag, -rminMag, -rmin, -rmax</CODE></H3>
+
+<P>
+The <CODE>-rnear_even</CODE> option restricts testing to only the cases in
+which the rounding mode is nearest/even.
+The other rounding mode choices are not tested.
+Likewise, <CODE>-rnear_maxMag</CODE> forces rounding to nearest/maximum
+magnitude (nearest-away), <CODE>-rminMag</CODE> forces rounding to minimum
+magnitude (toward zero), <CODE>-rmin</CODE> forces rounding to minimum (down,
+toward negative infinity), and <CODE>-rmax</CODE> forces rounding to maximum
+(up, toward positive infinity).
+These options are ignored for operations that are exact and thus do not round.
+</P>
+
+<H3><CODE>-tininessbefore, -tininessafter</CODE></H3>
+
+<P>
+The <CODE>-tininessbefore</CODE> option restricts testing to only the cases in
+which tininess on underflow is detected before rounding.
+Likewise, <CODE>-tininessafter</CODE> restricts testing to only the cases in
+which tininess on underflow is detected after rounding.
+</P>
+
+<H3><CODE>-notexact, -exact</CODE></H3>
+
+<P>
+For functions that round to an integer (conversions to integer types and the
+<CODE>roundToInt</CODE> functions), the <CODE>-notexact</CODE> option restricts
+testing to only the cases for which the <CODE><I>exact</I></CODE> operand
+(specifying whether the <I>inexact</I> exception flag may be raised) is
+<CODE>false</CODE>.
+Likewise, the <CODE>-exact</CODE> option restricts testing to only the cases
+for which the <CODE><I>exact</I></CODE> operand is <CODE>true</CODE>.
+</P>
+
+
+<H2>Function Sets</H2>
+
+<P>
+Just as <CODE>testsoftfloat</CODE> can test a function for all five rounding
+modes in sequence, multiple functions can be tested with a single execution of
+<CODE>testsoftfloat</CODE>.
+Two sets are recognized: <CODE>-all1</CODE> and <CODE>-all2</CODE>.
+The set <CODE>-all1</CODE> comprises all one-operand operations, while
+<CODE>-all2</CODE> is all two-operand operations.
+A function set is used in place of a function name in the
+<CODE>testsoftfloat</CODE> command line, such as
+<PRE>
+ testsoftfloat [&lt;option&gt;...] -all1
+</PRE>
+</P>
+
+<P>
+For the purpose of deciding the number of operands of an operation, any
+<CODE><I>roundingMode</I></CODE> and <CODE><I>exact</I></CODE> arguments are
+ignored.
+(Such arguments specify the rounding mode and whether the <I>inexact</I>
+exception flag may be raised, respectively.)
+Thus, functions that convert to integer type and the <CODE>roundToInt</CODE>
+functions are included in the set of one-operand operations tested by
+<CODE>-all1</CODE>.
+</P>
+
+
+</BODY>
+
diff --git a/doc/timesoftfloat.html b/doc/timesoftfloat.html
new file mode 100644
index 0000000..b214611
--- /dev/null
+++ b/doc/timesoftfloat.html
@@ -0,0 +1,202 @@
+
+<HTML>
+
+<HEAD>
+<TITLE>timesoftfloat</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Berkeley TestFloat Release 3: <CODE>timesoftfloat</CODE></H1>
+
+<P>
+John R. Hauser<BR>
+2014 ______<BR>
+</P>
+
+<P>
+*** CONTENT DONE.
+</P>
+
+<P>
+*** REPLACE QUOTATION MARKS.
+<BR>
+*** REPLACE APOSTROPHES.
+<BR>
+*** REPLACE EM DASH.
+</P>
+
+
+<H2>Overview</H2>
+
+<P>
+The <CODE>timesoftfloat</CODE> program provides a simple way to evaluate the
+speed of the floating-point operations of the Berkeley SoftFloat library.
+Program <CODE>timesoftfloat</CODE> is included with the Berkeley TestFloat
+package, a small collection of programs for testing that an implementation of
+floating-point conforms to the IEEE Standard for Binary Floating-Point
+Arithmetic.
+Although <CODE>timesoftfloat</CODE> does not test floating-point correctness
+like other TestFloat programs, nevertheless <CODE>timesoftfloat</CODE> is a
+partner to TestFloat's <CODE>testsoftfloat</CODE> program.
+For more about TestFloat generally and <CODE>testsoftfloat</CODE> specifically,
+see file
+<A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
+</P>
+
+<P>
+Ordinarily, <CODE>timesoftfloat</CODE> will measure a function's speed
+separately for each rounding mode defined by the IEEE Floating-Point Standard,
+one after the other.
+If an operation is not supposed to require rounding, it will by default be
+timed only with the rounding mode set to <CODE>near_even</CODE> (nearest/even).
+In the same way, if an operation is affected by the way in which underflow
+tininess is detected, <CODE>timesoftfloat</CODE> times the function with
+tininess detected both before rounding and after rounding.
+For <NOBR>80-bit</NOBR> double-extended-precision operations affected by
+rounding precision control, <CODE>timesoftfloat</CODE> also times the function
+for each of the three rounding precision modes, one after the other.
+Evaluation of a function can be limited to a single rounding mode, a single
+tininess mode, and/or a single rounding precision with appropriate command-line
+options.
+</P>
+
+<P>
+For each function and mode evaluated, <CODE>timesoftfloat</CODE> reports the
+measured speed of the function in Mops/s, or ``millions of operations per
+second''.
+The speeds reported by <CODE>timesoftfloat</CODE> may be affected somewhat by
+other software executing at the same time as <CODE>timesoftfloat</CODE>.
+Be aware also that the exact execution time of any SoftFloat function depends
+partly on the values of arguments and the state of the processor's caches at
+the time the function is called.
+Your actual experience with SoftFloat may differ from the speeds reported by
+<CODE>timesoftfloat</CODE> for all these reasons.
+</P>
+
+<P>
+Note that the remainder operations (<CODE>f32_rem</CODE>, <CODE>f64_rem</CODE>,
+<CODE>extF80_rem</CODE>, and <CODE>f128_rem</CODE>) will be markedly slower
+than other operations, particularly for double-extended-precision
+(<CODE>extF80_rem</CODE>) and quadruple precision (<CODE>f128_rem</CODE>).
+This is inherent to the remainder operation itself and is not a failing of the
+SoftFloat implementation.
+</P>
+
+
+<H2>Command Syntax</H2>
+
+<P>
+The <CODE>timesoftfloat</CODE> program is executed as a command with this
+syntax:
+<PRE>
+ timesoftfloat [&lt;option&gt;...] &lt;function&gt;
+</PRE>
+Square brackets (<CODE>[ ]</CODE>) denote optional arguments,
+<CODE>&lt;option&gt;</CODE> is a supported option, and
+<CODE>&lt;function&gt;</CODE> is the name of either a testable function or a
+function set.
+The available options and function sets are documented below.
+If <CODE>timesoftfloat</CODE> is executed without any arguments, a summary of
+usage is written.
+</P>
+
+
+<H2>Options</H2>
+
+<P>
+The <CODE>timesoftfloat</CODE> program accepts several command options.
+If mutually contradictory options are given, the last one has priority.
+</P>
+
+<H3><CODE>-help</CODE></H3>
+
+<P>
+The <CODE>-help</CODE> option causes a summary of program usage to be written,
+after which the program exits.
+</P>
+
+<H3><CODE>-precision32, -precision64, -precision80</CODE></H3>
+
+<P>
+For <NOBR>80-bit</NOBR> double-extended-precision funcions affected by
+rounding precision control, the <CODE>-precision32</CODE> option restricts
+timing of an operation to only the cases in which the rounding precision is
+<NOBR>32 bits</NOBR>, equivalent to <NOBR>32-bit</NOBR> single-precision.
+Other rounding precision choices are not timed.
+Likewise, <CODE>-precision64</CODE> fixes the rounding precision to
+<NOBR>64 bits</NOBR>, equivalent to <NOBR>64-bit</NOBR> double-precision;
+and <CODE>-precision80</CODE> fixes the rounding precision to the full
+<NOBR>80 bits</NOBR> of the double-extended-precision format.
+All these options are ignored for operations not affected by rounding precision
+control.
+</P>
+
+<H3><CODE>-rnear_even, -rnear_maxMag, -rminMag, -rmin, -rmax</CODE></H3>
+
+<P>
+The <CODE>-rnear_even</CODE> option restricts timing of an operation to only
+the cases in which the rounding mode is nearest/even.
+Other rounding mode choices are not timed.
+Likewise, <CODE>-rnear_maxMag</CODE> forces rounding to nearest/maximum
+magnitude (nearest-away), <CODE>-rminMag</CODE> forces rounding to minimum
+magnitude (toward zero), <CODE>-rmin</CODE> forces rounding to minimum (down,
+toward negative infinity), and <CODE>-rmax</CODE> forces rounding to maximum
+(up, toward positive infinity).
+These options are ignored for operations that are exact and thus do not round.
+</P>
+
+<H3><CODE>-tininessbefore, -tininessafter</CODE></H3>
+
+<P>
+The <CODE>-tininessbefore</CODE> option restricts timing of an operation to
+only the cases in which tininess on underflow is detected before rounding.
+Likewise, <CODE>-tininessafter</CODE> restricts measurement to only the cases
+in which tininess on underflow is detected after rounding.
+</P>
+
+<H3><CODE>-notexact, -exact</CODE></H3>
+
+<P>
+For functions that round to an integer (conversions to integer types and the
+<CODE>roundToInt</CODE> functions), the <CODE>-notexact</CODE> option restricts
+timing of an operation to only the cases for which the
+<CODE><I>exact</I></CODE> operand (specifying whether the <I>inexact</I>
+exception flag may be raised) is <CODE>false</CODE>.
+Likewise, the <CODE>-exact</CODE> option restricts measurement to only the
+cases for which the <CODE><I>exact</I></CODE> operand is <CODE>true</CODE>.
+</P>
+
+
+<H2>Function Sets</H2>
+
+<P>
+Just as <CODE>timesoftfloat</CODE> can time a function for all five rounding
+modes in sequence, multiple functions can be timed with a single execution of
+<CODE>timesoftfloat</CODE>.
+Three sets are recognized:
+<CODE>-all1</CODE>, <CODE>-all2</CODE>, and <CODE>-all</CODE>.
+The set <CODE>-all1</CODE> comprises all one-operand operations,
+<CODE>-all2</CODE> is all two-operand operations, and <CODE>-all</CODE> is
+obviously all operations.
+A function set is used in place of a function name in the
+<CODE>timesoftfloat</CODE> command line, such as
+<PRE>
+ timesoftfloat [&lt;option&gt;...] -all1
+</PRE>
+</P>
+
+<P>
+For the purpose of deciding the number of operands of an operation, any
+<CODE><I>roundingMode</I></CODE> and <CODE><I>exact</I></CODE> arguments are
+ignored.
+(Such arguments specify the rounding mode and whether the <I>inexact</I>
+exception flag may be raised, respectively.)
+Thus, functions that convert to integer type and the <CODE>roundToInt</CODE>
+functions are included in the set of one-operand operations timed by
+<CODE>-all1</CODE>.
+</P>
+
+
+</BODY>
+
diff --git a/source/fail.c b/source/fail.c
new file mode 100644
index 0000000..80685ef
--- /dev/null
+++ b/source/fail.c
@@ -0,0 +1,56 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "platform.h"
+#include "fail.h"
+
+char *fail_programName = "";
+
+void fail( const char *messagePtr, ... )
+{
+ va_list varArgs;
+
+ fflush( 0 );
+ fprintf( stderr, "%s: ", fail_programName );
+ va_start( varArgs, messagePtr );
+ vfprintf( stderr, messagePtr, varArgs );
+ va_end( varArgs );
+ fputs( ".\n", stderr );
+ exit( EXIT_FAILURE );
+
+}
+
diff --git a/source/fail.h b/source/fail.h
new file mode 100644
index 0000000..50e50e5
--- /dev/null
+++ b/source/fail.h
@@ -0,0 +1,38 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+extern char *fail_programName;
+
+void fail( const char *, ... );
+
diff --git a/source/functionInfos.c b/source/functionInfos.c
new file mode 100644
index 0000000..1a3c54f
--- /dev/null
+++ b/source/functionInfos.c
@@ -0,0 +1,212 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include "platform.h"
+#include "functions.h"
+
+#define ARG_1 FUNC_ARG_UNARY
+#define ARG_2 FUNC_ARG_BINARY
+#define ARG_R FUNC_ARG_ROUNDINGMODE
+#define ARG_E FUNC_ARG_EXACT
+#define EFF_P FUNC_EFF_ROUNDINGPRECISION
+#define EFF_R FUNC_EFF_ROUNDINGMODE
+#define EFF_T FUNC_EFF_TININESSMODE
+#define EFF_T_REDP FUNC_EFF_TININESSMODE_REDUCEDPREC
+
+/*----------------------------------------------------------------------------
+| Warning: This array must match the functions names defined in
+| "functions.h".
+*----------------------------------------------------------------------------*/
+const struct functionInfo functionInfos[NUM_FUNCTIONS] = {
+ { 0, 0 },
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ { "ui32_to_f32", ARG_1 | EFF_R },
+ { "ui32_to_f64", ARG_1 },
+#ifdef EXTFLOAT80
+ { "ui32_to_extF80", ARG_1 },
+#endif
+#ifdef FLOAT128
+ { "ui32_to_f128", ARG_1 },
+#endif
+ { "ui64_to_f32", ARG_1 | EFF_R },
+ { "ui64_to_f64", ARG_1 | EFF_R },
+#ifdef EXTFLOAT80
+ { "ui64_to_extF80", ARG_1 },
+#endif
+#ifdef FLOAT128
+ { "ui64_to_f128", ARG_1 },
+#endif
+ { "i32_to_f32", ARG_1 | EFF_R },
+ { "i32_to_f64", ARG_1 },
+#ifdef EXTFLOAT80
+ { "i32_to_extF80", ARG_1 },
+#endif
+#ifdef FLOAT128
+ { "i32_to_f128", ARG_1 },
+#endif
+ { "i64_to_f32", ARG_1 | EFF_R },
+ { "i64_to_f64", ARG_1 | EFF_R },
+#ifdef EXTFLOAT80
+ { "i64_to_extF80", ARG_1 },
+#endif
+#ifdef FLOAT128
+ { "i64_to_f128", ARG_1 },
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ { "f32_to_ui32", ARG_1 | ARG_R | ARG_E },
+ { "f32_to_ui64", ARG_1 | ARG_R | ARG_E },
+ { "f32_to_i32", ARG_1 | ARG_R | ARG_E },
+ { "f32_to_i64", ARG_1 | ARG_R | ARG_E },
+ { "f32_to_ui32_r_minMag", ARG_1 | ARG_E },
+ { "f32_to_ui64_r_minMag", ARG_1 | ARG_E },
+ { "f32_to_i32_r_minMag", ARG_1 | ARG_E },
+ { "f32_to_i64_r_minMag", ARG_1 | ARG_E },
+ { "f32_to_f64", ARG_1 },
+#ifdef EXTFLOAT80
+ { "f32_to_extF80", ARG_1 },
+#endif
+#ifdef FLOAT128
+ { "f32_to_f128", ARG_1 },
+#endif
+ { "f32_roundToInt", ARG_1 | ARG_R | ARG_E },
+ { "f32_add", ARG_2 | EFF_R },
+ { "f32_sub", ARG_2 | EFF_R },
+ { "f32_mul", ARG_2 | EFF_R | EFF_T },
+ { "f32_mulAdd", EFF_R | EFF_T },
+ { "f32_div", ARG_2 | EFF_R },
+ { "f32_rem", ARG_2 },
+ { "f32_sqrt", ARG_1 | EFF_R },
+ { "f32_eq", ARG_2 },
+ { "f32_le", ARG_2 },
+ { "f32_lt", ARG_2 },
+ { "f32_eq_signaling", ARG_2 },
+ { "f32_le_quiet", ARG_2 },
+ { "f32_lt_quiet", ARG_2 },
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ { "f64_to_ui32", ARG_1 | ARG_R | ARG_E },
+ { "f64_to_ui64", ARG_1 | ARG_R | ARG_E },
+ { "f64_to_i32", ARG_1 | ARG_R | ARG_E },
+ { "f64_to_i64", ARG_1 | ARG_R | ARG_E },
+ { "f64_to_ui32_r_minMag", ARG_1 | ARG_E },
+ { "f64_to_ui64_r_minMag", ARG_1 | ARG_E },
+ { "f64_to_i32_r_minMag", ARG_1 | ARG_E },
+ { "f64_to_i64_r_minMag", ARG_1 | ARG_E },
+ { "f64_to_f32", ARG_1 | EFF_R | EFF_T },
+#ifdef EXTFLOAT80
+ { "f64_to_extF80", ARG_1 },
+#endif
+#ifdef FLOAT128
+ { "f64_to_f128", ARG_1 },
+#endif
+ { "f64_roundToInt", ARG_1 | ARG_R | ARG_E },
+ { "f64_add", ARG_2 | EFF_R },
+ { "f64_sub", ARG_2 | EFF_R },
+ { "f64_mul", ARG_2 | EFF_R | EFF_T },
+ { "f64_mulAdd", EFF_R | EFF_T },
+ { "f64_div", ARG_2 | EFF_R },
+ { "f64_rem", ARG_2 },
+ { "f64_sqrt", ARG_1 | EFF_R },
+ { "f64_eq", ARG_2 },
+ { "f64_le", ARG_2 },
+ { "f64_lt", ARG_2 },
+ { "f64_eq_signaling", ARG_2 },
+ { "f64_le_quiet", ARG_2 },
+ { "f64_lt_quiet", ARG_2 },
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+ { "extF80_to_ui32", ARG_1 | ARG_R | ARG_E },
+ { "extF80_to_ui64", ARG_1 | ARG_R | ARG_E },
+ { "extF80_to_i32", ARG_1 | ARG_R | ARG_E },
+ { "extF80_to_i64", ARG_1 | ARG_R | ARG_E },
+ { "extF80_to_ui32_r_minMag", ARG_1 | ARG_E },
+ { "extF80_to_ui64_r_minMag", ARG_1 | ARG_E },
+ { "extF80_to_i32_r_minMag", ARG_1 | ARG_E },
+ { "extF80_to_i64_r_minMag", ARG_1 | ARG_E },
+ { "extF80_to_f32", ARG_1 | EFF_R | EFF_T },
+ { "extF80_to_f64", ARG_1 | EFF_R | EFF_T },
+#ifdef FLOAT128
+ { "extF80_to_f128", ARG_1 },
+#endif
+ { "extF80_roundToInt", ARG_1 | ARG_R | ARG_E },
+ { "extF80_add", ARG_2 | EFF_P | EFF_R | EFF_T_REDP },
+ { "extF80_sub", ARG_2 | EFF_P | EFF_R | EFF_T_REDP },
+ { "extF80_mul", ARG_2 | EFF_P | EFF_R | EFF_T | EFF_T_REDP },
+ { "extF80_div", ARG_2 | EFF_P | EFF_R | EFF_T_REDP },
+ { "extF80_rem", ARG_2 },
+ { "extF80_sqrt", ARG_1 | EFF_P | EFF_R },
+ { "extF80_eq", ARG_2 },
+ { "extF80_le", ARG_2 },
+ { "extF80_lt", ARG_2 },
+ { "extF80_eq_signaling", ARG_2 },
+ { "extF80_le_quiet", ARG_2 },
+ { "extF80_lt_quiet", ARG_2 },
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef FLOAT128
+ { "f128_to_ui32", ARG_1 | ARG_R | ARG_E },
+ { "f128_to_ui64", ARG_1 | ARG_R | ARG_E },
+ { "f128_to_i32", ARG_1 | ARG_R | ARG_E },
+ { "f128_to_i64", ARG_1 | ARG_R | ARG_E },
+ { "f128_to_ui32_r_minMag", ARG_1 | ARG_E },
+ { "f128_to_ui64_r_minMag", ARG_1 | ARG_E },
+ { "f128_to_i32_r_minMag", ARG_1 | ARG_E },
+ { "f128_to_i64_r_minMag", ARG_1 | ARG_E },
+ { "f128_to_f32", ARG_1 | EFF_R | EFF_T },
+ { "f128_to_f64", ARG_1 | EFF_R | EFF_T },
+#ifdef EXTFLOAT80
+ { "f128_to_extF80", ARG_1 | EFF_R | EFF_T },
+#endif
+ { "f128_roundToInt", ARG_1 | ARG_R | ARG_E },
+ { "f128_add", ARG_2 | EFF_R },
+ { "f128_sub", ARG_2 | EFF_R },
+ { "f128_mul", ARG_2 | EFF_R | EFF_T },
+ { "f128_mulAdd", EFF_R | EFF_T },
+ { "f128_div", ARG_2 | EFF_R },
+ { "f128_rem", ARG_2 },
+ { "f128_sqrt", ARG_1 | EFF_R },
+ { "f128_eq", ARG_2 },
+ { "f128_le", ARG_2 },
+ { "f128_lt", ARG_2 },
+ { "f128_eq_signaling", ARG_2 },
+ { "f128_le_quiet", ARG_2 },
+ { "f128_lt_quiet", ARG_2 },
+#endif
+};
+
diff --git a/source/functions.h b/source/functions.h
new file mode 100644
index 0000000..0f5e55f
--- /dev/null
+++ b/source/functions.h
@@ -0,0 +1,230 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+
+/*----------------------------------------------------------------------------
+| Warning: This list must match the contents of "functionInfos.c".
+*----------------------------------------------------------------------------*/
+enum {
+ UI32_TO_F32 = 1,
+ UI32_TO_F64,
+#ifdef EXTFLOAT80
+ UI32_TO_EXTF80,
+#endif
+#ifdef FLOAT128
+ UI32_TO_F128,
+#endif
+ UI64_TO_F32,
+ UI64_TO_F64,
+#ifdef EXTFLOAT80
+ UI64_TO_EXTF80,
+#endif
+#ifdef FLOAT128
+ UI64_TO_F128,
+#endif
+ I32_TO_F32,
+ I32_TO_F64,
+#ifdef EXTFLOAT80
+ I32_TO_EXTF80,
+#endif
+#ifdef FLOAT128
+ I32_TO_F128,
+#endif
+ I64_TO_F32,
+ I64_TO_F64,
+#ifdef EXTFLOAT80
+ I64_TO_EXTF80,
+#endif
+#ifdef FLOAT128
+ I64_TO_F128,
+#endif
+ F32_TO_UI32,
+ F32_TO_UI64,
+ F32_TO_I32,
+ F32_TO_I64,
+ F32_TO_UI32_R_MINMAG,
+ F32_TO_UI64_R_MINMAG,
+ F32_TO_I32_R_MINMAG,
+ F32_TO_I64_R_MINMAG,
+ F32_TO_F64,
+#ifdef EXTFLOAT80
+ F32_TO_EXTF80,
+#endif
+#ifdef FLOAT128
+ F32_TO_F128,
+#endif
+ F32_ROUNDTOINT,
+ F32_ADD,
+ F32_SUB,
+ F32_MUL,
+ F32_MULADD,
+ F32_DIV,
+ F32_REM,
+ F32_SQRT,
+ F32_EQ,
+ F32_LE,
+ F32_LT,
+ F32_EQ_SIGNALING,
+ F32_LE_QUIET,
+ F32_LT_QUIET,
+ F64_TO_UI32,
+ F64_TO_UI64,
+ F64_TO_I32,
+ F64_TO_I64,
+ F64_TO_UI32_R_MINMAG,
+ F64_TO_UI64_R_MINMAG,
+ F64_TO_I32_R_MINMAG,
+ F64_TO_I64_R_MINMAG,
+ F64_TO_F32,
+#ifdef EXTFLOAT80
+ F64_TO_EXTF80,
+#endif
+#ifdef FLOAT128
+ F64_TO_F128,
+#endif
+ F64_ROUNDTOINT,
+ F64_ADD,
+ F64_SUB,
+ F64_MUL,
+ F64_MULADD,
+ F64_DIV,
+ F64_REM,
+ F64_SQRT,
+ F64_EQ,
+ F64_LE,
+ F64_LT,
+ F64_EQ_SIGNALING,
+ F64_LE_QUIET,
+ F64_LT_QUIET,
+#ifdef EXTFLOAT80
+ EXTF80_TO_UI32,
+ EXTF80_TO_UI64,
+ EXTF80_TO_I32,
+ EXTF80_TO_I64,
+ EXTF80_TO_UI32_R_MINMAG,
+ EXTF80_TO_UI64_R_MINMAG,
+ EXTF80_TO_I32_R_MINMAG,
+ EXTF80_TO_I64_R_MINMAG,
+ EXTF80_TO_F32,
+ EXTF80_TO_F64,
+#ifdef FLOAT128
+ EXTF80_TO_F128,
+#endif
+ EXTF80_ROUNDTOINT,
+ EXTF80_ADD,
+ EXTF80_SUB,
+ EXTF80_MUL,
+ EXTF80_DIV,
+ EXTF80_REM,
+ EXTF80_SQRT,
+ EXTF80_EQ,
+ EXTF80_LE,
+ EXTF80_LT,
+ EXTF80_EQ_SIGNALING,
+ EXTF80_LE_QUIET,
+ EXTF80_LT_QUIET,
+#endif
+#ifdef FLOAT128
+ F128_TO_UI32,
+ F128_TO_UI64,
+ F128_TO_I32,
+ F128_TO_I64,
+ F128_TO_UI32_R_MINMAG,
+ F128_TO_UI64_R_MINMAG,
+ F128_TO_I32_R_MINMAG,
+ F128_TO_I64_R_MINMAG,
+ F128_TO_F32,
+ F128_TO_F64,
+#ifdef EXTFLOAT80
+ F128_TO_EXTF80,
+#endif
+ F128_ROUNDTOINT,
+ F128_ADD,
+ F128_SUB,
+ F128_MUL,
+ F128_MULADD,
+ F128_DIV,
+ F128_REM,
+ F128_SQRT,
+ F128_EQ,
+ F128_LE,
+ F128_LT,
+ F128_EQ_SIGNALING,
+ F128_LE_QUIET,
+ F128_LT_QUIET,
+#endif
+ NUM_FUNCTIONS
+};
+
+enum {
+ ROUND_NEAR_EVEN = 1,
+ ROUND_MINMAG,
+ ROUND_MIN,
+ ROUND_MAX,
+ ROUND_NEAR_MAXMAG,
+ NUM_ROUNDINGMODES
+};
+enum {
+ TININESS_BEFORE_ROUNDING = 1,
+ TININESS_AFTER_ROUNDING,
+ NUM_TININESSMODES
+};
+
+extern const uint_fast8_t roundingModes[NUM_ROUNDINGMODES];
+extern const uint_fast8_t tininessModes[NUM_TININESSMODES];
+
+enum {
+ FUNC_ARG_UNARY = 0x01,
+ FUNC_ARG_BINARY = 0x02,
+ FUNC_ARG_ROUNDINGMODE = 0x04,
+ FUNC_ARG_EXACT = 0x08,
+ FUNC_EFF_ROUNDINGPRECISION = 0x10,
+ FUNC_EFF_ROUNDINGMODE = 0x20,
+ FUNC_EFF_TININESSMODE = 0x40,
+ FUNC_EFF_TININESSMODE_REDUCEDPREC = 0x80
+};
+struct functionInfo {
+ const char *namePtr;
+ unsigned char attribs;
+};
+extern const struct functionInfo functionInfos[NUM_FUNCTIONS];
+
+struct standardFunctionInfo {
+ const char *namePtr;
+ unsigned char functionCode;
+ char roundingCode, exact;
+};
+extern const struct standardFunctionInfo standardFunctionInfos[];
+
diff --git a/source/functions_common.c b/source/functions_common.c
new file mode 100644
index 0000000..ca6caeb
--- /dev/null
+++ b/source/functions_common.c
@@ -0,0 +1,54 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "functions.h"
+
+const uint_fast8_t roundingModes[NUM_ROUNDINGMODES] = {
+ 0,
+ softfloat_round_near_even,
+ softfloat_round_minMag,
+ softfloat_round_min,
+ softfloat_round_max,
+ softfloat_round_near_maxMag
+};
+
+const uint_fast8_t tininessModes[NUM_TININESSMODES] = {
+ 0,
+ softfloat_tininess_beforeRounding,
+ softfloat_tininess_afterRounding
+};
+
diff --git a/source/genCases.h b/source/genCases.h
new file mode 100644
index 0000000..d186592
--- /dev/null
+++ b/source/genCases.h
@@ -0,0 +1,99 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "softfloat.h"
+
+extern int genCases_level;
+
+void genCases_setLevel( int );
+
+extern uint_fast64_t genCases_total;
+extern bool genCases_done;
+
+void genCases_ui32_a_init( void );
+void genCases_ui32_a_next( void );
+extern uint_fast32_t genCases_ui32_a;
+
+void genCases_ui64_a_init( void );
+void genCases_ui64_a_next( void );
+extern uint_fast64_t genCases_ui64_a;
+
+void genCases_i32_a_init( void );
+void genCases_i32_a_next( void );
+extern int_fast32_t genCases_i32_a;
+
+void genCases_i64_a_init( void );
+void genCases_i64_a_next( void );
+extern int_fast64_t genCases_i64_a;
+
+void genCases_f32_a_init( void );
+void genCases_f32_a_next( void );
+void genCases_f32_ab_init( void );
+void genCases_f32_ab_next( void );
+void genCases_f32_abc_init( void );
+void genCases_f32_abc_next( void );
+extern float32_t genCases_f32_a, genCases_f32_b, genCases_f32_c;
+
+void genCases_f64_a_init( void );
+void genCases_f64_a_next( void );
+void genCases_f64_ab_init( void );
+void genCases_f64_ab_next( void );
+void genCases_f64_abc_init( void );
+void genCases_f64_abc_next( void );
+extern float64_t genCases_f64_a, genCases_f64_b, genCases_f64_c;
+
+#ifdef EXTFLOAT80
+void genCases_extF80_a_init( void );
+void genCases_extF80_a_next( void );
+void genCases_extF80_ab_init( void );
+void genCases_extF80_ab_next( void );
+void genCases_extF80_abc_init( void );
+void genCases_extF80_abc_next( void );
+extern extFloat80_t genCases_extF80_a, genCases_extF80_b, genCases_extF80_c;
+#endif
+
+#ifdef FLOAT128
+void genCases_f128_a_init( void );
+void genCases_f128_a_next( void );
+void genCases_f128_ab_init( void );
+void genCases_f128_ab_next( void );
+void genCases_f128_abc_init( void );
+void genCases_f128_abc_next( void );
+extern float128_t genCases_f128_a, genCases_f128_b, genCases_f128_c;
+#endif
+
+void genCases_writeTestsTotal( bool );
+
diff --git a/source/genCases_common.c b/source/genCases_common.c
new file mode 100644
index 0000000..d0fe0bf
--- /dev/null
+++ b/source/genCases_common.c
@@ -0,0 +1,55 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "fail.h"
+#include "genCases.h"
+
+int genCases_level = 0;
+
+void genCases_setLevel( int newLevel )
+{
+
+ if ( (newLevel < 1) || (2 < newLevel) ) {
+ fail( "Invalid testing level %d", newLevel );
+ }
+ genCases_level = newLevel;
+
+}
+
+uint_fast64_t genCases_total;
+bool genCases_done;
+
diff --git a/source/genCases_extF80.c b/source/genCases_extF80.c
new file mode 100644
index 0000000..0cfc468
--- /dev/null
+++ b/source/genCases_extF80.c
@@ -0,0 +1,917 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "random.h"
+#include "softfloat.h"
+#include "genCases.h"
+
+#ifdef EXTFLOAT80
+
+struct sequence {
+ int expNum, term1Num, term2Num;
+ bool done;
+};
+
+enum {
+ extF80NumQIn = 22,
+ extF80NumQOut = 76,
+ extF80NumP1 = 4,
+ extF80NumP2 = 248
+};
+static const uint16_t extF80QIn[extF80NumQIn] = {
+ 0x0000, /* positive, subnormal */
+ 0x0001, /* positive, -16382 */
+ 0x3FBF, /* positive, -64 */
+ 0x3FFD, /* positive, -2 */
+ 0x3FFE, /* positive, -1 */
+ 0x3FFF, /* positive, 0 */
+ 0x4000, /* positive, 1 */
+ 0x4001, /* positive, 2 */
+ 0x403F, /* positive, 64 */
+ 0x7FFE, /* positive, 16383 */
+ 0x7FFF, /* positive, infinity or NaN */
+ 0x8000, /* negative, subnormal */
+ 0x8001, /* negative, -16382 */
+ 0xBFBF, /* negative, -64 */
+ 0xBFFD, /* negative, -2 */
+ 0xBFFE, /* negative, -1 */
+ 0xBFFF, /* negative, 0 */
+ 0xC000, /* negative, 1 */
+ 0xC001, /* negative, 2 */
+ 0xC03F, /* negative, 64 */
+ 0xFFFE, /* negative, 16383 */
+ 0xFFFF /* negative, infinity or NaN */
+};
+static const uint16_t extF80QOut[extF80NumQOut] = {
+ 0x0000, /* positive, subnormal */
+ 0x0001, /* positive, -16382 */
+ 0x0002, /* positive, -16381 */
+ 0x3BFE, /* positive, -1025 */
+ 0x3BFF, /* positive, -1024 */
+ 0x3C00, /* positive, -1023 */
+ 0x3C01, /* positive, -1022 */
+ 0x3F7E, /* positive, -129 */
+ 0x3F7F, /* positive, -128 */
+ 0x3F80, /* positive, -127 */
+ 0x3F81, /* positive, -126 */
+ 0x3FBF, /* positive, -64 */
+ 0x3FFB, /* positive, -4 */
+ 0x3FFC, /* positive, -3 */
+ 0x3FFD, /* positive, -2 */
+ 0x3FFE, /* positive, -1 */
+ 0x3FFF, /* positive, 0 */
+ 0x4000, /* positive, 1 */
+ 0x4001, /* positive, 2 */
+ 0x4002, /* positive, 3 */
+ 0x4003, /* positive, 4 */
+ 0x401C, /* positive, 29 */
+ 0x401D, /* positive, 30 */
+ 0x401E, /* positive, 31 */
+ 0x401F, /* positive, 32 */
+ 0x403C, /* positive, 61 */
+ 0x403D, /* positive, 62 */
+ 0x403E, /* positive, 63 */
+ 0x403F, /* positive, 64 */
+ 0x407E, /* positive, 127 */
+ 0x407F, /* positive, 128 */
+ 0x4080, /* positive, 129 */
+ 0x43FE, /* positive, 1023 */
+ 0x43FF, /* positive, 1024 */
+ 0x4400, /* positive, 1025 */
+ 0x7FFD, /* positive, 16382 */
+ 0x7FFE, /* positive, 16383 */
+ 0x7FFF, /* positive, infinity or NaN */
+ 0x8000, /* negative, subnormal */
+ 0x8001, /* negative, -16382 */
+ 0x8002, /* negative, -16381 */
+ 0xBBFE, /* negative, -1025 */
+ 0xBBFF, /* negative, -1024 */
+ 0xBC00, /* negative, -1023 */
+ 0xBC01, /* negative, -1022 */
+ 0xBF7E, /* negative, -129 */
+ 0xBF7F, /* negative, -128 */
+ 0xBF80, /* negative, -127 */
+ 0xBF81, /* negative, -126 */
+ 0xBFBF, /* negative, -64 */
+ 0xBFFB, /* negative, -4 */
+ 0xBFFC, /* negative, -3 */
+ 0xBFFD, /* negative, -2 */
+ 0xBFFE, /* negative, -1 */
+ 0xBFFF, /* negative, 0 */
+ 0xC000, /* negative, 1 */
+ 0xC001, /* negative, 2 */
+ 0xC002, /* negative, 3 */
+ 0xC003, /* negative, 4 */
+ 0xC01C, /* negative, 29 */
+ 0xC01D, /* negative, 30 */
+ 0xC01E, /* negative, 31 */
+ 0xC01F, /* negative, 32 */
+ 0xC03C, /* negative, 61 */
+ 0xC03D, /* negative, 62 */
+ 0xC03E, /* negative, 63 */
+ 0xC03F, /* negative, 64 */
+ 0xC07E, /* negative, 127 */
+ 0xC07F, /* negative, 128 */
+ 0xC080, /* negative, 129 */
+ 0xC3FE, /* negative, 1023 */
+ 0xC3FF, /* negative, 1024 */
+ 0xC400, /* negative, 1025 */
+ 0xFFFD, /* negative, 16382 */
+ 0xFFFE, /* negative, 16383 */
+ 0xFFFF /* negative, infinity or NaN */
+};
+static const uint64_t extF80P1[extF80NumP1] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x0000000000000001 ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFE )
+};
+static const uint64_t extF80P2[extF80NumP2] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x0000000000000001 ),
+ UINT64_C( 0x0000000000000002 ),
+ UINT64_C( 0x0000000000000004 ),
+ UINT64_C( 0x0000000000000008 ),
+ UINT64_C( 0x0000000000000010 ),
+ UINT64_C( 0x0000000000000020 ),
+ UINT64_C( 0x0000000000000040 ),
+ UINT64_C( 0x0000000000000080 ),
+ UINT64_C( 0x0000000000000100 ),
+ UINT64_C( 0x0000000000000200 ),
+ UINT64_C( 0x0000000000000400 ),
+ UINT64_C( 0x0000000000000800 ),
+ UINT64_C( 0x0000000000001000 ),
+ UINT64_C( 0x0000000000002000 ),
+ UINT64_C( 0x0000000000004000 ),
+ UINT64_C( 0x0000000000008000 ),
+ UINT64_C( 0x0000000000010000 ),
+ UINT64_C( 0x0000000000020000 ),
+ UINT64_C( 0x0000000000040000 ),
+ UINT64_C( 0x0000000000080000 ),
+ UINT64_C( 0x0000000000100000 ),
+ UINT64_C( 0x0000000000200000 ),
+ UINT64_C( 0x0000000000400000 ),
+ UINT64_C( 0x0000000000800000 ),
+ UINT64_C( 0x0000000001000000 ),
+ UINT64_C( 0x0000000002000000 ),
+ UINT64_C( 0x0000000004000000 ),
+ UINT64_C( 0x0000000008000000 ),
+ UINT64_C( 0x0000000010000000 ),
+ UINT64_C( 0x0000000020000000 ),
+ UINT64_C( 0x0000000040000000 ),
+ UINT64_C( 0x0000000080000000 ),
+ UINT64_C( 0x0000000100000000 ),
+ UINT64_C( 0x0000000200000000 ),
+ UINT64_C( 0x0000000400000000 ),
+ UINT64_C( 0x0000000800000000 ),
+ UINT64_C( 0x0000001000000000 ),
+ UINT64_C( 0x0000002000000000 ),
+ UINT64_C( 0x0000004000000000 ),
+ UINT64_C( 0x0000008000000000 ),
+ UINT64_C( 0x0000010000000000 ),
+ UINT64_C( 0x0000020000000000 ),
+ UINT64_C( 0x0000040000000000 ),
+ UINT64_C( 0x0000080000000000 ),
+ UINT64_C( 0x0000100000000000 ),
+ UINT64_C( 0x0000200000000000 ),
+ UINT64_C( 0x0000400000000000 ),
+ UINT64_C( 0x0000800000000000 ),
+ UINT64_C( 0x0001000000000000 ),
+ UINT64_C( 0x0002000000000000 ),
+ UINT64_C( 0x0004000000000000 ),
+ UINT64_C( 0x0008000000000000 ),
+ UINT64_C( 0x0010000000000000 ),
+ UINT64_C( 0x0020000000000000 ),
+ UINT64_C( 0x0040000000000000 ),
+ UINT64_C( 0x0080000000000000 ),
+ UINT64_C( 0x0100000000000000 ),
+ UINT64_C( 0x0200000000000000 ),
+ UINT64_C( 0x0400000000000000 ),
+ UINT64_C( 0x0800000000000000 ),
+ UINT64_C( 0x1000000000000000 ),
+ UINT64_C( 0x2000000000000000 ),
+ UINT64_C( 0x4000000000000000 ),
+ UINT64_C( 0x6000000000000000 ),
+ UINT64_C( 0x7000000000000000 ),
+ UINT64_C( 0x7800000000000000 ),
+ UINT64_C( 0x7C00000000000000 ),
+ UINT64_C( 0x7E00000000000000 ),
+ UINT64_C( 0x7F00000000000000 ),
+ UINT64_C( 0x7F80000000000000 ),
+ UINT64_C( 0x7FC0000000000000 ),
+ UINT64_C( 0x7FE0000000000000 ),
+ UINT64_C( 0x7FF0000000000000 ),
+ UINT64_C( 0x7FF8000000000000 ),
+ UINT64_C( 0x7FFC000000000000 ),
+ UINT64_C( 0x7FFE000000000000 ),
+ UINT64_C( 0x7FFF000000000000 ),
+ UINT64_C( 0x7FFF800000000000 ),
+ UINT64_C( 0x7FFFC00000000000 ),
+ UINT64_C( 0x7FFFE00000000000 ),
+ UINT64_C( 0x7FFFF00000000000 ),
+ UINT64_C( 0x7FFFF80000000000 ),
+ UINT64_C( 0x7FFFFC0000000000 ),
+ UINT64_C( 0x7FFFFE0000000000 ),
+ UINT64_C( 0x7FFFFF0000000000 ),
+ UINT64_C( 0x7FFFFF8000000000 ),
+ UINT64_C( 0x7FFFFFC000000000 ),
+ UINT64_C( 0x7FFFFFE000000000 ),
+ UINT64_C( 0x7FFFFFF000000000 ),
+ UINT64_C( 0x7FFFFFF800000000 ),
+ UINT64_C( 0x7FFFFFFC00000000 ),
+ UINT64_C( 0x7FFFFFFE00000000 ),
+ UINT64_C( 0x7FFFFFFF00000000 ),
+ UINT64_C( 0x7FFFFFFF80000000 ),
+ UINT64_C( 0x7FFFFFFFC0000000 ),
+ UINT64_C( 0x7FFFFFFFE0000000 ),
+ UINT64_C( 0x7FFFFFFFF0000000 ),
+ UINT64_C( 0x7FFFFFFFF8000000 ),
+ UINT64_C( 0x7FFFFFFFFC000000 ),
+ UINT64_C( 0x7FFFFFFFFE000000 ),
+ UINT64_C( 0x7FFFFFFFFF000000 ),
+ UINT64_C( 0x7FFFFFFFFF800000 ),
+ UINT64_C( 0x7FFFFFFFFFC00000 ),
+ UINT64_C( 0x7FFFFFFFFFE00000 ),
+ UINT64_C( 0x7FFFFFFFFFF00000 ),
+ UINT64_C( 0x7FFFFFFFFFF80000 ),
+ UINT64_C( 0x7FFFFFFFFFFC0000 ),
+ UINT64_C( 0x7FFFFFFFFFFE0000 ),
+ UINT64_C( 0x7FFFFFFFFFFF0000 ),
+ UINT64_C( 0x7FFFFFFFFFFF8000 ),
+ UINT64_C( 0x7FFFFFFFFFFFC000 ),
+ UINT64_C( 0x7FFFFFFFFFFFE000 ),
+ UINT64_C( 0x7FFFFFFFFFFFF000 ),
+ UINT64_C( 0x7FFFFFFFFFFFF800 ),
+ UINT64_C( 0x7FFFFFFFFFFFFC00 ),
+ UINT64_C( 0x7FFFFFFFFFFFFE00 ),
+ UINT64_C( 0x7FFFFFFFFFFFFF00 ),
+ UINT64_C( 0x7FFFFFFFFFFFFF80 ),
+ UINT64_C( 0x7FFFFFFFFFFFFFC0 ),
+ UINT64_C( 0x7FFFFFFFFFFFFFE0 ),
+ UINT64_C( 0x7FFFFFFFFFFFFFF0 ),
+ UINT64_C( 0x7FFFFFFFFFFFFFF8 ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFC ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFE ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFD ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFB ),
+ UINT64_C( 0x7FFFFFFFFFFFFFF7 ),
+ UINT64_C( 0x7FFFFFFFFFFFFFEF ),
+ UINT64_C( 0x7FFFFFFFFFFFFFDF ),
+ UINT64_C( 0x7FFFFFFFFFFFFFBF ),
+ UINT64_C( 0x7FFFFFFFFFFFFF7F ),
+ UINT64_C( 0x7FFFFFFFFFFFFEFF ),
+ UINT64_C( 0x7FFFFFFFFFFFFDFF ),
+ UINT64_C( 0x7FFFFFFFFFFFFBFF ),
+ UINT64_C( 0x7FFFFFFFFFFFF7FF ),
+ UINT64_C( 0x7FFFFFFFFFFFEFFF ),
+ UINT64_C( 0x7FFFFFFFFFFFDFFF ),
+ UINT64_C( 0x7FFFFFFFFFFFBFFF ),
+ UINT64_C( 0x7FFFFFFFFFFF7FFF ),
+ UINT64_C( 0x7FFFFFFFFFFEFFFF ),
+ UINT64_C( 0x7FFFFFFFFFFDFFFF ),
+ UINT64_C( 0x7FFFFFFFFFFBFFFF ),
+ UINT64_C( 0x7FFFFFFFFFF7FFFF ),
+ UINT64_C( 0x7FFFFFFFFFEFFFFF ),
+ UINT64_C( 0x7FFFFFFFFFDFFFFF ),
+ UINT64_C( 0x7FFFFFFFFFBFFFFF ),
+ UINT64_C( 0x7FFFFFFFFF7FFFFF ),
+ UINT64_C( 0x7FFFFFFFFEFFFFFF ),
+ UINT64_C( 0x7FFFFFFFFDFFFFFF ),
+ UINT64_C( 0x7FFFFFFFFBFFFFFF ),
+ UINT64_C( 0x7FFFFFFFF7FFFFFF ),
+ UINT64_C( 0x7FFFFFFFEFFFFFFF ),
+ UINT64_C( 0x7FFFFFFFDFFFFFFF ),
+ UINT64_C( 0x7FFFFFFFBFFFFFFF ),
+ UINT64_C( 0x7FFFFFFF7FFFFFFF ),
+ UINT64_C( 0x7FFFFFFEFFFFFFFF ),
+ UINT64_C( 0x7FFFFFFDFFFFFFFF ),
+ UINT64_C( 0x7FFFFFFBFFFFFFFF ),
+ UINT64_C( 0x7FFFFFF7FFFFFFFF ),
+ UINT64_C( 0x7FFFFFEFFFFFFFFF ),
+ UINT64_C( 0x7FFFFFDFFFFFFFFF ),
+ UINT64_C( 0x7FFFFFBFFFFFFFFF ),
+ UINT64_C( 0x7FFFFF7FFFFFFFFF ),
+ UINT64_C( 0x7FFFFEFFFFFFFFFF ),
+ UINT64_C( 0x7FFFFDFFFFFFFFFF ),
+ UINT64_C( 0x7FFFFBFFFFFFFFFF ),
+ UINT64_C( 0x7FFFF7FFFFFFFFFF ),
+ UINT64_C( 0x7FFFEFFFFFFFFFFF ),
+ UINT64_C( 0x7FFFDFFFFFFFFFFF ),
+ UINT64_C( 0x7FFFBFFFFFFFFFFF ),
+ UINT64_C( 0x7FFF7FFFFFFFFFFF ),
+ UINT64_C( 0x7FFEFFFFFFFFFFFF ),
+ UINT64_C( 0x7FFDFFFFFFFFFFFF ),
+ UINT64_C( 0x7FFBFFFFFFFFFFFF ),
+ UINT64_C( 0x7FF7FFFFFFFFFFFF ),
+ UINT64_C( 0x7FEFFFFFFFFFFFFF ),
+ UINT64_C( 0x7FDFFFFFFFFFFFFF ),
+ UINT64_C( 0x7FBFFFFFFFFFFFFF ),
+ UINT64_C( 0x7F7FFFFFFFFFFFFF ),
+ UINT64_C( 0x7EFFFFFFFFFFFFFF ),
+ UINT64_C( 0x7DFFFFFFFFFFFFFF ),
+ UINT64_C( 0x7BFFFFFFFFFFFFFF ),
+ UINT64_C( 0x77FFFFFFFFFFFFFF ),
+ UINT64_C( 0x6FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x5FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x3FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x1FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x0FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x07FFFFFFFFFFFFFF ),
+ UINT64_C( 0x03FFFFFFFFFFFFFF ),
+ UINT64_C( 0x01FFFFFFFFFFFFFF ),
+ UINT64_C( 0x00FFFFFFFFFFFFFF ),
+ UINT64_C( 0x007FFFFFFFFFFFFF ),
+ UINT64_C( 0x003FFFFFFFFFFFFF ),
+ UINT64_C( 0x001FFFFFFFFFFFFF ),
+ UINT64_C( 0x000FFFFFFFFFFFFF ),
+ UINT64_C( 0x0007FFFFFFFFFFFF ),
+ UINT64_C( 0x0003FFFFFFFFFFFF ),
+ UINT64_C( 0x0001FFFFFFFFFFFF ),
+ UINT64_C( 0x0000FFFFFFFFFFFF ),
+ UINT64_C( 0x00007FFFFFFFFFFF ),
+ UINT64_C( 0x00003FFFFFFFFFFF ),
+ UINT64_C( 0x00001FFFFFFFFFFF ),
+ UINT64_C( 0x00000FFFFFFFFFFF ),
+ UINT64_C( 0x000007FFFFFFFFFF ),
+ UINT64_C( 0x000003FFFFFFFFFF ),
+ UINT64_C( 0x000001FFFFFFFFFF ),
+ UINT64_C( 0x000000FFFFFFFFFF ),
+ UINT64_C( 0x0000007FFFFFFFFF ),
+ UINT64_C( 0x0000003FFFFFFFFF ),
+ UINT64_C( 0x0000001FFFFFFFFF ),
+ UINT64_C( 0x0000000FFFFFFFFF ),
+ UINT64_C( 0x00000007FFFFFFFF ),
+ UINT64_C( 0x00000003FFFFFFFF ),
+ UINT64_C( 0x00000001FFFFFFFF ),
+ UINT64_C( 0x00000000FFFFFFFF ),
+ UINT64_C( 0x000000007FFFFFFF ),
+ UINT64_C( 0x000000003FFFFFFF ),
+ UINT64_C( 0x000000001FFFFFFF ),
+ UINT64_C( 0x000000000FFFFFFF ),
+ UINT64_C( 0x0000000007FFFFFF ),
+ UINT64_C( 0x0000000003FFFFFF ),
+ UINT64_C( 0x0000000001FFFFFF ),
+ UINT64_C( 0x0000000000FFFFFF ),
+ UINT64_C( 0x00000000007FFFFF ),
+ UINT64_C( 0x00000000003FFFFF ),
+ UINT64_C( 0x00000000001FFFFF ),
+ UINT64_C( 0x00000000000FFFFF ),
+ UINT64_C( 0x000000000007FFFF ),
+ UINT64_C( 0x000000000003FFFF ),
+ UINT64_C( 0x000000000001FFFF ),
+ UINT64_C( 0x000000000000FFFF ),
+ UINT64_C( 0x0000000000007FFF ),
+ UINT64_C( 0x0000000000003FFF ),
+ UINT64_C( 0x0000000000001FFF ),
+ UINT64_C( 0x0000000000000FFF ),
+ UINT64_C( 0x00000000000007FF ),
+ UINT64_C( 0x00000000000003FF ),
+ UINT64_C( 0x00000000000001FF ),
+ UINT64_C( 0x00000000000000FF ),
+ UINT64_C( 0x000000000000007F ),
+ UINT64_C( 0x000000000000003F ),
+ UINT64_C( 0x000000000000001F ),
+ UINT64_C( 0x000000000000000F ),
+ UINT64_C( 0x0000000000000007 ),
+ UINT64_C( 0x0000000000000003 )
+};
+
+static const uint_fast32_t extF80NumQInP1 = extF80NumQIn * extF80NumP1;
+static const uint_fast32_t extF80NumQOutP1 = extF80NumQOut * extF80NumP1;
+
+static void extF80NextQInP1( struct sequence *sequencePtr, extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ int expNum, sigNum;
+ uint_fast16_t uiZ64;
+ uint_fast64_t uiZ0;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uiZ64 = extF80QIn[expNum];
+ uiZ0 = extF80P1[sigNum];
+ if ( uiZ64 & 0x7FFF ) uiZ0 |= UINT64_C( 0x8000000000000000 );
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = uiZ0;
+ ++sigNum;
+ if ( extF80NumP1 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( extF80NumQIn <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+
+}
+
+static
+ void extF80NextQOutP1( struct sequence *sequencePtr, extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ int expNum, sigNum;
+ uint_fast16_t uiZ64;
+ uint_fast64_t uiZ0;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uiZ64 = extF80QOut[expNum];
+ uiZ0 = extF80P1[sigNum];
+ if ( uiZ64 & 0x7FFF ) uiZ0 |= UINT64_C( 0x8000000000000000 );
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = uiZ0;
+ ++sigNum;
+ if ( extF80NumP1 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( extF80NumQOut <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+
+}
+
+static const uint_fast32_t extF80NumQInP2 = extF80NumQIn * extF80NumP2;
+static const uint_fast32_t extF80NumQOutP2 = extF80NumQOut * extF80NumP2;
+
+static void extF80NextQInP2( struct sequence *sequencePtr, extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ int expNum, sigNum;
+ uint_fast16_t uiZ64;
+ uint_fast64_t uiZ0;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uiZ64 = extF80QIn[expNum];
+ uiZ0 = extF80P2[sigNum];
+ if ( uiZ64 & 0x7FFF ) uiZ0 |= UINT64_C( 0x8000000000000000 );
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = uiZ0;
+ ++sigNum;
+ if ( extF80NumP2 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( extF80NumQIn <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+
+}
+
+static
+ void extF80NextQOutP2( struct sequence *sequencePtr, extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ int expNum, sigNum;
+ uint_fast16_t uiZ64;
+ uint_fast64_t uiZ0;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uiZ64 = extF80QOut[expNum];
+ uiZ0 = extF80P2[sigNum];
+ if ( uiZ64 & 0x7FFF ) uiZ0 |= UINT64_C( 0x8000000000000000 );
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = uiZ0;
+ ++sigNum;
+ if ( extF80NumP2 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( extF80NumQOut <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+
+}
+
+static void extF80RandomQOutP3( extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ uint_fast16_t uiZ64;
+ uint_fast64_t uiZ0;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ uiZ64 = extF80QOut[randomN_ui8( extF80NumQOut )];
+ uiZ0 =
+ (extF80P2[randomN_ui8( extF80NumP2 )]
+ + extF80P2[randomN_ui8( extF80NumP2 )])
+ & UINT64_C( 0x7FFFFFFFFFFFFFFF );
+ if ( uiZ64 & 0x7FFF ) uiZ0 |= UINT64_C( 0x8000000000000000 );
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = uiZ0;
+
+}
+
+static void extF80RandomQOutPInf( extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ uint_fast16_t uiZ64;
+ uint_fast64_t uiZ0;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ uiZ64 = extF80QOut[randomN_ui8( extF80NumQOut )];
+ uiZ0 = random_ui64() & UINT64_C( 0x7FFFFFFFFFFFFFFF );
+ if ( uiZ64 & 0x7FFF ) uiZ0 |= UINT64_C( 0x8000000000000000 );
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = uiZ0;
+
+}
+
+enum { extF80NumQInfWeightMasks = 14 };
+static const uint16_t extF80QInfWeightMasks[extF80NumQInfWeightMasks] = {
+ 0xFFFF,
+ 0xFFFF,
+ 0xBFFF,
+ 0x9FFF,
+ 0x87FF,
+ 0x87FF,
+ 0x83FF,
+ 0x81FF,
+ 0x80FF,
+ 0x807F,
+ 0x803F,
+ 0x801F,
+ 0x800F,
+ 0x8007
+};
+static const uint16_t extF80QInfWeightOffsets[extF80NumQInfWeightMasks] = {
+ 0x0000,
+ 0x0000,
+ 0x2000,
+ 0x3000,
+ 0x3800,
+ 0x3C00,
+ 0x3E00,
+ 0x3F00,
+ 0x3F80,
+ 0x3FC0,
+ 0x3FE0,
+ 0x3FF0,
+ 0x3FF8,
+ 0x3FFC
+};
+
+static void extF80RandomQInfP3( extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ int weightMaskNum;
+ uint_fast16_t uiZ64;
+ uint_fast64_t uiZ0;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ weightMaskNum = randomN_ui8( extF80NumQInfWeightMasks );
+ uiZ64 =
+ (random_ui16() & extF80QInfWeightMasks[weightMaskNum])
+ + extF80QInfWeightOffsets[weightMaskNum];
+ uiZ0 =
+ (extF80P2[randomN_ui8( extF80NumP2 )]
+ + extF80P2[randomN_ui8( extF80NumP2 )])
+ & UINT64_C( 0x7FFFFFFFFFFFFFFF );
+ if ( uiZ64 & 0x7FFF ) uiZ0 |= UINT64_C( 0x8000000000000000 );
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = uiZ0;
+
+}
+
+static void extF80RandomQInfPInf( extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ int weightMaskNum;
+ uint_fast16_t uiZ64;
+ uint_fast64_t uiZ0;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ weightMaskNum = randomN_ui8( extF80NumQInfWeightMasks );
+ uiZ64 =
+ (random_ui16() & extF80QInfWeightMasks[weightMaskNum])
+ + extF80QInfWeightOffsets[weightMaskNum];
+ uiZ0 = random_ui64() & UINT64_C( 0x7FFFFFFFFFFFFFFF );
+ if ( uiZ64 & 0x7FFF ) uiZ0 |= UINT64_C( 0x8000000000000000 );
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = uiZ0;
+
+}
+
+static void extF80Random( extFloat80_t *zPtr )
+{
+
+ switch ( random_ui8() & 7 ) {
+ case 0:
+ case 1:
+ case 2:
+ extF80RandomQOutP3( zPtr );
+ break;
+ case 3:
+ extF80RandomQOutPInf( zPtr );
+ break;
+ case 4:
+ case 5:
+ case 6:
+ extF80RandomQInfP3( zPtr );
+ break;
+ case 7:
+ extF80RandomQInfPInf( zPtr );
+ break;
+ }
+
+}
+
+static struct sequence sequenceA, sequenceB, sequenceC;
+static extFloat80_t currentA, currentB, currentC;
+static int subcase;
+
+extFloat80_t genCases_extF80_a, genCases_extF80_b, genCases_extF80_c;
+
+void genCases_extF80_a_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ subcase = 0;
+ genCases_total =
+ (genCases_level == 1) ? 3 * extF80NumQOutP1 : 2 * extF80NumQOutP2;
+ genCases_done = false;
+
+}
+
+void genCases_extF80_a_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ case 1:
+ extF80Random( &genCases_extF80_a );
+ break;
+ case 2:
+ extF80NextQOutP1( &sequenceA, &genCases_extF80_a );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ extF80Random( &genCases_extF80_a );
+ break;
+ case 1:
+ extF80NextQOutP2( &sequenceA, &genCases_extF80_a );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+void genCases_extF80_ab_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ sequenceB.expNum = 0;
+ sequenceB.term1Num = 0;
+ sequenceB.term2Num = 0;
+ sequenceB.done = false;
+ subcase = 0;
+ if ( genCases_level == 1 ) {
+ genCases_total = 6 * extF80NumQInP1 * extF80NumQInP1;
+ extF80NextQInP1( &sequenceA, &currentA );
+ } else {
+ genCases_total = 2 * extF80NumQInP2 * extF80NumQInP2;
+ extF80NextQInP2( &sequenceA, &currentA );
+ }
+ genCases_done = false;
+
+}
+
+void genCases_extF80_ab_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ extF80NextQInP1( &sequenceA, &currentA );
+ }
+ extF80NextQInP1( &sequenceB, &currentB );
+ case 2:
+ case 4:
+ extF80Random( &genCases_extF80_a );
+ extF80Random( &genCases_extF80_b );
+ break;
+ case 1:
+ genCases_extF80_a = currentA;
+ extF80Random( &genCases_extF80_b );
+ break;
+ case 3:
+ extF80Random( &genCases_extF80_a );
+ genCases_extF80_b = currentB;
+ break;
+ case 5:
+ genCases_extF80_a = currentA;
+ genCases_extF80_b = currentB;
+ genCases_done = sequenceA.done & sequenceB.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ extF80Random( &genCases_extF80_a );
+ extF80Random( &genCases_extF80_b );
+ break;
+ case 1:
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ extF80NextQInP2( &sequenceA, &currentA );
+ }
+ genCases_extF80_a = currentA;
+ extF80NextQInP2( &sequenceB, &genCases_extF80_b );
+ genCases_done = sequenceA.done & sequenceB.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+void genCases_extF80_abc_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ sequenceB.expNum = 0;
+ sequenceB.term1Num = 0;
+ sequenceB.term2Num = 0;
+ sequenceB.done = false;
+ sequenceC.expNum = 0;
+ sequenceC.term1Num = 0;
+ sequenceC.term2Num = 0;
+ sequenceC.done = false;
+ subcase = 0;
+ if ( genCases_level == 1 ) {
+ genCases_total = 9 * extF80NumQInP1 * extF80NumQInP1 * extF80NumQInP1;
+ extF80NextQInP1( &sequenceA, &currentA );
+ extF80NextQInP1( &sequenceB, &currentB );
+ } else {
+ genCases_total = 2 * extF80NumQInP2 * extF80NumQInP2 * extF80NumQInP2;
+ extF80NextQInP2( &sequenceA, &currentA );
+ extF80NextQInP2( &sequenceB, &currentB );
+ }
+ genCases_done = false;
+
+}
+
+void genCases_extF80_abc_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ if ( sequenceC.done ) {
+ sequenceC.done = false;
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ extF80NextQInP1( &sequenceA, &currentA );
+ }
+ extF80NextQInP1( &sequenceB, &currentB );
+ }
+ extF80NextQInP1( &sequenceC, &currentC );
+ extF80Random( &genCases_extF80_a );
+ extF80Random( &genCases_extF80_b );
+ genCases_extF80_c = currentC;
+ break;
+ case 1:
+ genCases_extF80_a = currentA;
+ genCases_extF80_b = currentB;
+ extF80Random( &genCases_extF80_c );
+ break;
+ case 2:
+ extF80Random( &genCases_extF80_a );
+ extF80Random( &genCases_extF80_b );
+ extF80Random( &genCases_extF80_c );
+ break;
+ case 3:
+ extF80Random( &genCases_extF80_a );
+ genCases_extF80_b = currentB;
+ genCases_extF80_c = currentC;
+ break;
+ case 4:
+ genCases_extF80_a = currentA;
+ extF80Random( &genCases_extF80_b );
+ extF80Random( &genCases_extF80_c );
+ break;
+ case 5:
+ extF80Random( &genCases_extF80_a );
+ genCases_extF80_b = currentB;
+ extF80Random( &genCases_extF80_c );
+ break;
+ case 6:
+ genCases_extF80_a = currentA;
+ extF80Random( &genCases_extF80_b );
+ genCases_extF80_c = currentC;
+ break;
+ case 7:
+ extF80Random( &genCases_extF80_a );
+ extF80Random( &genCases_extF80_b );
+ extF80Random( &genCases_extF80_c );
+ break;
+ case 8:
+ genCases_extF80_a = currentA;
+ genCases_extF80_b = currentB;
+ genCases_extF80_c = currentC;
+ genCases_done = sequenceA.done & sequenceB.done & sequenceC.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ extF80Random( &genCases_extF80_a );
+ extF80Random( &genCases_extF80_b );
+ extF80Random( &genCases_extF80_c );
+ break;
+ case 1:
+ if ( sequenceC.done ) {
+ sequenceC.done = false;
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ extF80NextQInP2( &sequenceA, &currentA );
+ }
+ extF80NextQInP2( &sequenceB, &currentB );
+ }
+ genCases_extF80_a = currentA;
+ genCases_extF80_b = currentB;
+ extF80NextQInP2( &sequenceC, &genCases_extF80_c );
+ genCases_done = sequenceA.done & sequenceB.done & sequenceC.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+#endif
+
diff --git a/source/genCases_f128.c b/source/genCases_f128.c
new file mode 100644
index 0000000..0a516d3
--- /dev/null
+++ b/source/genCases_f128.c
@@ -0,0 +1,1087 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "uint128.h"
+#include "random.h"
+#include "softfloat.h"
+#include "genCases.h"
+
+#ifdef FLOAT128
+
+struct sequence {
+ int expNum, term1Num, term2Num;
+ bool done;
+};
+
+enum {
+ f128NumQIn = 22,
+ f128NumQOut = 78,
+ f128NumP1 = 4,
+ f128NumP2 = 443
+};
+static const uint64_t f128QIn[f128NumQIn] = {
+ UINT64_C( 0x0000000000000000 ), /* positive, subnormal */
+ UINT64_C( 0x0001000000000000 ), /* positive, -16382 */
+ UINT64_C( 0x3F8E000000000000 ), /* positive, -113 */
+ UINT64_C( 0x3FFD000000000000 ), /* positive, -2 */
+ UINT64_C( 0x3FFE000000000000 ), /* positive, -1 */
+ UINT64_C( 0x3FFF000000000000 ), /* positive, 0 */
+ UINT64_C( 0x4000000000000000 ), /* positive, 1 */
+ UINT64_C( 0x4001000000000000 ), /* positive, 2 */
+ UINT64_C( 0x4070000000000000 ), /* positive, 113 */
+ UINT64_C( 0x7FFE000000000000 ), /* positive, 16383 */
+ UINT64_C( 0x7FFF000000000000 ), /* positive, infinity or NaN */
+ UINT64_C( 0x8000000000000000 ), /* negative, subnormal */
+ UINT64_C( 0x8001000000000000 ), /* negative, -16382 */
+ UINT64_C( 0xBF8E000000000000 ), /* negative, -113 */
+ UINT64_C( 0xBFFD000000000000 ), /* negative, -2 */
+ UINT64_C( 0xBFFE000000000000 ), /* negative, -1 */
+ UINT64_C( 0xBFFF000000000000 ), /* negative, 0 */
+ UINT64_C( 0xC000000000000000 ), /* negative, 1 */
+ UINT64_C( 0xC001000000000000 ), /* negative, 2 */
+ UINT64_C( 0xC070000000000000 ), /* negative, 113 */
+ UINT64_C( 0xFFFE000000000000 ), /* negative, 16383 */
+ UINT64_C( 0xFFFF000000000000 ) /* negative, infinity or NaN */
+};
+static const uint64_t f128QOut[f128NumQOut] = {
+ UINT64_C( 0x0000000000000000 ), /* positive, subnormal */
+ UINT64_C( 0x0001000000000000 ), /* positive, -16382 */
+ UINT64_C( 0x0002000000000000 ), /* positive, -16381 */
+ UINT64_C( 0x3BFE000000000000 ), /* positive, -1025 */
+ UINT64_C( 0x3BFF000000000000 ), /* positive, -1024 */
+ UINT64_C( 0x3C00000000000000 ), /* positive, -1023 */
+ UINT64_C( 0x3C01000000000000 ), /* positive, -1022 */
+ UINT64_C( 0x3F7E000000000000 ), /* positive, -129 */
+ UINT64_C( 0x3F7F000000000000 ), /* positive, -128 */
+ UINT64_C( 0x3F80000000000000 ), /* positive, -127 */
+ UINT64_C( 0x3F81000000000000 ), /* positive, -126 */
+ UINT64_C( 0x3F8E000000000000 ), /* positive, -113 */
+ UINT64_C( 0x3FFB000000000000 ), /* positive, -4 */
+ UINT64_C( 0x3FFC000000000000 ), /* positive, -3 */
+ UINT64_C( 0x3FFD000000000000 ), /* positive, -2 */
+ UINT64_C( 0x3FFE000000000000 ), /* positive, -1 */
+ UINT64_C( 0x3FFF000000000000 ), /* positive, 0 */
+ UINT64_C( 0x4000000000000000 ), /* positive, 1 */
+ UINT64_C( 0x4001000000000000 ), /* positive, 2 */
+ UINT64_C( 0x4002000000000000 ), /* positive, 3 */
+ UINT64_C( 0x4003000000000000 ), /* positive, 4 */
+ UINT64_C( 0x401C000000000000 ), /* positive, 29 */
+ UINT64_C( 0x401D000000000000 ), /* positive, 30 */
+ UINT64_C( 0x401E000000000000 ), /* positive, 31 */
+ UINT64_C( 0x401F000000000000 ), /* positive, 32 */
+ UINT64_C( 0x403C000000000000 ), /* positive, 61 */
+ UINT64_C( 0x403D000000000000 ), /* positive, 62 */
+ UINT64_C( 0x403E000000000000 ), /* positive, 63 */
+ UINT64_C( 0x403F000000000000 ), /* positive, 64 */
+ UINT64_C( 0x4070000000000000 ), /* positive, 113 */
+ UINT64_C( 0x407E000000000000 ), /* positive, 127 */
+ UINT64_C( 0x407F000000000000 ), /* positive, 128 */
+ UINT64_C( 0x4080000000000000 ), /* positive, 129 */
+ UINT64_C( 0x43FE000000000000 ), /* positive, 1023 */
+ UINT64_C( 0x43FF000000000000 ), /* positive, 1024 */
+ UINT64_C( 0x4400000000000000 ), /* positive, 1025 */
+ UINT64_C( 0x7FFD000000000000 ), /* positive, 16382 */
+ UINT64_C( 0x7FFE000000000000 ), /* positive, 16383 */
+ UINT64_C( 0x7FFF000000000000 ), /* positive, infinity or NaN */
+ UINT64_C( 0x8000000000000000 ), /* negative, subnormal */
+ UINT64_C( 0x8001000000000000 ), /* negative, -16382 */
+ UINT64_C( 0x8002000000000000 ), /* negative, -16381 */
+ UINT64_C( 0xBBFE000000000000 ), /* negative, -1025 */
+ UINT64_C( 0xBBFF000000000000 ), /* negative, -1024 */
+ UINT64_C( 0xBC00000000000000 ), /* negative, -1023 */
+ UINT64_C( 0xBC01000000000000 ), /* negative, -1022 */
+ UINT64_C( 0xBF7E000000000000 ), /* negative, -129 */
+ UINT64_C( 0xBF7F000000000000 ), /* negative, -128 */
+ UINT64_C( 0xBF80000000000000 ), /* negative, -127 */
+ UINT64_C( 0xBF81000000000000 ), /* negative, -126 */
+ UINT64_C( 0xBF8E000000000000 ), /* negative, -113 */
+ UINT64_C( 0xBFFB000000000000 ), /* negative, -4 */
+ UINT64_C( 0xBFFC000000000000 ), /* negative, -3 */
+ UINT64_C( 0xBFFD000000000000 ), /* negative, -2 */
+ UINT64_C( 0xBFFE000000000000 ), /* negative, -1 */
+ UINT64_C( 0xBFFF000000000000 ), /* negative, 0 */
+ UINT64_C( 0xC000000000000000 ), /* negative, 1 */
+ UINT64_C( 0xC001000000000000 ), /* negative, 2 */
+ UINT64_C( 0xC002000000000000 ), /* negative, 3 */
+ UINT64_C( 0xC003000000000000 ), /* negative, 4 */
+ UINT64_C( 0xC01C000000000000 ), /* negative, 29 */
+ UINT64_C( 0xC01D000000000000 ), /* negative, 30 */
+ UINT64_C( 0xC01E000000000000 ), /* negative, 31 */
+ UINT64_C( 0xC01F000000000000 ), /* negative, 32 */
+ UINT64_C( 0xC03C000000000000 ), /* negative, 61 */
+ UINT64_C( 0xC03D000000000000 ), /* negative, 62 */
+ UINT64_C( 0xC03E000000000000 ), /* negative, 63 */
+ UINT64_C( 0xC03F000000000000 ), /* negative, 64 */
+ UINT64_C( 0xC070000000000000 ), /* negative, 113 */
+ UINT64_C( 0xC07E000000000000 ), /* negative, 127 */
+ UINT64_C( 0xC07F000000000000 ), /* negative, 128 */
+ UINT64_C( 0xC080000000000000 ), /* negative, 129 */
+ UINT64_C( 0xC3FE000000000000 ), /* negative, 1023 */
+ UINT64_C( 0xC3FF000000000000 ), /* negative, 1024 */
+ UINT64_C( 0xC400000000000000 ), /* negative, 1025 */
+ UINT64_C( 0xFFFD000000000000 ), /* negative, 16382 */
+ UINT64_C( 0xFFFE000000000000 ), /* negative, 16383 */
+ UINT64_C( 0xFFFF000000000000 ) /* negative, infinity or NaN */
+};
+static const struct { uint64_t v64, v0; } f128P1[f128NumP1] = {
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000001 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFE ) }
+};
+static const struct { uint64_t v64, v0; } f128P2[f128NumP2] = {
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000001 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000002 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000004 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000008 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000010 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000020 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000040 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000080 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000100 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000200 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000400 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000800 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000001000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000002000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000004000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000008000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000010000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000020000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000040000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000080000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000100000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000200000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000400000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000800000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000001000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000002000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000004000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000008000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000010000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000020000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000040000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000080000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000100000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000200000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000400000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000800000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000001000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000002000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000004000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000008000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000010000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000020000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000040000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000080000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000100000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000200000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000400000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000800000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0001000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0002000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0004000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0008000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0010000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0020000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0040000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0080000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0100000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0200000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0400000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0800000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x1000000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x2000000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x4000000000000000 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x8000000000000000 ) },
+ { UINT64_C( 0x0000000000000001 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000002 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000004 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000008 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000010 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000020 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000040 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000080 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000100 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000200 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000400 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000000800 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000001000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000002000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000004000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000008000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000010000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000020000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000040000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000080000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000100000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000200000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000400000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000000800000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000001000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000002000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000004000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000008000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000010000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000020000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000040000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000080000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000100000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000200000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000400000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000000800000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000001000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000002000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000004000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000008000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000010000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000020000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000040000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000080000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000100000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000200000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000400000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000800000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000C00000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000E00000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000F00000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000F80000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FC0000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FE0000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FF0000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FF8000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFC000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFE000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFF000000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFF800000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFC00000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFE00000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFF00000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFF80000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFC0000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFE0000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFF0000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFF8000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFC000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFE000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFF000000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFF800000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFC00000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFE00000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFF00000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFF80000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFC0000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFE0000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFF0000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFF8000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFC000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFE000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFF000 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFF800 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFC00 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFE00 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFF00 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFF80 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFC0 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFE0 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFF0 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFF8 ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFC ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFE ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0x0000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0x8000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xC000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xE000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xF000000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xF800000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFC00000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFE00000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFF00000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFF80000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFC0000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFE0000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFF0000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFF8000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFC000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFE000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFF000000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFF800000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFC00000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFE00000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFF00000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFF80000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFC0000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFE0000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFF0000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFF8000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFC000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFE000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFF000000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFF800000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFC00000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFE00000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFF00000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFF80000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFC0000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFE0000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFF0000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFF8000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFC000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFE000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFF000000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFF800000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFC00000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFE00000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFF00000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFF80000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFC0000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFE0000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFF0000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFF8000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFC000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFE000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFF000 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFF800 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFC00 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFE00 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFF00 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFF80 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFC0 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFE0 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFF0 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFF8 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFC ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFE ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFD ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFB ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFF7 ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFEF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFDF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFBF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFF7F ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFEFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFDFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFBFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFF7FF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFEFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFDFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFBFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFF7FFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFEFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFDFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFBFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFF7FFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFEFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFDFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFBFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFF7FFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFEFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFDFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFBFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFF7FFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFEFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFDFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFBFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFF7FFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFEFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFDFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFBFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFF7FFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFEFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFDFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFFBFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFF7FFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFEFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFDFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFFBFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFF7FFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFEFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFDFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFFBFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFF7FFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFEFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFDFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFFBFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFF7FFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFEFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFDFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFFBFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFF7FFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFEFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFDFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xFBFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xF7FFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xEFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xDFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0xBFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFF ), UINT64_C( 0x7FFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFD ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFFB ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFF7 ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFEF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFDF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFFBF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFF7F ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFEFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFDFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFFBFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFF7FF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFEFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFDFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFFBFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFF7FFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFEFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFDFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFFBFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFF7FFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFEFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFDFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFFBFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFF7FFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFEFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFDFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFFBFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFF7FFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFEFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFDFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFFBFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFF7FFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFEFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFDFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFFBFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFF7FFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFEFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFDFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FFBFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FF7FFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FEFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FDFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000FBFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000F7FFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000EFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000DFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000BFFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00007FFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00003FFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00001FFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000FFFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000007FFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000003FFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000001FFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000FFFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000007FFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000003FFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000001FFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000FFFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000007FFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000003FFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000001FFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000FFFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000007FFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000003FFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000001FFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000FFFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000007FFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000003FFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000001FFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000FFFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000007FFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000003FFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000001FFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000000FFFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000007FFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000003FFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000001FFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000000FFFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000007FFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000003FFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000001FFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000FFF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000000007FF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000000003FF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000000001FF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x00000000000000FF ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000000007F ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000000003F ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000000001F ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x000000000000000F ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000007 ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000003 ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000001 ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0xFFFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x7FFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x3FFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x1FFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0FFFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x07FFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x03FFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x01FFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00FFFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x007FFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x003FFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x001FFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000FFFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0007FFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0003FFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0001FFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000FFFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00007FFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00003FFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00001FFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000FFFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000007FFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000003FFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000001FFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000FFFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000007FFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000003FFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000001FFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000FFFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000007FFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000003FFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000001FFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000FFFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000007FFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000003FFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000001FFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000FFFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000007FFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000003FFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000001FFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000FFFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000007FFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000003FFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000001FFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000000FFFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000007FFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000003FFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000001FFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000000FFFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000007FFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000003FFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000001FFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000FFF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000000007FF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000000003FF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000000001FF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x00000000000000FF ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000000007F ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000000003F ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000000001F ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x000000000000000F ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000007 ) },
+ { UINT64_C( 0x0000000000000000 ), UINT64_C( 0x0000000000000003 ) }
+};
+
+static const uint_fast64_t f128NumQInP1 = f128NumQIn * f128NumP1;
+static const uint_fast64_t f128NumQOutP1 = f128NumQOut * f128NumP1;
+
+static void f128NextQInP1( struct sequence *sequencePtr, float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+ int expNum, sigNum;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uiZPtr->v64 = f128QIn[expNum] | f128P1[sigNum].v64;
+ uiZPtr->v0 = f128P1[sigNum].v0;
+ ++sigNum;
+ if ( f128NumP1 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f128NumQIn <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+
+}
+
+static void f128NextQOutP1( struct sequence *sequencePtr, float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+ int expNum, sigNum;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uiZPtr->v64 = f128QOut[expNum] | f128P1[sigNum].v64;
+ uiZPtr->v0 = f128P1[sigNum].v0;
+ ++sigNum;
+ if ( f128NumP1 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f128NumQOut <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+
+}
+
+static const uint_fast64_t f128NumQInP2 = f128NumQIn * f128NumP2;
+static const uint_fast64_t f128NumQOutP2 = f128NumQOut * f128NumP2;
+
+static void f128NextQInP2( struct sequence *sequencePtr, float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+ int expNum, sigNum;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uiZPtr->v64 = f128QIn[expNum] | f128P2[sigNum].v64;
+ uiZPtr->v0 = f128P2[sigNum].v0;
+ ++sigNum;
+ if ( f128NumP2 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f128NumQIn <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+
+}
+
+static void f128NextQOutP2( struct sequence *sequencePtr, float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+ int expNum, sigNum;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uiZPtr->v64 = f128QOut[expNum] | f128P2[sigNum].v64;
+ uiZPtr->v0 = f128P2[sigNum].v0;
+ ++sigNum;
+ if ( f128NumP2 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f128NumQOut <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+
+}
+
+static void f128RandomQOutP3( float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+ int sigNum1, sigNum2;
+ uint_fast64_t sig1_0;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ sigNum1 = randomN_ui16( f128NumP2 );
+ sigNum2 = randomN_ui16( f128NumP2 );
+ sig1_0 = f128P2[sigNum1].v0;
+ uiZPtr->v0 = sig1_0 + f128P2[sigNum2].v0;
+ uiZPtr->v64 =
+ f128QOut[randomN_ui8( f128NumQOut )]
+ | ((f128P2[sigNum1].v64 + f128P2[sigNum2].v64 + (uiZPtr->v0 < sig1_0))
+ & UINT64_C( 0x0000FFFFFFFFFFFF ));
+
+}
+
+static void f128RandomQOutPInf( float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ uiZPtr->v64 =
+ f128QOut[randomN_ui8( f128NumQOut )]
+ | (random_ui64() & UINT64_C( 0x0000FFFFFFFFFFFF ));
+ uiZPtr->v0 = random_ui64();
+
+}
+
+enum { f128NumQInfWeightMasks = 14 };
+static const uint64_t f128QInfWeightMasks[f128NumQInfWeightMasks] = {
+ UINT64_C( 0xFFFF000000000000 ),
+ UINT64_C( 0xFFFF000000000000 ),
+ UINT64_C( 0xBFFF000000000000 ),
+ UINT64_C( 0x9FFF000000000000 ),
+ UINT64_C( 0x87FF000000000000 ),
+ UINT64_C( 0x87FF000000000000 ),
+ UINT64_C( 0x83FF000000000000 ),
+ UINT64_C( 0x81FF000000000000 ),
+ UINT64_C( 0x80FF000000000000 ),
+ UINT64_C( 0x807F000000000000 ),
+ UINT64_C( 0x803F000000000000 ),
+ UINT64_C( 0x801F000000000000 ),
+ UINT64_C( 0x800F000000000000 ),
+ UINT64_C( 0x8007000000000000 )
+};
+static const uint64_t f128QInfWeightOffsets[f128NumQInfWeightMasks] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x2000000000000000 ),
+ UINT64_C( 0x3000000000000000 ),
+ UINT64_C( 0x3800000000000000 ),
+ UINT64_C( 0x3C00000000000000 ),
+ UINT64_C( 0x3E00000000000000 ),
+ UINT64_C( 0x3F00000000000000 ),
+ UINT64_C( 0x3F80000000000000 ),
+ UINT64_C( 0x3FC0000000000000 ),
+ UINT64_C( 0x3FE0000000000000 ),
+ UINT64_C( 0x3FF0000000000000 ),
+ UINT64_C( 0x3FF8000000000000 ),
+ UINT64_C( 0x3FFC000000000000 )
+};
+
+static void f128RandomQInfP3( float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+ int sigNum1, sigNum2;
+ uint_fast64_t sig1_0;
+ int weightMaskNum;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ sigNum1 = randomN_ui16( f128NumP2 );
+ sigNum2 = randomN_ui16( f128NumP2 );
+ sig1_0 = f128P2[sigNum1].v0;
+ uiZPtr->v0 = sig1_0 + f128P2[sigNum2].v0;
+ weightMaskNum = randomN_ui8( f128NumQInfWeightMasks );
+ uiZPtr->v64 =
+ (((uint_fast64_t) random_ui16()<<48
+ & f128QInfWeightMasks[weightMaskNum])
+ + f128QInfWeightOffsets[weightMaskNum])
+ | ((f128P2[sigNum1].v64 + f128P2[sigNum2].v64 + (uiZPtr->v0 < sig1_0))
+ & UINT64_C( 0x0000FFFFFFFFFFFF ));
+
+}
+
+static void f128RandomQInfPInf( float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+ int weightMaskNum;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ weightMaskNum = randomN_ui8( f128NumQInfWeightMasks );
+ uiZPtr->v64 =
+ (random_ui64()
+ & (f128QInfWeightMasks[weightMaskNum]
+ | UINT64_C( 0x0000FFFFFFFFFFFF )))
+ + f128QInfWeightOffsets[weightMaskNum];
+ uiZPtr->v0 = random_ui64();
+
+}
+
+static void f128Random( float128_t *zPtr )
+{
+
+ switch ( random_ui8() & 7 ) {
+ case 0:
+ case 1:
+ case 2:
+ f128RandomQOutP3( zPtr );
+ break;
+ case 3:
+ f128RandomQOutPInf( zPtr );
+ break;
+ case 4:
+ case 5:
+ case 6:
+ f128RandomQInfP3( zPtr );
+ break;
+ case 7:
+ f128RandomQInfPInf( zPtr );
+ break;
+ }
+
+}
+
+static struct sequence sequenceA, sequenceB, sequenceC;
+static float128_t currentA, currentB, currentC;
+static int subcase;
+
+float128_t genCases_f128_a, genCases_f128_b, genCases_f128_c;
+
+void genCases_f128_a_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ subcase = 0;
+ genCases_total =
+ (genCases_level == 1) ? 3 * f128NumQOutP1 : 2 * f128NumQOutP2;
+ genCases_done = false;
+
+}
+
+void genCases_f128_a_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ case 1:
+ f128Random( &genCases_f128_a );
+ break;
+ case 2:
+ f128NextQOutP1( &sequenceA, &genCases_f128_a );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ f128Random( &genCases_f128_a );
+ break;
+ case 1:
+ f128NextQOutP2( &sequenceA, &genCases_f128_a );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+void genCases_f128_ab_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ sequenceB.expNum = 0;
+ sequenceB.term1Num = 0;
+ sequenceB.term2Num = 0;
+ sequenceB.done = false;
+ subcase = 0;
+ if ( genCases_level == 1 ) {
+ genCases_total = 6 * f128NumQInP1 * f128NumQInP1;
+ f128NextQInP1( &sequenceA, &currentA );
+ } else {
+ genCases_total = 2 * f128NumQInP2 * f128NumQInP2;
+ f128NextQInP2( &sequenceA, &currentA );
+ }
+ genCases_done = false;
+
+}
+
+void genCases_f128_ab_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ f128NextQInP1( &sequenceA, &currentA );
+ }
+ f128NextQInP1( &sequenceB, &currentB );
+ case 2:
+ case 4:
+ f128Random( &genCases_f128_a );
+ f128Random( &genCases_f128_b );
+ break;
+ case 1:
+ genCases_f128_a = currentA;
+ f128Random( &genCases_f128_b );
+ break;
+ case 3:
+ f128Random( &genCases_f128_a );
+ genCases_f128_b = currentB;
+ break;
+ case 5:
+ genCases_f128_a = currentA;
+ genCases_f128_b = currentB;
+ genCases_done = sequenceA.done & sequenceB.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ f128Random( &genCases_f128_a );
+ f128Random( &genCases_f128_b );
+ break;
+ case 1:
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ f128NextQInP2( &sequenceA, &currentA );
+ }
+ genCases_f128_a = currentA;
+ f128NextQInP2( &sequenceB, &genCases_f128_b );
+ genCases_done = sequenceA.done & sequenceB.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+void genCases_f128_abc_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ sequenceB.expNum = 0;
+ sequenceB.term1Num = 0;
+ sequenceB.term2Num = 0;
+ sequenceB.done = false;
+ sequenceC.expNum = 0;
+ sequenceC.term1Num = 0;
+ sequenceC.term2Num = 0;
+ sequenceC.done = false;
+ subcase = 0;
+ if ( genCases_level == 1 ) {
+ genCases_total = 9 * f128NumQInP1 * f128NumQInP1 * f128NumQInP1;
+ f128NextQInP1( &sequenceA, &currentA );
+ f128NextQInP1( &sequenceB, &currentB );
+ } else {
+ genCases_total = 2 * f128NumQInP2 * f128NumQInP2 * f128NumQInP2;
+ f128NextQInP2( &sequenceA, &currentA );
+ f128NextQInP2( &sequenceB, &currentB );
+ }
+ genCases_done = false;
+
+}
+
+void genCases_f128_abc_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ if ( sequenceC.done ) {
+ sequenceC.done = false;
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ f128NextQInP1( &sequenceA, &currentA );
+ }
+ f128NextQInP1( &sequenceB, &currentB );
+ }
+ f128NextQInP1( &sequenceC, &currentC );
+ f128Random( &genCases_f128_a );
+ f128Random( &genCases_f128_b );
+ genCases_f128_c = currentC;
+ break;
+ case 1:
+ genCases_f128_a = currentA;
+ genCases_f128_b = currentB;
+ f128Random( &genCases_f128_c );
+ break;
+ case 2:
+ f128Random( &genCases_f128_a );
+ f128Random( &genCases_f128_b );
+ f128Random( &genCases_f128_c );
+ break;
+ case 3:
+ f128Random( &genCases_f128_a );
+ genCases_f128_b = currentB;
+ genCases_f128_c = currentC;
+ break;
+ case 4:
+ genCases_f128_a = currentA;
+ f128Random( &genCases_f128_b );
+ f128Random( &genCases_f128_c );
+ break;
+ case 5:
+ f128Random( &genCases_f128_a );
+ genCases_f128_b = currentB;
+ f128Random( &genCases_f128_c );
+ break;
+ case 6:
+ genCases_f128_a = currentA;
+ f128Random( &genCases_f128_b );
+ genCases_f128_c = currentC;
+ break;
+ case 7:
+ f128Random( &genCases_f128_a );
+ f128Random( &genCases_f128_b );
+ f128Random( &genCases_f128_c );
+ break;
+ case 8:
+ genCases_f128_a = currentA;
+ genCases_f128_b = currentB;
+ genCases_f128_c = currentC;
+ genCases_done = sequenceA.done & sequenceB.done & sequenceC.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ f128Random( &genCases_f128_a );
+ f128Random( &genCases_f128_b );
+ f128Random( &genCases_f128_c );
+ break;
+ case 1:
+ if ( sequenceC.done ) {
+ sequenceC.done = false;
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ f128NextQInP2( &sequenceA, &currentA );
+ }
+ f128NextQInP2( &sequenceB, &currentB );
+ }
+ genCases_f128_a = currentA;
+ genCases_f128_b = currentB;
+ f128NextQInP2( &sequenceC, &genCases_f128_c );
+ genCases_done = sequenceA.done & sequenceB.done & sequenceC.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+#endif
+
diff --git a/source/genCases_f32.c b/source/genCases_f32.c
new file mode 100644
index 0000000..e81dd89
--- /dev/null
+++ b/source/genCases_f32.c
@@ -0,0 +1,661 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "random.h"
+#include "softfloat.h"
+#include "genCases.h"
+
+struct sequence {
+ int expNum, term1Num, term2Num;
+ bool done;
+};
+
+union ui32_f32 { uint32_t ui; float32_t f; };
+
+enum {
+ f32NumQIn = 22,
+ f32NumQOut = 50,
+ f32NumP1 = 4,
+ f32NumP2 = 88
+};
+static const uint32_t f32QIn[f32NumQIn] = {
+ 0x00000000, /* positive, subnormal */
+ 0x00800000, /* positive, -126 */
+ 0x33800000, /* positive, -24 */
+ 0x3E800000, /* positive, -2 */
+ 0x3F000000, /* positive, -1 */
+ 0x3F800000, /* positive, 0 */
+ 0x40000000, /* positive, 1 */
+ 0x40800000, /* positive, 2 */
+ 0x4B800000, /* positive, 24 */
+ 0x7F000000, /* positive, 127 */
+ 0x7F800000, /* positive, infinity or NaN */
+ 0x80000000, /* negative, subnormal */
+ 0x80800000, /* negative, -126 */
+ 0xB3800000, /* negative, -24 */
+ 0xBE800000, /* negative, -2 */
+ 0xBF000000, /* negative, -1 */
+ 0xBF800000, /* negative, 0 */
+ 0xC0000000, /* negative, 1 */
+ 0xC0800000, /* negative, 2 */
+ 0xCB800000, /* negative, 24 */
+ 0xFE800000, /* negative, 126 */
+ 0xFF800000 /* negative, infinity or NaN */
+};
+static const uint32_t f32QOut[f32NumQOut] = {
+ 0x00000000, /* positive, subnormal */
+ 0x00800000, /* positive, -126 */
+ 0x01000000, /* positive, -125 */
+ 0x33800000, /* positive, -24 */
+ 0x3D800000, /* positive, -4 */
+ 0x3E000000, /* positive, -3 */
+ 0x3E800000, /* positive, -2 */
+ 0x3F000000, /* positive, -1 */
+ 0x3F800000, /* positive, 0 */
+ 0x40000000, /* positive, 1 */
+ 0x40800000, /* positive, 2 */
+ 0x41000000, /* positive, 3 */
+ 0x41800000, /* positive, 4 */
+ 0x4B800000, /* positive, 24 */
+ 0x4E000000, /* positive, 29 */
+ 0x4E800000, /* positive, 30 */
+ 0x4F000000, /* positive, 31 */
+ 0x4F800000, /* positive, 32 */
+ 0x5E000000, /* positive, 61 */
+ 0x5E800000, /* positive, 62 */
+ 0x5F000000, /* positive, 63 */
+ 0x5F800000, /* positive, 64 */
+ 0x7E800000, /* positive, 126 */
+ 0x7F000000, /* positive, 127 */
+ 0x7F800000, /* positive, infinity or NaN */
+ 0x80000000, /* negative, subnormal */
+ 0x80800000, /* negative, -126 */
+ 0x81000000, /* negative, -125 */
+ 0xB3800000, /* negative, -24 */
+ 0xBD800000, /* negative, -4 */
+ 0xBE000000, /* negative, -3 */
+ 0xBE800000, /* negative, -2 */
+ 0xBF000000, /* negative, -1 */
+ 0xBF800000, /* negative, 0 */
+ 0xC0000000, /* negative, 1 */
+ 0xC0800000, /* negative, 2 */
+ 0xC1000000, /* negative, 3 */
+ 0xC1800000, /* negative, 4 */
+ 0xCB800000, /* negative, 24 */
+ 0xCE000000, /* negative, 29 */
+ 0xCE800000, /* negative, 30 */
+ 0xCF000000, /* negative, 31 */
+ 0xCF800000, /* negative, 32 */
+ 0xDE000000, /* negative, 61 */
+ 0xDE800000, /* negative, 62 */
+ 0xDF000000, /* negative, 63 */
+ 0xDF800000, /* negative, 64 */
+ 0xFE800000, /* negative, 126 */
+ 0xFF000000, /* negative, 127 */
+ 0xFF800000 /* negative, infinity or NaN */
+};
+static const uint32_t f32P1[f32NumP1] = {
+ 0x00000000,
+ 0x00000001,
+ 0x007FFFFF,
+ 0x007FFFFE
+};
+static const uint32_t f32P2[f32NumP2] = {
+ 0x00000000,
+ 0x00000001,
+ 0x00000002,
+ 0x00000004,
+ 0x00000008,
+ 0x00000010,
+ 0x00000020,
+ 0x00000040,
+ 0x00000080,
+ 0x00000100,
+ 0x00000200,
+ 0x00000400,
+ 0x00000800,
+ 0x00001000,
+ 0x00002000,
+ 0x00004000,
+ 0x00008000,
+ 0x00010000,
+ 0x00020000,
+ 0x00040000,
+ 0x00080000,
+ 0x00100000,
+ 0x00200000,
+ 0x00400000,
+ 0x00600000,
+ 0x00700000,
+ 0x00780000,
+ 0x007C0000,
+ 0x007E0000,
+ 0x007F0000,
+ 0x007F8000,
+ 0x007FC000,
+ 0x007FE000,
+ 0x007FF000,
+ 0x007FF800,
+ 0x007FFC00,
+ 0x007FFE00,
+ 0x007FFF00,
+ 0x007FFF80,
+ 0x007FFFC0,
+ 0x007FFFE0,
+ 0x007FFFF0,
+ 0x007FFFF8,
+ 0x007FFFFC,
+ 0x007FFFFE,
+ 0x007FFFFF,
+ 0x007FFFFD,
+ 0x007FFFFB,
+ 0x007FFFF7,
+ 0x007FFFEF,
+ 0x007FFFDF,
+ 0x007FFFBF,
+ 0x007FFF7F,
+ 0x007FFEFF,
+ 0x007FFDFF,
+ 0x007FFBFF,
+ 0x007FF7FF,
+ 0x007FEFFF,
+ 0x007FDFFF,
+ 0x007FBFFF,
+ 0x007F7FFF,
+ 0x007EFFFF,
+ 0x007DFFFF,
+ 0x007BFFFF,
+ 0x0077FFFF,
+ 0x006FFFFF,
+ 0x005FFFFF,
+ 0x003FFFFF,
+ 0x001FFFFF,
+ 0x000FFFFF,
+ 0x0007FFFF,
+ 0x0003FFFF,
+ 0x0001FFFF,
+ 0x0000FFFF,
+ 0x00007FFF,
+ 0x00003FFF,
+ 0x00001FFF,
+ 0x00000FFF,
+ 0x000007FF,
+ 0x000003FF,
+ 0x000001FF,
+ 0x000000FF,
+ 0x0000007F,
+ 0x0000003F,
+ 0x0000001F,
+ 0x0000000F,
+ 0x00000007,
+ 0x00000003
+};
+
+static const uint_fast64_t f32NumQInP1 = f32NumQIn * f32NumP1;
+static const uint_fast64_t f32NumQOutP1 = f32NumQOut * f32NumP1;
+
+static float32_t f32NextQInP1( struct sequence *sequencePtr )
+{
+ int expNum, sigNum;
+ union ui32_f32 uZ;
+
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uZ.ui = f32QIn[expNum] | f32P1[sigNum];
+ ++sigNum;
+ if ( f32NumP1 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f32NumQIn <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+ return uZ.f;
+
+}
+
+static float32_t f32NextQOutP1( struct sequence *sequencePtr )
+{
+ int expNum, sigNum;
+ union ui32_f32 uZ;
+
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uZ.ui = f32QOut[expNum] | f32P1[sigNum];
+ ++sigNum;
+ if ( f32NumP1 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f32NumQOut <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+ return uZ.f;
+
+}
+
+static const uint_fast64_t f32NumQInP2 = f32NumQIn * f32NumP2;
+static const uint_fast64_t f32NumQOutP2 = f32NumQOut * f32NumP2;
+
+static float32_t f32NextQInP2( struct sequence *sequencePtr )
+{
+ int expNum, sigNum;
+ union ui32_f32 uZ;
+
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uZ.ui = f32QIn[expNum] | f32P2[sigNum];
+ ++sigNum;
+ if ( f32NumP2 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f32NumQIn <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+ return uZ.f;
+
+}
+
+static float32_t f32NextQOutP2( struct sequence *sequencePtr )
+{
+ int expNum, sigNum;
+ union ui32_f32 uZ;
+
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uZ.ui = f32QOut[expNum] | f32P2[sigNum];
+ ++sigNum;
+ if ( f32NumP2 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f32NumQOut <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+ return uZ.f;
+
+}
+
+static float32_t f32RandomQOutP3( void )
+{
+ union ui32_f32 uZ;
+
+ uZ.ui =
+ f32QOut[randomN_ui8( f32NumQOut )]
+ | ((f32P2[randomN_ui8( f32NumP2 )] + f32P2[randomN_ui8( f32NumP2 )])
+ & 0x007FFFFF);
+ return uZ.f;
+
+}
+
+static float32_t f32RandomQOutPInf( void )
+{
+ union ui32_f32 uZ;
+
+ uZ.ui = f32QOut[randomN_ui8( f32NumQOut )] | (random_ui32() & 0x007FFFFF);
+ return uZ.f;
+
+}
+
+enum { f32NumQInfWeightMasks = 7 };
+static const uint32_t f32QInfWeightMasks[f32NumQInfWeightMasks] = {
+ 0xFF800000,
+ 0xFF800000,
+ 0xBF800000,
+ 0x9F800000,
+ 0x8F800000,
+ 0x87800000,
+ 0x83800000
+};
+static const uint32_t f32QInfWeightOffsets[f32NumQInfWeightMasks] = {
+ 0x00000000,
+ 0x00000000,
+ 0x20000000,
+ 0x30000000,
+ 0x38000000,
+ 0x3C000000,
+ 0x3E000000
+};
+
+static float32_t f32RandomQInfP3( void )
+{
+ int weightMaskNum;
+ union ui32_f32 uZ;
+
+ weightMaskNum = randomN_ui8( f32NumQInfWeightMasks );
+ uZ.ui =
+ (((uint_fast32_t) random_ui16()<<16
+ & f32QInfWeightMasks[weightMaskNum])
+ + f32QInfWeightOffsets[weightMaskNum])
+ | ((f32P2[randomN_ui8( f32NumP2 )] + f32P2[randomN_ui8( f32NumP2 )])
+ & 0x007FFFFF);
+ return uZ.f;
+
+}
+
+static float32_t f32RandomQInfPInf( void )
+{
+ int weightMaskNum;
+ union ui32_f32 uZ;
+
+ weightMaskNum = randomN_ui8( f32NumQInfWeightMasks );
+ uZ.ui =
+ (random_ui32() & (f32QInfWeightMasks[weightMaskNum] | 0x007FFFFF))
+ + f32QInfWeightOffsets[weightMaskNum];
+ return uZ.f;
+
+}
+
+static float32_t f32Random( void )
+{
+
+ switch ( random_ui8() & 7 ) {
+ case 0:
+ case 1:
+ case 2:
+ return f32RandomQOutP3();
+ case 3:
+ return f32RandomQOutPInf();
+ case 4:
+ case 5:
+ case 6:
+ return f32RandomQInfP3();
+ case 7:
+ return f32RandomQInfPInf();
+ }
+
+}
+
+static struct sequence sequenceA, sequenceB, sequenceC;
+static float32_t currentA, currentB, currentC;
+static int subcase;
+
+float32_t genCases_f32_a, genCases_f32_b, genCases_f32_c;
+
+void genCases_f32_a_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ subcase = 0;
+ genCases_total =
+ (genCases_level == 1) ? 3 * f32NumQOutP1 : 2 * f32NumQOutP2;
+ genCases_done = false;
+
+}
+
+void genCases_f32_a_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ case 1:
+ genCases_f32_a = f32Random();
+ break;
+ case 2:
+ genCases_f32_a = f32NextQOutP1( &sequenceA );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_f32_a = f32Random();
+ break;
+ case 1:
+ genCases_f32_a = f32NextQOutP2( &sequenceA );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+void genCases_f32_ab_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ sequenceB.expNum = 0;
+ sequenceB.term1Num = 0;
+ sequenceB.term2Num = 0;
+ sequenceB.done = false;
+ subcase = 0;
+ if ( genCases_level == 1 ) {
+ genCases_total = 6 * f32NumQInP1 * f32NumQInP1;
+ currentA = f32NextQInP1( &sequenceA );
+ } else {
+ genCases_total = 2 * f32NumQInP2 * f32NumQInP2;
+ currentA = f32NextQInP2( &sequenceA );
+ }
+ genCases_done = false;
+
+}
+
+void genCases_f32_ab_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ currentA = f32NextQInP1( &sequenceA );
+ }
+ currentB = f32NextQInP1( &sequenceB );
+ case 2:
+ case 4:
+ genCases_f32_a = f32Random();
+ genCases_f32_b = f32Random();
+ break;
+ case 1:
+ genCases_f32_a = currentA;
+ genCases_f32_b = f32Random();
+ break;
+ case 3:
+ genCases_f32_a = f32Random();
+ genCases_f32_b = currentB;
+ break;
+ case 5:
+ genCases_f32_a = currentA;
+ genCases_f32_b = currentB;
+ genCases_done = sequenceA.done & sequenceB.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_f32_a = f32Random();
+ genCases_f32_b = f32Random();
+ break;
+ case 1:
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ currentA = f32NextQInP2( &sequenceA );
+ }
+ genCases_f32_a = currentA;
+ genCases_f32_b = f32NextQInP2( &sequenceB );
+ genCases_done = sequenceA.done & sequenceB.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+void genCases_f32_abc_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ sequenceB.expNum = 0;
+ sequenceB.term1Num = 0;
+ sequenceB.term2Num = 0;
+ sequenceB.done = false;
+ sequenceC.expNum = 0;
+ sequenceC.term1Num = 0;
+ sequenceC.term2Num = 0;
+ sequenceC.done = false;
+ subcase = 0;
+ if ( genCases_level == 1 ) {
+ genCases_total = 9 * f32NumQInP1 * f32NumQInP1 * f32NumQInP1;
+ currentA = f32NextQInP1( &sequenceA );
+ currentB = f32NextQInP1( &sequenceB );
+ } else {
+ genCases_total = 2 * f32NumQInP2 * f32NumQInP2 * f32NumQInP2;
+ currentA = f32NextQInP2( &sequenceA );
+ currentB = f32NextQInP2( &sequenceB );
+ }
+ genCases_done = false;
+
+}
+
+void genCases_f32_abc_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ if ( sequenceC.done ) {
+ sequenceC.done = false;
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ currentA = f32NextQInP1( &sequenceA );
+ }
+ currentB = f32NextQInP1( &sequenceB );
+ }
+ currentC = f32NextQInP1( &sequenceC );
+ genCases_f32_a = f32Random();
+ genCases_f32_b = f32Random();
+ genCases_f32_c = currentC;
+ break;
+ case 1:
+ genCases_f32_a = currentA;
+ genCases_f32_b = currentB;
+ genCases_f32_c = f32Random();
+ break;
+ case 2:
+ genCases_f32_a = f32Random();
+ genCases_f32_b = f32Random();
+ genCases_f32_c = f32Random();
+ break;
+ case 3:
+ genCases_f32_a = f32Random();
+ genCases_f32_b = currentB;
+ genCases_f32_c = currentC;
+ break;
+ case 4:
+ genCases_f32_a = currentA;
+ genCases_f32_b = f32Random();
+ genCases_f32_c = f32Random();
+ break;
+ case 5:
+ genCases_f32_a = f32Random();
+ genCases_f32_b = currentB;
+ genCases_f32_c = f32Random();
+ break;
+ case 6:
+ genCases_f32_a = currentA;
+ genCases_f32_b = f32Random();
+ genCases_f32_c = currentC;
+ break;
+ case 7:
+ genCases_f32_a = f32Random();
+ genCases_f32_b = f32Random();
+ genCases_f32_c = f32Random();
+ break;
+ case 8:
+ genCases_f32_a = currentA;
+ genCases_f32_b = currentB;
+ genCases_f32_c = currentC;
+ genCases_done = sequenceA.done & sequenceB.done & sequenceC.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_f32_a = f32Random();
+ genCases_f32_b = f32Random();
+ genCases_f32_c = f32Random();
+ break;
+ case 1:
+ if ( sequenceC.done ) {
+ sequenceC.done = false;
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ currentA = f32NextQInP2( &sequenceA );
+ }
+ currentB = f32NextQInP2( &sequenceB );
+ }
+ genCases_f32_a = currentA;
+ genCases_f32_b = currentB;
+ genCases_f32_c = f32NextQInP2( &sequenceC );
+ genCases_done = sequenceA.done & sequenceB.done & sequenceC.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
diff --git a/source/genCases_f64.c b/source/genCases_f64.c
new file mode 100644
index 0000000..cc91fb4
--- /dev/null
+++ b/source/genCases_f64.c
@@ -0,0 +1,801 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "random.h"
+#include "softfloat.h"
+#include "genCases.h"
+
+struct sequence {
+ int expNum, term1Num, term2Num;
+ bool done;
+};
+
+union ui64_f64 { uint64_t ui; float64_t f; };
+
+enum {
+ f64NumQIn = 22,
+ f64NumQOut = 64,
+ f64NumP1 = 4,
+ f64NumP2 = 204
+};
+static const uint64_t f64QIn[f64NumQIn] = {
+ UINT64_C( 0x0000000000000000 ), /* positive, subnormal */
+ UINT64_C( 0x0010000000000000 ), /* positive, -1022 */
+ UINT64_C( 0x3CA0000000000000 ), /* positive, -53 */
+ UINT64_C( 0x3FD0000000000000 ), /* positive, -2 */
+ UINT64_C( 0x3FE0000000000000 ), /* positive, -1 */
+ UINT64_C( 0x3FF0000000000000 ), /* positive, 0 */
+ UINT64_C( 0x4000000000000000 ), /* positive, 1 */
+ UINT64_C( 0x4010000000000000 ), /* positive, 2 */
+ UINT64_C( 0x4340000000000000 ), /* positive, 53 */
+ UINT64_C( 0x7FE0000000000000 ), /* positive, 1023 */
+ UINT64_C( 0x7FF0000000000000 ), /* positive, infinity or NaN */
+ UINT64_C( 0x8000000000000000 ), /* negative, subnormal */
+ UINT64_C( 0x8010000000000000 ), /* negative, -1022 */
+ UINT64_C( 0xBCA0000000000000 ), /* negative, -53 */
+ UINT64_C( 0xBFD0000000000000 ), /* negative, -2 */
+ UINT64_C( 0xBFE0000000000000 ), /* negative, -1 */
+ UINT64_C( 0xBFF0000000000000 ), /* negative, 0 */
+ UINT64_C( 0xC000000000000000 ), /* negative, 1 */
+ UINT64_C( 0xC010000000000000 ), /* negative, 2 */
+ UINT64_C( 0xC340000000000000 ), /* negative, 53 */
+ UINT64_C( 0xFFE0000000000000 ), /* negative, 1023 */
+ UINT64_C( 0xFFF0000000000000 ) /* negative, infinity or NaN */
+};
+static const uint64_t f64QOut[f64NumQOut] = {
+ UINT64_C( 0x0000000000000000 ), /* positive, subnormal */
+ UINT64_C( 0x0010000000000000 ), /* positive, -1022 */
+ UINT64_C( 0x0020000000000000 ), /* positive, -1021 */
+ UINT64_C( 0x37E0000000000000 ), /* positive, -129 */
+ UINT64_C( 0x37F0000000000000 ), /* positive, -128 */
+ UINT64_C( 0x3800000000000000 ), /* positive, -127 */
+ UINT64_C( 0x3810000000000000 ), /* positive, -126 */
+ UINT64_C( 0x3CA0000000000000 ), /* positive, -53 */
+ UINT64_C( 0x3FB0000000000000 ), /* positive, -4 */
+ UINT64_C( 0x3FC0000000000000 ), /* positive, -3 */
+ UINT64_C( 0x3FD0000000000000 ), /* positive, -2 */
+ UINT64_C( 0x3FE0000000000000 ), /* positive, -1 */
+ UINT64_C( 0x3FF0000000000000 ), /* positive, 0 */
+ UINT64_C( 0x4000000000000000 ), /* positive, 1 */
+ UINT64_C( 0x4010000000000000 ), /* positive, 2 */
+ UINT64_C( 0x4020000000000000 ), /* positive, 3 */
+ UINT64_C( 0x4030000000000000 ), /* positive, 4 */
+ UINT64_C( 0x41C0000000000000 ), /* positive, 29 */
+ UINT64_C( 0x41D0000000000000 ), /* positive, 30 */
+ UINT64_C( 0x41E0000000000000 ), /* positive, 31 */
+ UINT64_C( 0x41F0000000000000 ), /* positive, 32 */
+ UINT64_C( 0x4340000000000000 ), /* positive, 53 */
+ UINT64_C( 0x43C0000000000000 ), /* positive, 61 */
+ UINT64_C( 0x43D0000000000000 ), /* positive, 62 */
+ UINT64_C( 0x43E0000000000000 ), /* positive, 63 */
+ UINT64_C( 0x43F0000000000000 ), /* positive, 64 */
+ UINT64_C( 0x47E0000000000000 ), /* positive, 127 */
+ UINT64_C( 0x47F0000000000000 ), /* positive, 128 */
+ UINT64_C( 0x4800000000000000 ), /* positive, 129 */
+ UINT64_C( 0x7FD0000000000000 ), /* positive, 1022 */
+ UINT64_C( 0x7FE0000000000000 ), /* positive, 1023 */
+ UINT64_C( 0x7FF0000000000000 ), /* positive, infinity or NaN */
+ UINT64_C( 0x8000000000000000 ), /* negative, subnormal */
+ UINT64_C( 0x8010000000000000 ), /* negative, -1022 */
+ UINT64_C( 0x8020000000000000 ), /* negative, -1021 */
+ UINT64_C( 0xB7E0000000000000 ), /* negative, -129 */
+ UINT64_C( 0xB7F0000000000000 ), /* negative, -128 */
+ UINT64_C( 0xB800000000000000 ), /* negative, -127 */
+ UINT64_C( 0xB810000000000000 ), /* negative, -126 */
+ UINT64_C( 0xBCA0000000000000 ), /* negative, -53 */
+ UINT64_C( 0xBFB0000000000000 ), /* negative, -4 */
+ UINT64_C( 0xBFC0000000000000 ), /* negative, -3 */
+ UINT64_C( 0xBFD0000000000000 ), /* negative, -2 */
+ UINT64_C( 0xBFE0000000000000 ), /* negative, -1 */
+ UINT64_C( 0xBFF0000000000000 ), /* negative, 0 */
+ UINT64_C( 0xC000000000000000 ), /* negative, 1 */
+ UINT64_C( 0xC010000000000000 ), /* negative, 2 */
+ UINT64_C( 0xC020000000000000 ), /* negative, 3 */
+ UINT64_C( 0xC030000000000000 ), /* negative, 4 */
+ UINT64_C( 0xC1C0000000000000 ), /* negative, 29 */
+ UINT64_C( 0xC1D0000000000000 ), /* negative, 30 */
+ UINT64_C( 0xC1E0000000000000 ), /* negative, 31 */
+ UINT64_C( 0xC1F0000000000000 ), /* negative, 32 */
+ UINT64_C( 0xC340000000000000 ), /* negative, 53 */
+ UINT64_C( 0xC3C0000000000000 ), /* negative, 61 */
+ UINT64_C( 0xC3D0000000000000 ), /* negative, 62 */
+ UINT64_C( 0xC3E0000000000000 ), /* negative, 63 */
+ UINT64_C( 0xC3F0000000000000 ), /* negative, 64 */
+ UINT64_C( 0xC7E0000000000000 ), /* negative, 127 */
+ UINT64_C( 0xC7F0000000000000 ), /* negative, 128 */
+ UINT64_C( 0xC800000000000000 ), /* negative, 129 */
+ UINT64_C( 0xFFD0000000000000 ), /* negative, 1022 */
+ UINT64_C( 0xFFE0000000000000 ), /* negative, 1023 */
+ UINT64_C( 0xFFF0000000000000 ) /* negative, infinity or NaN */
+};
+static const uint64_t f64P1[f64NumP1] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x0000000000000001 ),
+ UINT64_C( 0x000FFFFFFFFFFFFF ),
+ UINT64_C( 0x000FFFFFFFFFFFFE )
+};
+static const uint64_t f64P2[f64NumP2] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x0000000000000001 ),
+ UINT64_C( 0x0000000000000002 ),
+ UINT64_C( 0x0000000000000004 ),
+ UINT64_C( 0x0000000000000008 ),
+ UINT64_C( 0x0000000000000010 ),
+ UINT64_C( 0x0000000000000020 ),
+ UINT64_C( 0x0000000000000040 ),
+ UINT64_C( 0x0000000000000080 ),
+ UINT64_C( 0x0000000000000100 ),
+ UINT64_C( 0x0000000000000200 ),
+ UINT64_C( 0x0000000000000400 ),
+ UINT64_C( 0x0000000000000800 ),
+ UINT64_C( 0x0000000000001000 ),
+ UINT64_C( 0x0000000000002000 ),
+ UINT64_C( 0x0000000000004000 ),
+ UINT64_C( 0x0000000000008000 ),
+ UINT64_C( 0x0000000000010000 ),
+ UINT64_C( 0x0000000000020000 ),
+ UINT64_C( 0x0000000000040000 ),
+ UINT64_C( 0x0000000000080000 ),
+ UINT64_C( 0x0000000000100000 ),
+ UINT64_C( 0x0000000000200000 ),
+ UINT64_C( 0x0000000000400000 ),
+ UINT64_C( 0x0000000000800000 ),
+ UINT64_C( 0x0000000001000000 ),
+ UINT64_C( 0x0000000002000000 ),
+ UINT64_C( 0x0000000004000000 ),
+ UINT64_C( 0x0000000008000000 ),
+ UINT64_C( 0x0000000010000000 ),
+ UINT64_C( 0x0000000020000000 ),
+ UINT64_C( 0x0000000040000000 ),
+ UINT64_C( 0x0000000080000000 ),
+ UINT64_C( 0x0000000100000000 ),
+ UINT64_C( 0x0000000200000000 ),
+ UINT64_C( 0x0000000400000000 ),
+ UINT64_C( 0x0000000800000000 ),
+ UINT64_C( 0x0000001000000000 ),
+ UINT64_C( 0x0000002000000000 ),
+ UINT64_C( 0x0000004000000000 ),
+ UINT64_C( 0x0000008000000000 ),
+ UINT64_C( 0x0000010000000000 ),
+ UINT64_C( 0x0000020000000000 ),
+ UINT64_C( 0x0000040000000000 ),
+ UINT64_C( 0x0000080000000000 ),
+ UINT64_C( 0x0000100000000000 ),
+ UINT64_C( 0x0000200000000000 ),
+ UINT64_C( 0x0000400000000000 ),
+ UINT64_C( 0x0000800000000000 ),
+ UINT64_C( 0x0001000000000000 ),
+ UINT64_C( 0x0002000000000000 ),
+ UINT64_C( 0x0004000000000000 ),
+ UINT64_C( 0x0008000000000000 ),
+ UINT64_C( 0x000C000000000000 ),
+ UINT64_C( 0x000E000000000000 ),
+ UINT64_C( 0x000F000000000000 ),
+ UINT64_C( 0x000F800000000000 ),
+ UINT64_C( 0x000FC00000000000 ),
+ UINT64_C( 0x000FE00000000000 ),
+ UINT64_C( 0x000FF00000000000 ),
+ UINT64_C( 0x000FF80000000000 ),
+ UINT64_C( 0x000FFC0000000000 ),
+ UINT64_C( 0x000FFE0000000000 ),
+ UINT64_C( 0x000FFF0000000000 ),
+ UINT64_C( 0x000FFF8000000000 ),
+ UINT64_C( 0x000FFFC000000000 ),
+ UINT64_C( 0x000FFFE000000000 ),
+ UINT64_C( 0x000FFFF000000000 ),
+ UINT64_C( 0x000FFFF800000000 ),
+ UINT64_C( 0x000FFFFC00000000 ),
+ UINT64_C( 0x000FFFFE00000000 ),
+ UINT64_C( 0x000FFFFF00000000 ),
+ UINT64_C( 0x000FFFFF80000000 ),
+ UINT64_C( 0x000FFFFFC0000000 ),
+ UINT64_C( 0x000FFFFFE0000000 ),
+ UINT64_C( 0x000FFFFFF0000000 ),
+ UINT64_C( 0x000FFFFFF8000000 ),
+ UINT64_C( 0x000FFFFFFC000000 ),
+ UINT64_C( 0x000FFFFFFE000000 ),
+ UINT64_C( 0x000FFFFFFF000000 ),
+ UINT64_C( 0x000FFFFFFF800000 ),
+ UINT64_C( 0x000FFFFFFFC00000 ),
+ UINT64_C( 0x000FFFFFFFE00000 ),
+ UINT64_C( 0x000FFFFFFFF00000 ),
+ UINT64_C( 0x000FFFFFFFF80000 ),
+ UINT64_C( 0x000FFFFFFFFC0000 ),
+ UINT64_C( 0x000FFFFFFFFE0000 ),
+ UINT64_C( 0x000FFFFFFFFF0000 ),
+ UINT64_C( 0x000FFFFFFFFF8000 ),
+ UINT64_C( 0x000FFFFFFFFFC000 ),
+ UINT64_C( 0x000FFFFFFFFFE000 ),
+ UINT64_C( 0x000FFFFFFFFFF000 ),
+ UINT64_C( 0x000FFFFFFFFFF800 ),
+ UINT64_C( 0x000FFFFFFFFFFC00 ),
+ UINT64_C( 0x000FFFFFFFFFFE00 ),
+ UINT64_C( 0x000FFFFFFFFFFF00 ),
+ UINT64_C( 0x000FFFFFFFFFFF80 ),
+ UINT64_C( 0x000FFFFFFFFFFFC0 ),
+ UINT64_C( 0x000FFFFFFFFFFFE0 ),
+ UINT64_C( 0x000FFFFFFFFFFFF0 ),
+ UINT64_C( 0x000FFFFFFFFFFFF8 ),
+ UINT64_C( 0x000FFFFFFFFFFFFC ),
+ UINT64_C( 0x000FFFFFFFFFFFFE ),
+ UINT64_C( 0x000FFFFFFFFFFFFF ),
+ UINT64_C( 0x000FFFFFFFFFFFFD ),
+ UINT64_C( 0x000FFFFFFFFFFFFB ),
+ UINT64_C( 0x000FFFFFFFFFFFF7 ),
+ UINT64_C( 0x000FFFFFFFFFFFEF ),
+ UINT64_C( 0x000FFFFFFFFFFFDF ),
+ UINT64_C( 0x000FFFFFFFFFFFBF ),
+ UINT64_C( 0x000FFFFFFFFFFF7F ),
+ UINT64_C( 0x000FFFFFFFFFFEFF ),
+ UINT64_C( 0x000FFFFFFFFFFDFF ),
+ UINT64_C( 0x000FFFFFFFFFFBFF ),
+ UINT64_C( 0x000FFFFFFFFFF7FF ),
+ UINT64_C( 0x000FFFFFFFFFEFFF ),
+ UINT64_C( 0x000FFFFFFFFFDFFF ),
+ UINT64_C( 0x000FFFFFFFFFBFFF ),
+ UINT64_C( 0x000FFFFFFFFF7FFF ),
+ UINT64_C( 0x000FFFFFFFFEFFFF ),
+ UINT64_C( 0x000FFFFFFFFDFFFF ),
+ UINT64_C( 0x000FFFFFFFFBFFFF ),
+ UINT64_C( 0x000FFFFFFFF7FFFF ),
+ UINT64_C( 0x000FFFFFFFEFFFFF ),
+ UINT64_C( 0x000FFFFFFFDFFFFF ),
+ UINT64_C( 0x000FFFFFFFBFFFFF ),
+ UINT64_C( 0x000FFFFFFF7FFFFF ),
+ UINT64_C( 0x000FFFFFFEFFFFFF ),
+ UINT64_C( 0x000FFFFFFDFFFFFF ),
+ UINT64_C( 0x000FFFFFFBFFFFFF ),
+ UINT64_C( 0x000FFFFFF7FFFFFF ),
+ UINT64_C( 0x000FFFFFEFFFFFFF ),
+ UINT64_C( 0x000FFFFFDFFFFFFF ),
+ UINT64_C( 0x000FFFFFBFFFFFFF ),
+ UINT64_C( 0x000FFFFF7FFFFFFF ),
+ UINT64_C( 0x000FFFFEFFFFFFFF ),
+ UINT64_C( 0x000FFFFDFFFFFFFF ),
+ UINT64_C( 0x000FFFFBFFFFFFFF ),
+ UINT64_C( 0x000FFFF7FFFFFFFF ),
+ UINT64_C( 0x000FFFEFFFFFFFFF ),
+ UINT64_C( 0x000FFFDFFFFFFFFF ),
+ UINT64_C( 0x000FFFBFFFFFFFFF ),
+ UINT64_C( 0x000FFF7FFFFFFFFF ),
+ UINT64_C( 0x000FFEFFFFFFFFFF ),
+ UINT64_C( 0x000FFDFFFFFFFFFF ),
+ UINT64_C( 0x000FFBFFFFFFFFFF ),
+ UINT64_C( 0x000FF7FFFFFFFFFF ),
+ UINT64_C( 0x000FEFFFFFFFFFFF ),
+ UINT64_C( 0x000FDFFFFFFFFFFF ),
+ UINT64_C( 0x000FBFFFFFFFFFFF ),
+ UINT64_C( 0x000F7FFFFFFFFFFF ),
+ UINT64_C( 0x000EFFFFFFFFFFFF ),
+ UINT64_C( 0x000DFFFFFFFFFFFF ),
+ UINT64_C( 0x000BFFFFFFFFFFFF ),
+ UINT64_C( 0x0007FFFFFFFFFFFF ),
+ UINT64_C( 0x0003FFFFFFFFFFFF ),
+ UINT64_C( 0x0001FFFFFFFFFFFF ),
+ UINT64_C( 0x0000FFFFFFFFFFFF ),
+ UINT64_C( 0x00007FFFFFFFFFFF ),
+ UINT64_C( 0x00003FFFFFFFFFFF ),
+ UINT64_C( 0x00001FFFFFFFFFFF ),
+ UINT64_C( 0x00000FFFFFFFFFFF ),
+ UINT64_C( 0x000007FFFFFFFFFF ),
+ UINT64_C( 0x000003FFFFFFFFFF ),
+ UINT64_C( 0x000001FFFFFFFFFF ),
+ UINT64_C( 0x000000FFFFFFFFFF ),
+ UINT64_C( 0x0000007FFFFFFFFF ),
+ UINT64_C( 0x0000003FFFFFFFFF ),
+ UINT64_C( 0x0000001FFFFFFFFF ),
+ UINT64_C( 0x0000000FFFFFFFFF ),
+ UINT64_C( 0x00000007FFFFFFFF ),
+ UINT64_C( 0x00000003FFFFFFFF ),
+ UINT64_C( 0x00000001FFFFFFFF ),
+ UINT64_C( 0x00000000FFFFFFFF ),
+ UINT64_C( 0x000000007FFFFFFF ),
+ UINT64_C( 0x000000003FFFFFFF ),
+ UINT64_C( 0x000000001FFFFFFF ),
+ UINT64_C( 0x000000000FFFFFFF ),
+ UINT64_C( 0x0000000007FFFFFF ),
+ UINT64_C( 0x0000000003FFFFFF ),
+ UINT64_C( 0x0000000001FFFFFF ),
+ UINT64_C( 0x0000000000FFFFFF ),
+ UINT64_C( 0x00000000007FFFFF ),
+ UINT64_C( 0x00000000003FFFFF ),
+ UINT64_C( 0x00000000001FFFFF ),
+ UINT64_C( 0x00000000000FFFFF ),
+ UINT64_C( 0x000000000007FFFF ),
+ UINT64_C( 0x000000000003FFFF ),
+ UINT64_C( 0x000000000001FFFF ),
+ UINT64_C( 0x000000000000FFFF ),
+ UINT64_C( 0x0000000000007FFF ),
+ UINT64_C( 0x0000000000003FFF ),
+ UINT64_C( 0x0000000000001FFF ),
+ UINT64_C( 0x0000000000000FFF ),
+ UINT64_C( 0x00000000000007FF ),
+ UINT64_C( 0x00000000000003FF ),
+ UINT64_C( 0x00000000000001FF ),
+ UINT64_C( 0x00000000000000FF ),
+ UINT64_C( 0x000000000000007F ),
+ UINT64_C( 0x000000000000003F ),
+ UINT64_C( 0x000000000000001F ),
+ UINT64_C( 0x000000000000000F ),
+ UINT64_C( 0x0000000000000007 ),
+ UINT64_C( 0x0000000000000003 )
+};
+
+static const uint_fast64_t f64NumQInP1 = f64NumQIn * f64NumP1;
+static const uint_fast64_t f64NumQOutP1 = f64NumQOut * f64NumP1;
+
+static float64_t f64NextQInP1( struct sequence *sequencePtr )
+{
+ int expNum, sigNum;
+ union ui64_f64 uZ;
+
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uZ.ui = f64QIn[expNum] | f64P1[sigNum];
+ ++sigNum;
+ if ( f64NumP1 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f64NumQIn <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+ return uZ.f;
+
+}
+
+static float64_t f64NextQOutP1( struct sequence *sequencePtr )
+{
+ int expNum, sigNum;
+ union ui64_f64 uZ;
+
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uZ.ui = f64QOut[expNum] | f64P1[sigNum];
+ ++sigNum;
+ if ( f64NumP1 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f64NumQOut <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+ return uZ.f;
+
+}
+
+static const uint_fast64_t f64NumQInP2 = f64NumQIn * f64NumP2;
+static const uint_fast64_t f64NumQOutP2 = f64NumQOut * f64NumP2;
+
+static float64_t f64NextQInP2( struct sequence *sequencePtr )
+{
+ int expNum, sigNum;
+ union ui64_f64 uZ;
+
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uZ.ui = f64QIn[expNum] | f64P2[sigNum];
+ ++sigNum;
+ if ( f64NumP2 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f64NumQIn <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+ return uZ.f;
+
+}
+
+static float64_t f64NextQOutP2( struct sequence *sequencePtr )
+{
+ int expNum, sigNum;
+ union ui64_f64 uZ;
+
+ expNum = sequencePtr->expNum;
+ sigNum = sequencePtr->term1Num;
+ uZ.ui = f64QOut[expNum] | f64P2[sigNum];
+ ++sigNum;
+ if ( f64NumP2 <= sigNum ) {
+ sigNum = 0;
+ ++expNum;
+ if ( f64NumQOut <= expNum ) {
+ expNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->expNum = expNum;
+ }
+ sequencePtr->term1Num = sigNum;
+ return uZ.f;
+
+}
+
+static float64_t f64RandomQOutP3( void )
+{
+ union ui64_f64 uZ;
+
+ uZ.ui =
+ f64QOut[randomN_ui8( f64NumQOut )]
+ | ((f64P2[randomN_ui8( f64NumP2 )] + f64P2[randomN_ui8( f64NumP2 )])
+ & UINT64_C( 0x000FFFFFFFFFFFFF ));
+ return uZ.f;
+
+}
+
+static float64_t f64RandomQOutPInf( void )
+{
+ union ui64_f64 uZ;
+
+ uZ.ui =
+ f64QOut[randomN_ui8( f64NumQOut )]
+ | (random_ui64() & UINT64_C( 0x000FFFFFFFFFFFFF ));
+ return uZ.f;
+
+}
+
+enum { f64NumQInfWeightMasks = 10 };
+static const uint64_t f64QInfWeightMasks[f64NumQInfWeightMasks] = {
+ UINT64_C( 0xFFF0000000000000 ),
+ UINT64_C( 0xFFF0000000000000 ),
+ UINT64_C( 0xBFF0000000000000 ),
+ UINT64_C( 0x9FF0000000000000 ),
+ UINT64_C( 0x8FF0000000000000 ),
+ UINT64_C( 0x87F0000000000000 ),
+ UINT64_C( 0x83F0000000000000 ),
+ UINT64_C( 0x81F0000000000000 ),
+ UINT64_C( 0x80F0000000000000 ),
+ UINT64_C( 0x8070000000000000 )
+};
+static const uint64_t f64QInfWeightOffsets[f64NumQInfWeightMasks] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x2000000000000000 ),
+ UINT64_C( 0x3000000000000000 ),
+ UINT64_C( 0x3800000000000000 ),
+ UINT64_C( 0x3C00000000000000 ),
+ UINT64_C( 0x3E00000000000000 ),
+ UINT64_C( 0x3F00000000000000 ),
+ UINT64_C( 0x3F80000000000000 ),
+ UINT64_C( 0x3FC0000000000000 )
+};
+
+static float64_t f64RandomQInfP3( void )
+{
+ int weightMaskNum;
+ union ui64_f64 uZ;
+
+ weightMaskNum = randomN_ui8( f64NumQInfWeightMasks );
+ uZ.ui =
+ (((uint_fast64_t) random_ui16()<<48
+ & f64QInfWeightMasks[weightMaskNum])
+ + f64QInfWeightOffsets[weightMaskNum])
+ | ((f64P2[randomN_ui8( f64NumP2 )] + f64P2[randomN_ui8( f64NumP2 )])
+ & UINT64_C( 0x000FFFFFFFFFFFFF ));
+ return uZ.f;
+
+}
+
+static float64_t f64RandomQInfPInf( void )
+{
+ int weightMaskNum;
+ union ui64_f64 uZ;
+
+ weightMaskNum = randomN_ui8( f64NumQInfWeightMasks );
+ uZ.ui =
+ (random_ui64()
+ & (f64QInfWeightMasks[weightMaskNum]
+ | UINT64_C( 0x000FFFFFFFFFFFFF )))
+ + f64QInfWeightOffsets[weightMaskNum];
+ return uZ.f;
+
+}
+
+static float64_t f64Random( void )
+{
+
+ switch ( random_ui8() & 7 ) {
+ case 0:
+ case 1:
+ case 2:
+ return f64RandomQOutP3();
+ case 3:
+ return f64RandomQOutPInf();
+ case 4:
+ case 5:
+ case 6:
+ return f64RandomQInfP3();
+ case 7:
+ return f64RandomQInfPInf();
+ }
+
+}
+
+static struct sequence sequenceA, sequenceB, sequenceC;
+static float64_t currentA, currentB, currentC;
+static int subcase;
+
+float64_t genCases_f64_a, genCases_f64_b, genCases_f64_c;
+
+void genCases_f64_a_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ subcase = 0;
+ genCases_total =
+ (genCases_level == 1) ? 3 * f64NumQOutP1 : 2 * f64NumQOutP2;
+ genCases_done = false;
+
+}
+
+void genCases_f64_a_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ case 1:
+ genCases_f64_a = f64Random();
+ break;
+ case 2:
+ genCases_f64_a = f64NextQOutP1( &sequenceA );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_f64_a = f64Random();
+ break;
+ case 1:
+ genCases_f64_a = f64NextQOutP2( &sequenceA );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+void genCases_f64_ab_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ sequenceB.expNum = 0;
+ sequenceB.term1Num = 0;
+ sequenceB.term2Num = 0;
+ sequenceB.done = false;
+ subcase = 0;
+ if ( genCases_level == 1 ) {
+ genCases_total = 6 * f64NumQInP1 * f64NumQInP1;
+ currentA = f64NextQInP1( &sequenceA );
+ } else {
+ genCases_total = 2 * f64NumQInP2 * f64NumQInP2;
+ currentA = f64NextQInP2( &sequenceA );
+ }
+ genCases_done = false;
+
+}
+
+void genCases_f64_ab_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ currentA = f64NextQInP1( &sequenceA );
+ }
+ currentB = f64NextQInP1( &sequenceB );
+ case 2:
+ case 4:
+ genCases_f64_a = f64Random();
+ genCases_f64_b = f64Random();
+ break;
+ case 1:
+ genCases_f64_a = currentA;
+ genCases_f64_b = f64Random();
+ break;
+ case 3:
+ genCases_f64_a = f64Random();
+ genCases_f64_b = currentB;
+ break;
+ case 5:
+ genCases_f64_a = currentA;
+ genCases_f64_b = currentB;
+ genCases_done = sequenceA.done & sequenceB.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_f64_a = f64Random();
+ genCases_f64_b = f64Random();
+ break;
+ case 1:
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ currentA = f64NextQInP2( &sequenceA );
+ }
+ genCases_f64_a = currentA;
+ genCases_f64_b = f64NextQInP2( &sequenceB );
+ genCases_done = sequenceA.done & sequenceB.done;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
+void genCases_f64_abc_init( void )
+{
+
+ sequenceA.expNum = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ sequenceB.expNum = 0;
+ sequenceB.term1Num = 0;
+ sequenceB.term2Num = 0;
+ sequenceB.done = false;
+ sequenceC.expNum = 0;
+ sequenceC.term1Num = 0;
+ sequenceC.term2Num = 0;
+ sequenceC.done = false;
+ subcase = 0;
+ if ( genCases_level == 1 ) {
+ genCases_total = 9 * f64NumQInP1 * f64NumQInP1 * f64NumQInP1;
+ currentA = f64NextQInP1( &sequenceA );
+ currentB = f64NextQInP1( &sequenceB );
+ } else {
+ genCases_total = 2 * f64NumQInP2 * f64NumQInP2 * f64NumQInP2;
+ currentA = f64NextQInP2( &sequenceA );
+ currentB = f64NextQInP2( &sequenceB );
+ }
+ genCases_done = false;
+
+}
+
+void genCases_f64_abc_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ if ( sequenceC.done ) {
+ sequenceC.done = false;
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ currentA = f64NextQInP1( &sequenceA );
+ }
+ currentB = f64NextQInP1( &sequenceB );
+ }
+ currentC = f64NextQInP1( &sequenceC );
+ genCases_f64_a = f64Random();
+ genCases_f64_b = f64Random();
+ genCases_f64_c = currentC;
+ break;
+ case 1:
+ genCases_f64_a = currentA;
+ genCases_f64_b = currentB;
+ genCases_f64_c = f64Random();
+ break;
+ case 2:
+ genCases_f64_a = f64Random();
+ genCases_f64_b = f64Random();
+ genCases_f64_c = f64Random();
+ break;
+ case 3:
+ genCases_f64_a = f64Random();
+ genCases_f64_b = currentB;
+ genCases_f64_c = currentC;
+ break;
+ case 4:
+ genCases_f64_a = currentA;
+ genCases_f64_b = f64Random();
+ genCases_f64_c = f64Random();
+ break;
+ case 5:
+ genCases_f64_a = f64Random();
+ genCases_f64_b = currentB;
+ genCases_f64_c = f64Random();
+ break;
+ case 6:
+ genCases_f64_a = currentA;
+ genCases_f64_b = f64Random();
+ genCases_f64_c = currentC;
+ break;
+ case 7:
+ genCases_f64_a = f64Random();
+ genCases_f64_b = f64Random();
+ genCases_f64_c = f64Random();
+ break;
+ case 8:
+ genCases_f64_a = currentA;
+ genCases_f64_b = currentB;
+ genCases_f64_c = currentC;
+ genCases_done = sequenceA.done & sequenceB.done & sequenceC.done;;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_f64_a = f64Random();
+ genCases_f64_b = f64Random();
+ genCases_f64_c = f64Random();
+ break;
+ case 1:
+ if ( sequenceC.done ) {
+ sequenceC.done = false;
+ if ( sequenceB.done ) {
+ sequenceB.done = false;
+ currentA = f64NextQInP2( &sequenceA );
+ }
+ currentB = f64NextQInP2( &sequenceB );
+ }
+ genCases_f64_a = currentA;
+ genCases_f64_b = currentB;
+ genCases_f64_c = f64NextQInP2( &sequenceC );
+ genCases_done = sequenceA.done & sequenceB.done & sequenceC.done;;
+ subcase = -1;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
diff --git a/source/genCases_i32.c b/source/genCases_i32.c
new file mode 100644
index 0000000..bc3287a
--- /dev/null
+++ b/source/genCases_i32.c
@@ -0,0 +1,359 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "random.h"
+#include "genCases.h"
+
+struct sequence {
+ int term1Num, term2Num;
+ bool done;
+};
+
+union ui32_i32 { uint32_t ui; int32_t i; };
+
+enum { i32NumP1 = 124 };
+static const uint32_t i32P1[i32NumP1] = {
+ 0x00000000,
+ 0x00000001,
+ 0x00000002,
+ 0x00000004,
+ 0x00000008,
+ 0x00000010,
+ 0x00000020,
+ 0x00000040,
+ 0x00000080,
+ 0x00000100,
+ 0x00000200,
+ 0x00000400,
+ 0x00000800,
+ 0x00001000,
+ 0x00002000,
+ 0x00004000,
+ 0x00008000,
+ 0x00010000,
+ 0x00020000,
+ 0x00040000,
+ 0x00080000,
+ 0x00100000,
+ 0x00200000,
+ 0x00400000,
+ 0x00800000,
+ 0x01000000,
+ 0x02000000,
+ 0x04000000,
+ 0x08000000,
+ 0x10000000,
+ 0x20000000,
+ 0x40000000,
+ 0x80000000,
+ 0xC0000000,
+ 0xE0000000,
+ 0xF0000000,
+ 0xF8000000,
+ 0xFC000000,
+ 0xFE000000,
+ 0xFF000000,
+ 0xFF800000,
+ 0xFFC00000,
+ 0xFFE00000,
+ 0xFFF00000,
+ 0xFFF80000,
+ 0xFFFC0000,
+ 0xFFFE0000,
+ 0xFFFF0000,
+ 0xFFFF8000,
+ 0xFFFFC000,
+ 0xFFFFE000,
+ 0xFFFFF000,
+ 0xFFFFF800,
+ 0xFFFFFC00,
+ 0xFFFFFE00,
+ 0xFFFFFF00,
+ 0xFFFFFF80,
+ 0xFFFFFFC0,
+ 0xFFFFFFE0,
+ 0xFFFFFFF0,
+ 0xFFFFFFF8,
+ 0xFFFFFFFC,
+ 0xFFFFFFFE,
+ 0xFFFFFFFF,
+ 0xFFFFFFFD,
+ 0xFFFFFFFB,
+ 0xFFFFFFF7,
+ 0xFFFFFFEF,
+ 0xFFFFFFDF,
+ 0xFFFFFFBF,
+ 0xFFFFFF7F,
+ 0xFFFFFEFF,
+ 0xFFFFFDFF,
+ 0xFFFFFBFF,
+ 0xFFFFF7FF,
+ 0xFFFFEFFF,
+ 0xFFFFDFFF,
+ 0xFFFFBFFF,
+ 0xFFFF7FFF,
+ 0xFFFEFFFF,
+ 0xFFFDFFFF,
+ 0xFFFBFFFF,
+ 0xFFF7FFFF,
+ 0xFFEFFFFF,
+ 0xFFDFFFFF,
+ 0xFFBFFFFF,
+ 0xFF7FFFFF,
+ 0xFEFFFFFF,
+ 0xFDFFFFFF,
+ 0xFBFFFFFF,
+ 0xF7FFFFFF,
+ 0xEFFFFFFF,
+ 0xDFFFFFFF,
+ 0xBFFFFFFF,
+ 0x7FFFFFFF,
+ 0x3FFFFFFF,
+ 0x1FFFFFFF,
+ 0x0FFFFFFF,
+ 0x07FFFFFF,
+ 0x03FFFFFF,
+ 0x01FFFFFF,
+ 0x00FFFFFF,
+ 0x007FFFFF,
+ 0x003FFFFF,
+ 0x001FFFFF,
+ 0x000FFFFF,
+ 0x0007FFFF,
+ 0x0003FFFF,
+ 0x0001FFFF,
+ 0x0000FFFF,
+ 0x00007FFF,
+ 0x00003FFF,
+ 0x00001FFF,
+ 0x00000FFF,
+ 0x000007FF,
+ 0x000003FF,
+ 0x000001FF,
+ 0x000000FF,
+ 0x0000007F,
+ 0x0000003F,
+ 0x0000001F,
+ 0x0000000F,
+ 0x00000007,
+ 0x00000003
+};
+
+static int_fast32_t i32NextP1( struct sequence *sequencePtr )
+{
+ int termNum;
+ union ui32_i32 uZ;
+
+ termNum = sequencePtr->term1Num;
+ uZ.ui = i32P1[termNum];
+ ++termNum;
+ if ( i32NumP1 <= termNum ) {
+ termNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->term1Num = termNum;
+ return uZ.i;
+
+}
+
+static const int_fast32_t i32NumP2 = (i32NumP1 * i32NumP1 + i32NumP1) / 2;
+
+static int_fast32_t i32NextP2( struct sequence *sequencePtr )
+{
+ int term1Num, term2Num;
+ union ui32_i32 uZ;
+
+ term2Num = sequencePtr->term2Num;
+ term1Num = sequencePtr->term1Num;
+ uZ.ui = i32P1[term1Num] + i32P1[term2Num];
+ ++term2Num;
+ if ( i32NumP1 <= term2Num ) {
+ ++term1Num;
+ if ( i32NumP1 <= term1Num ) {
+ term1Num = 0;
+ sequencePtr->done = true;
+ }
+ term2Num = term1Num;
+ sequencePtr->term1Num = term1Num;
+ }
+ sequencePtr->term2Num = term2Num;
+ return uZ.i;
+
+}
+
+static int_fast32_t i32RandomP3( void )
+{
+ union ui32_i32 uZ;
+
+ uZ.ui =
+ i32P1[randomN_ui8( i32NumP1 )] + i32P1[randomN_ui8( i32NumP1 )]
+ + i32P1[randomN_ui8( i32NumP1 )];
+ return uZ.i;
+
+}
+
+enum { i32NumPInfWeightMasks = 29 };
+static const uint32_t i32PInfWeightMasks[i32NumPInfWeightMasks] = {
+ 0xFFFFFFFF,
+ 0x7FFFFFFF,
+ 0x3FFFFFFF,
+ 0x1FFFFFFF,
+ 0x0FFFFFFF,
+ 0x07FFFFFF,
+ 0x03FFFFFF,
+ 0x01FFFFFF,
+ 0x00FFFFFF,
+ 0x007FFFFF,
+ 0x003FFFFF,
+ 0x001FFFFF,
+ 0x000FFFFF,
+ 0x0007FFFF,
+ 0x0003FFFF,
+ 0x0001FFFF,
+ 0x0000FFFF,
+ 0x00007FFF,
+ 0x00003FFF,
+ 0x00001FFF,
+ 0x00000FFF,
+ 0x000007FF,
+ 0x000003FF,
+ 0x000001FF,
+ 0x000000FF,
+ 0x0000007F,
+ 0x0000003F,
+ 0x0000001F,
+ 0x0000000F
+};
+static const uint32_t i32PInfWeightOffsets[i32NumPInfWeightMasks] = {
+ 0x00000000,
+ 0xC0000000,
+ 0xE0000000,
+ 0xF0000000,
+ 0xF8000000,
+ 0xFC000000,
+ 0xFE000000,
+ 0xFF000000,
+ 0xFF800000,
+ 0xFFC00000,
+ 0xFFE00000,
+ 0xFFF00000,
+ 0xFFF80000,
+ 0xFFFC0000,
+ 0xFFFE0000,
+ 0xFFFF0000,
+ 0xFFFF8000,
+ 0xFFFFC000,
+ 0xFFFFE000,
+ 0xFFFFF000,
+ 0xFFFFF800,
+ 0xFFFFFC00,
+ 0xFFFFFE00,
+ 0xFFFFFF00,
+ 0xFFFFFF80,
+ 0xFFFFFFC0,
+ 0xFFFFFFE0,
+ 0xFFFFFFF0,
+ 0xFFFFFFF8
+};
+
+static int_fast32_t i32RandomPInf( void )
+{
+ int weightMaskNum;
+ union ui32_i32 uZ;
+
+ weightMaskNum = randomN_ui8( i32NumPInfWeightMasks );
+ uZ.ui =
+ (random_ui32() & i32PInfWeightMasks[weightMaskNum])
+ + i32PInfWeightOffsets[weightMaskNum];
+ return uZ.i;
+
+}
+
+static struct sequence sequenceA;
+static int subcase;
+
+int_fast32_t genCases_i32_a;
+
+void genCases_i32_a_init( void )
+{
+
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ subcase = 0;
+ genCases_total = (genCases_level == 1) ? 3 * i32NumP1 : 2 * i32NumP2;
+ genCases_done = false;
+
+}
+
+void genCases_i32_a_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ genCases_i32_a = i32RandomP3();
+ break;
+ case 1:
+ genCases_i32_a = i32RandomPInf();
+ break;
+ case 2:
+ genCases_i32_a = i32NextP1( &sequenceA );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_i32_a = i32RandomP3();
+ break;
+ case 2:
+ genCases_i32_a = i32RandomPInf();
+ break;
+ case 3:
+ subcase = -1;
+ case 1:
+ genCases_i32_a = i32NextP2( &sequenceA );
+ genCases_done = sequenceA.done;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
diff --git a/source/genCases_i64.c b/source/genCases_i64.c
new file mode 100644
index 0000000..b98df8d
--- /dev/null
+++ b/source/genCases_i64.c
@@ -0,0 +1,551 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "random.h"
+#include "genCases.h"
+
+struct sequence {
+ int term1Num, term2Num;
+ bool done;
+};
+
+union ui64_i64 { uint64_t ui; int64_t i; };
+
+enum { i64NumP1 = 252 };
+static const uint64_t i64P1[i64NumP1] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x0000000000000001 ),
+ UINT64_C( 0x0000000000000002 ),
+ UINT64_C( 0x0000000000000004 ),
+ UINT64_C( 0x0000000000000008 ),
+ UINT64_C( 0x0000000000000010 ),
+ UINT64_C( 0x0000000000000020 ),
+ UINT64_C( 0x0000000000000040 ),
+ UINT64_C( 0x0000000000000080 ),
+ UINT64_C( 0x0000000000000100 ),
+ UINT64_C( 0x0000000000000200 ),
+ UINT64_C( 0x0000000000000400 ),
+ UINT64_C( 0x0000000000000800 ),
+ UINT64_C( 0x0000000000001000 ),
+ UINT64_C( 0x0000000000002000 ),
+ UINT64_C( 0x0000000000004000 ),
+ UINT64_C( 0x0000000000008000 ),
+ UINT64_C( 0x0000000000010000 ),
+ UINT64_C( 0x0000000000020000 ),
+ UINT64_C( 0x0000000000040000 ),
+ UINT64_C( 0x0000000000080000 ),
+ UINT64_C( 0x0000000000100000 ),
+ UINT64_C( 0x0000000000200000 ),
+ UINT64_C( 0x0000000000400000 ),
+ UINT64_C( 0x0000000000800000 ),
+ UINT64_C( 0x0000000001000000 ),
+ UINT64_C( 0x0000000002000000 ),
+ UINT64_C( 0x0000000004000000 ),
+ UINT64_C( 0x0000000008000000 ),
+ UINT64_C( 0x0000000010000000 ),
+ UINT64_C( 0x0000000020000000 ),
+ UINT64_C( 0x0000000040000000 ),
+ UINT64_C( 0x0000000080000000 ),
+ UINT64_C( 0x0000000100000000 ),
+ UINT64_C( 0x0000000200000000 ),
+ UINT64_C( 0x0000000400000000 ),
+ UINT64_C( 0x0000000800000000 ),
+ UINT64_C( 0x0000001000000000 ),
+ UINT64_C( 0x0000002000000000 ),
+ UINT64_C( 0x0000004000000000 ),
+ UINT64_C( 0x0000008000000000 ),
+ UINT64_C( 0x0000010000000000 ),
+ UINT64_C( 0x0000020000000000 ),
+ UINT64_C( 0x0000040000000000 ),
+ UINT64_C( 0x0000080000000000 ),
+ UINT64_C( 0x0000100000000000 ),
+ UINT64_C( 0x0000200000000000 ),
+ UINT64_C( 0x0000400000000000 ),
+ UINT64_C( 0x0000800000000000 ),
+ UINT64_C( 0x0001000000000000 ),
+ UINT64_C( 0x0002000000000000 ),
+ UINT64_C( 0x0004000000000000 ),
+ UINT64_C( 0x0008000000000000 ),
+ UINT64_C( 0x0010000000000000 ),
+ UINT64_C( 0x0020000000000000 ),
+ UINT64_C( 0x0040000000000000 ),
+ UINT64_C( 0x0080000000000000 ),
+ UINT64_C( 0x0100000000000000 ),
+ UINT64_C( 0x0200000000000000 ),
+ UINT64_C( 0x0400000000000000 ),
+ UINT64_C( 0x0800000000000000 ),
+ UINT64_C( 0x1000000000000000 ),
+ UINT64_C( 0x2000000000000000 ),
+ UINT64_C( 0x4000000000000000 ),
+ UINT64_C( 0x8000000000000000 ),
+ UINT64_C( 0xC000000000000000 ),
+ UINT64_C( 0xE000000000000000 ),
+ UINT64_C( 0xF000000000000000 ),
+ UINT64_C( 0xF800000000000000 ),
+ UINT64_C( 0xFC00000000000000 ),
+ UINT64_C( 0xFE00000000000000 ),
+ UINT64_C( 0xFF00000000000000 ),
+ UINT64_C( 0xFF80000000000000 ),
+ UINT64_C( 0xFFC0000000000000 ),
+ UINT64_C( 0xFFE0000000000000 ),
+ UINT64_C( 0xFFF0000000000000 ),
+ UINT64_C( 0xFFF8000000000000 ),
+ UINT64_C( 0xFFFC000000000000 ),
+ UINT64_C( 0xFFFE000000000000 ),
+ UINT64_C( 0xFFFF000000000000 ),
+ UINT64_C( 0xFFFF800000000000 ),
+ UINT64_C( 0xFFFFC00000000000 ),
+ UINT64_C( 0xFFFFE00000000000 ),
+ UINT64_C( 0xFFFFF00000000000 ),
+ UINT64_C( 0xFFFFF80000000000 ),
+ UINT64_C( 0xFFFFFC0000000000 ),
+ UINT64_C( 0xFFFFFE0000000000 ),
+ UINT64_C( 0xFFFFFF0000000000 ),
+ UINT64_C( 0xFFFFFF8000000000 ),
+ UINT64_C( 0xFFFFFFC000000000 ),
+ UINT64_C( 0xFFFFFFE000000000 ),
+ UINT64_C( 0xFFFFFFF000000000 ),
+ UINT64_C( 0xFFFFFFF800000000 ),
+ UINT64_C( 0xFFFFFFFC00000000 ),
+ UINT64_C( 0xFFFFFFFE00000000 ),
+ UINT64_C( 0xFFFFFFFF00000000 ),
+ UINT64_C( 0xFFFFFFFF80000000 ),
+ UINT64_C( 0xFFFFFFFFC0000000 ),
+ UINT64_C( 0xFFFFFFFFE0000000 ),
+ UINT64_C( 0xFFFFFFFFF0000000 ),
+ UINT64_C( 0xFFFFFFFFF8000000 ),
+ UINT64_C( 0xFFFFFFFFFC000000 ),
+ UINT64_C( 0xFFFFFFFFFE000000 ),
+ UINT64_C( 0xFFFFFFFFFF000000 ),
+ UINT64_C( 0xFFFFFFFFFF800000 ),
+ UINT64_C( 0xFFFFFFFFFFC00000 ),
+ UINT64_C( 0xFFFFFFFFFFE00000 ),
+ UINT64_C( 0xFFFFFFFFFFF00000 ),
+ UINT64_C( 0xFFFFFFFFFFF80000 ),
+ UINT64_C( 0xFFFFFFFFFFFC0000 ),
+ UINT64_C( 0xFFFFFFFFFFFE0000 ),
+ UINT64_C( 0xFFFFFFFFFFFF0000 ),
+ UINT64_C( 0xFFFFFFFFFFFF8000 ),
+ UINT64_C( 0xFFFFFFFFFFFFC000 ),
+ UINT64_C( 0xFFFFFFFFFFFFE000 ),
+ UINT64_C( 0xFFFFFFFFFFFFF000 ),
+ UINT64_C( 0xFFFFFFFFFFFFF800 ),
+ UINT64_C( 0xFFFFFFFFFFFFFC00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFE00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFF00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFF80 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFC0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFE0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFF0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFF8 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFC ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFE ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFF ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFD ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFB ),
+ UINT64_C( 0xFFFFFFFFFFFFFFF7 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFEF ),
+ UINT64_C( 0xFFFFFFFFFFFFFFDF ),
+ UINT64_C( 0xFFFFFFFFFFFFFFBF ),
+ UINT64_C( 0xFFFFFFFFFFFFFF7F ),
+ UINT64_C( 0xFFFFFFFFFFFFFEFF ),
+ UINT64_C( 0xFFFFFFFFFFFFFDFF ),
+ UINT64_C( 0xFFFFFFFFFFFFFBFF ),
+ UINT64_C( 0xFFFFFFFFFFFFF7FF ),
+ UINT64_C( 0xFFFFFFFFFFFFEFFF ),
+ UINT64_C( 0xFFFFFFFFFFFFDFFF ),
+ UINT64_C( 0xFFFFFFFFFFFFBFFF ),
+ UINT64_C( 0xFFFFFFFFFFFF7FFF ),
+ UINT64_C( 0xFFFFFFFFFFFEFFFF ),
+ UINT64_C( 0xFFFFFFFFFFFDFFFF ),
+ UINT64_C( 0xFFFFFFFFFFFBFFFF ),
+ UINT64_C( 0xFFFFFFFFFFF7FFFF ),
+ UINT64_C( 0xFFFFFFFFFFEFFFFF ),
+ UINT64_C( 0xFFFFFFFFFFDFFFFF ),
+ UINT64_C( 0xFFFFFFFFFFBFFFFF ),
+ UINT64_C( 0xFFFFFFFFFF7FFFFF ),
+ UINT64_C( 0xFFFFFFFFFEFFFFFF ),
+ UINT64_C( 0xFFFFFFFFFDFFFFFF ),
+ UINT64_C( 0xFFFFFFFFFBFFFFFF ),
+ UINT64_C( 0xFFFFFFFFF7FFFFFF ),
+ UINT64_C( 0xFFFFFFFFEFFFFFFF ),
+ UINT64_C( 0xFFFFFFFFDFFFFFFF ),
+ UINT64_C( 0xFFFFFFFFBFFFFFFF ),
+ UINT64_C( 0xFFFFFFFF7FFFFFFF ),
+ UINT64_C( 0xFFFFFFFEFFFFFFFF ),
+ UINT64_C( 0xFFFFFFFDFFFFFFFF ),
+ UINT64_C( 0xFFFFFFFBFFFFFFFF ),
+ UINT64_C( 0xFFFFFFF7FFFFFFFF ),
+ UINT64_C( 0xFFFFFFEFFFFFFFFF ),
+ UINT64_C( 0xFFFFFFDFFFFFFFFF ),
+ UINT64_C( 0xFFFFFFBFFFFFFFFF ),
+ UINT64_C( 0xFFFFFF7FFFFFFFFF ),
+ UINT64_C( 0xFFFFFEFFFFFFFFFF ),
+ UINT64_C( 0xFFFFFDFFFFFFFFFF ),
+ UINT64_C( 0xFFFFFBFFFFFFFFFF ),
+ UINT64_C( 0xFFFFF7FFFFFFFFFF ),
+ UINT64_C( 0xFFFFEFFFFFFFFFFF ),
+ UINT64_C( 0xFFFFDFFFFFFFFFFF ),
+ UINT64_C( 0xFFFFBFFFFFFFFFFF ),
+ UINT64_C( 0xFFFF7FFFFFFFFFFF ),
+ UINT64_C( 0xFFFEFFFFFFFFFFFF ),
+ UINT64_C( 0xFFFDFFFFFFFFFFFF ),
+ UINT64_C( 0xFFFBFFFFFFFFFFFF ),
+ UINT64_C( 0xFFF7FFFFFFFFFFFF ),
+ UINT64_C( 0xFFEFFFFFFFFFFFFF ),
+ UINT64_C( 0xFFDFFFFFFFFFFFFF ),
+ UINT64_C( 0xFFBFFFFFFFFFFFFF ),
+ UINT64_C( 0xFF7FFFFFFFFFFFFF ),
+ UINT64_C( 0xFEFFFFFFFFFFFFFF ),
+ UINT64_C( 0xFDFFFFFFFFFFFFFF ),
+ UINT64_C( 0xFBFFFFFFFFFFFFFF ),
+ UINT64_C( 0xF7FFFFFFFFFFFFFF ),
+ UINT64_C( 0xEFFFFFFFFFFFFFFF ),
+ UINT64_C( 0xDFFFFFFFFFFFFFFF ),
+ UINT64_C( 0xBFFFFFFFFFFFFFFF ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x3FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x1FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x0FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x07FFFFFFFFFFFFFF ),
+ UINT64_C( 0x03FFFFFFFFFFFFFF ),
+ UINT64_C( 0x01FFFFFFFFFFFFFF ),
+ UINT64_C( 0x00FFFFFFFFFFFFFF ),
+ UINT64_C( 0x007FFFFFFFFFFFFF ),
+ UINT64_C( 0x003FFFFFFFFFFFFF ),
+ UINT64_C( 0x001FFFFFFFFFFFFF ),
+ UINT64_C( 0x000FFFFFFFFFFFFF ),
+ UINT64_C( 0x0007FFFFFFFFFFFF ),
+ UINT64_C( 0x0003FFFFFFFFFFFF ),
+ UINT64_C( 0x0001FFFFFFFFFFFF ),
+ UINT64_C( 0x0000FFFFFFFFFFFF ),
+ UINT64_C( 0x00007FFFFFFFFFFF ),
+ UINT64_C( 0x00003FFFFFFFFFFF ),
+ UINT64_C( 0x00001FFFFFFFFFFF ),
+ UINT64_C( 0x00000FFFFFFFFFFF ),
+ UINT64_C( 0x000007FFFFFFFFFF ),
+ UINT64_C( 0x000003FFFFFFFFFF ),
+ UINT64_C( 0x000001FFFFFFFFFF ),
+ UINT64_C( 0x000000FFFFFFFFFF ),
+ UINT64_C( 0x0000007FFFFFFFFF ),
+ UINT64_C( 0x0000003FFFFFFFFF ),
+ UINT64_C( 0x0000001FFFFFFFFF ),
+ UINT64_C( 0x0000000FFFFFFFFF ),
+ UINT64_C( 0x00000007FFFFFFFF ),
+ UINT64_C( 0x00000003FFFFFFFF ),
+ UINT64_C( 0x00000001FFFFFFFF ),
+ UINT64_C( 0x00000000FFFFFFFF ),
+ UINT64_C( 0x000000007FFFFFFF ),
+ UINT64_C( 0x000000003FFFFFFF ),
+ UINT64_C( 0x000000001FFFFFFF ),
+ UINT64_C( 0x000000000FFFFFFF ),
+ UINT64_C( 0x0000000007FFFFFF ),
+ UINT64_C( 0x0000000003FFFFFF ),
+ UINT64_C( 0x0000000001FFFFFF ),
+ UINT64_C( 0x0000000000FFFFFF ),
+ UINT64_C( 0x00000000007FFFFF ),
+ UINT64_C( 0x00000000003FFFFF ),
+ UINT64_C( 0x00000000001FFFFF ),
+ UINT64_C( 0x00000000000FFFFF ),
+ UINT64_C( 0x000000000007FFFF ),
+ UINT64_C( 0x000000000003FFFF ),
+ UINT64_C( 0x000000000001FFFF ),
+ UINT64_C( 0x000000000000FFFF ),
+ UINT64_C( 0x0000000000007FFF ),
+ UINT64_C( 0x0000000000003FFF ),
+ UINT64_C( 0x0000000000001FFF ),
+ UINT64_C( 0x0000000000000FFF ),
+ UINT64_C( 0x00000000000007FF ),
+ UINT64_C( 0x00000000000003FF ),
+ UINT64_C( 0x00000000000001FF ),
+ UINT64_C( 0x00000000000000FF ),
+ UINT64_C( 0x000000000000007F ),
+ UINT64_C( 0x000000000000003F ),
+ UINT64_C( 0x000000000000001F ),
+ UINT64_C( 0x000000000000000F ),
+ UINT64_C( 0x0000000000000007 ),
+ UINT64_C( 0x0000000000000003 )
+};
+
+static int_fast64_t i64NextP1( struct sequence *sequencePtr )
+{
+ int termNum;
+ union ui64_i64 uZ;
+
+ termNum = sequencePtr->term1Num;
+ uZ.ui = i64P1[termNum];
+ ++termNum;
+ if ( i64NumP1 <= termNum ) {
+ termNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->term1Num = termNum;
+ return uZ.i;
+
+}
+
+static const int_fast64_t i64NumP2 = (i64NumP1 * i64NumP1 + i64NumP1) / 2;
+
+static int_fast64_t i64NextP2( struct sequence *sequencePtr )
+{
+ int term1Num, term2Num;
+ union ui64_i64 uZ;
+
+ term2Num = sequencePtr->term2Num;
+ term1Num = sequencePtr->term1Num;
+ uZ.ui = i64P1[term1Num] + i64P1[term2Num];
+ ++term2Num;
+ if ( i64NumP1 <= term2Num ) {
+ ++term1Num;
+ if ( i64NumP1 <= term1Num ) {
+ term1Num = 0;
+ sequencePtr->done = true;
+ }
+ term2Num = term1Num;
+ sequencePtr->term1Num = term1Num;
+ }
+ sequencePtr->term2Num = term2Num;
+ return uZ.i;
+
+}
+
+static int_fast64_t i64RandomP3( void )
+{
+ union ui64_i64 uZ;
+
+ uZ.ui =
+ i64P1[randomN_ui8( i64NumP1 )] + i64P1[randomN_ui8( i64NumP1 )]
+ + i64P1[randomN_ui8( i64NumP1 )];
+ return uZ.i;
+
+}
+
+enum { i64NumPInfWeightMasks = 61 };
+static const uint64_t i64PInfWeightMasks[i64NumPInfWeightMasks] = {
+ UINT64_C( 0xFFFFFFFFFFFFFFFF ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x3FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x1FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x0FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x07FFFFFFFFFFFFFF ),
+ UINT64_C( 0x03FFFFFFFFFFFFFF ),
+ UINT64_C( 0x01FFFFFFFFFFFFFF ),
+ UINT64_C( 0x00FFFFFFFFFFFFFF ),
+ UINT64_C( 0x007FFFFFFFFFFFFF ),
+ UINT64_C( 0x003FFFFFFFFFFFFF ),
+ UINT64_C( 0x001FFFFFFFFFFFFF ),
+ UINT64_C( 0x000FFFFFFFFFFFFF ),
+ UINT64_C( 0x0007FFFFFFFFFFFF ),
+ UINT64_C( 0x0003FFFFFFFFFFFF ),
+ UINT64_C( 0x0001FFFFFFFFFFFF ),
+ UINT64_C( 0x0000FFFFFFFFFFFF ),
+ UINT64_C( 0x00007FFFFFFFFFFF ),
+ UINT64_C( 0x00003FFFFFFFFFFF ),
+ UINT64_C( 0x00001FFFFFFFFFFF ),
+ UINT64_C( 0x00000FFFFFFFFFFF ),
+ UINT64_C( 0x000007FFFFFFFFFF ),
+ UINT64_C( 0x000003FFFFFFFFFF ),
+ UINT64_C( 0x000001FFFFFFFFFF ),
+ UINT64_C( 0x000000FFFFFFFFFF ),
+ UINT64_C( 0x0000007FFFFFFFFF ),
+ UINT64_C( 0x0000003FFFFFFFFF ),
+ UINT64_C( 0x0000001FFFFFFFFF ),
+ UINT64_C( 0x0000000FFFFFFFFF ),
+ UINT64_C( 0x00000007FFFFFFFF ),
+ UINT64_C( 0x00000003FFFFFFFF ),
+ UINT64_C( 0x00000001FFFFFFFF ),
+ UINT64_C( 0x00000000FFFFFFFF ),
+ UINT64_C( 0x000000007FFFFFFF ),
+ UINT64_C( 0x000000003FFFFFFF ),
+ UINT64_C( 0x000000001FFFFFFF ),
+ UINT64_C( 0x000000000FFFFFFF ),
+ UINT64_C( 0x0000000007FFFFFF ),
+ UINT64_C( 0x0000000003FFFFFF ),
+ UINT64_C( 0x0000000001FFFFFF ),
+ UINT64_C( 0x0000000000FFFFFF ),
+ UINT64_C( 0x00000000007FFFFF ),
+ UINT64_C( 0x00000000003FFFFF ),
+ UINT64_C( 0x00000000001FFFFF ),
+ UINT64_C( 0x00000000000FFFFF ),
+ UINT64_C( 0x000000000007FFFF ),
+ UINT64_C( 0x000000000003FFFF ),
+ UINT64_C( 0x000000000001FFFF ),
+ UINT64_C( 0x000000000000FFFF ),
+ UINT64_C( 0x0000000000007FFF ),
+ UINT64_C( 0x0000000000003FFF ),
+ UINT64_C( 0x0000000000001FFF ),
+ UINT64_C( 0x0000000000000FFF ),
+ UINT64_C( 0x00000000000007FF ),
+ UINT64_C( 0x00000000000003FF ),
+ UINT64_C( 0x00000000000001FF ),
+ UINT64_C( 0x00000000000000FF ),
+ UINT64_C( 0x000000000000007F ),
+ UINT64_C( 0x000000000000003F ),
+ UINT64_C( 0x000000000000001F ),
+ UINT64_C( 0x000000000000000F )
+};
+static const uint64_t i64PInfWeightOffsets[i64NumPInfWeightMasks] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0xC000000000000000 ),
+ UINT64_C( 0xE000000000000000 ),
+ UINT64_C( 0xF000000000000000 ),
+ UINT64_C( 0xF800000000000000 ),
+ UINT64_C( 0xFC00000000000000 ),
+ UINT64_C( 0xFE00000000000000 ),
+ UINT64_C( 0xFF00000000000000 ),
+ UINT64_C( 0xFF80000000000000 ),
+ UINT64_C( 0xFFC0000000000000 ),
+ UINT64_C( 0xFFE0000000000000 ),
+ UINT64_C( 0xFFF0000000000000 ),
+ UINT64_C( 0xFFF8000000000000 ),
+ UINT64_C( 0xFFFC000000000000 ),
+ UINT64_C( 0xFFFE000000000000 ),
+ UINT64_C( 0xFFFF000000000000 ),
+ UINT64_C( 0xFFFF800000000000 ),
+ UINT64_C( 0xFFFFC00000000000 ),
+ UINT64_C( 0xFFFFE00000000000 ),
+ UINT64_C( 0xFFFFF00000000000 ),
+ UINT64_C( 0xFFFFF80000000000 ),
+ UINT64_C( 0xFFFFFC0000000000 ),
+ UINT64_C( 0xFFFFFE0000000000 ),
+ UINT64_C( 0xFFFFFF0000000000 ),
+ UINT64_C( 0xFFFFFF8000000000 ),
+ UINT64_C( 0xFFFFFFC000000000 ),
+ UINT64_C( 0xFFFFFFE000000000 ),
+ UINT64_C( 0xFFFFFFF000000000 ),
+ UINT64_C( 0xFFFFFFF800000000 ),
+ UINT64_C( 0xFFFFFFFC00000000 ),
+ UINT64_C( 0xFFFFFFFE00000000 ),
+ UINT64_C( 0xFFFFFFFF00000000 ),
+ UINT64_C( 0xFFFFFFFF80000000 ),
+ UINT64_C( 0xFFFFFFFFC0000000 ),
+ UINT64_C( 0xFFFFFFFFE0000000 ),
+ UINT64_C( 0xFFFFFFFFF0000000 ),
+ UINT64_C( 0xFFFFFFFFF8000000 ),
+ UINT64_C( 0xFFFFFFFFFC000000 ),
+ UINT64_C( 0xFFFFFFFFFE000000 ),
+ UINT64_C( 0xFFFFFFFFFF000000 ),
+ UINT64_C( 0xFFFFFFFFFF800000 ),
+ UINT64_C( 0xFFFFFFFFFFC00000 ),
+ UINT64_C( 0xFFFFFFFFFFE00000 ),
+ UINT64_C( 0xFFFFFFFFFFF00000 ),
+ UINT64_C( 0xFFFFFFFFFFF80000 ),
+ UINT64_C( 0xFFFFFFFFFFFC0000 ),
+ UINT64_C( 0xFFFFFFFFFFFE0000 ),
+ UINT64_C( 0xFFFFFFFFFFFF0000 ),
+ UINT64_C( 0xFFFFFFFFFFFF8000 ),
+ UINT64_C( 0xFFFFFFFFFFFFC000 ),
+ UINT64_C( 0xFFFFFFFFFFFFE000 ),
+ UINT64_C( 0xFFFFFFFFFFFFF000 ),
+ UINT64_C( 0xFFFFFFFFFFFFF800 ),
+ UINT64_C( 0xFFFFFFFFFFFFFC00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFE00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFF00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFF80 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFC0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFE0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFF0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFF8 )
+};
+
+static int_fast64_t i64RandomPInf( void )
+{
+ int weightMaskNum;
+ union ui64_i64 uZ;
+
+ weightMaskNum = randomN_ui8( i64NumPInfWeightMasks );
+ uZ.ui =
+ (random_ui64() & i64PInfWeightMasks[weightMaskNum])
+ + i64PInfWeightOffsets[weightMaskNum];
+ return uZ.i;
+
+}
+
+static struct sequence sequenceA;
+static int subcase;
+
+int_fast64_t genCases_i64_a;
+
+void genCases_i64_a_init( void )
+{
+
+ sequenceA.term2Num = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.done = false;
+ subcase = 0;
+ genCases_total = (genCases_level == 1) ? 3 * i64NumP1 : 2 * i64NumP2;
+ genCases_done = false;
+
+}
+
+void genCases_i64_a_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ genCases_i64_a = i64RandomP3();
+ break;
+ case 1:
+ genCases_i64_a = i64RandomPInf();
+ break;
+ case 2:
+ genCases_i64_a = i64NextP1( &sequenceA );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_i64_a = i64RandomP3();
+ break;
+ case 2:
+ genCases_i64_a = i64RandomPInf();
+ break;
+ case 3:
+ subcase = -1;
+ case 1:
+ genCases_i64_a = i64NextP2( &sequenceA );
+ genCases_done = sequenceA.done;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
diff --git a/source/genCases_ui32.c b/source/genCases_ui32.c
new file mode 100644
index 0000000..3b890cb
--- /dev/null
+++ b/source/genCases_ui32.c
@@ -0,0 +1,320 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "random.h"
+#include "genCases.h"
+
+struct sequence {
+ int term1Num, term2Num;
+ bool done;
+};
+
+enum { ui32NumP1 = 124 };
+static const uint32_t ui32P1[ui32NumP1] = {
+ 0x00000000,
+ 0x00000001,
+ 0x00000002,
+ 0x00000004,
+ 0x00000008,
+ 0x00000010,
+ 0x00000020,
+ 0x00000040,
+ 0x00000080,
+ 0x00000100,
+ 0x00000200,
+ 0x00000400,
+ 0x00000800,
+ 0x00001000,
+ 0x00002000,
+ 0x00004000,
+ 0x00008000,
+ 0x00010000,
+ 0x00020000,
+ 0x00040000,
+ 0x00080000,
+ 0x00100000,
+ 0x00200000,
+ 0x00400000,
+ 0x00800000,
+ 0x01000000,
+ 0x02000000,
+ 0x04000000,
+ 0x08000000,
+ 0x10000000,
+ 0x20000000,
+ 0x40000000,
+ 0x80000000,
+ 0xC0000000,
+ 0xE0000000,
+ 0xF0000000,
+ 0xF8000000,
+ 0xFC000000,
+ 0xFE000000,
+ 0xFF000000,
+ 0xFF800000,
+ 0xFFC00000,
+ 0xFFE00000,
+ 0xFFF00000,
+ 0xFFF80000,
+ 0xFFFC0000,
+ 0xFFFE0000,
+ 0xFFFF0000,
+ 0xFFFF8000,
+ 0xFFFFC000,
+ 0xFFFFE000,
+ 0xFFFFF000,
+ 0xFFFFF800,
+ 0xFFFFFC00,
+ 0xFFFFFE00,
+ 0xFFFFFF00,
+ 0xFFFFFF80,
+ 0xFFFFFFC0,
+ 0xFFFFFFE0,
+ 0xFFFFFFF0,
+ 0xFFFFFFF8,
+ 0xFFFFFFFC,
+ 0xFFFFFFFE,
+ 0xFFFFFFFF,
+ 0xFFFFFFFD,
+ 0xFFFFFFFB,
+ 0xFFFFFFF7,
+ 0xFFFFFFEF,
+ 0xFFFFFFDF,
+ 0xFFFFFFBF,
+ 0xFFFFFF7F,
+ 0xFFFFFEFF,
+ 0xFFFFFDFF,
+ 0xFFFFFBFF,
+ 0xFFFFF7FF,
+ 0xFFFFEFFF,
+ 0xFFFFDFFF,
+ 0xFFFFBFFF,
+ 0xFFFF7FFF,
+ 0xFFFEFFFF,
+ 0xFFFDFFFF,
+ 0xFFFBFFFF,
+ 0xFFF7FFFF,
+ 0xFFEFFFFF,
+ 0xFFDFFFFF,
+ 0xFFBFFFFF,
+ 0xFF7FFFFF,
+ 0xFEFFFFFF,
+ 0xFDFFFFFF,
+ 0xFBFFFFFF,
+ 0xF7FFFFFF,
+ 0xEFFFFFFF,
+ 0xDFFFFFFF,
+ 0xBFFFFFFF,
+ 0x7FFFFFFF,
+ 0x3FFFFFFF,
+ 0x1FFFFFFF,
+ 0x0FFFFFFF,
+ 0x07FFFFFF,
+ 0x03FFFFFF,
+ 0x01FFFFFF,
+ 0x00FFFFFF,
+ 0x007FFFFF,
+ 0x003FFFFF,
+ 0x001FFFFF,
+ 0x000FFFFF,
+ 0x0007FFFF,
+ 0x0003FFFF,
+ 0x0001FFFF,
+ 0x0000FFFF,
+ 0x00007FFF,
+ 0x00003FFF,
+ 0x00001FFF,
+ 0x00000FFF,
+ 0x000007FF,
+ 0x000003FF,
+ 0x000001FF,
+ 0x000000FF,
+ 0x0000007F,
+ 0x0000003F,
+ 0x0000001F,
+ 0x0000000F,
+ 0x00000007,
+ 0x00000003
+};
+
+static uint_fast32_t ui32NextP1( struct sequence *sequencePtr )
+{
+ int termNum;
+ uint_fast32_t z;
+
+ termNum = sequencePtr->term1Num;
+ z = ui32P1[termNum];
+ ++termNum;
+ if ( ui32NumP1 <= termNum ) {
+ termNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->term1Num = termNum;
+ return z;
+
+}
+
+static const uint_fast32_t ui32NumP2 = (ui32NumP1 * ui32NumP1 + ui32NumP1) / 2;
+
+static uint_fast32_t ui32NextP2( struct sequence *sequencePtr )
+{
+ int term1Num, term2Num;
+ uint_fast32_t z;
+
+ term2Num = sequencePtr->term2Num;
+ term1Num = sequencePtr->term1Num;
+ z = ui32P1[term1Num] + ui32P1[term2Num];
+ ++term2Num;
+ if ( ui32NumP1 <= term2Num ) {
+ ++term1Num;
+ if ( ui32NumP1 <= term1Num ) {
+ term1Num = 0;
+ sequencePtr->done = true;
+ }
+ term2Num = term1Num;
+ sequencePtr->term1Num = term1Num;
+ }
+ sequencePtr->term2Num = term2Num;
+ return z;
+
+}
+
+static uint_fast32_t ui32RandomP3( void )
+{
+
+ return
+ ui32P1[randomN_ui8( ui32NumP1 )] + ui32P1[randomN_ui8( ui32NumP1 )]
+ + ui32P1[randomN_ui8( ui32NumP1 )];
+
+}
+
+enum { ui32NumPInfWeightMasks = 29 };
+static const uint32_t ui32PInfWeightMasks[ui32NumPInfWeightMasks] = {
+ 0xFFFFFFFF,
+ 0x7FFFFFFF,
+ 0x3FFFFFFF,
+ 0x1FFFFFFF,
+ 0x0FFFFFFF,
+ 0x07FFFFFF,
+ 0x03FFFFFF,
+ 0x01FFFFFF,
+ 0x00FFFFFF,
+ 0x007FFFFF,
+ 0x003FFFFF,
+ 0x001FFFFF,
+ 0x000FFFFF,
+ 0x0007FFFF,
+ 0x0003FFFF,
+ 0x0001FFFF,
+ 0x0000FFFF,
+ 0x00007FFF,
+ 0x00003FFF,
+ 0x00001FFF,
+ 0x00000FFF,
+ 0x000007FF,
+ 0x000003FF,
+ 0x000001FF,
+ 0x000000FF,
+ 0x0000007F,
+ 0x0000003F,
+ 0x0000001F,
+ 0x0000000F
+};
+
+static uint_fast32_t ui32RandomPInf( void )
+{
+ int weightMaskNum;
+
+ weightMaskNum = randomN_ui8( ui32NumPInfWeightMasks );
+ return random_ui32() & ui32PInfWeightMasks[weightMaskNum];
+
+}
+
+static struct sequence sequenceA;
+static int subcase;
+
+uint_fast32_t genCases_ui32_a;
+
+void genCases_ui32_a_init( void )
+{
+
+ sequenceA.term1Num = 0;
+ sequenceA.term2Num = 0;
+ sequenceA.done = false;
+ subcase = 0;
+ genCases_total = (genCases_level == 1) ? 3 * ui32NumP1 : 2 * ui32NumP2;
+ genCases_done = false;
+
+}
+
+void genCases_ui32_a_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ genCases_ui32_a = ui32RandomP3();
+ break;
+ case 1:
+ genCases_ui32_a = ui32RandomPInf();
+ break;
+ case 2:
+ genCases_ui32_a = ui32NextP1( &sequenceA );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_ui32_a = ui32RandomP3();
+ break;
+ case 2:
+ genCases_ui32_a = ui32RandomPInf();
+ break;
+ case 3:
+ subcase = -1;
+ case 1:
+ genCases_ui32_a = ui32NextP2( &sequenceA );
+ genCases_done = sequenceA.done;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
diff --git a/source/genCases_ui64.c b/source/genCases_ui64.c
new file mode 100644
index 0000000..51dc428
--- /dev/null
+++ b/source/genCases_ui64.c
@@ -0,0 +1,480 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "random.h"
+#include "genCases.h"
+
+struct sequence {
+ int term1Num, term2Num;
+ bool done;
+};
+
+enum { ui64NumP1 = 252 };
+static const uint64_t ui64P1[ui64NumP1] = {
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x0000000000000001 ),
+ UINT64_C( 0x0000000000000002 ),
+ UINT64_C( 0x0000000000000004 ),
+ UINT64_C( 0x0000000000000008 ),
+ UINT64_C( 0x0000000000000010 ),
+ UINT64_C( 0x0000000000000020 ),
+ UINT64_C( 0x0000000000000040 ),
+ UINT64_C( 0x0000000000000080 ),
+ UINT64_C( 0x0000000000000100 ),
+ UINT64_C( 0x0000000000000200 ),
+ UINT64_C( 0x0000000000000400 ),
+ UINT64_C( 0x0000000000000800 ),
+ UINT64_C( 0x0000000000001000 ),
+ UINT64_C( 0x0000000000002000 ),
+ UINT64_C( 0x0000000000004000 ),
+ UINT64_C( 0x0000000000008000 ),
+ UINT64_C( 0x0000000000010000 ),
+ UINT64_C( 0x0000000000020000 ),
+ UINT64_C( 0x0000000000040000 ),
+ UINT64_C( 0x0000000000080000 ),
+ UINT64_C( 0x0000000000100000 ),
+ UINT64_C( 0x0000000000200000 ),
+ UINT64_C( 0x0000000000400000 ),
+ UINT64_C( 0x0000000000800000 ),
+ UINT64_C( 0x0000000001000000 ),
+ UINT64_C( 0x0000000002000000 ),
+ UINT64_C( 0x0000000004000000 ),
+ UINT64_C( 0x0000000008000000 ),
+ UINT64_C( 0x0000000010000000 ),
+ UINT64_C( 0x0000000020000000 ),
+ UINT64_C( 0x0000000040000000 ),
+ UINT64_C( 0x0000000080000000 ),
+ UINT64_C( 0x0000000100000000 ),
+ UINT64_C( 0x0000000200000000 ),
+ UINT64_C( 0x0000000400000000 ),
+ UINT64_C( 0x0000000800000000 ),
+ UINT64_C( 0x0000001000000000 ),
+ UINT64_C( 0x0000002000000000 ),
+ UINT64_C( 0x0000004000000000 ),
+ UINT64_C( 0x0000008000000000 ),
+ UINT64_C( 0x0000010000000000 ),
+ UINT64_C( 0x0000020000000000 ),
+ UINT64_C( 0x0000040000000000 ),
+ UINT64_C( 0x0000080000000000 ),
+ UINT64_C( 0x0000100000000000 ),
+ UINT64_C( 0x0000200000000000 ),
+ UINT64_C( 0x0000400000000000 ),
+ UINT64_C( 0x0000800000000000 ),
+ UINT64_C( 0x0001000000000000 ),
+ UINT64_C( 0x0002000000000000 ),
+ UINT64_C( 0x0004000000000000 ),
+ UINT64_C( 0x0008000000000000 ),
+ UINT64_C( 0x0010000000000000 ),
+ UINT64_C( 0x0020000000000000 ),
+ UINT64_C( 0x0040000000000000 ),
+ UINT64_C( 0x0080000000000000 ),
+ UINT64_C( 0x0100000000000000 ),
+ UINT64_C( 0x0200000000000000 ),
+ UINT64_C( 0x0400000000000000 ),
+ UINT64_C( 0x0800000000000000 ),
+ UINT64_C( 0x1000000000000000 ),
+ UINT64_C( 0x2000000000000000 ),
+ UINT64_C( 0x4000000000000000 ),
+ UINT64_C( 0x8000000000000000 ),
+ UINT64_C( 0xC000000000000000 ),
+ UINT64_C( 0xE000000000000000 ),
+ UINT64_C( 0xF000000000000000 ),
+ UINT64_C( 0xF800000000000000 ),
+ UINT64_C( 0xFC00000000000000 ),
+ UINT64_C( 0xFE00000000000000 ),
+ UINT64_C( 0xFF00000000000000 ),
+ UINT64_C( 0xFF80000000000000 ),
+ UINT64_C( 0xFFC0000000000000 ),
+ UINT64_C( 0xFFE0000000000000 ),
+ UINT64_C( 0xFFF0000000000000 ),
+ UINT64_C( 0xFFF8000000000000 ),
+ UINT64_C( 0xFFFC000000000000 ),
+ UINT64_C( 0xFFFE000000000000 ),
+ UINT64_C( 0xFFFF000000000000 ),
+ UINT64_C( 0xFFFF800000000000 ),
+ UINT64_C( 0xFFFFC00000000000 ),
+ UINT64_C( 0xFFFFE00000000000 ),
+ UINT64_C( 0xFFFFF00000000000 ),
+ UINT64_C( 0xFFFFF80000000000 ),
+ UINT64_C( 0xFFFFFC0000000000 ),
+ UINT64_C( 0xFFFFFE0000000000 ),
+ UINT64_C( 0xFFFFFF0000000000 ),
+ UINT64_C( 0xFFFFFF8000000000 ),
+ UINT64_C( 0xFFFFFFC000000000 ),
+ UINT64_C( 0xFFFFFFE000000000 ),
+ UINT64_C( 0xFFFFFFF000000000 ),
+ UINT64_C( 0xFFFFFFF800000000 ),
+ UINT64_C( 0xFFFFFFFC00000000 ),
+ UINT64_C( 0xFFFFFFFE00000000 ),
+ UINT64_C( 0xFFFFFFFF00000000 ),
+ UINT64_C( 0xFFFFFFFF80000000 ),
+ UINT64_C( 0xFFFFFFFFC0000000 ),
+ UINT64_C( 0xFFFFFFFFE0000000 ),
+ UINT64_C( 0xFFFFFFFFF0000000 ),
+ UINT64_C( 0xFFFFFFFFF8000000 ),
+ UINT64_C( 0xFFFFFFFFFC000000 ),
+ UINT64_C( 0xFFFFFFFFFE000000 ),
+ UINT64_C( 0xFFFFFFFFFF000000 ),
+ UINT64_C( 0xFFFFFFFFFF800000 ),
+ UINT64_C( 0xFFFFFFFFFFC00000 ),
+ UINT64_C( 0xFFFFFFFFFFE00000 ),
+ UINT64_C( 0xFFFFFFFFFFF00000 ),
+ UINT64_C( 0xFFFFFFFFFFF80000 ),
+ UINT64_C( 0xFFFFFFFFFFFC0000 ),
+ UINT64_C( 0xFFFFFFFFFFFE0000 ),
+ UINT64_C( 0xFFFFFFFFFFFF0000 ),
+ UINT64_C( 0xFFFFFFFFFFFF8000 ),
+ UINT64_C( 0xFFFFFFFFFFFFC000 ),
+ UINT64_C( 0xFFFFFFFFFFFFE000 ),
+ UINT64_C( 0xFFFFFFFFFFFFF000 ),
+ UINT64_C( 0xFFFFFFFFFFFFF800 ),
+ UINT64_C( 0xFFFFFFFFFFFFFC00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFE00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFF00 ),
+ UINT64_C( 0xFFFFFFFFFFFFFF80 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFC0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFE0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFF0 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFF8 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFC ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFE ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFF ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFD ),
+ UINT64_C( 0xFFFFFFFFFFFFFFFB ),
+ UINT64_C( 0xFFFFFFFFFFFFFFF7 ),
+ UINT64_C( 0xFFFFFFFFFFFFFFEF ),
+ UINT64_C( 0xFFFFFFFFFFFFFFDF ),
+ UINT64_C( 0xFFFFFFFFFFFFFFBF ),
+ UINT64_C( 0xFFFFFFFFFFFFFF7F ),
+ UINT64_C( 0xFFFFFFFFFFFFFEFF ),
+ UINT64_C( 0xFFFFFFFFFFFFFDFF ),
+ UINT64_C( 0xFFFFFFFFFFFFFBFF ),
+ UINT64_C( 0xFFFFFFFFFFFFF7FF ),
+ UINT64_C( 0xFFFFFFFFFFFFEFFF ),
+ UINT64_C( 0xFFFFFFFFFFFFDFFF ),
+ UINT64_C( 0xFFFFFFFFFFFFBFFF ),
+ UINT64_C( 0xFFFFFFFFFFFF7FFF ),
+ UINT64_C( 0xFFFFFFFFFFFEFFFF ),
+ UINT64_C( 0xFFFFFFFFFFFDFFFF ),
+ UINT64_C( 0xFFFFFFFFFFFBFFFF ),
+ UINT64_C( 0xFFFFFFFFFFF7FFFF ),
+ UINT64_C( 0xFFFFFFFFFFEFFFFF ),
+ UINT64_C( 0xFFFFFFFFFFDFFFFF ),
+ UINT64_C( 0xFFFFFFFFFFBFFFFF ),
+ UINT64_C( 0xFFFFFFFFFF7FFFFF ),
+ UINT64_C( 0xFFFFFFFFFEFFFFFF ),
+ UINT64_C( 0xFFFFFFFFFDFFFFFF ),
+ UINT64_C( 0xFFFFFFFFFBFFFFFF ),
+ UINT64_C( 0xFFFFFFFFF7FFFFFF ),
+ UINT64_C( 0xFFFFFFFFEFFFFFFF ),
+ UINT64_C( 0xFFFFFFFFDFFFFFFF ),
+ UINT64_C( 0xFFFFFFFFBFFFFFFF ),
+ UINT64_C( 0xFFFFFFFF7FFFFFFF ),
+ UINT64_C( 0xFFFFFFFEFFFFFFFF ),
+ UINT64_C( 0xFFFFFFFDFFFFFFFF ),
+ UINT64_C( 0xFFFFFFFBFFFFFFFF ),
+ UINT64_C( 0xFFFFFFF7FFFFFFFF ),
+ UINT64_C( 0xFFFFFFEFFFFFFFFF ),
+ UINT64_C( 0xFFFFFFDFFFFFFFFF ),
+ UINT64_C( 0xFFFFFFBFFFFFFFFF ),
+ UINT64_C( 0xFFFFFF7FFFFFFFFF ),
+ UINT64_C( 0xFFFFFEFFFFFFFFFF ),
+ UINT64_C( 0xFFFFFDFFFFFFFFFF ),
+ UINT64_C( 0xFFFFFBFFFFFFFFFF ),
+ UINT64_C( 0xFFFFF7FFFFFFFFFF ),
+ UINT64_C( 0xFFFFEFFFFFFFFFFF ),
+ UINT64_C( 0xFFFFDFFFFFFFFFFF ),
+ UINT64_C( 0xFFFFBFFFFFFFFFFF ),
+ UINT64_C( 0xFFFF7FFFFFFFFFFF ),
+ UINT64_C( 0xFFFEFFFFFFFFFFFF ),
+ UINT64_C( 0xFFFDFFFFFFFFFFFF ),
+ UINT64_C( 0xFFFBFFFFFFFFFFFF ),
+ UINT64_C( 0xFFF7FFFFFFFFFFFF ),
+ UINT64_C( 0xFFEFFFFFFFFFFFFF ),
+ UINT64_C( 0xFFDFFFFFFFFFFFFF ),
+ UINT64_C( 0xFFBFFFFFFFFFFFFF ),
+ UINT64_C( 0xFF7FFFFFFFFFFFFF ),
+ UINT64_C( 0xFEFFFFFFFFFFFFFF ),
+ UINT64_C( 0xFDFFFFFFFFFFFFFF ),
+ UINT64_C( 0xFBFFFFFFFFFFFFFF ),
+ UINT64_C( 0xF7FFFFFFFFFFFFFF ),
+ UINT64_C( 0xEFFFFFFFFFFFFFFF ),
+ UINT64_C( 0xDFFFFFFFFFFFFFFF ),
+ UINT64_C( 0xBFFFFFFFFFFFFFFF ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x3FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x1FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x0FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x07FFFFFFFFFFFFFF ),
+ UINT64_C( 0x03FFFFFFFFFFFFFF ),
+ UINT64_C( 0x01FFFFFFFFFFFFFF ),
+ UINT64_C( 0x00FFFFFFFFFFFFFF ),
+ UINT64_C( 0x007FFFFFFFFFFFFF ),
+ UINT64_C( 0x003FFFFFFFFFFFFF ),
+ UINT64_C( 0x001FFFFFFFFFFFFF ),
+ UINT64_C( 0x000FFFFFFFFFFFFF ),
+ UINT64_C( 0x0007FFFFFFFFFFFF ),
+ UINT64_C( 0x0003FFFFFFFFFFFF ),
+ UINT64_C( 0x0001FFFFFFFFFFFF ),
+ UINT64_C( 0x0000FFFFFFFFFFFF ),
+ UINT64_C( 0x00007FFFFFFFFFFF ),
+ UINT64_C( 0x00003FFFFFFFFFFF ),
+ UINT64_C( 0x00001FFFFFFFFFFF ),
+ UINT64_C( 0x00000FFFFFFFFFFF ),
+ UINT64_C( 0x000007FFFFFFFFFF ),
+ UINT64_C( 0x000003FFFFFFFFFF ),
+ UINT64_C( 0x000001FFFFFFFFFF ),
+ UINT64_C( 0x000000FFFFFFFFFF ),
+ UINT64_C( 0x0000007FFFFFFFFF ),
+ UINT64_C( 0x0000003FFFFFFFFF ),
+ UINT64_C( 0x0000001FFFFFFFFF ),
+ UINT64_C( 0x0000000FFFFFFFFF ),
+ UINT64_C( 0x00000007FFFFFFFF ),
+ UINT64_C( 0x00000003FFFFFFFF ),
+ UINT64_C( 0x00000001FFFFFFFF ),
+ UINT64_C( 0x00000000FFFFFFFF ),
+ UINT64_C( 0x000000007FFFFFFF ),
+ UINT64_C( 0x000000003FFFFFFF ),
+ UINT64_C( 0x000000001FFFFFFF ),
+ UINT64_C( 0x000000000FFFFFFF ),
+ UINT64_C( 0x0000000007FFFFFF ),
+ UINT64_C( 0x0000000003FFFFFF ),
+ UINT64_C( 0x0000000001FFFFFF ),
+ UINT64_C( 0x0000000000FFFFFF ),
+ UINT64_C( 0x00000000007FFFFF ),
+ UINT64_C( 0x00000000003FFFFF ),
+ UINT64_C( 0x00000000001FFFFF ),
+ UINT64_C( 0x00000000000FFFFF ),
+ UINT64_C( 0x000000000007FFFF ),
+ UINT64_C( 0x000000000003FFFF ),
+ UINT64_C( 0x000000000001FFFF ),
+ UINT64_C( 0x000000000000FFFF ),
+ UINT64_C( 0x0000000000007FFF ),
+ UINT64_C( 0x0000000000003FFF ),
+ UINT64_C( 0x0000000000001FFF ),
+ UINT64_C( 0x0000000000000FFF ),
+ UINT64_C( 0x00000000000007FF ),
+ UINT64_C( 0x00000000000003FF ),
+ UINT64_C( 0x00000000000001FF ),
+ UINT64_C( 0x00000000000000FF ),
+ UINT64_C( 0x000000000000007F ),
+ UINT64_C( 0x000000000000003F ),
+ UINT64_C( 0x000000000000001F ),
+ UINT64_C( 0x000000000000000F ),
+ UINT64_C( 0x0000000000000007 ),
+ UINT64_C( 0x0000000000000003 )
+};
+
+static uint_fast64_t ui64NextP1( struct sequence *sequencePtr )
+{
+ int termNum;
+ uint_fast64_t z;
+
+ termNum = sequencePtr->term1Num;
+ z = ui64P1[termNum];
+ ++termNum;
+ if ( ui64NumP1 <= termNum ) {
+ termNum = 0;
+ sequencePtr->done = true;
+ }
+ sequencePtr->term1Num = termNum;
+ return z;
+
+}
+
+static const uint_fast64_t ui64NumP2 = (ui64NumP1 * ui64NumP1 + ui64NumP1) / 2;
+
+static uint_fast64_t ui64NextP2( struct sequence *sequencePtr )
+{
+ int term1Num, term2Num;
+ uint_fast64_t z;
+
+ term2Num = sequencePtr->term2Num;
+ term1Num = sequencePtr->term1Num;
+ z = ui64P1[term1Num] + ui64P1[term2Num];
+ ++term2Num;
+ if ( ui64NumP1 <= term2Num ) {
+ ++term1Num;
+ if ( ui64NumP1 <= term1Num ) {
+ term1Num = 0;
+ sequencePtr->done = true;
+ }
+ term2Num = term1Num;
+ sequencePtr->term1Num = term1Num;
+ }
+ sequencePtr->term2Num = term2Num;
+ return z;
+
+}
+
+static uint_fast64_t ui64RandomP3( void )
+{
+
+ return
+ ui64P1[randomN_ui8( ui64NumP1 )] + ui64P1[randomN_ui8( ui64NumP1 )]
+ + ui64P1[randomN_ui8( ui64NumP1 )];
+
+}
+
+enum { ui64NumPInfWeightMasks = 61 };
+static const uint64_t ui64PInfWeightMasks[ui64NumPInfWeightMasks] = {
+ UINT64_C( 0xFFFFFFFFFFFFFFFF ),
+ UINT64_C( 0x7FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x3FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x1FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x0FFFFFFFFFFFFFFF ),
+ UINT64_C( 0x07FFFFFFFFFFFFFF ),
+ UINT64_C( 0x03FFFFFFFFFFFFFF ),
+ UINT64_C( 0x01FFFFFFFFFFFFFF ),
+ UINT64_C( 0x00FFFFFFFFFFFFFF ),
+ UINT64_C( 0x007FFFFFFFFFFFFF ),
+ UINT64_C( 0x003FFFFFFFFFFFFF ),
+ UINT64_C( 0x001FFFFFFFFFFFFF ),
+ UINT64_C( 0x000FFFFFFFFFFFFF ),
+ UINT64_C( 0x0007FFFFFFFFFFFF ),
+ UINT64_C( 0x0003FFFFFFFFFFFF ),
+ UINT64_C( 0x0001FFFFFFFFFFFF ),
+ UINT64_C( 0x0000FFFFFFFFFFFF ),
+ UINT64_C( 0x00007FFFFFFFFFFF ),
+ UINT64_C( 0x00003FFFFFFFFFFF ),
+ UINT64_C( 0x00001FFFFFFFFFFF ),
+ UINT64_C( 0x00000FFFFFFFFFFF ),
+ UINT64_C( 0x000007FFFFFFFFFF ),
+ UINT64_C( 0x000003FFFFFFFFFF ),
+ UINT64_C( 0x000001FFFFFFFFFF ),
+ UINT64_C( 0x000000FFFFFFFFFF ),
+ UINT64_C( 0x0000007FFFFFFFFF ),
+ UINT64_C( 0x0000003FFFFFFFFF ),
+ UINT64_C( 0x0000001FFFFFFFFF ),
+ UINT64_C( 0x0000000FFFFFFFFF ),
+ UINT64_C( 0x00000007FFFFFFFF ),
+ UINT64_C( 0x00000003FFFFFFFF ),
+ UINT64_C( 0x00000001FFFFFFFF ),
+ UINT64_C( 0x00000000FFFFFFFF ),
+ UINT64_C( 0x000000007FFFFFFF ),
+ UINT64_C( 0x000000003FFFFFFF ),
+ UINT64_C( 0x000000001FFFFFFF ),
+ UINT64_C( 0x000000000FFFFFFF ),
+ UINT64_C( 0x0000000007FFFFFF ),
+ UINT64_C( 0x0000000003FFFFFF ),
+ UINT64_C( 0x0000000001FFFFFF ),
+ UINT64_C( 0x0000000000FFFFFF ),
+ UINT64_C( 0x00000000007FFFFF ),
+ UINT64_C( 0x00000000003FFFFF ),
+ UINT64_C( 0x00000000001FFFFF ),
+ UINT64_C( 0x00000000000FFFFF ),
+ UINT64_C( 0x000000000007FFFF ),
+ UINT64_C( 0x000000000003FFFF ),
+ UINT64_C( 0x000000000001FFFF ),
+ UINT64_C( 0x000000000000FFFF ),
+ UINT64_C( 0x0000000000007FFF ),
+ UINT64_C( 0x0000000000003FFF ),
+ UINT64_C( 0x0000000000001FFF ),
+ UINT64_C( 0x0000000000000FFF ),
+ UINT64_C( 0x00000000000007FF ),
+ UINT64_C( 0x00000000000003FF ),
+ UINT64_C( 0x00000000000001FF ),
+ UINT64_C( 0x00000000000000FF ),
+ UINT64_C( 0x000000000000007F ),
+ UINT64_C( 0x000000000000003F ),
+ UINT64_C( 0x000000000000001F ),
+ UINT64_C( 0x000000000000000F )
+};
+
+static uint_fast64_t ui64RandomPInf( void )
+{
+ int weightMaskNum;
+
+ weightMaskNum = randomN_ui8( ui64NumPInfWeightMasks );
+ return random_ui64() & ui64PInfWeightMasks[weightMaskNum];
+
+}
+
+static struct sequence sequenceA;
+static int subcase;
+
+uint_fast64_t genCases_ui64_a;
+
+void genCases_ui64_a_init( void )
+{
+
+ sequenceA.term2Num = 0;
+ sequenceA.term1Num = 0;
+ sequenceA.done = false;
+ subcase = 0;
+ genCases_total = (genCases_level == 1) ? 3 * ui64NumP1 : 2 * ui64NumP2;
+ genCases_done = false;
+
+}
+
+void genCases_ui64_a_next( void )
+{
+
+ if ( genCases_level == 1 ) {
+ switch ( subcase ) {
+ case 0:
+ genCases_ui64_a = ui64RandomP3();
+ break;
+ case 1:
+ genCases_ui64_a = ui64RandomPInf();
+ break;
+ case 2:
+ genCases_ui64_a = ui64NextP1( &sequenceA );
+ genCases_done = sequenceA.done;
+ subcase = -1;
+ break;
+ }
+ } else {
+ switch ( subcase ) {
+ case 0:
+ genCases_ui64_a = ui64RandomP3();
+ break;
+ case 2:
+ genCases_ui64_a = ui64RandomPInf();
+ break;
+ case 3:
+ subcase = -1;
+ case 1:
+ genCases_ui64_a = ui64NextP2( &sequenceA );
+ genCases_done = sequenceA.done;
+ break;
+ }
+ }
+ ++subcase;
+
+}
+
diff --git a/source/genCases_writeTestsTotal.c b/source/genCases_writeTestsTotal.c
new file mode 100644
index 0000000..64eda6d
--- /dev/null
+++ b/source/genCases_writeTestsTotal.c
@@ -0,0 +1,60 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdio.h>
+#include "platform.h"
+#include "genCases.h"
+
+void genCases_writeTestsTotal( bool forever )
+{
+
+ if ( forever ) {
+ fputs( "Unbounded tests.\n", stderr );
+ } else {
+ if ( 2000000000 <= genCases_total ) {
+ fprintf(
+ stderr,
+ "\r%lu%09lu tests total.\n",
+ (long unsigned) (genCases_total / 1000000000),
+ (long unsigned) (genCases_total % 1000000000)
+ );
+ } else {
+ fprintf(
+ stderr, "\r%lu tests total.\n", (long unsigned) genCases_total
+ );
+ }
+ }
+
+}
+
diff --git a/source/genLoops.c b/source/genLoops.c
new file mode 100644
index 0000000..893c344
--- /dev/null
+++ b/source/genLoops.c
@@ -0,0 +1,2224 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "uint128.h"
+#include "fail.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "writeHex.h"
+#include "genLoops.h"
+
+volatile bool genLoops_stop = false;
+
+bool genLoops_forever;
+bool genLoops_givenCount;
+uint_fast64_t genLoops_count;
+uint_fast8_t *genLoops_trueFlagsPtr;
+
+union ui32_f32 { uint32_t ui; float32_t f; };
+union ui64_f64 { uint64_t ui; float64_t f; };
+
+static void checkEnoughCases( void )
+{
+
+ if ( genLoops_givenCount && (genLoops_count < genCases_total) ) {
+ if ( 2000000000 <= genCases_total ) {
+ fail(
+ "Too few cases; minimum is %lu%09lu",
+ (unsigned long) (genCases_total / 1000000000),
+ (unsigned long) (genCases_total % 1000000000)
+ );
+ } else {
+ fail(
+ "Too few cases; minimum is %lu", (unsigned long) genCases_total
+ );
+ }
+ }
+
+}
+
+static void writeGenOutput_flags( uint_fast8_t flags )
+{
+ uint_fast8_t commonFlags;
+
+ commonFlags = 0;
+ if ( flags & softfloat_flag_invalid ) commonFlags |= 0x10;
+ if ( flags & softfloat_flag_infinite ) commonFlags |= 0x08;
+ if ( flags & softfloat_flag_overflow ) commonFlags |= 0x04;
+ if ( flags & softfloat_flag_underflow ) commonFlags |= 0x02;
+ if ( flags & softfloat_flag_inexact ) commonFlags |= 0x01;
+ writeHex_ui8( commonFlags, '\n' );
+
+}
+
+static bool writeGenOutputs_bool( bool z, uint_fast8_t flags )
+{
+
+ writeHex_bool( z, ' ' );
+ writeGenOutput_flags( flags );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) return true;
+ }
+ return false;
+
+}
+
+static bool writeGenOutputs_ui32( uint_fast32_t z, uint_fast8_t flags )
+{
+
+ writeHex_ui32( z, ' ' );
+ writeGenOutput_flags( flags );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) return true;
+ }
+ return false;
+
+}
+
+static bool writeGenOutputs_ui64( uint_fast64_t z, uint_fast8_t flags )
+{
+
+ writeHex_ui64( z, ' ' );
+ writeGenOutput_flags( flags );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) return true;
+ }
+ return false;
+
+}
+
+#ifdef EXTFLOAT80
+
+static void writeHex_uiExtF80M( const extFloat80_t *aPtr, char sepChar )
+{
+ const struct extFloat80M *aSPtr;
+
+ aSPtr = (const struct extFloat80M *) aPtr;
+ writeHex_ui16( aSPtr->signExp, 0 );
+ writeHex_ui64( aSPtr->signif, sepChar );
+
+}
+
+static
+ bool writeGenOutputs_extF80M( const extFloat80_t *aPtr, uint_fast8_t flags )
+{
+
+ writeHex_uiExtF80M( aPtr, ' ' );
+ writeGenOutput_flags( flags );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) return true;
+ }
+ return false;
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void writeHex_uiF128M( const float128_t *aPtr, char sepChar )
+{
+ const struct uint128 *uiAPtr;
+
+ uiAPtr = (const struct uint128 *) aPtr;
+ writeHex_ui64( uiAPtr->v64, 0 );
+ writeHex_ui64( uiAPtr->v0, sepChar );
+
+}
+
+static bool writeGenOutputs_f128M( const float128_t *aPtr, uint_fast8_t flags )
+{
+
+ writeHex_uiF128M( aPtr, ' ' );
+ writeGenOutput_flags( flags );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) return true;
+ }
+ return false;
+
+}
+
+#endif
+
+void gen_a_ui32( void )
+{
+
+ genCases_ui32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui32_a_next();
+ writeHex_ui32( genCases_ui32_a, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_a_ui64( void )
+{
+
+ genCases_ui64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui64_a_next();
+ writeHex_ui64( genCases_ui64_a, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_a_i32( void )
+{
+
+ genCases_i32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i32_a_next();
+ writeHex_ui32( genCases_i32_a, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_a_i64( void )
+{
+
+ genCases_i64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i64_a_next();
+ writeHex_ui64( genCases_i64_a, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_a_f32( void )
+{
+ union ui32_f32 uA;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_ab_f32( void )
+{
+ union ui32_f32 u;
+
+ genCases_f32_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_ab_next();
+ u.f = genCases_f32_a;
+ writeHex_ui32( u.ui, ' ' );
+ u.f = genCases_f32_b;
+ writeHex_ui32( u.ui, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_abc_f32( void )
+{
+ union ui32_f32 u;
+
+ genCases_f32_abc_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_abc_next();
+ u.f = genCases_f32_a;
+ writeHex_ui32( u.ui, ' ' );
+ u.f = genCases_f32_b;
+ writeHex_ui32( u.ui, ' ' );
+ u.f = genCases_f32_c;
+ writeHex_ui32( u.ui, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_a_f64( void )
+{
+ union ui64_f64 uA;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_ab_f64( void )
+{
+ union ui64_f64 u;
+
+ genCases_f64_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_ab_next();
+ u.f = genCases_f64_a;
+ writeHex_ui64( u.ui, ' ' );
+ u.f = genCases_f64_b;
+ writeHex_ui64( u.ui, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_abc_f64( void )
+{
+ union ui64_f64 u;
+
+ genCases_f64_abc_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_abc_next();
+ u.f = genCases_f64_a;
+ writeHex_ui64( u.ui, ' ' );
+ u.f = genCases_f64_b;
+ writeHex_ui64( u.ui, ' ' );
+ u.f = genCases_f64_c;
+ writeHex_ui64( u.ui, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void gen_a_extF80( void )
+{
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_ab_extF80( void )
+{
+
+ genCases_extF80_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_ab_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ writeHex_uiExtF80M( &genCases_extF80_b, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_abc_extF80( void )
+{
+
+ genCases_extF80_abc_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_abc_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ writeHex_uiExtF80M( &genCases_extF80_b, ' ' );
+ writeHex_uiExtF80M( &genCases_extF80_c, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void gen_a_f128( void )
+{
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_ab_f128( void )
+{
+
+ genCases_f128_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_ab_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ writeHex_uiF128M( &genCases_f128_b, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+void gen_abc_f128( void )
+{
+
+ genCases_f128_abc_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_abc_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ writeHex_uiF128M( &genCases_f128_b, ' ' );
+ writeHex_uiF128M( &genCases_f128_c, '\n' );
+ if ( genLoops_givenCount ) {
+ --genLoops_count;
+ if ( ! genLoops_count ) break;
+ }
+ }
+
+}
+
+#endif
+
+void gen_a_ui32_z_f32( float32_t trueFunction( uint_fast32_t ) )
+{
+ union ui32_f32 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_ui32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui32_a_next();
+ writeHex_ui32( genCases_ui32_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_ui32_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_ui32_z_f64( float64_t trueFunction( uint_fast32_t ) )
+{
+ union ui64_f64 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_ui32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui32_a_next();
+ writeHex_ui32( genCases_ui32_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_ui32_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void gen_a_ui32_z_extF80( void trueFunction( uint_fast32_t, extFloat80_t * ) )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_ui32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui32_a_next();
+ writeHex_ui32( genCases_ui32_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_ui32_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void gen_a_ui32_z_f128( void trueFunction( uint_fast32_t, float128_t * ) )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_ui32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui32_a_next();
+ writeHex_ui32( genCases_ui32_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_ui32_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+void gen_a_ui64_z_f32( float32_t trueFunction( uint_fast64_t ) )
+{
+ union ui32_f32 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_ui64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui64_a_next();
+ writeHex_ui64( genCases_ui64_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_ui64_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_ui64_z_f64( float64_t trueFunction( uint_fast64_t ) )
+{
+ union ui64_f64 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_ui64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui64_a_next();
+ writeHex_ui64( genCases_ui64_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_ui64_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void gen_a_ui64_z_extF80( void trueFunction( uint_fast64_t, extFloat80_t * ) )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_ui64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui64_a_next();
+ writeHex_ui64( genCases_ui64_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_ui64_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void gen_a_ui64_z_f128( void trueFunction( uint_fast64_t, float128_t * ) )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_ui64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_ui64_a_next();
+ writeHex_ui64( genCases_ui64_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_ui64_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+void gen_a_i32_z_f32( float32_t trueFunction( int_fast32_t ) )
+{
+ union ui32_f32 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_i32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i32_a_next();
+ writeHex_ui32( genCases_i32_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_i32_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_i32_z_f64( float64_t trueFunction( int_fast32_t ) )
+{
+ union ui64_f64 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_i32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i32_a_next();
+ writeHex_ui32( genCases_i32_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_i32_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void gen_a_i32_z_extF80( void trueFunction( int_fast32_t, extFloat80_t * ) )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_i32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i32_a_next();
+ writeHex_ui32( genCases_i32_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_i32_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void gen_a_i32_z_f128( void trueFunction( int_fast32_t, float128_t * ) )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_i32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i32_a_next();
+ writeHex_ui32( genCases_i32_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_i32_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+void gen_a_i64_z_f32( float32_t trueFunction( int_fast64_t ) )
+{
+ union ui32_f32 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_i64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i64_a_next();
+ writeHex_ui64( genCases_i64_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_i64_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_i64_z_f64( float64_t trueFunction( int_fast64_t ) )
+{
+ union ui64_f64 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_i64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i64_a_next();
+ writeHex_ui64( genCases_i64_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_i64_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void gen_a_i64_z_extF80( void trueFunction( int_fast64_t, extFloat80_t * ) )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_i64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i64_a_next();
+ writeHex_ui64( genCases_i64_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_i64_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void gen_a_i64_z_f128( void trueFunction( int_fast64_t, float128_t * ) )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_i64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_i64_a_next();
+ writeHex_ui64( genCases_i64_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_i64_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+void
+ gen_a_f32_z_ui32_rx(
+ uint_fast32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui32_f32 uA;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f32_z_ui64_rx(
+ uint_fast64_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui32_f32 uA;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f32_z_i32_rx(
+ int_fast32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui32_f32 uA;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f32_z_i64_rx(
+ int_fast64_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui32_f32 uA;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f32_z_ui32_x(
+ uint_fast32_t trueFunction( float32_t, bool ), bool exact )
+{
+ union ui32_f32 uA;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f32_z_ui64_x(
+ uint_fast64_t trueFunction( float32_t, bool ), bool exact )
+{
+ union ui32_f32 uA;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f32_z_i32_x( int_fast32_t trueFunction( float32_t, bool ), bool exact )
+{
+ union ui32_f32 uA;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f32_z_i64_x( int_fast64_t trueFunction( float32_t, bool ), bool exact )
+{
+ union ui32_f32 uA;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_f32_z_f64( float64_t trueFunction( float32_t ) )
+{
+ union ui32_f32 uA;
+ union ui64_f64 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_f32_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void gen_a_f32_z_extF80( void trueFunction( float32_t, extFloat80_t * ) )
+{
+ union ui32_f32 uA;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_f32_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void gen_a_f32_z_f128( void trueFunction( float32_t, float128_t * ) )
+{
+ union ui32_f32 uA;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ uA.f = genCases_f32_a;
+ writeHex_ui32( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_f32_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+void gen_az_f32( float32_t trueFunction( float32_t ) )
+{
+ union ui32_f32 u;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ u.f = genCases_f32_a;
+ writeHex_ui32( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ u.f = trueFunction( genCases_f32_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( u.ui, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_az_f32_rx(
+ float32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui32_f32 u;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_a_next();
+ u.f = genCases_f32_a;
+ writeHex_ui32( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ u.f = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( u.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_abz_f32( float32_t trueFunction( float32_t, float32_t ) )
+{
+ union ui32_f32 u;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_ab_next();
+ u.f = genCases_f32_a;
+ writeHex_ui32( u.ui, ' ' );
+ u.f = genCases_f32_b;
+ writeHex_ui32( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ u.f = trueFunction( genCases_f32_a, genCases_f32_b );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( u.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_abcz_f32( float32_t trueFunction( float32_t, float32_t, float32_t ) )
+{
+ union ui32_f32 u;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_abc_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_abc_next();
+ u.f = genCases_f32_a;
+ writeHex_ui32( u.ui, ' ' );
+ u.f = genCases_f32_b;
+ writeHex_ui32( u.ui, ' ' );
+ u.f = genCases_f32_c;
+ writeHex_ui32( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ u.f = trueFunction( genCases_f32_a, genCases_f32_b, genCases_f32_c );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( u.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_ab_f32_z_bool( bool trueFunction( float32_t, float32_t ) )
+{
+ union ui32_f32 u;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f32_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f32_ab_next();
+ u.f = genCases_f32_a;
+ writeHex_ui32( u.ui, ' ' );
+ u.f = genCases_f32_b;
+ writeHex_ui32( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, genCases_f32_b );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_bool( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f64_z_ui32_rx(
+ uint_fast32_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui64_f64 uA;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f64_z_ui64_rx(
+ uint_fast64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui64_f64 uA;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f64_z_i32_rx(
+ int_fast32_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui64_f64 uA;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f64_z_i64_rx(
+ int_fast64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui64_f64 uA;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f64_z_ui32_x(
+ uint_fast32_t trueFunction( float64_t, bool ), bool exact )
+{
+ union ui64_f64 uA;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f64_z_ui64_x(
+ uint_fast64_t trueFunction( float64_t, bool ), bool exact )
+{
+ union ui64_f64 uA;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f64_z_i32_x( int_fast32_t trueFunction( float64_t, bool ), bool exact )
+{
+ union ui64_f64 uA;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f64_z_i64_x( int_fast64_t trueFunction( float64_t, bool ), bool exact )
+{
+ union ui64_f64 uA;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_f64_z_f32( float32_t trueFunction( float64_t ) )
+{
+ union ui64_f64 uA;
+ union ui32_f32 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( genCases_f64_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void gen_a_f64_z_extF80( void trueFunction( float64_t, extFloat80_t * ) )
+{
+ union ui64_f64 uA;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_f64_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void gen_a_f64_z_f128( void trueFunction( float64_t, float128_t * ) )
+{
+ union ui64_f64 uA;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ uA.f = genCases_f64_a;
+ writeHex_ui64( uA.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_f64_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+void gen_az_f64( float64_t trueFunction( float64_t ) )
+{
+ union ui64_f64 u;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ u.f = genCases_f64_a;
+ writeHex_ui64( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ u.f = trueFunction( genCases_f64_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( u.ui, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_az_f64_rx(
+ float64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ union ui64_f64 u;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_a_next();
+ u.f = genCases_f64_a;
+ writeHex_ui64( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ u.f = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( u.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_abz_f64( float64_t trueFunction( float64_t, float64_t ) )
+{
+ union ui64_f64 u;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_ab_next();
+ u.f = genCases_f64_a;
+ writeHex_ui64( u.ui, ' ' );
+ u.f = genCases_f64_b;
+ writeHex_ui64( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ u.f = trueFunction( genCases_f64_a, genCases_f64_b );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( u.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_abcz_f64( float64_t trueFunction( float64_t, float64_t, float64_t ) )
+{
+ union ui64_f64 u;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_abc_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_abc_next();
+ u.f = genCases_f64_a;
+ writeHex_ui64( u.ui, ' ' );
+ u.f = genCases_f64_b;
+ writeHex_ui64( u.ui, ' ' );
+ u.f = genCases_f64_c;
+ writeHex_ui64( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ u.f = trueFunction( genCases_f64_a, genCases_f64_b, genCases_f64_c );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( u.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_ab_f64_z_bool( bool trueFunction( float64_t, float64_t ) )
+{
+ union ui64_f64 u;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f64_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f64_ab_next();
+ u.f = genCases_f64_a;
+ writeHex_ui64( u.ui, ' ' );
+ u.f = genCases_f64_b;
+ writeHex_ui64( u.ui, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, genCases_f64_b );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_bool( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void
+ gen_a_extF80_z_ui32_rx(
+ uint_fast32_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_extF80_z_ui64_rx(
+ uint_fast64_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_extF80_z_i32_rx(
+ int_fast32_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_extF80_z_i64_rx(
+ int_fast64_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_extF80_z_ui32_x(
+ uint_fast32_t trueFunction( const extFloat80_t *, bool ), bool exact )
+{
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_extF80_z_ui64_x(
+ uint_fast64_t trueFunction( const extFloat80_t *, bool ), bool exact )
+{
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_extF80_z_i32_x(
+ int_fast32_t trueFunction( const extFloat80_t *, bool ), bool exact )
+{
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_extF80_z_i64_x(
+ int_fast64_t trueFunction( const extFloat80_t *, bool ), bool exact )
+{
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_extF80_z_f32( float32_t trueFunction( const extFloat80_t * ) )
+{
+ union ui32_f32 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( &genCases_extF80_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_extF80_z_f64( float64_t trueFunction( const extFloat80_t * ) )
+{
+ union ui64_f64 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( &genCases_extF80_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef FLOAT128
+
+void
+ gen_a_extF80_z_f128( void trueFunction( const extFloat80_t *, float128_t * ) )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_extF80_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+void gen_az_extF80( void trueFunction( const extFloat80_t *, extFloat80_t * ) )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_extF80_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_az_extF80_rx(
+ void
+ trueFunction( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_a_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_extF80_a, roundingMode, exact, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_abz_extF80(
+ void
+ trueFunction(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * )
+ )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_ab_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ writeHex_uiExtF80M( &genCases_extF80_b, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_extF80_a, &genCases_extF80_b, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_abcz_extF80(
+ void
+ trueFunction(
+ const extFloat80_t *,
+ const extFloat80_t *,
+ const extFloat80_t *,
+ extFloat80_t *
+ )
+ )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_abc_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_abc_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ writeHex_uiExtF80M( &genCases_extF80_b, ' ' );
+ writeHex_uiExtF80M( &genCases_extF80_c, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction(
+ &genCases_extF80_a, &genCases_extF80_b, &genCases_extF80_c, &trueZ
+ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_ab_extF80_z_bool(
+ bool trueFunction( const extFloat80_t *, const extFloat80_t * ) )
+{
+ bool trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_extF80_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_extF80_ab_next();
+ writeHex_uiExtF80M( &genCases_extF80_a, ' ' );
+ writeHex_uiExtF80M( &genCases_extF80_b, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, &genCases_extF80_b );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_bool( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void
+ gen_a_f128_z_ui32_rx(
+ uint_fast32_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f128_z_ui64_rx(
+ uint_fast64_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f128_z_i32_rx(
+ int_fast32_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f128_z_i64_rx(
+ int_fast64_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f128_z_ui32_x(
+ uint_fast32_t trueFunction( const float128_t *, bool ), bool exact )
+{
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f128_z_ui64_x(
+ uint_fast64_t trueFunction( const float128_t *, bool ), bool exact )
+{
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f128_z_i32_x(
+ int_fast32_t trueFunction( const float128_t *, bool ), bool exact )
+{
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_a_f128_z_i64_x(
+ int_fast64_t trueFunction( const float128_t *, bool ), bool exact )
+{
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, exact );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_f128_z_f32( float32_t trueFunction( const float128_t * ) )
+{
+ union ui32_f32 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( &genCases_f128_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui32( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+void gen_a_f128_z_f64( float64_t trueFunction( const float128_t * ) )
+{
+ union ui64_f64 uTrueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ uTrueZ.f = trueFunction( &genCases_f128_a );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_ui64( uTrueZ.ui, trueFlags ) ) break;
+ }
+
+}
+
+#ifdef EXTFLOAT80
+
+void
+ gen_a_f128_z_extF80( void trueFunction( const float128_t *, extFloat80_t * ) )
+{
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_f128_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_extF80M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
+void gen_az_f128( void trueFunction( const float128_t *, float128_t * ) )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_f128_a, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_az_f128_rx(
+ void trueFunction( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_a_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_a_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_f128_a, roundingMode, exact, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_abz_f128(
+ void trueFunction( const float128_t *, const float128_t *, float128_t * )
+ )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_ab_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ writeHex_uiF128M( &genCases_f128_b, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_f128_a, &genCases_f128_b, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_abcz_f128(
+ void
+ trueFunction(
+ const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ )
+ )
+{
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_abc_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_abc_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ writeHex_uiF128M( &genCases_f128_b, ' ' );
+ writeHex_uiF128M( &genCases_f128_c, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueFunction(
+ &genCases_f128_a, &genCases_f128_b, &genCases_f128_c, &trueZ );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_f128M( &trueZ, trueFlags ) ) break;
+ }
+
+}
+
+void
+ gen_ab_f128_z_bool(
+ bool trueFunction( const float128_t *, const float128_t * ) )
+{
+ bool trueZ;
+ uint_fast8_t trueFlags;
+
+ genCases_f128_ab_init();
+ checkEnoughCases();
+ while ( ! genLoops_stop && (! genCases_done || genLoops_forever) ) {
+ genCases_f128_ab_next();
+ writeHex_uiF128M( &genCases_f128_a, ' ' );
+ writeHex_uiF128M( &genCases_f128_b, ' ' );
+ *genLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, &genCases_f128_b );
+ trueFlags = *genLoops_trueFlagsPtr;
+ if ( writeGenOutputs_bool( trueZ, trueFlags ) ) break;
+ }
+
+}
+
+#endif
+
diff --git a/source/genLoops.h b/source/genLoops.h
new file mode 100644
index 0000000..74ac42e
--- /dev/null
+++ b/source/genLoops.h
@@ -0,0 +1,277 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "softfloat.h"
+
+extern volatile bool genLoops_stop;
+
+extern bool genLoops_forever;
+extern bool genLoops_givenCount;
+extern uint_fast64_t genLoops_count;
+extern uint_fast8_t *genLoops_trueFlagsPtr;
+
+void gen_a_ui32( void );
+void gen_a_ui64( void );
+void gen_a_i32( void );
+void gen_a_i64( void );
+void gen_a_f32( void );
+void gen_ab_f32( void );
+void gen_abc_f32( void );
+void gen_a_f64( void );
+void gen_ab_f64( void );
+void gen_abc_f64( void );
+#ifdef EXTFLOAT80
+void gen_a_extF80( void );
+void gen_ab_extF80( void );
+void gen_abc_extF80( void );
+#endif
+#ifdef FLOAT128
+void gen_a_f128( void );
+void gen_ab_f128( void );
+void gen_abc_f128( void );
+#endif
+
+void gen_a_ui32_z_f32( float32_t ( uint_fast32_t ) );
+void gen_a_ui32_z_f64( float64_t ( uint_fast32_t ) );
+#ifdef EXTFLOAT80
+void gen_a_ui32_z_extF80( void ( uint_fast32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void gen_a_ui32_z_f128( void ( uint_fast32_t, float128_t * ) );
+#endif
+void gen_a_ui64_z_f32( float32_t ( uint_fast64_t ) );
+void gen_a_ui64_z_f64( float64_t ( uint_fast64_t ) );
+#ifdef EXTFLOAT80
+void gen_a_ui64_z_extF80( void ( uint_fast64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void gen_a_ui64_z_f128( void ( uint_fast64_t, float128_t * ) );
+#endif
+void gen_a_i32_z_f32( float32_t ( int_fast32_t ) );
+void gen_a_i32_z_f64( float64_t ( int_fast32_t ) );
+#ifdef EXTFLOAT80
+void gen_a_i32_z_extF80( void ( int_fast32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void gen_a_i32_z_f128( void ( int_fast32_t, float128_t * ) );
+#endif
+void gen_a_i64_z_f32( float32_t ( int_fast64_t ) );
+void gen_a_i64_z_f64( float64_t ( int_fast64_t ) );
+#ifdef EXTFLOAT80
+void gen_a_i64_z_extF80( void ( int_fast64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void gen_a_i64_z_f128( void ( int_fast64_t, float128_t * ) );
+#endif
+
+void
+ gen_a_f32_z_ui32_rx(
+ uint_fast32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ gen_a_f32_z_ui64_rx(
+ uint_fast64_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ gen_a_f32_z_i32_rx(
+ int_fast32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ gen_a_f32_z_i64_rx(
+ int_fast64_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void gen_a_f32_z_ui32_x( uint_fast32_t ( float32_t, bool ), bool );
+void gen_a_f32_z_ui64_x( uint_fast64_t ( float32_t, bool ), bool );
+void gen_a_f32_z_i32_x( int_fast32_t ( float32_t, bool ), bool );
+void gen_a_f32_z_i64_x( int_fast64_t ( float32_t, bool ), bool );
+void gen_a_f32_z_f64( float64_t ( float32_t ) );
+#ifdef EXTFLOAT80
+void gen_a_f32_z_extF80( void ( float32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void gen_a_f32_z_f128( void ( float32_t, float128_t * ) );
+#endif
+void gen_az_f32( float32_t ( float32_t ) );
+void
+ gen_az_f32_rx(
+ float32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void gen_abz_f32( float32_t ( float32_t, float32_t ) );
+void gen_abcz_f32( float32_t ( float32_t, float32_t, float32_t ) );
+void gen_ab_f32_z_bool( bool ( float32_t, float32_t ) );
+
+void
+ gen_a_f64_z_ui32_rx(
+ uint_fast32_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ gen_a_f64_z_ui64_rx(
+ uint_fast64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ gen_a_f64_z_i32_rx(
+ int_fast32_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ gen_a_f64_z_i64_rx(
+ int_fast64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void gen_a_f64_z_ui32_x( uint_fast32_t ( float64_t, bool ), bool );
+void gen_a_f64_z_ui64_x( uint_fast64_t ( float64_t, bool ), bool );
+void gen_a_f64_z_i32_x( int_fast32_t ( float64_t, bool ), bool );
+void gen_a_f64_z_i64_x( int_fast64_t ( float64_t, bool ), bool );
+void gen_a_f64_z_f32( float32_t ( float64_t ) );
+#ifdef EXTFLOAT80
+void gen_a_f64_z_extF80( void ( float64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void gen_a_f64_z_f128( void ( float64_t, float128_t * ) );
+#endif
+void gen_az_f64( float64_t ( float64_t ) );
+void
+ gen_az_f64_rx(
+ float64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void gen_abz_f64( float64_t ( float64_t, float64_t ) );
+void gen_abcz_f64( float64_t ( float64_t, float64_t, float64_t ) );
+void gen_ab_f64_z_bool( bool ( float64_t, float64_t ) );
+
+#ifdef EXTFLOAT80
+void
+ gen_a_extF80_z_ui32_rx(
+ uint_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_a_extF80_z_ui64_rx(
+ uint_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_a_extF80_z_i32_rx(
+ int_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_a_extF80_z_i64_rx(
+ int_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_a_extF80_z_ui32_x( uint_fast32_t ( const extFloat80_t *, bool ), bool );
+void
+ gen_a_extF80_z_ui64_x( uint_fast64_t ( const extFloat80_t *, bool ), bool );
+void gen_a_extF80_z_i32_x( int_fast32_t ( const extFloat80_t *, bool ), bool );
+void gen_a_extF80_z_i64_x( int_fast64_t ( const extFloat80_t *, bool ), bool );
+void gen_a_extF80_z_f32( float32_t ( const extFloat80_t * ) );
+void gen_a_extF80_z_f64( float64_t ( const extFloat80_t * ) );
+#ifdef FLOAT128
+void gen_a_extF80_z_f128( void ( const extFloat80_t *, float128_t * ) );
+#endif
+void gen_az_extF80( void ( const extFloat80_t *, extFloat80_t * ) );
+void
+ gen_az_extF80_rx(
+ void ( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_abz_extF80(
+ void ( const extFloat80_t *, const extFloat80_t *, extFloat80_t * ) );
+void
+ gen_abcz_extF80(
+ void
+ (
+ const extFloat80_t *,
+ const extFloat80_t *,
+ const extFloat80_t *,
+ extFloat80_t *
+ )
+ );
+void
+ gen_ab_extF80_z_bool( bool ( const extFloat80_t *, const extFloat80_t * ) );
+#endif
+
+#ifdef FLOAT128
+void
+ gen_a_f128_z_ui32_rx(
+ uint_fast32_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_a_f128_z_ui64_rx(
+ uint_fast64_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_a_f128_z_i32_rx(
+ int_fast32_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_a_f128_z_i64_rx(
+ int_fast64_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void gen_a_f128_z_ui32_x( uint_fast32_t ( const float128_t *, bool ), bool );
+void gen_a_f128_z_ui64_x( uint_fast64_t ( const float128_t *, bool ), bool );
+void gen_a_f128_z_i32_x( int_fast32_t ( const float128_t *, bool ), bool );
+void gen_a_f128_z_i64_x( int_fast64_t ( const float128_t *, bool ), bool );
+void gen_a_f128_z_f32( float32_t ( const float128_t * ) );
+void gen_a_f128_z_f64( float64_t ( const float128_t * ) );
+#ifdef EXTFLOAT80
+void gen_a_f128_z_extF80( void ( const float128_t *, extFloat80_t * ) );
+#endif
+void gen_az_f128( void ( const float128_t *, float128_t * ) );
+void
+ gen_az_f128_rx(
+ void ( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ uint_fast8_t,
+ bool
+ );
+void
+ gen_abz_f128( void ( const float128_t *, const float128_t *, float128_t * ) );
+void
+ gen_abcz_f128(
+ void
+ (
+ const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ )
+ );
+void gen_ab_f128_z_bool( bool ( const float128_t *, const float128_t * ) );
+#endif
+
diff --git a/source/random.c b/source/random.c
new file mode 100644
index 0000000..fbf3408
--- /dev/null
+++ b/source/random.c
@@ -0,0 +1,135 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdlib.h>
+#include "platform.h"
+#include "random.h"
+
+uint_fast8_t random_ui8( void )
+{
+
+ return rand()>>4 & 0xFF;
+
+}
+
+uint_fast16_t random_ui16( void )
+{
+
+ return (rand() & 0x0FF0)<<4 | (rand()>>4 & 0xFF);
+
+}
+
+uint_fast32_t random_ui32( void )
+{
+
+ return
+ (uint_fast32_t) (rand() & 0x0FF0)<<20
+ | (uint_fast32_t) (rand() & 0x0FF0)<<12
+ | (rand() & 0x0FF0)<<4
+ | (rand()>>4 & 0xFF);
+
+}
+
+uint_fast64_t random_ui64( void )
+{
+
+ return (uint_fast64_t) random_ui32()<<32 | random_ui32();
+
+}
+
+uint_fast8_t randomN_ui8( uint_fast8_t N )
+{
+ uint_fast8_t scale, z;
+
+ scale = 0;
+ while ( N < 0x80 ) {
+ ++scale;
+ N <<= 1;
+ }
+ do {
+ z = random_ui8();
+ } while ( N <= z );
+ return z>>scale;
+
+}
+
+uint_fast16_t randomN_ui16( uint_fast16_t N )
+{
+ uint_fast16_t scale, z;
+
+ scale = 0;
+ while ( N < 0x8000 ) {
+ ++scale;
+ N <<= 1;
+ }
+ do {
+ z = random_ui16();
+ } while ( N <= z );
+ return z>>scale;
+
+}
+
+uint_fast32_t randomN_ui32( uint_fast32_t N )
+{
+ uint_fast32_t scale, z;
+
+ scale = 0;
+ while ( N < 0x8000 ) {
+ ++scale;
+ N <<= 1;
+ }
+ do {
+ z = random_ui32();
+ } while ( N <= z );
+ return z>>scale;
+
+}
+
+uint_fast64_t randomN_ui64( uint_fast64_t N )
+{
+ uint_fast64_t scale, z;
+
+ scale = 0;
+ while ( N < 0x8000 ) {
+ ++scale;
+ N <<= 1;
+ }
+ do {
+ z = random_ui64();
+ } while ( N <= z );
+ return z>>scale;
+
+}
+
diff --git a/source/random.h b/source/random.h
new file mode 100644
index 0000000..47864c9
--- /dev/null
+++ b/source/random.h
@@ -0,0 +1,46 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+
+uint_fast8_t random_ui8( void );
+uint_fast16_t random_ui16( void );
+uint_fast32_t random_ui32( void );
+uint_fast64_t random_ui64( void );
+
+uint_fast8_t randomN_ui8( uint_fast8_t );
+uint_fast16_t randomN_ui16( uint_fast16_t );
+uint_fast32_t randomN_ui32( uint_fast32_t );
+uint_fast64_t randomN_ui64( uint_fast64_t );
+
diff --git a/source/readHex.c b/source/readHex.c
new file mode 100644
index 0000000..5d313ba
--- /dev/null
+++ b/source/readHex.c
@@ -0,0 +1,187 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "readHex.h"
+
+bool readHex_bool( bool *aPtr, char sepChar )
+{
+ int i;
+ bool a;
+
+ i = fgetc( stdin );
+ if ( (i == EOF) || (i < '0') || ('1' < i) ) return false;
+ a = i - '0';
+ if ( sepChar ) {
+ i = fgetc( stdin );
+ if ( (sepChar != '\n') || (i != '\r') ) {
+ if ( i != sepChar ) return false;
+ }
+ }
+ *aPtr = a;
+ return true;
+
+}
+
+bool readHex_ui8( uint_least8_t *aPtr, char sepChar )
+{
+ int i;
+ uint_fast8_t a;
+
+ i = fgetc( stdin );
+ if ( i == EOF ) return false;
+ if ( ('0' <= i) && (i <= '9') ) {
+ i -= '0';
+ } else if ( ('A' <= i) && (i <= 'F') ) {
+ i -= 'A' - 10;
+ } else if ( ('a' <= i) && (i <= 'f') ) {
+ i -= 'a' - 10;
+ } else {
+ return false;
+ }
+ a = i<<4;
+ i = fgetc( stdin );
+ if ( i == EOF ) return false;
+ if ( ('0' <= i) && (i <= '9') ) {
+ i -= '0';
+ } else if ( ('A' <= i) && (i <= 'F') ) {
+ i -= 'A' - 10;
+ } else if ( ('a' <= i) && (i <= 'f') ) {
+ i -= 'a' - 10;
+ } else {
+ return false;
+ }
+ a |= i;
+ if ( sepChar ) {
+ i = fgetc( stdin );
+ if ( (sepChar != '\n') || (i != '\r') ) {
+ if ( i != sepChar ) return false;
+ }
+ }
+ *aPtr = a;
+ return true;
+
+}
+
+bool readHex_ui16( uint16_t *aPtr, char sepChar )
+{
+ int i;
+ uint_fast16_t a;
+
+ i = fgetc( stdin );
+ if ( i == EOF ) return false;
+ if ( ('0' <= i) && (i <= '9') ) {
+ i -= '0';
+ } else if ( ('A' <= i) && (i <= 'F') ) {
+ i -= 'A' - 10;
+ } else if ( ('a' <= i) && (i <= 'f') ) {
+ i -= 'a' - 10;
+ } else {
+ return false;
+ }
+ a = (uint_fast16_t) i<<12;
+ i = fgetc( stdin );
+ if ( i == EOF ) return false;
+ if ( ('0' <= i) && (i <= '9') ) {
+ i -= '0';
+ } else if ( ('A' <= i) && (i <= 'F') ) {
+ i -= 'A' - 10;
+ } else if ( ('a' <= i) && (i <= 'f') ) {
+ i -= 'a' - 10;
+ } else {
+ return false;
+ }
+ a |= (uint_fast16_t) i<<8;
+ i = fgetc( stdin );
+ if ( i == EOF ) return false;
+ if ( ('0' <= i) && (i <= '9') ) {
+ i -= '0';
+ } else if ( ('A' <= i) && (i <= 'F') ) {
+ i -= 'A' - 10;
+ } else if ( ('a' <= i) && (i <= 'f') ) {
+ i -= 'a' - 10;
+ } else {
+ return false;
+ }
+ a |= (uint_fast16_t) i<<4;
+ i = fgetc( stdin );
+ if ( i == EOF ) return false;
+ if ( ('0' <= i) && (i <= '9') ) {
+ i -= '0';
+ } else if ( ('A' <= i) && (i <= 'F') ) {
+ i -= 'A' - 10;
+ } else if ( ('a' <= i) && (i <= 'f') ) {
+ i -= 'a' - 10;
+ } else {
+ return false;
+ }
+ a |= i;
+ if ( sepChar ) {
+ i = fgetc( stdin );
+ if ( (sepChar != '\n') || (i != '\r') ) {
+ if ( i != sepChar ) return false;
+ }
+ }
+ *aPtr = a;
+ return true;
+
+}
+
+bool readHex_ui32( uint32_t *aPtr, char sepChar )
+{
+ uint16_t v16, v0;
+
+ if ( ! readHex_ui16( &v16, 0 ) || ! readHex_ui16( &v0, sepChar ) ) {
+ return false;
+ }
+ *aPtr = (uint_fast32_t) v16<<16 | v0;
+ return true;
+
+}
+
+bool readHex_ui64( uint64_t *aPtr, char sepChar )
+{
+ uint32_t v32, v0;
+
+ if ( ! readHex_ui32( &v32, 0 ) || ! readHex_ui32( &v0, sepChar ) ) {
+ return false;
+ }
+ *aPtr = (uint_fast64_t) v32<<32 | v0;
+ return true;
+
+}
+
diff --git a/source/readHex.h b/source/readHex.h
new file mode 100644
index 0000000..56c8eeb
--- /dev/null
+++ b/source/readHex.h
@@ -0,0 +1,43 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+
+bool readHex_bool( bool *, char );
+bool readHex_ui8( uint_least8_t *, char );
+bool readHex_ui16( uint16_t *, char );
+bool readHex_ui32( uint32_t *, char );
+bool readHex_ui64( uint64_t *, char );
+
diff --git a/source/slowfloat.c b/source/slowfloat.c
new file mode 100644
index 0000000..ac54bb5
--- /dev/null
+++ b/source/slowfloat.c
@@ -0,0 +1,3098 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "uint128.h"
+#include "softfloat.h"
+#include "slowfloat.h"
+
+uint_fast8_t slowfloat_roundingMode;
+uint_fast8_t slowfloat_detectTininess;
+uint_fast8_t slowfloat_exceptionFlags;
+#ifdef EXTFLOAT80
+uint_fast8_t slow_extF80_roundingPrecision;
+#endif
+
+union ui32_f32 { uint32_t ui; float32_t f; };
+union ui64_f64 { uint64_t ui; float64_t f; };
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+
+struct floatX {
+ bool isNaN;
+ bool isInf;
+ bool isZero;
+ bool sign;
+ int_fast32_t exp;
+ struct uint128 sig;
+};
+
+static const struct floatX floatXNaN =
+ { true, false, false, false, 0, { 0, 0 } };
+static const struct floatX floatXPositiveZero =
+ { false, false, true, false, 0, { 0, 0 } };
+static const struct floatX floatXNegativeZero =
+ { false, false, true, true, 0, { 0, 0 } };
+
+static
+ void
+ roundFloatXTo24(
+ bool isTiny, struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ uint_fast64_t sigX64;
+ uint_fast32_t roundBits;
+
+ sigX64 = xPtr->sig.v64 | (xPtr->sig.v0 != 0);
+ roundBits = (uint32_t) sigX64;
+ sigX64 -= roundBits;
+ if ( roundBits ) {
+ if ( exact ) slowfloat_exceptionFlags |= softfloat_flag_inexact;
+ if ( isTiny ) slowfloat_exceptionFlags |= softfloat_flag_underflow;
+ switch ( roundingMode ) {
+ case softfloat_round_near_even:
+ if ( roundBits < 0x80000000 ) goto noIncrement;
+ if (
+ (roundBits == 0x80000000)
+ && ! (sigX64 & UINT64_C( 0x100000000 ))
+ ) {
+ goto noIncrement;
+ }
+ break;
+ case softfloat_round_minMag:
+ goto noIncrement;
+ case softfloat_round_min:
+ if ( ! xPtr->sign ) goto noIncrement;
+ break;
+ case softfloat_round_max:
+ if ( xPtr->sign ) goto noIncrement;
+ break;
+ case softfloat_round_near_maxMag:
+ if ( roundBits < 0x80000000 ) goto noIncrement;
+ break;
+ }
+ sigX64 += UINT64_C( 0x100000000 );
+ if ( sigX64 == UINT64_C( 0x0100000000000000 ) ) {
+ ++xPtr->exp;
+ sigX64 = UINT64_C( 0x0080000000000000 );
+ }
+ }
+ noIncrement:
+ xPtr->sig.v64 = sigX64;
+ xPtr->sig.v0 = 0;
+
+}
+
+static
+ void
+ roundFloatXTo53(
+ bool isTiny, struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ uint_fast64_t sigX64;
+ uint_fast8_t roundBits;
+
+ sigX64 = xPtr->sig.v64 | (xPtr->sig.v0 != 0);
+ roundBits = sigX64 & 7;
+ sigX64 -= roundBits;
+ if ( roundBits ) {
+ if ( exact ) slowfloat_exceptionFlags |= softfloat_flag_inexact;
+ if ( isTiny ) slowfloat_exceptionFlags |= softfloat_flag_underflow;
+ switch ( roundingMode ) {
+ case softfloat_round_near_even:
+ if ( roundBits < 4 ) goto noIncrement;
+ if ( (roundBits == 4) && ! (sigX64 & 8) ) goto noIncrement;
+ break;
+ case softfloat_round_minMag:
+ goto noIncrement;
+ case softfloat_round_min:
+ if ( ! xPtr->sign ) goto noIncrement;
+ break;
+ case softfloat_round_max:
+ if ( xPtr->sign ) goto noIncrement;
+ break;
+ case softfloat_round_near_maxMag:
+ if ( roundBits < 4 ) goto noIncrement;
+ break;
+ }
+ sigX64 += 8;
+ if ( sigX64 == UINT64_C( 0x0100000000000000 ) ) {
+ ++xPtr->exp;
+ sigX64 = UINT64_C( 0x0080000000000000 );
+ }
+ }
+ noIncrement:
+ xPtr->sig.v64 = sigX64;
+ xPtr->sig.v0 = 0;
+
+}
+
+static
+ void
+ roundFloatXTo64(
+ bool isTiny, struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ uint_fast64_t sigX0;
+ int_fast64_t roundBits;
+ uint_fast64_t sigX64;
+
+ sigX0 = xPtr->sig.v0;
+ roundBits = sigX0 & UINT64_C( 0x00FFFFFFFFFFFFFF );
+ sigX0 -= roundBits;
+ if ( roundBits ) {
+ if ( exact ) slowfloat_exceptionFlags |= softfloat_flag_inexact;
+ if ( isTiny ) slowfloat_exceptionFlags |= softfloat_flag_underflow;
+ switch ( roundingMode ) {
+ case softfloat_round_near_even:
+ if ( roundBits < UINT64_C( 0x0080000000000000 ) ) goto noIncrement;
+ if (
+ (roundBits == UINT64_C( 0x0080000000000000 ))
+ && ! (sigX0 & UINT64_C( 0x0100000000000000 ))
+ ) {
+ goto noIncrement;
+ }
+ break;
+ case softfloat_round_minMag:
+ goto noIncrement;
+ case softfloat_round_min:
+ if ( ! xPtr->sign ) goto noIncrement;
+ break;
+ case softfloat_round_max:
+ if ( xPtr->sign ) goto noIncrement;
+ break;
+ case softfloat_round_near_maxMag:
+ if ( roundBits < UINT64_C( 0x0080000000000000 ) ) goto noIncrement;
+ break;
+ }
+ sigX0 += UINT64_C( 0x0100000000000000 );
+ sigX64 = xPtr->sig.v64 + ! sigX0;
+ if ( sigX64 == UINT64_C( 0x0100000000000000 ) ) {
+ ++xPtr->exp;
+ sigX64 = UINT64_C( 0x0080000000000000 );
+ }
+ xPtr->sig.v64 = sigX64;
+ }
+ noIncrement:
+ xPtr->sig.v0 = sigX0;
+
+}
+
+static
+ void
+ roundFloatXTo113(
+ bool isTiny, struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ uint_fast64_t sigX0;
+ int_fast64_t roundBits;
+ uint_fast64_t sigX64;
+
+ sigX0 = xPtr->sig.v0;
+ roundBits = sigX0 & 0x7F;
+ sigX0 -= roundBits;
+ if ( roundBits ) {
+ if ( exact ) slowfloat_exceptionFlags |= softfloat_flag_inexact;
+ if ( isTiny ) slowfloat_exceptionFlags |= softfloat_flag_underflow;
+ switch ( roundingMode ) {
+ case softfloat_round_near_even:
+ if ( roundBits < 0x40 ) goto noIncrement;
+ if ( (roundBits == 0x40) && ! (sigX0 & 0x80) ) goto noIncrement;
+ break;
+ case softfloat_round_minMag:
+ goto noIncrement;
+ case softfloat_round_min:
+ if ( ! xPtr->sign ) goto noIncrement;
+ break;
+ case softfloat_round_max:
+ if ( xPtr->sign ) goto noIncrement;
+ break;
+ case softfloat_round_near_maxMag:
+ if ( roundBits < 0x40 ) goto noIncrement;
+ break;
+ }
+ sigX0 += 0x80;
+ sigX64 = xPtr->sig.v64 + ! sigX0;
+ if ( sigX64 == UINT64_C( 0x0100000000000000 ) ) {
+ ++xPtr->exp;
+ sigX64 = UINT64_C( 0x0080000000000000 );
+ }
+ xPtr->sig.v64 = sigX64;
+ }
+ noIncrement:
+ xPtr->sig.v0 = sigX0;
+
+}
+
+static void ui32ToFloatX( uint_fast32_t a, struct floatX *xPtr )
+{
+ uint_fast64_t sig64;
+ int_fast32_t exp;
+
+ xPtr->isNaN = false;
+ xPtr->isInf = false;
+ xPtr->sign = false;
+ sig64 = a;
+ if ( a ) {
+ xPtr->isZero = false;
+ exp = 31;
+ sig64 <<= 24;
+ while ( sig64 < UINT64_C( 0x0080000000000000 ) ) {
+ --exp;
+ sig64 <<= 1;
+ }
+ xPtr->exp = exp;
+ } else {
+ xPtr->isZero = true;
+ }
+ xPtr->sig.v64 = sig64;
+ xPtr->sig.v0 = 0;
+
+}
+
+static
+ uint_fast32_t
+ floatXToUI32(
+ const struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ uint_fast8_t savedExceptionFlags;
+ struct floatX x;
+ int_fast32_t shiftCount;
+ uint_fast32_t z;
+
+ if ( xPtr->isInf || xPtr->isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ return 0xFFFFFFFF;
+ }
+ if ( xPtr->isZero ) return 0;
+ savedExceptionFlags = slowfloat_exceptionFlags;
+ x = *xPtr;
+ shiftCount = 52 - x.exp;
+ if ( 56 < shiftCount ) {
+ x.sig.v64 = 0;
+ x.sig.v0 = 1;
+ } else {
+ while ( 0 < shiftCount ) {
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ --shiftCount;
+ }
+ }
+ roundFloatXTo53( false, &x, roundingMode, exact );
+ x.sig = shortShiftRightJam128( x.sig, 3 );
+ z = x.sig.v64;
+ if ( (shiftCount < 0) || x.sig.v64>>32 || (x.sign && z) ) {
+ slowfloat_exceptionFlags =
+ savedExceptionFlags | softfloat_flag_invalid;
+ return 0xFFFFFFFF;
+ }
+ return z;
+
+}
+
+static void ui64ToFloatX( uint_fast64_t a, struct floatX *xPtr )
+{
+ struct uint128 sig;
+ int_fast32_t exp;
+
+ xPtr->isNaN = false;
+ xPtr->isInf = false;
+ xPtr->sign = false;
+ sig.v64 = 0;
+ sig.v0 = a;
+ if ( a ) {
+ xPtr->isZero = false;
+ exp = 63;
+ sig = shortShiftLeft128( sig, 56 );
+ while ( sig.v64 < UINT64_C( 0x0080000000000000 ) ) {
+ --exp;
+ sig = shortShiftLeft128( sig, 1 );
+ }
+ xPtr->exp = exp;
+ } else {
+ xPtr->isZero = true;
+ }
+ xPtr->sig = sig;
+
+}
+
+static
+ uint_fast64_t
+ floatXToUI64(
+ const struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ uint_fast8_t savedExceptionFlags;
+ struct floatX x;
+ int_fast32_t shiftCount;
+ uint_fast64_t z;
+
+ if ( xPtr->isInf || xPtr->isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ return UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ }
+ if ( xPtr->isZero ) return 0;
+ savedExceptionFlags = slowfloat_exceptionFlags;
+ x = *xPtr;
+ shiftCount = 112 - x.exp;
+ if ( 116 < shiftCount ) {
+ x.sig.v64 = 0;
+ x.sig.v0 = 1;
+ } else {
+ while ( 0 < shiftCount ) {
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ --shiftCount;
+ }
+ }
+ roundFloatXTo113( false, &x, roundingMode, exact );
+ x.sig = shortShiftRightJam128( x.sig, 7 );
+ z = x.sig.v0;
+ if ( (shiftCount < 0) || x.sig.v64 || (x.sign && z) ) {
+ slowfloat_exceptionFlags =
+ savedExceptionFlags | softfloat_flag_invalid;
+ return UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ }
+ return z;
+
+}
+
+static void i32ToFloatX( int_fast32_t a, struct floatX *xPtr )
+{
+ bool sign;
+ uint_fast64_t sig64;
+ int_fast32_t exp;
+
+ xPtr->isNaN = false;
+ xPtr->isInf = false;
+ sign = (a < 0);
+ xPtr->sign = sign;
+ sig64 = sign ? -(uint64_t) a : a;
+ if ( a ) {
+ xPtr->isZero = false;
+ exp = 31;
+ sig64 <<= 24;
+ while ( sig64 < UINT64_C( 0x0080000000000000 ) ) {
+ --exp;
+ sig64 <<= 1;
+ }
+ xPtr->exp = exp;
+ } else {
+ xPtr->isZero = true;
+ }
+ xPtr->sig.v64 = sig64;
+ xPtr->sig.v0 = 0;
+
+}
+
+static
+ int_fast32_t
+ floatXToI32(
+ const struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ uint_fast8_t savedExceptionFlags;
+ struct floatX x;
+ int_fast32_t shiftCount;
+ union { uint32_t ui; int32_t i; } uZ;
+
+ if ( xPtr->isInf || xPtr->isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ return (xPtr->isInf & xPtr->sign) ? -0x7FFFFFFF - 1 : 0x7FFFFFFF;
+ }
+ if ( xPtr->isZero ) return 0;
+ savedExceptionFlags = slowfloat_exceptionFlags;
+ x = *xPtr;
+ shiftCount = 52 - x.exp;
+ if ( 56 < shiftCount ) {
+ x.sig.v64 = 0;
+ x.sig.v0 = 1;
+ } else {
+ while ( 0 < shiftCount ) {
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ --shiftCount;
+ }
+ }
+ roundFloatXTo53( false, &x, roundingMode, exact );
+ x.sig = shortShiftRightJam128( x.sig, 3 );
+ uZ.ui = x.sig.v64;
+ if ( x.sign ) uZ.ui = -uZ.ui;
+ if (
+ (shiftCount < 0) || x.sig.v64>>32
+ || ((uZ.i != 0) && (x.sign != (uZ.i < 0)))
+ ) {
+ slowfloat_exceptionFlags =
+ savedExceptionFlags | softfloat_flag_invalid;
+ return x.sign ? -0x7FFFFFFF - 1 : 0x7FFFFFFF;
+ }
+ return uZ.i;
+
+}
+
+static void i64ToFloatX( int_fast64_t a, struct floatX *xPtr )
+{
+ bool sign;
+ struct uint128 sig;
+ int_fast32_t exp;
+
+ xPtr->isNaN = false;
+ xPtr->isInf = false;
+ sign = (a < 0);
+ xPtr->sign = sign;
+ sig.v64 = 0;
+ sig.v0 = sign ? -(uint_fast64_t) a : a;
+ if ( a ) {
+ xPtr->isZero = false;
+ exp = 63;
+ sig = shortShiftLeft128( sig, 56 );
+ while ( sig.v64 < UINT64_C( 0x0080000000000000 ) ) {
+ --exp;
+ sig = shortShiftLeft128( sig, 1 );
+ }
+ xPtr->exp = exp;
+ } else {
+ xPtr->isZero = true;
+ }
+ xPtr->sig = sig;
+
+}
+
+static
+ int_fast64_t
+ floatXToI64(
+ const struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ uint_fast8_t savedExceptionFlags;
+ struct floatX x;
+ int_fast32_t shiftCount;
+ union { uint64_t ui; int64_t i; } uZ;
+
+ if ( xPtr->isInf || xPtr->isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ return
+ (xPtr->isInf & xPtr->sign) ? -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1
+ : INT64_C( 0x7FFFFFFFFFFFFFFF );
+ }
+ if ( xPtr->isZero ) return 0;
+ savedExceptionFlags = slowfloat_exceptionFlags;
+ x = *xPtr;
+ shiftCount = 112 - x.exp;
+ if ( 116 < shiftCount ) {
+ x.sig.v64 = 0;
+ x.sig.v0 = 1;
+ } else {
+ while ( 0 < shiftCount ) {
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ --shiftCount;
+ }
+ }
+ roundFloatXTo113( false, &x, roundingMode, exact );
+ x.sig = shortShiftRightJam128( x.sig, 7 );
+ uZ.ui = x.sig.v0;
+ if ( x.sign ) uZ.ui = -uZ.ui;
+ if (
+ (shiftCount < 0) || x.sig.v64
+ || ((uZ.i != 0) && (x.sign != (uZ.i < 0)))
+ ) {
+ slowfloat_exceptionFlags =
+ savedExceptionFlags | softfloat_flag_invalid;
+ return
+ x.sign ? -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1
+ : INT64_C( 0x7FFFFFFFFFFFFFFF );
+ }
+ return uZ.i;
+
+}
+
+static void f32ToFloatX( float32_t a, struct floatX *xPtr )
+{
+ union ui32_f32 uA;
+ uint_fast32_t uiA;
+ int_fast16_t exp;
+ uint_fast64_t sig64;
+
+ uA.f = a;
+ uiA = uA.ui;
+ xPtr->isNaN = false;
+ xPtr->isInf = false;
+ xPtr->isZero = false;
+ xPtr->sign = ((uiA & 0x80000000) != 0);
+ exp = uiA>>23 & 0xFF;
+ sig64 = uiA & 0x007FFFFF;
+ sig64 <<= 32;
+ if ( exp == 0xFF ) {
+ if ( sig64 ) {
+ xPtr->isNaN = true;
+ } else {
+ xPtr->isInf = true;
+ }
+ } else if ( ! exp ) {
+ if ( ! sig64 ) {
+ xPtr->isZero = true;
+ } else {
+ exp = 1 - 0x7F;
+ do {
+ --exp;
+ sig64 <<= 1;
+ } while ( sig64 < UINT64_C( 0x0080000000000000 ) );
+ xPtr->exp = exp;
+ }
+ } else {
+ xPtr->exp = exp - 0x7F;
+ sig64 |= UINT64_C( 0x0080000000000000 );
+ }
+ xPtr->sig.v64 = sig64;
+ xPtr->sig.v0 = 0;
+
+}
+
+static float32_t floatXToF32( const struct floatX *xPtr )
+{
+ uint_fast32_t uiZ;
+ struct floatX x, savedX;
+ bool isTiny;
+ int_fast32_t exp;
+ union ui32_f32 uZ;
+
+ if ( xPtr->isNaN ) {
+ uiZ = 0xFFFFFFFF;
+ goto uiZ;
+ }
+ if ( xPtr->isInf ) {
+ uiZ = xPtr->sign ? 0xFF800000 : 0x7F800000;
+ goto uiZ;
+ }
+ if ( xPtr->isZero ) {
+ uiZ = xPtr->sign ? 0x80000000 : 0;
+ goto uiZ;
+ }
+ x = *xPtr;
+ while ( UINT64_C( 0x0100000000000000 ) <= x.sig.v64 ) {
+ ++x.exp;
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ }
+ while ( x.sig.v64 < UINT64_C( 0x0080000000000000 ) ) {
+ --x.exp;
+ x.sig = shortShiftLeft128( x.sig, 1 );
+ }
+ savedX = x;
+ isTiny =
+ (slowfloat_detectTininess == softfloat_tininess_beforeRounding)
+ && (x.exp + 0x7F <= 0);
+ roundFloatXTo24( isTiny, &x, slowfloat_roundingMode, true );
+ exp = x.exp + 0x7F;
+ if ( 0xFF <= exp ) {
+ slowfloat_exceptionFlags |=
+ softfloat_flag_overflow | softfloat_flag_inexact;
+ if ( x.sign ) {
+ switch ( slowfloat_roundingMode ) {
+ case softfloat_round_near_even:
+ case softfloat_round_min:
+ case softfloat_round_near_maxMag:
+ uiZ = 0xFF800000;
+ break;
+ case softfloat_round_minMag:
+ case softfloat_round_max:
+ uiZ = 0xFF7FFFFF;
+ break;
+ }
+ } else {
+ switch ( slowfloat_roundingMode ) {
+ case softfloat_round_near_even:
+ case softfloat_round_max:
+ case softfloat_round_near_maxMag:
+ uiZ = 0x7F800000;
+ break;
+ case softfloat_round_minMag:
+ case softfloat_round_min:
+ uiZ = 0x7F7FFFFF;
+ break;
+ }
+ }
+ goto uiZ;
+ }
+ if ( exp <= 0 ) {
+ isTiny = true;
+ x = savedX;
+ exp = x.exp + 0x7F;
+ if ( exp < -27 ) {
+ x.sig.v0 = (x.sig.v64 != 0) || (x.sig.v0 != 0);
+ x.sig.v64 = 0;
+ } else {
+ while ( exp <= 0 ) {
+ ++exp;
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ }
+ }
+ roundFloatXTo24( isTiny, &x, slowfloat_roundingMode, true );
+ exp = (UINT64_C( 0x0080000000000000 ) <= x.sig.v64) ? 1 : 0;
+ }
+ uiZ = (uint_fast32_t) exp<<23;
+ if ( x.sign ) uiZ |= 0x80000000;
+ uiZ |= x.sig.v64>>32 & 0x007FFFFF;
+ uiZ:
+ uZ.ui = uiZ;
+ return uZ.f;
+
+}
+
+static void f64ToFloatX( float64_t a, struct floatX *xPtr )
+{
+ union ui64_f64 uA;
+ uint_fast64_t uiA;
+ int_fast16_t exp;
+ uint_fast64_t sig64;
+
+ uA.f = a;
+ uiA = uA.ui;
+ xPtr->isNaN = false;
+ xPtr->isInf = false;
+ xPtr->isZero = false;
+ xPtr->sign = ((uiA & UINT64_C( 0x8000000000000000 )) != 0);
+ exp = uiA>>52 & 0x7FF;
+ sig64 = uiA & UINT64_C( 0x000FFFFFFFFFFFFF );
+ if ( exp == 0x7FF ) {
+ if ( sig64 ) {
+ xPtr->isNaN = true;
+ } else {
+ xPtr->isInf = true;
+ }
+ } else if ( ! exp ) {
+ if ( ! sig64 ) {
+ xPtr->isZero = true;
+ } else {
+ exp = 1 - 0x3FF;
+ do {
+ --exp;
+ sig64 <<= 1;
+ } while ( sig64 < UINT64_C( 0x0010000000000000 ) );
+ xPtr->exp = exp;
+ }
+ } else {
+ xPtr->exp = exp - 0x3FF;
+ sig64 |= UINT64_C( 0x0010000000000000 );
+ }
+ xPtr->sig.v64 = sig64<<3;
+ xPtr->sig.v0 = 0;
+
+}
+
+static float64_t floatXToF64( const struct floatX *xPtr )
+{
+ uint_fast64_t uiZ;
+ struct floatX x, savedX;
+ bool isTiny;
+ int_fast32_t exp;
+ union ui64_f64 uZ;
+
+ if ( xPtr->isNaN ) {
+ uiZ = UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ goto uiZ;
+ }
+ if ( xPtr->isInf ) {
+ uiZ =
+ xPtr->sign ? UINT64_C( 0xFFF0000000000000 )
+ : UINT64_C( 0x7FF0000000000000 );
+ goto uiZ;
+ }
+ if ( xPtr->isZero ) {
+ uiZ = xPtr->sign ? UINT64_C( 0x8000000000000000 ) : 0;
+ goto uiZ;
+ }
+ x = *xPtr;
+ while ( UINT64_C( 0x0100000000000000 ) <= x.sig.v64 ) {
+ ++x.exp;
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ }
+ while ( x.sig.v64 < UINT64_C( 0x0080000000000000 ) ) {
+ --x.exp;
+ x.sig = shortShiftLeft128( x.sig, 1 );
+ }
+ savedX = x;
+ isTiny =
+ (slowfloat_detectTininess == softfloat_tininess_beforeRounding)
+ && (x.exp + 0x3FF <= 0);
+ roundFloatXTo53( isTiny, &x, slowfloat_roundingMode, true );
+ exp = x.exp + 0x3FF;
+ if ( 0x7FF <= exp ) {
+ slowfloat_exceptionFlags |=
+ softfloat_flag_overflow | softfloat_flag_inexact;
+ if ( x.sign ) {
+ switch ( slowfloat_roundingMode ) {
+ case softfloat_round_near_even:
+ case softfloat_round_min:
+ case softfloat_round_near_maxMag:
+ uiZ = UINT64_C( 0xFFF0000000000000 );
+ break;
+ case softfloat_round_minMag:
+ case softfloat_round_max:
+ uiZ = UINT64_C( 0xFFEFFFFFFFFFFFFF );
+ break;
+ }
+ } else {
+ switch ( slowfloat_roundingMode ) {
+ case softfloat_round_near_even:
+ case softfloat_round_max:
+ case softfloat_round_near_maxMag:
+ uiZ = UINT64_C( 0x7FF0000000000000 );
+ break;
+ case softfloat_round_minMag:
+ case softfloat_round_min:
+ uiZ = UINT64_C( 0x7FEFFFFFFFFFFFFF );
+ break;
+ }
+ }
+ goto uiZ;
+ }
+ if ( exp <= 0 ) {
+ isTiny = true;
+ x = savedX;
+ exp = x.exp + 0x3FF;
+ if ( exp < -56 ) {
+ x.sig.v0 = (x.sig.v64 != 0) || (x.sig.v0 != 0);
+ x.sig.v64 = 0;
+ } else {
+ while ( exp <= 0 ) {
+ ++exp;
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ }
+ }
+ roundFloatXTo53( isTiny, &x, slowfloat_roundingMode, true );
+ exp = (UINT64_C( 0x0080000000000000 ) <= x.sig.v64) ? 1 : 0;
+ }
+ uiZ = (uint_fast64_t) exp<<52;
+ if ( x.sign ) uiZ |= UINT64_C( 0x8000000000000000 );
+ uiZ |= x.sig.v64>>3 & UINT64_C( 0x000FFFFFFFFFFFFF );
+ uiZ:
+ uZ.ui = uiZ;
+ return uZ.f;
+
+}
+
+#ifdef EXTFLOAT80
+
+static void extF80MToFloatX( const extFloat80_t *aPtr, struct floatX *xPtr )
+{
+ const struct extFloat80M *aSPtr;
+ uint_fast16_t uiA64;
+ int_fast32_t exp;
+ struct uint128 sig;
+
+ aSPtr = (const struct extFloat80M *) aPtr;
+ xPtr->isNaN = false;
+ xPtr->isInf = false;
+ xPtr->isZero = false;
+ uiA64 = aSPtr->signExp;
+ xPtr->sign = ((uiA64 & 0x8000) != 0);
+ exp = uiA64 & 0x7FFF;
+ sig.v64 = 0;
+ sig.v0 = aSPtr->signif;
+ if ( exp == 0x7FFF ) {
+ if ( sig.v0 & UINT64_C( 0x7FFFFFFFFFFFFFFF ) ) {
+ xPtr->isNaN = true;
+ } else {
+ xPtr->isInf = true;
+ }
+ } else {
+ if ( ! exp ) ++exp;
+ exp -= 0x3FFF;
+ if ( ! (sig.v0 & UINT64_C( 0x8000000000000000 )) ) {
+ if ( ! sig.v0 ) {
+ xPtr->isZero = true;
+ } else {
+ do {
+ --exp;
+ sig.v0 <<= 1;
+ } while ( sig.v0 < UINT64_C( 0x8000000000000000 ) );
+ }
+ }
+ xPtr->exp = exp;
+ }
+ xPtr->sig = shortShiftLeft128( sig, 56 );
+
+}
+
+static void floatXToExtF80M( const struct floatX *xPtr, extFloat80_t *zPtr )
+{
+ struct extFloat80M *zSPtr;
+ struct floatX x, savedX;
+ bool isTiny;
+ int_fast32_t exp;
+ uint_fast64_t uiZ0;
+ uint_fast16_t uiZ64;
+
+ zSPtr = (struct extFloat80M *) zPtr;
+ if ( xPtr->isNaN ) {
+ zSPtr->signExp = 0xFFFF;
+ zSPtr->signif = UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ return;
+ }
+ if ( xPtr->isInf ) {
+ zSPtr->signExp = xPtr->sign ? 0xFFFF : 0x7FFF;
+ zSPtr->signif = UINT64_C( 0x8000000000000000 );
+ return;
+ }
+ if ( xPtr->isZero ) {
+ zSPtr->signExp = xPtr->sign ? 0x8000 : 0;
+ zSPtr->signif = 0;
+ return;
+ }
+ x = *xPtr;
+ while ( UINT64_C( 0x0100000000000000 ) <= x.sig.v64 ) {
+ ++x.exp;
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ }
+ while ( x.sig.v64 < UINT64_C( 0x0080000000000000 ) ) {
+ --x.exp;
+ x.sig = shortShiftLeft128( x.sig, 1 );
+ }
+ savedX = x;
+ isTiny =
+ (slowfloat_detectTininess == softfloat_tininess_beforeRounding)
+ && (x.exp + 0x3FFF <= 0);
+ switch ( slow_extF80_roundingPrecision ) {
+ case 32:
+ roundFloatXTo24( isTiny, &x, slowfloat_roundingMode, true );
+ break;
+ case 64:
+ roundFloatXTo53( isTiny, &x, slowfloat_roundingMode, true );
+ break;
+ default:
+ roundFloatXTo64( isTiny, &x, slowfloat_roundingMode, true );
+ break;
+ }
+ exp = x.exp + 0x3FFF;
+ if ( 0x7FFF <= exp ) {
+ slowfloat_exceptionFlags |=
+ softfloat_flag_overflow | softfloat_flag_inexact;
+ if ( x.sign ) {
+ switch ( slowfloat_roundingMode ) {
+ case softfloat_round_near_even:
+ case softfloat_round_min:
+ case softfloat_round_near_maxMag:
+ zSPtr->signExp = 0xFFFF;
+ zSPtr->signif = UINT64_C( 0x8000000000000000 );
+ break;
+ case softfloat_round_minMag:
+ case softfloat_round_max:
+ switch ( slow_extF80_roundingPrecision ) {
+ case 32:
+ uiZ0 = UINT64_C( 0xFFFFFF0000000000 );
+ break;
+ case 64:
+ uiZ0 = UINT64_C( 0xFFFFFFFFFFFFF800 );
+ break;
+ default:
+ uiZ0 = UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ break;
+ }
+ zSPtr->signExp = 0xFFFE;
+ zSPtr->signif = uiZ0;
+ break;
+ }
+ } else {
+ switch ( slowfloat_roundingMode ) {
+ case softfloat_round_near_even:
+ case softfloat_round_max:
+ case softfloat_round_near_maxMag:
+ zSPtr->signExp = 0x7FFF;
+ zSPtr->signif = UINT64_C( 0x8000000000000000 );
+ break;
+ case softfloat_round_minMag:
+ case softfloat_round_min:
+ switch ( slow_extF80_roundingPrecision ) {
+ case 32:
+ uiZ0 = UINT64_C( 0xFFFFFF0000000000 );
+ break;
+ case 64:
+ uiZ0 = UINT64_C( 0xFFFFFFFFFFFFF800 );
+ break;
+ default:
+ uiZ0 = UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ break;
+ }
+ zSPtr->signExp = 0x7FFE;
+ zSPtr->signif = uiZ0;
+ break;
+ }
+ }
+ return;
+ }
+ if ( exp <= 0 ) {
+ isTiny = true;
+ x = savedX;
+ exp = x.exp + 0x3FFF;
+ if ( exp < -70 ) {
+ x.sig.v0 = (x.sig.v64 != 0) || (x.sig.v0 != 0);
+ x.sig.v64 = 0;
+ } else {
+ while ( exp <= 0 ) {
+ ++exp;
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ }
+ }
+ switch ( slow_extF80_roundingPrecision ) {
+ case 32:
+ roundFloatXTo24( isTiny, &x, slowfloat_roundingMode, true );
+ break;
+ case 64:
+ roundFloatXTo53( isTiny, &x, slowfloat_roundingMode, true );
+ break;
+ default:
+ roundFloatXTo64( isTiny, &x, slowfloat_roundingMode, true );
+ break;
+ }
+ exp = (UINT64_C( 0x0080000000000000 ) <= x.sig.v64) ? 1 : 0;
+ }
+ uiZ64 = exp;
+ if ( x.sign ) uiZ64 |= 0x8000;
+ zSPtr->signExp = uiZ64;
+ zSPtr->signif = shortShiftRightJam128( x.sig, 56 ).v0;
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void f128MToFloatX( const float128_t *aPtr, struct floatX *xPtr )
+{
+ const struct uint128 *uiAPtr;
+ uint_fast64_t uiA64;
+ int_fast32_t exp;
+ struct uint128 sig;
+
+ uiAPtr = (const struct uint128 *) aPtr;
+ xPtr->isNaN = false;
+ xPtr->isInf = false;
+ xPtr->isZero = false;
+ uiA64 = uiAPtr->v64;
+ xPtr->sign = ((uiA64 & UINT64_C( 0x8000000000000000 )) != 0);
+ exp = uiA64>>48 & 0x7FFF;
+ sig.v64 = uiA64 & UINT64_C( 0x0000FFFFFFFFFFFF );
+ sig.v0 = uiAPtr->v0;
+ if ( exp == 0x7FFF ) {
+ if ( sig.v64 || sig.v0 ) {
+ xPtr->isNaN = true;
+ } else {
+ xPtr->isInf = true;
+ }
+ } else if ( ! exp ) {
+ if ( ! sig.v64 && ! sig.v0 ) {
+ xPtr->isZero = true;
+ } else {
+ exp = 1 - 0x3FFF;
+ do {
+ --exp;
+ sig = shortShiftLeft128( sig, 1 );
+ } while ( sig.v64 < UINT64_C( 0x0001000000000000 ) );
+ xPtr->exp = exp;
+ }
+ } else {
+ xPtr->exp = exp - 0x3FFF;
+ sig.v64 |= UINT64_C( 0x0001000000000000 );
+ }
+ xPtr->sig = shortShiftLeft128( sig, 7 );
+
+}
+
+static void floatXToF128M( const struct floatX *xPtr, float128_t *zPtr )
+{
+ struct uint128 *uiZPtr;
+ struct floatX x, savedX;
+ bool isTiny;
+ int_fast32_t exp;
+ uint_fast64_t uiZ64;
+
+ uiZPtr = (struct uint128 *) zPtr;
+ if ( xPtr->isNaN ) {
+ uiZPtr->v64 = uiZPtr->v0 = UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ return;
+ }
+ if ( xPtr->isInf ) {
+ uiZPtr->v64 =
+ xPtr->sign ? UINT64_C( 0xFFFF000000000000 )
+ : UINT64_C( 0x7FFF000000000000 );
+ uiZPtr->v0 = 0;
+ return;
+ }
+ if ( xPtr->isZero ) {
+ uiZPtr->v64 = xPtr->sign ? UINT64_C( 0x8000000000000000 ) : 0;
+ uiZPtr->v0 = 0;
+ return;
+ }
+ x = *xPtr;
+ while ( UINT64_C( 0x0100000000000000 ) <= x.sig.v64 ) {
+ ++x.exp;
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ }
+ while ( x.sig.v64 < UINT64_C( 0x0080000000000000 ) ) {
+ --x.exp;
+ x.sig = shortShiftLeft128( x.sig, 1 );
+ }
+ savedX = x;
+ isTiny =
+ (slowfloat_detectTininess == softfloat_tininess_beforeRounding)
+ && (x.exp + 0x3FFF <= 0);
+ roundFloatXTo113( isTiny, &x, slowfloat_roundingMode, true );
+ exp = x.exp + 0x3FFF;
+ if ( 0x7FFF <= exp ) {
+ slowfloat_exceptionFlags |=
+ softfloat_flag_overflow | softfloat_flag_inexact;
+ if ( x.sign ) {
+ switch ( slowfloat_roundingMode ) {
+ case softfloat_round_near_even:
+ case softfloat_round_min:
+ case softfloat_round_near_maxMag:
+ uiZPtr->v64 = UINT64_C( 0xFFFF000000000000 );
+ uiZPtr->v0 = 0;
+ break;
+ case softfloat_round_minMag:
+ case softfloat_round_max:
+ uiZPtr->v64 = UINT64_C( 0xFFFEFFFFFFFFFFFF );
+ uiZPtr->v0 = UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ break;
+ }
+ } else {
+ switch ( slowfloat_roundingMode ) {
+ case softfloat_round_near_even:
+ case softfloat_round_max:
+ case softfloat_round_near_maxMag:
+ uiZPtr->v64 = UINT64_C( 0x7FFF000000000000 );
+ uiZPtr->v0 = 0;
+ break;
+ case softfloat_round_minMag:
+ case softfloat_round_min:
+ uiZPtr->v64 = UINT64_C( 0x7FFEFFFFFFFFFFFF );
+ uiZPtr->v0 = UINT64_C( 0xFFFFFFFFFFFFFFFF );
+ break;
+ }
+ }
+ return;
+ }
+ if ( exp <= 0 ) {
+ isTiny = true;
+ x = savedX;
+ exp = x.exp + 0x3FFF;
+ if ( exp < -120 ) {
+ x.sig.v0 = (x.sig.v64 != 0) || (x.sig.v0 != 0);
+ x.sig.v64 = 0;
+ } else {
+ while ( exp <= 0 ) {
+ ++exp;
+ x.sig = shortShiftRightJam128( x.sig, 1 );
+ }
+ }
+ roundFloatXTo113( isTiny, &x, slowfloat_roundingMode, true );
+ exp = (UINT64_C( 0x0080000000000000 ) <= x.sig.v64) ? 1 : 0;
+ }
+ uiZ64 = (uint_fast64_t) exp<<48;
+ if ( x.sign ) uiZ64 |= UINT64_C( 0x8000000000000000 );
+ x.sig = shortShiftRightJam128( x.sig, 7 );
+ uiZPtr->v64 = uiZ64 | x.sig.v64 & UINT64_C( 0x0000FFFFFFFFFFFF );
+ uiZPtr->v0 = x.sig.v0;
+
+}
+
+#endif
+
+static void floatXInvalid( struct floatX *xPtr )
+{
+
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ *xPtr = floatXNaN;
+
+}
+
+static
+ void
+ floatXRoundToInt(
+ struct floatX *xPtr, uint_fast8_t roundingMode, bool exact )
+{
+ int_fast32_t exp, shiftCount;
+ struct uint128 sig;
+
+ if ( xPtr->isNaN || xPtr->isInf ) return;
+ exp = xPtr->exp;
+ shiftCount = 112 - exp;
+ if ( shiftCount <= 0 ) return;
+ if ( 119 < shiftCount ) {
+ xPtr->exp = 112;
+ xPtr->sig.v64 = 0;
+ xPtr->sig.v0 = ! xPtr->isZero;
+ } else {
+ sig = xPtr->sig;
+ while ( 0 < shiftCount ) {
+ ++exp;
+ sig = shortShiftRightJam128( sig, 1 );
+ --shiftCount;
+ }
+ xPtr->exp = exp;
+ xPtr->sig = sig;
+ }
+ roundFloatXTo113( false, xPtr, roundingMode, exact );
+ if ( ! xPtr->sig.v64 && ! xPtr->sig.v0 ) xPtr->isZero = true;
+
+}
+
+static void floatXAdd( struct floatX *xPtr, const struct floatX *yPtr )
+{
+ int_fast32_t expX, expY, expDiff;
+ struct uint128 sigY;
+
+ if ( xPtr->isNaN ) return;
+ if ( yPtr->isNaN ) goto copyY;
+ if ( xPtr->isInf && yPtr->isInf ) {
+ if ( xPtr->sign != yPtr->sign ) floatXInvalid( xPtr );
+ return;
+ }
+ if ( xPtr->isInf ) return;
+ if ( yPtr->isInf ) goto copyY;
+ if ( xPtr->isZero && yPtr->isZero ) {
+ if ( xPtr->sign == yPtr->sign ) return;
+ goto completeCancellation;
+ }
+ expX = xPtr->exp;
+ expY = yPtr->exp;
+ if (
+ (xPtr->sign != yPtr->sign) && (expX == expY)
+ && eq128( xPtr->sig, yPtr->sig )
+ ) {
+ completeCancellation:
+ if (slowfloat_roundingMode == softfloat_round_min) {
+ *xPtr = floatXNegativeZero;
+ } else {
+ *xPtr = floatXPositiveZero;
+ }
+ return;
+ }
+ if ( xPtr->isZero ) goto copyY;
+ if ( yPtr->isZero ) return;
+ expDiff = expX - expY;
+ if ( expDiff < 0 ) {
+ xPtr->exp = expY;
+ if ( expDiff < -120 ) {
+ xPtr->sig.v64 = 0;
+ xPtr->sig.v0 = 1;
+ } else {
+ while ( expDiff < 0 ) {
+ ++expDiff;
+ xPtr->sig = shortShiftRightJam128( xPtr->sig, 1 );
+ }
+ }
+ if ( xPtr->sign != yPtr->sign ) xPtr->sig = neg128( xPtr->sig );
+ xPtr->sign = yPtr->sign;
+ xPtr->sig = add128( xPtr->sig, yPtr->sig );
+ } else {
+ sigY = yPtr->sig;
+ if ( 120 < expDiff ) {
+ sigY.v64 = 0;
+ sigY.v0 = 1;
+ } else {
+ while ( 0 < expDiff ) {
+ --expDiff;
+ sigY = shortShiftRightJam128( sigY, 1 );
+ }
+ }
+ if ( xPtr->sign != yPtr->sign ) sigY = neg128( sigY );
+ xPtr->sig = add128( xPtr->sig, sigY );
+ }
+ if ( xPtr->sig.v64 & UINT64_C( 0x8000000000000000 ) ) {
+ xPtr->sign = ! xPtr->sign;
+ xPtr->sig = neg128( xPtr->sig );
+ }
+ return;
+ copyY:
+ *xPtr = *yPtr;
+
+}
+
+static void floatXMul( struct floatX *xPtr, const struct floatX *yPtr )
+{
+ struct uint128 sig;
+ int bitNum;
+
+ if ( xPtr->isNaN ) return;
+ if ( yPtr->isNaN ) {
+ xPtr->isNaN = true;
+ xPtr->isInf = false;
+ xPtr->isZero = false;
+ xPtr->sign = yPtr->sign;
+ return;
+ }
+ if ( yPtr->sign ) xPtr->sign = ! xPtr->sign;
+ if ( xPtr->isInf ) {
+ if ( yPtr->isZero ) floatXInvalid( xPtr );
+ return;
+ }
+ if ( yPtr->isInf ) {
+ if ( xPtr->isZero ) {
+ floatXInvalid( xPtr );
+ return;
+ }
+ xPtr->isInf = true;
+ return;
+ }
+ if ( xPtr->isZero || yPtr->isZero ) {
+ if ( xPtr->sign ) {
+ *xPtr = floatXNegativeZero;
+ } else {
+ *xPtr = floatXPositiveZero;
+ }
+ return;
+ }
+ xPtr->exp += yPtr->exp;
+ sig.v64 = 0;
+ sig.v0 = 0;
+ for ( bitNum = 0; bitNum < 120; ++bitNum ) {
+ sig = shortShiftRightJam128( sig, 1 );
+ if ( xPtr->sig.v0 & 1 ) sig = add128( sig, yPtr->sig );
+ xPtr->sig = shortShiftRight128( xPtr->sig, 1 );
+ }
+ if ( UINT64_C( 0x0100000000000000 ) <= sig.v64 ) {
+ ++xPtr->exp;
+ sig = shortShiftRightJam128( sig, 1 );
+ }
+ xPtr->sig = sig;
+
+}
+
+static void floatXDiv( struct floatX *xPtr, const struct floatX *yPtr )
+{
+ struct uint128 sig, negSigY;
+ int bitNum;
+
+ if ( xPtr->isNaN ) return;
+ if ( yPtr->isNaN ) {
+ xPtr->isNaN = true;
+ xPtr->isInf = false;
+ xPtr->isZero = false;
+ xPtr->sign = yPtr->sign;
+ return;
+ }
+ if ( yPtr->sign ) xPtr->sign = ! xPtr->sign;
+ if ( xPtr->isInf ) {
+ if ( yPtr->isInf ) floatXInvalid( xPtr );
+ return;
+ }
+ if ( yPtr->isZero ) {
+ if ( xPtr->isZero ) {
+ floatXInvalid( xPtr );
+ return;
+ }
+ slowfloat_exceptionFlags |= softfloat_flag_infinite;
+ xPtr->isInf = true;
+ return;
+ }
+ if ( xPtr->isZero || yPtr->isInf ) {
+ if ( xPtr->sign ) {
+ *xPtr = floatXNegativeZero;
+ } else {
+ *xPtr = floatXPositiveZero;
+ }
+ return;
+ }
+ xPtr->exp -= yPtr->exp + 1;
+ sig.v64 = 0;
+ sig.v0 = 0;
+ negSigY = neg128( yPtr->sig );
+ for ( bitNum = 0; bitNum < 120; ++bitNum ) {
+ if ( le128( yPtr->sig, xPtr->sig ) ) {
+ sig.v0 |= 1;
+ xPtr->sig = add128( xPtr->sig, negSigY );
+ }
+ xPtr->sig = shortShiftLeft128( xPtr->sig, 1 );
+ sig = shortShiftLeft128( sig, 1 );
+ }
+ if ( xPtr->sig.v64 || xPtr->sig.v0 ) sig.v0 |= 1;
+ xPtr->sig = sig;
+
+}
+
+static void floatXRem( struct floatX *xPtr, const struct floatX *yPtr )
+{
+ int_fast32_t expX, expY;
+ struct uint128 sigY, negSigY;
+ bool lastQuotientBit;
+ struct uint128 savedSigX;
+
+ if ( xPtr->isNaN ) return;
+ if ( yPtr->isNaN ) {
+ xPtr->isNaN = true;
+ xPtr->isInf = false;
+ xPtr->isZero = false;
+ xPtr->sign = yPtr->sign;
+ return;
+ }
+ if ( xPtr->isInf || yPtr->isZero ) {
+ floatXInvalid( xPtr );
+ return;
+ }
+ if ( xPtr->isZero || yPtr->isInf ) return;
+ expX = xPtr->exp;
+ expY = yPtr->exp - 1;
+ if ( expX < expY ) return;
+ sigY = shortShiftLeft128( yPtr->sig, 1 );
+ negSigY = neg128( sigY );
+ while ( expY < expX ) {
+ --expX;
+ if ( le128( sigY, xPtr->sig ) ) {
+ xPtr->sig = add128( xPtr->sig, negSigY );
+ }
+ xPtr->sig = shortShiftLeft128( xPtr->sig, 1 );
+ }
+ xPtr->exp = expX;
+ lastQuotientBit = le128( sigY, xPtr->sig );
+ if ( lastQuotientBit ) xPtr->sig = add128( xPtr->sig, negSigY );
+ savedSigX = xPtr->sig;
+ xPtr->sig = neg128( add128( xPtr->sig, negSigY ) );
+ if ( lt128( xPtr->sig, savedSigX ) ) {
+ xPtr->sign = ! xPtr->sign;
+ } else if ( lt128( savedSigX, xPtr->sig ) ) {
+ goto restoreSavedSigX;
+ } else {
+ if ( lastQuotientBit ) {
+ xPtr->sign = ! xPtr->sign;
+ } else {
+ restoreSavedSigX:
+ xPtr->sig = savedSigX;
+ }
+ }
+ if ( ! xPtr->sig.v64 && ! xPtr->sig.v0 ) xPtr->isZero = true;
+
+}
+
+static void floatXSqrt( struct floatX *xPtr )
+{
+ struct uint128 sig, bitSig;
+ int bitNum;
+ struct uint128 savedSigX;
+
+ if ( xPtr->isNaN || xPtr->isZero ) return;
+ if ( xPtr->sign ) {
+ floatXInvalid( xPtr );
+ return;
+ }
+ if ( xPtr->isInf ) return;
+ if ( ! (xPtr->exp & 1) ) xPtr->sig = shortShiftRightJam128( xPtr->sig, 1 );
+ xPtr->exp >>= 1;
+ sig.v64 = 0;
+ sig.v0 = 0;
+ bitSig.v64 = UINT64_C( 0x0080000000000000 );
+ bitSig.v0 = 0;
+ for ( bitNum = 0; bitNum < 120; ++bitNum ) {
+ savedSigX = xPtr->sig;
+ xPtr->sig = add128( xPtr->sig, neg128( sig ) );
+ xPtr->sig = shortShiftLeft128( xPtr->sig, 1 );
+ xPtr->sig = add128( xPtr->sig, neg128( bitSig ) );
+ if ( xPtr->sig.v64 & UINT64_C( 0x8000000000000000 ) ) {
+ xPtr->sig = shortShiftLeft128( savedSigX, 1 );
+ } else {
+ sig.v64 |= bitSig.v64;
+ sig.v0 |= bitSig.v0;
+ }
+ bitSig = shortShiftRightJam128( bitSig, 1 );
+ }
+ if ( xPtr->sig.v64 || xPtr->sig.v0 ) sig.v0 |= 1;
+ xPtr->sig = sig;
+
+}
+
+static bool floatXEq( const struct floatX *xPtr, const struct floatX *yPtr )
+{
+
+ if ( xPtr->isNaN || yPtr->isNaN ) return false;
+ if ( xPtr->isZero && yPtr->isZero ) return true;
+ if ( xPtr->sign != yPtr->sign ) return false;
+ if ( xPtr->isInf || yPtr->isInf ) return xPtr->isInf && yPtr->isInf;
+ return ( xPtr->exp == yPtr->exp ) && eq128( xPtr->sig, yPtr->sig );
+
+}
+
+static bool floatXLe( const struct floatX *xPtr, const struct floatX *yPtr )
+{
+
+ if ( xPtr->isNaN || yPtr->isNaN ) return false;
+ if ( xPtr->isZero && yPtr->isZero ) return true;
+ if ( xPtr->sign != yPtr->sign ) return xPtr->sign;
+ if ( xPtr->sign ) {
+ if ( xPtr->isInf || yPtr->isZero ) return true;
+ if ( yPtr->isInf || xPtr->isZero ) return false;
+ if ( yPtr->exp < xPtr->exp ) return true;
+ if ( xPtr->exp < yPtr->exp ) return false;
+ return le128( yPtr->sig, xPtr->sig );
+ } else {
+ if ( yPtr->isInf || xPtr->isZero ) return true;
+ if ( xPtr->isInf || yPtr->isZero ) return false;
+ if ( xPtr->exp < yPtr->exp ) return true;
+ if ( yPtr->exp < xPtr->exp ) return false;
+ return le128( xPtr->sig, yPtr->sig );
+ }
+
+}
+
+static bool floatXLt( const struct floatX *xPtr, const struct floatX *yPtr )
+{
+
+ if ( xPtr->isNaN || yPtr->isNaN ) return false;
+ if ( xPtr->isZero && yPtr->isZero ) return false;
+ if ( xPtr->sign != yPtr->sign ) return xPtr->sign;
+ if ( xPtr->isInf && yPtr->isInf ) return false;
+ if ( xPtr->sign ) {
+ if ( xPtr->isInf || yPtr->isZero ) return true;
+ if ( yPtr->isInf || xPtr->isZero ) return false;
+ if ( yPtr->exp < xPtr->exp ) return true;
+ if ( xPtr->exp < yPtr->exp ) return false;
+ return lt128( yPtr->sig, xPtr->sig );
+ } else {
+ if ( yPtr->isInf || xPtr->isZero ) return true;
+ if ( xPtr->isInf || yPtr->isZero ) return false;
+ if ( xPtr->exp < yPtr->exp ) return true;
+ if ( yPtr->exp < xPtr->exp ) return false;
+ return lt128( xPtr->sig, yPtr->sig );
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+
+#if defined EXTFLOAT80 || defined FLOAT128
+
+#ifdef LITTLEENDIAN
+struct uint256 { uint64_t v0, v64, v128, v192; };
+#else
+struct uint256 { uint64_t v192, v128 v64, v0; };
+#endif
+
+static bool eq256M( const struct uint256 *aPtr, const struct uint256 *bPtr )
+{
+
+ return
+ (aPtr->v192 == bPtr->v192) && (aPtr->v128 == bPtr->v128)
+ && (aPtr->v64 == bPtr->v64) && (aPtr->v0 == bPtr->v0);
+
+}
+
+static void shiftLeft1256M( struct uint256 *ptr )
+{
+ uint64_t dword1, dword2;
+
+ dword1 = ptr->v128;
+ ptr->v192 = ptr->v192<<1 | dword1>>63;
+ dword2 = ptr->v64;
+ ptr->v128 = dword1<<1 | dword2>>63;
+ dword1 = ptr->v0;
+ ptr->v64 = dword2<<1 | dword1>>63;
+ ptr->v0 = dword1<<1;
+
+}
+
+static void shiftRight1256M( struct uint256 *ptr )
+{
+ uint64_t dword1, dword2;
+
+ dword1 = ptr->v64;
+ ptr->v0 = dword1<<63 | ptr->v0>>1;
+ dword2 = ptr->v128;
+ ptr->v64 = dword2<<63 | dword1>>1;
+ dword1 = ptr->v192;
+ ptr->v128 = dword1<<63 | dword2>>1;
+ ptr->v192 = dword1>>1;
+
+}
+
+static void shiftRight1Jam256M( struct uint256 *ptr )
+{
+ int extra;
+
+ extra = ptr->v0 & 1;
+ shiftRight1256M( ptr );
+ ptr->v0 |= extra;
+
+}
+
+static void neg256M( struct uint256 *ptr )
+{
+ uint64_t v64, v0, v128;
+
+ v64 = ptr->v64;
+ v0 = ptr->v0;
+ if ( v64 | v0 ) {
+ ptr->v192 = ~ptr->v192;
+ ptr->v128 = ~ptr->v128;
+ if ( v0 ) {
+ ptr->v64 = ~v64;
+ ptr->v0 = -v0;
+ } else {
+ ptr->v64 = -v64;
+ }
+ } else {
+ v128 = ptr->v128;
+ if ( v128 ) {
+ ptr->v192 = ~ptr->v192;
+ ptr->v128 = -v128;
+ } else {
+ ptr->v192 = -ptr->v192;
+ }
+ }
+
+}
+
+static void add256M( struct uint256 *aPtr, const struct uint256 *bPtr )
+{
+ uint64_t dwordA, dwordZ;
+ unsigned int carry1, carry2;
+
+ dwordA = aPtr->v0;
+ dwordZ = dwordA + bPtr->v0;
+ carry1 = (dwordZ < dwordA);
+ aPtr->v0 = dwordZ;
+ dwordA = aPtr->v64;
+ dwordZ = dwordA + bPtr->v64;
+ carry2 = (dwordZ < dwordA);
+ dwordZ += carry1;
+ carry2 += (dwordZ < carry1);
+ aPtr->v64 = dwordZ;
+ dwordA = aPtr->v128;
+ dwordZ = dwordA + bPtr->v128;
+ carry1 = (dwordZ < dwordA);
+ dwordZ += carry2;
+ carry1 += (dwordZ < carry2);
+ aPtr->v128 = dwordZ;
+ aPtr->v192 = aPtr->v192 + bPtr->v192 + carry1;
+
+}
+
+struct floatX256 {
+ bool isNaN;
+ bool isInf;
+ bool isZero;
+ bool sign;
+ int_fast32_t exp;
+ struct uint256 sig;
+};
+
+static const struct floatX256 floatX256NaN =
+ { true, false, false, false, 0, { 0, 0, 0, 0 } };
+static const struct floatX256 floatX256PositiveZero =
+ { false, false, true, false, 0, { 0, 0, 0, 0 } };
+static const struct floatX256 floatX256NegativeZero =
+ { false, false, true, true, 0, { 0, 0, 0, 0 } };
+
+#ifdef FLOAT128
+
+static void f128MToFloatX256( const float128_t *aPtr, struct floatX256 *xPtr )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ xPtr->isNaN = x.isNaN;
+ xPtr->isInf = x.isInf;
+ xPtr->isZero = x.isZero;
+ xPtr->sign = x.sign;
+ xPtr->exp = x.exp;
+ xPtr->sig.v192 = x.sig.v64;
+ xPtr->sig.v128 = x.sig.v0;
+ xPtr->sig.v64 = 0;
+ xPtr->sig.v0 = 0;
+
+}
+
+static void floatX256ToF128M( const struct floatX256 *xPtr, float128_t *zPtr )
+{
+ struct floatX x;
+ int_fast32_t expZ;
+ struct uint256 sig;
+
+ x.isNaN = xPtr->isNaN;
+ x.isInf = xPtr->isInf;
+ x.isZero = xPtr->isZero;
+ x.sign = xPtr->sign;
+ if ( ! (x.isNaN | x.isInf | x.isZero) ) {
+ expZ = xPtr->exp;
+ sig = xPtr->sig;
+ while ( ! sig.v192 ) {
+ expZ -= 64;
+ sig.v192 = sig.v128;
+ sig.v128 = sig.v64;
+ sig.v64 = sig.v0;
+ sig.v0 = 0;
+ }
+ while ( sig.v192 < UINT64_C( 0x0100000000000000 ) ) {
+ --expZ;
+ shiftLeft1256M( &sig );
+ }
+ x.exp = expZ;
+ x.sig.v64 = sig.v192;
+ x.sig.v0 = sig.v128 | ((sig.v64 | sig.v0) != 0);
+ }
+ floatXToF128M( &x, zPtr );
+
+}
+
+#endif
+
+static void floatX256Invalid( struct floatX256 *xPtr )
+{
+
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ *xPtr = floatX256NaN;
+
+}
+
+static
+ void floatX256Add( struct floatX256 *xPtr, const struct floatX256 *yPtr )
+{
+ int_fast32_t expX, expY, expDiff;
+ struct uint256 sigY;
+
+ if ( xPtr->isNaN ) return;
+ if ( yPtr->isNaN ) goto copyY;
+ if ( xPtr->isInf && yPtr->isInf ) {
+ if ( xPtr->sign != yPtr->sign ) floatX256Invalid( xPtr );
+ return;
+ }
+ if ( xPtr->isInf ) return;
+ if ( yPtr->isInf ) goto copyY;
+ if ( xPtr->isZero && yPtr->isZero ) {
+ if ( xPtr->sign == yPtr->sign ) return;
+ goto completeCancellation;
+ }
+ expX = xPtr->exp;
+ expY = yPtr->exp;
+ if (
+ (xPtr->sign != yPtr->sign) && (expX == expY)
+ && eq256M( &xPtr->sig, &yPtr->sig )
+ ) {
+ completeCancellation:
+ if (slowfloat_roundingMode == softfloat_round_min) {
+ *xPtr = floatX256NegativeZero;
+ } else {
+ *xPtr = floatX256PositiveZero;
+ }
+ return;
+ }
+ if ( xPtr->isZero ) goto copyY;
+ if ( yPtr->isZero ) return;
+ expDiff = expX - expY;
+ if ( expDiff < 0 ) {
+ xPtr->exp = expY;
+ if ( expDiff < -248 ) {
+ xPtr->sig.v192 = 0;
+ xPtr->sig.v128 = 0;
+ xPtr->sig.v64 = 0;
+ xPtr->sig.v0 = 1;
+ } else {
+ while ( expDiff < 0 ) {
+ ++expDiff;
+ shiftRight1Jam256M( &xPtr->sig );
+ }
+ }
+ if ( xPtr->sign != yPtr->sign ) neg256M( &xPtr->sig );
+ xPtr->sign = yPtr->sign;
+ add256M( &xPtr->sig, &yPtr->sig );
+ } else {
+ sigY = yPtr->sig;
+ if ( 248 < expDiff ) {
+ sigY.v192 = 0;
+ sigY.v128 = 0;
+ sigY.v64 = 0;
+ sigY.v0 = 1;
+ } else {
+ while ( 0 < expDiff ) {
+ --expDiff;
+ shiftRight1Jam256M( &sigY );
+ }
+ }
+ if ( xPtr->sign != yPtr->sign ) neg256M( &sigY );
+ add256M( &xPtr->sig, &sigY );
+ }
+ if ( xPtr->sig.v192 & UINT64_C( 0x8000000000000000 ) ) {
+ xPtr->sign = ! xPtr->sign;
+ neg256M( &xPtr->sig );
+ }
+ return;
+ copyY:
+ *xPtr = *yPtr;
+
+}
+
+static
+ void floatX256Mul( struct floatX256 *xPtr, const struct floatX256 *yPtr )
+{
+ struct uint256 sig;
+ int bitNum;
+
+ if ( xPtr->isNaN ) return;
+ if ( yPtr->isNaN ) {
+ xPtr->isNaN = true;
+ xPtr->isInf = false;
+ xPtr->isZero = false;
+ xPtr->sign = yPtr->sign;
+ return;
+ }
+ if ( yPtr->sign ) xPtr->sign = ! xPtr->sign;
+ if ( xPtr->isInf ) {
+ if ( yPtr->isZero ) floatX256Invalid( xPtr );
+ return;
+ }
+ if ( yPtr->isInf ) {
+ if ( xPtr->isZero ) {
+ floatX256Invalid( xPtr );
+ return;
+ }
+ xPtr->isInf = true;
+ return;
+ }
+ if ( xPtr->isZero || yPtr->isZero ) {
+ if ( xPtr->sign ) {
+ *xPtr = floatX256NegativeZero;
+ } else {
+ *xPtr = floatX256PositiveZero;
+ }
+ return;
+ }
+ xPtr->exp += yPtr->exp;
+ sig.v192 = 0;
+ sig.v128 = 0;
+ sig.v64 = 0;
+ sig.v0 = 0;
+ for ( bitNum = 0; bitNum < 248; ++bitNum ) {
+ shiftRight1Jam256M( &sig );
+ if ( xPtr->sig.v0 & 1 ) add256M( &sig, &yPtr->sig );
+ shiftRight1256M( &xPtr->sig );
+ }
+ if ( UINT64_C( 0x0100000000000000 ) <= sig.v192 ) {
+ ++xPtr->exp;
+ shiftRight1Jam256M( &sig );
+ }
+ xPtr->sig = sig;
+
+}
+
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+
+float32_t slow_ui32_to_f32( uint32_t a )
+{
+ struct floatX x;
+
+ ui32ToFloatX( a, &x );
+ return floatXToF32( &x );
+
+}
+
+float64_t slow_ui32_to_f64( uint32_t a )
+{
+ struct floatX x;
+
+ ui32ToFloatX( a, &x );
+ return floatXToF64( &x );
+
+}
+
+#ifdef EXTFLOAT80
+
+void slow_ui32_to_extF80M( uint32_t a, extFloat80_t *zPtr )
+{
+ struct floatX x;
+
+ ui32ToFloatX( a, &x );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void slow_ui32_to_f128M( uint32_t a, float128_t *zPtr )
+{
+ struct floatX x;
+
+ ui32ToFloatX( a, &x );
+ floatXToF128M( &x, zPtr );
+
+}
+
+#endif
+
+float32_t slow_ui64_to_f32( uint64_t a )
+{
+ struct floatX x;
+
+ ui64ToFloatX( a, &x );
+ return floatXToF32( &x );
+
+}
+
+float64_t slow_ui64_to_f64( uint64_t a )
+{
+ struct floatX x;
+
+ ui64ToFloatX( a, &x );
+ return floatXToF64( &x );
+
+}
+
+#ifdef EXTFLOAT80
+
+void slow_ui64_to_extF80M( uint64_t a, extFloat80_t *zPtr )
+{
+ struct floatX x;
+
+ ui64ToFloatX( a, &x );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void slow_ui64_to_f128M( uint64_t a, float128_t *zPtr )
+{
+ struct floatX x;
+
+ ui64ToFloatX( a, &x );
+ floatXToF128M( &x, zPtr );
+
+}
+
+#endif
+
+float32_t slow_i32_to_f32( int32_t a )
+{
+ struct floatX x;
+
+ i32ToFloatX( a, &x );
+ return floatXToF32( &x );
+
+}
+
+float64_t slow_i32_to_f64( int32_t a )
+{
+ struct floatX x;
+
+ i32ToFloatX( a, &x );
+ return floatXToF64( &x );
+
+}
+
+#ifdef EXTFLOAT80
+
+void slow_i32_to_extF80M( int32_t a, extFloat80_t *zPtr )
+{
+ struct floatX x;
+
+ i32ToFloatX( a, &x );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void slow_i32_to_f128M( int32_t a, float128_t *zPtr )
+{
+ struct floatX x;
+
+ i32ToFloatX( a, &x );
+ floatXToF128M( &x, zPtr );
+
+}
+
+#endif
+
+float32_t slow_i64_to_f32( int64_t a )
+{
+ struct floatX x;
+
+ i64ToFloatX( a, &x );
+ return floatXToF32( &x );
+
+}
+
+float64_t slow_i64_to_f64( int64_t a )
+{
+ struct floatX x;
+
+ i64ToFloatX( a, &x );
+ return floatXToF64( &x );
+
+}
+
+#ifdef EXTFLOAT80
+
+void slow_i64_to_extF80M( int64_t a, extFloat80_t *zPtr )
+{
+ struct floatX x;
+
+ i64ToFloatX( a, &x );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void slow_i64_to_f128M( int64_t a, float128_t *zPtr )
+{
+ struct floatX x;
+
+ i64ToFloatX( a, &x );
+ floatXToF128M( &x, zPtr );
+
+}
+
+#endif
+
+uint_fast32_t
+ slow_f32_to_ui32( float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToUI32( &x, roundingMode, exact );
+
+}
+
+uint_fast64_t
+ slow_f32_to_ui64( float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToUI64( &x, roundingMode, exact );
+
+}
+
+int_fast32_t
+ slow_f32_to_i32( float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToI32( &x, roundingMode, exact );
+
+}
+
+int_fast64_t
+ slow_f32_to_i64( float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToI64( &x, roundingMode, exact );
+
+}
+
+uint_fast32_t slow_f32_to_ui32_r_minMag( float32_t a, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToUI32( &x, softfloat_round_minMag, exact );
+
+}
+
+uint_fast64_t slow_f32_to_ui64_r_minMag( float32_t a, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToUI64( &x, softfloat_round_minMag, exact );
+
+}
+
+int_fast32_t slow_f32_to_i32_r_minMag( float32_t a, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToI32( &x, softfloat_round_minMag, exact );
+
+}
+
+int_fast64_t slow_f32_to_i64_r_minMag( float32_t a, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToI64( &x, softfloat_round_minMag, exact );
+
+}
+
+float64_t slow_f32_to_f64( float32_t a )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ return floatXToF64( &x );
+
+}
+
+#ifdef EXTFLOAT80
+
+void slow_f32_to_extF80M( float32_t a, extFloat80_t *zPtr )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void slow_f32_to_f128M( float32_t a, float128_t *zPtr )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ floatXToF128M( &x, zPtr );
+
+}
+
+#endif
+
+float32_t
+ slow_f32_roundToInt( float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ floatXRoundToInt( &x, roundingMode, exact );
+ return floatXToF32( &x );
+
+}
+
+float32_t slow_f32_add( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ floatXAdd( &x, &y );
+ return floatXToF32( &x );
+
+}
+
+float32_t slow_f32_sub( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ y.sign = ! y.sign;
+ floatXAdd( &x, &y );
+ return floatXToF32( &x );
+
+
+}
+
+float32_t slow_f32_mul( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ floatXMul( &x, &y );
+ return floatXToF32( &x );
+
+}
+
+float32_t slow_f32_mulAdd( float32_t a, float32_t b, float32_t c )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ floatXMul( &x, &y );
+ f32ToFloatX( c, &y );
+ floatXAdd( &x, &y );
+ return floatXToF32( &x );
+
+}
+
+float32_t slow_f32_div( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ floatXDiv( &x, &y );
+ return floatXToF32( &x );
+
+}
+
+float32_t slow_f32_rem( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ floatXRem( &x, &y );
+ return floatXToF32( &x );
+
+}
+
+float32_t slow_f32_sqrt( float32_t a )
+{
+ struct floatX x;
+
+ f32ToFloatX( a, &x );
+ floatXSqrt( &x );
+ return floatXToF32( &x );
+
+}
+
+bool slow_f32_eq( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ return floatXEq( &x, &y );
+
+}
+
+bool slow_f32_le( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXLe( &x, &y );
+
+}
+
+bool slow_f32_lt( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXLt( &x, &y );
+
+}
+
+bool slow_f32_eq_signaling( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXEq( &x, &y );
+
+}
+
+bool slow_f32_le_quiet( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ return floatXLe( &x, &y );
+
+}
+
+bool slow_f32_lt_quiet( float32_t a, float32_t b )
+{
+ struct floatX x, y;
+
+ f32ToFloatX( a, &x );
+ f32ToFloatX( b, &y );
+ return floatXLt( &x, &y );
+
+}
+
+uint_fast32_t
+ slow_f64_to_ui32( float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToUI32( &x, roundingMode, exact );
+
+}
+
+uint_fast64_t
+ slow_f64_to_ui64( float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToUI64( &x, roundingMode, exact );
+
+}
+
+int_fast32_t
+ slow_f64_to_i32( float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToI32( &x, roundingMode, exact );
+
+}
+
+int_fast64_t
+ slow_f64_to_i64( float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToI64( &x, roundingMode, exact );
+
+}
+
+uint_fast32_t slow_f64_to_ui32_r_minMag( float64_t a, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToUI32( &x, softfloat_round_minMag, exact );
+
+}
+
+uint_fast64_t slow_f64_to_ui64_r_minMag( float64_t a, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToUI64( &x, softfloat_round_minMag, exact );
+
+}
+
+int_fast32_t slow_f64_to_i32_r_minMag( float64_t a, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToI32( &x, softfloat_round_minMag, exact );
+
+}
+
+int_fast64_t slow_f64_to_i64_r_minMag( float64_t a, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToI64( &x, softfloat_round_minMag, exact );
+
+}
+
+float32_t slow_f64_to_f32( float64_t a )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ return floatXToF32( &x );
+
+}
+
+#ifdef EXTFLOAT80
+
+void slow_f64_to_extF80M( float64_t a, extFloat80_t *zPtr )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void slow_f64_to_f128M( float64_t a, float128_t *zPtr )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ floatXToF128M( &x, zPtr );
+
+}
+
+#endif
+
+float64_t
+ slow_f64_roundToInt( float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ floatXRoundToInt( &x, roundingMode, exact );
+ return floatXToF64( &x );
+
+}
+
+float64_t slow_f64_add( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ floatXAdd( &x, &y );
+ return floatXToF64( &x );
+
+}
+
+float64_t slow_f64_sub( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ y.sign = ! y.sign;
+ floatXAdd( &x, &y );
+ return floatXToF64( &x );
+
+}
+
+float64_t slow_f64_mul( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ floatXMul( &x, &y );
+ return floatXToF64( &x );
+
+}
+
+float64_t slow_f64_mulAdd( float64_t a, float64_t b, float64_t c )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ floatXMul( &x, &y );
+ f64ToFloatX( c, &y );
+ floatXAdd( &x, &y );
+ return floatXToF64( &x );
+
+}
+
+float64_t slow_f64_div( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ floatXDiv( &x, &y );
+ return floatXToF64( &x );
+
+}
+
+float64_t slow_f64_rem( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ floatXRem( &x, &y );
+ return floatXToF64( &x );
+
+}
+
+float64_t slow_f64_sqrt( float64_t a )
+{
+ struct floatX x;
+
+ f64ToFloatX( a, &x );
+ floatXSqrt( &x );
+ return floatXToF64( &x );
+
+}
+
+bool slow_f64_eq( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ return floatXEq( &x, &y );
+
+}
+
+bool slow_f64_le( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXLe( &x, &y );
+
+}
+
+bool slow_f64_lt( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXLt( &x, &y );
+
+}
+
+bool slow_f64_eq_signaling( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXEq( &x, &y );
+
+}
+
+bool slow_f64_le_quiet( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ return floatXLe( &x, &y );
+
+}
+
+bool slow_f64_lt_quiet( float64_t a, float64_t b )
+{
+ struct floatX x, y;
+
+ f64ToFloatX( a, &x );
+ f64ToFloatX( b, &y );
+ return floatXLt( &x, &y );
+
+}
+
+#ifdef EXTFLOAT80
+
+uint_fast32_t
+ slow_extF80M_to_ui32(
+ const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToUI32( &x, roundingMode, exact );
+
+}
+
+uint_fast64_t
+ slow_extF80M_to_ui64(
+ const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToUI64( &x, roundingMode, exact );
+
+}
+
+int_fast32_t
+ slow_extF80M_to_i32(
+ const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToI32( &x, roundingMode, exact );
+
+}
+
+int_fast64_t
+ slow_extF80M_to_i64(
+ const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToI64( &x, roundingMode, exact );
+
+}
+
+uint_fast32_t
+ slow_extF80M_to_ui32_r_minMag( const extFloat80_t *aPtr, bool exact )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToUI32( &x, softfloat_round_minMag, exact );
+
+}
+
+uint_fast64_t
+ slow_extF80M_to_ui64_r_minMag( const extFloat80_t *aPtr, bool exact )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToUI64( &x, softfloat_round_minMag, exact );
+
+}
+
+int_fast32_t
+ slow_extF80M_to_i32_r_minMag( const extFloat80_t *aPtr, bool exact )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToI32( &x, softfloat_round_minMag, exact );
+
+}
+
+int_fast64_t
+ slow_extF80M_to_i64_r_minMag( const extFloat80_t *aPtr, bool exact )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToI64( &x, softfloat_round_minMag, exact );
+
+}
+
+float32_t slow_extF80M_to_f32( const extFloat80_t *aPtr )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToF32( &x );
+
+}
+
+float64_t slow_extF80M_to_f64( const extFloat80_t *aPtr )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ return floatXToF64( &x );
+
+}
+
+#ifdef FLOAT128
+
+void slow_extF80M_to_f128M( const extFloat80_t *aPtr, float128_t *zPtr )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ floatXToF128M( &x, zPtr );
+
+}
+
+#endif
+
+void
+ slow_extF80M_roundToInt(
+ const extFloat80_t *aPtr,
+ uint_fast8_t roundingMode,
+ bool exact,
+ extFloat80_t *zPtr
+ )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ floatXRoundToInt( &x, roundingMode, exact );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+void
+ slow_extF80M_add(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ floatXAdd( &x, &y );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+void
+ slow_extF80M_sub(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ y.sign = ! y.sign;
+ floatXAdd( &x, &y );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+void
+ slow_extF80M_mul(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ floatXMul( &x, &y );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+void
+ slow_extF80M_div(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ floatXDiv( &x, &y );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+void
+ slow_extF80M_rem(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ floatXRem( &x, &y );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+void slow_extF80M_sqrt( const extFloat80_t *aPtr, extFloat80_t *zPtr )
+{
+ struct floatX x;
+
+ extF80MToFloatX( aPtr, &x );
+ floatXSqrt( &x );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+bool slow_extF80M_eq( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ return floatXEq( &x, &y );
+
+}
+
+bool slow_extF80M_le( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXLe( &x, &y );
+
+}
+
+bool slow_extF80M_lt( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXLt( &x, &y );
+
+}
+
+bool
+ slow_extF80M_eq_signaling(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXEq( &x, &y );
+
+}
+
+bool slow_extF80M_le_quiet( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ return floatXLe( &x, &y );
+
+}
+
+bool slow_extF80M_lt_quiet( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+ struct floatX x, y;
+
+ extF80MToFloatX( aPtr, &x );
+ extF80MToFloatX( bPtr, &y );
+ return floatXLt( &x, &y );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+uint_fast32_t
+ slow_f128M_to_ui32(
+ const float128_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToUI32( &x, roundingMode, exact );
+
+}
+
+uint_fast64_t
+ slow_f128M_to_ui64(
+ const float128_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToUI64( &x, roundingMode, exact );
+
+}
+
+int_fast32_t
+ slow_f128M_to_i32(
+ const float128_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToI32( &x, roundingMode, exact );
+
+}
+
+int_fast64_t
+ slow_f128M_to_i64(
+ const float128_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToI64( &x, roundingMode, exact );
+
+}
+
+uint_fast32_t slow_f128M_to_ui32_r_minMag( const float128_t *aPtr, bool exact )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToUI32( &x, softfloat_round_minMag, exact );
+
+}
+
+uint_fast64_t slow_f128M_to_ui64_r_minMag( const float128_t *aPtr, bool exact )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToUI64( &x, softfloat_round_minMag, exact );
+
+}
+
+int_fast32_t slow_f128M_to_i32_r_minMag( const float128_t *aPtr, bool exact )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToI32( &x, softfloat_round_minMag, exact );
+
+}
+
+int_fast64_t slow_f128M_to_i64_r_minMag( const float128_t *aPtr, bool exact )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToI64( &x, softfloat_round_minMag, exact );
+
+}
+
+float32_t slow_f128M_to_f32( const float128_t *aPtr )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToF32( &x );
+
+}
+
+float64_t slow_f128M_to_f64( const float128_t *aPtr )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ return floatXToF64( &x );
+
+}
+
+#ifdef EXTFLOAT80
+
+void slow_f128M_to_extF80M( const float128_t *aPtr, extFloat80_t *zPtr )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ floatXToExtF80M( &x, zPtr );
+
+}
+
+#endif
+
+void
+ slow_f128M_roundToInt(
+ const float128_t *aPtr,
+ uint_fast8_t roundingMode,
+ bool exact,
+ float128_t *zPtr
+ )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ floatXRoundToInt( &x, roundingMode, exact );
+ floatXToF128M( &x, zPtr );
+
+}
+
+void
+ slow_f128M_add(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ floatXAdd( &x, &y );
+ floatXToF128M( &x, zPtr );
+
+}
+
+void
+ slow_f128M_sub(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ y.sign = ! y.sign;
+ floatXAdd( &x, &y );
+ floatXToF128M( &x, zPtr );
+
+}
+
+void
+ slow_f128M_mul(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ floatXMul( &x, &y );
+ floatXToF128M( &x, zPtr );
+
+}
+
+void
+ slow_f128M_mulAdd(
+ const float128_t *aPtr,
+ const float128_t *bPtr,
+ const float128_t *cPtr,
+ float128_t *zPtr
+ )
+{
+ struct floatX256 x, y;
+
+ f128MToFloatX256( aPtr, &x );
+ f128MToFloatX256( bPtr, &y );
+ floatX256Mul( &x, &y );
+ f128MToFloatX256( cPtr, &y );
+ floatX256Add( &x, &y );
+ floatX256ToF128M( &x, zPtr );
+
+}
+
+void
+ slow_f128M_div(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ floatXDiv( &x, &y );
+ floatXToF128M( &x, zPtr );
+
+}
+
+void
+ slow_f128M_rem(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ floatXRem( &x, &y );
+ floatXToF128M( &x, zPtr );
+
+}
+
+void slow_f128M_sqrt( const float128_t *aPtr, float128_t *zPtr )
+{
+ struct floatX x;
+
+ f128MToFloatX( aPtr, &x );
+ floatXSqrt( &x );
+ floatXToF128M( &x, zPtr );
+
+}
+
+bool slow_f128M_eq( const float128_t *aPtr, const float128_t *bPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ return floatXEq( &x, &y );
+
+}
+
+bool slow_f128M_le( const float128_t *aPtr, const float128_t *bPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXLe( &x, &y );
+
+}
+
+bool slow_f128M_lt( const float128_t *aPtr, const float128_t *bPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXLt( &x, &y );
+
+}
+
+bool slow_f128M_eq_signaling( const float128_t *aPtr, const float128_t *bPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ if ( x.isNaN || y.isNaN ) {
+ slowfloat_exceptionFlags |= softfloat_flag_invalid;
+ }
+ return floatXEq( &x, &y );
+
+}
+
+bool slow_f128M_le_quiet( const float128_t *aPtr, const float128_t *bPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ return floatXLe( &x, &y );
+
+}
+
+bool slow_f128M_lt_quiet( const float128_t *aPtr, const float128_t *bPtr )
+{
+ struct floatX x, y;
+
+ f128MToFloatX( aPtr, &x );
+ f128MToFloatX( bPtr, &y );
+ return floatXLt( &x, &y );
+
+}
+
+#endif
+
diff --git a/source/slowfloat.h b/source/slowfloat.h
new file mode 100644
index 0000000..b2d8cb8
--- /dev/null
+++ b/source/slowfloat.h
@@ -0,0 +1,220 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "softfloat.h"
+
+extern uint_fast8_t slowfloat_roundingMode;
+extern uint_fast8_t slowfloat_detectTininess;
+extern uint_fast8_t slowfloat_exceptionFlags;
+#ifdef EXTFLOAT80
+extern uint_fast8_t slow_extF80_roundingPrecision;
+#endif
+
+float32_t slow_ui32_to_f32( uint32_t );
+float64_t slow_ui32_to_f64( uint32_t );
+#ifdef EXTFLOAT80
+void slow_ui32_to_extF80M( uint32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void slow_ui32_to_f128M( uint32_t, float128_t * );
+#endif
+float32_t slow_ui64_to_f32( uint64_t );
+float64_t slow_ui64_to_f64( uint64_t );
+#ifdef EXTFLOAT80
+void slow_ui64_to_extF80M( uint64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void slow_ui64_to_f128M( uint64_t, float128_t * );
+#endif
+float32_t slow_i32_to_f32( int32_t );
+float64_t slow_i32_to_f64( int32_t );
+#ifdef EXTFLOAT80
+void slow_i32_to_extF80M( int32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void slow_i32_to_f128M( int32_t, float128_t * );
+#endif
+float32_t slow_i64_to_f32( int64_t );
+float64_t slow_i64_to_f64( int64_t );
+#ifdef EXTFLOAT80
+void slow_i64_to_extF80M( int64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void slow_i64_to_f128M( int64_t, float128_t * );
+#endif
+
+uint_fast32_t slow_f32_to_ui32( float32_t, uint_fast8_t, bool );
+uint_fast64_t slow_f32_to_ui64( float32_t, uint_fast8_t, bool );
+int_fast32_t slow_f32_to_i32( float32_t, uint_fast8_t, bool );
+int_fast64_t slow_f32_to_i64( float32_t, uint_fast8_t, bool );
+uint_fast32_t slow_f32_to_ui32_r_minMag( float32_t, bool );
+uint_fast64_t slow_f32_to_ui64_r_minMag( float32_t, bool );
+int_fast32_t slow_f32_to_i32_r_minMag( float32_t, bool );
+int_fast64_t slow_f32_to_i64_r_minMag( float32_t, bool );
+float64_t slow_f32_to_f64( float32_t );
+#ifdef EXTFLOAT80
+void slow_f32_to_extF80M( float32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void slow_f32_to_f128M( float32_t, float128_t * );
+#endif
+float32_t slow_f32_roundToInt( float32_t, uint_fast8_t, bool );
+float32_t slow_f32_add( float32_t, float32_t );
+float32_t slow_f32_sub( float32_t, float32_t );
+float32_t slow_f32_mul( float32_t, float32_t );
+float32_t slow_f32_mulAdd( float32_t, float32_t, float32_t );
+float32_t slow_f32_div( float32_t, float32_t );
+float32_t slow_f32_rem( float32_t, float32_t );
+float32_t slow_f32_sqrt( float32_t );
+bool slow_f32_eq( float32_t, float32_t );
+bool slow_f32_le( float32_t, float32_t );
+bool slow_f32_lt( float32_t, float32_t );
+bool slow_f32_eq_signaling( float32_t, float32_t );
+bool slow_f32_le_quiet( float32_t, float32_t );
+bool slow_f32_lt_quiet( float32_t, float32_t );
+
+uint_fast32_t slow_f64_to_ui32( float64_t, uint_fast8_t, bool );
+uint_fast64_t slow_f64_to_ui64( float64_t, uint_fast8_t, bool );
+int_fast32_t slow_f64_to_i32( float64_t, uint_fast8_t, bool );
+int_fast64_t slow_f64_to_i64( float64_t, uint_fast8_t, bool );
+uint_fast32_t slow_f64_to_ui32_r_minMag( float64_t, bool );
+uint_fast64_t slow_f64_to_ui64_r_minMag( float64_t, bool );
+int_fast32_t slow_f64_to_i32_r_minMag( float64_t, bool );
+int_fast64_t slow_f64_to_i64_r_minMag( float64_t, bool );
+float32_t slow_f64_to_f32( float64_t );
+#ifdef EXTFLOAT80
+void slow_f64_to_extF80M( float64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void slow_f64_to_f128M( float64_t, float128_t * );
+#endif
+float64_t slow_f64_roundToInt( float64_t, uint_fast8_t, bool );
+float64_t slow_f64_add( float64_t, float64_t );
+float64_t slow_f64_sub( float64_t, float64_t );
+float64_t slow_f64_mul( float64_t, float64_t );
+float64_t slow_f64_mulAdd( float64_t, float64_t, float64_t );
+float64_t slow_f64_div( float64_t, float64_t );
+float64_t slow_f64_rem( float64_t, float64_t );
+float64_t slow_f64_sqrt( float64_t );
+bool slow_f64_eq( float64_t, float64_t );
+bool slow_f64_le( float64_t, float64_t );
+bool slow_f64_lt( float64_t, float64_t );
+bool slow_f64_eq_signaling( float64_t, float64_t );
+bool slow_f64_le_quiet( float64_t, float64_t );
+bool slow_f64_lt_quiet( float64_t, float64_t );
+
+#ifdef EXTFLOAT80
+uint_fast32_t slow_extF80M_to_ui32( const extFloat80_t *, uint_fast8_t, bool );
+uint_fast64_t slow_extF80M_to_ui64( const extFloat80_t *, uint_fast8_t, bool );
+int_fast32_t slow_extF80M_to_i32( const extFloat80_t *, uint_fast8_t, bool );
+int_fast64_t slow_extF80M_to_i64( const extFloat80_t *, uint_fast8_t, bool );
+uint_fast32_t slow_extF80M_to_ui32_r_minMag( const extFloat80_t *, bool );
+uint_fast64_t slow_extF80M_to_ui64_r_minMag( const extFloat80_t *, bool );
+int_fast32_t slow_extF80M_to_i32_r_minMag( const extFloat80_t *, bool );
+int_fast64_t slow_extF80M_to_i64_r_minMag( const extFloat80_t *, bool );
+float32_t slow_extF80M_to_f32( const extFloat80_t * );
+float64_t slow_extF80M_to_f64( const extFloat80_t * );
+#ifdef FLOAT128
+void slow_extF80M_to_f128M( const extFloat80_t *, float128_t * );
+#endif
+void
+ slow_extF80M_roundToInt(
+ const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * );
+void
+ slow_extF80M_add(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void
+ slow_extF80M_sub(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void
+ slow_extF80M_mul(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void
+ slow_extF80M_mulAdd(
+ const extFloat80_t *,
+ const extFloat80_t *,
+ const extFloat80_t *,
+ extFloat80_t *
+ );
+void
+ slow_extF80M_div(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void
+ slow_extF80M_rem(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void slow_extF80M_sqrt( const extFloat80_t *, extFloat80_t * );
+bool slow_extF80M_eq( const extFloat80_t *, const extFloat80_t * );
+bool slow_extF80M_le( const extFloat80_t *, const extFloat80_t * );
+bool slow_extF80M_lt( const extFloat80_t *, const extFloat80_t * );
+bool slow_extF80M_eq_signaling( const extFloat80_t *, const extFloat80_t * );
+bool slow_extF80M_le_quiet( const extFloat80_t *, const extFloat80_t * );
+bool slow_extF80M_lt_quiet( const extFloat80_t *, const extFloat80_t * );
+#endif
+
+#ifdef FLOAT128
+uint_fast32_t slow_f128M_to_ui32( const float128_t *, uint_fast8_t, bool );
+uint_fast64_t slow_f128M_to_ui64( const float128_t *, uint_fast8_t, bool );
+int_fast32_t slow_f128M_to_i32( const float128_t *, uint_fast8_t, bool );
+int_fast64_t slow_f128M_to_i64( const float128_t *, uint_fast8_t, bool );
+uint_fast32_t slow_f128M_to_ui32_r_minMag( const float128_t *, bool );
+uint_fast64_t slow_f128M_to_ui64_r_minMag( const float128_t *, bool );
+int_fast32_t slow_f128M_to_i32_r_minMag( const float128_t *, bool );
+int_fast64_t slow_f128M_to_i64_r_minMag( const float128_t *, bool );
+float32_t slow_f128M_to_f32( const float128_t * );
+float64_t slow_f128M_to_f64( const float128_t * );
+#ifdef EXTFLOAT80
+void slow_f128M_to_extF80M( const float128_t *, extFloat80_t * );
+#endif
+void
+ slow_f128M_roundToInt( const float128_t *, uint_fast8_t, bool, float128_t * );
+void slow_f128M_add( const float128_t *, const float128_t *, float128_t * );
+void slow_f128M_sub( const float128_t *, const float128_t *, float128_t * );
+void slow_f128M_mul( const float128_t *, const float128_t *, float128_t * );
+void
+ slow_f128M_mulAdd(
+ const float128_t *, const float128_t *, const float128_t *, float128_t *
+ );
+void slow_f128M_div( const float128_t *, const float128_t *, float128_t * );
+void slow_f128M_rem( const float128_t *, const float128_t *, float128_t * );
+void slow_f128M_sqrt( const float128_t *, float128_t * );
+bool slow_f128M_eq( const float128_t *, const float128_t * );
+bool slow_f128M_le( const float128_t *, const float128_t * );
+bool slow_f128M_lt( const float128_t *, const float128_t * );
+bool slow_f128M_eq_signaling( const float128_t *, const float128_t * );
+bool slow_f128M_le_quiet( const float128_t *, const float128_t * );
+bool slow_f128M_lt_quiet( const float128_t *, const float128_t * );
+#endif
+
diff --git a/source/standardFunctionInfos.c b/source/standardFunctionInfos.c
new file mode 100644
index 0000000..68613eb
--- /dev/null
+++ b/source/standardFunctionInfos.c
@@ -0,0 +1,355 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include "platform.h"
+#include "functions.h"
+
+#define RNEVEN ROUND_NEAR_EVEN
+#define RMINM ROUND_MINMAG
+#define RMIN ROUND_MIN
+#define RMAX ROUND_MAX
+#define RNMAXM ROUND_NEAR_MAXMAG
+
+const struct standardFunctionInfo standardFunctionInfos[] = {
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ { "ui32_to_f32", UI32_TO_F32, 0, 0 },
+ { "ui32_to_f64", UI32_TO_F64, 0, 0 },
+#ifdef EXTFLOAT80
+ { "ui32_to_extF80", UI32_TO_EXTF80, 0, 0 },
+#endif
+#ifdef FLOAT128
+ { "ui32_to_f128", UI32_TO_F128, 0, 0 },
+#endif
+ { "ui64_to_f32", UI64_TO_F32, 0, 0 },
+ { "ui64_to_f64", UI64_TO_F64, 0, 0 },
+#ifdef EXTFLOAT80
+ { "ui64_to_extF80", UI64_TO_EXTF80, 0, 0 },
+#endif
+#ifdef FLOAT128
+ { "ui64_to_f128", UI64_TO_F128, 0, 0 },
+#endif
+ { "i32_to_f32", I32_TO_F32, 0, 0 },
+ { "i32_to_f64", I32_TO_F64, 0, 0 },
+#ifdef EXTFLOAT80
+ { "i32_to_extF80", I32_TO_EXTF80, 0, 0 },
+#endif
+#ifdef FLOAT128
+ { "i32_to_f128", I32_TO_F128, 0, 0 },
+#endif
+ { "i64_to_f32", I64_TO_F32, 0, 0 },
+ { "i64_to_f64", I64_TO_F64, 0, 0 },
+#ifdef EXTFLOAT80
+ { "i64_to_extF80", I64_TO_EXTF80, 0, 0 },
+#endif
+#ifdef FLOAT128
+ { "i64_to_f128", I64_TO_F128, 0, 0 },
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ { "f32_to_ui32_r_near_even", F32_TO_UI32, RNEVEN, false },
+ { "f32_to_ui32_r_minMag", F32_TO_UI32, RMINM, false },
+ { "f32_to_ui32_r_min", F32_TO_UI32, RMIN, false },
+ { "f32_to_ui32_r_max", F32_TO_UI32, RMAX, false },
+ { "f32_to_ui32_r_near_maxMag", F32_TO_UI32, RNMAXM, false },
+ { "f32_to_ui64_r_near_even", F32_TO_UI64, RNEVEN, false },
+ { "f32_to_ui64_r_minMag", F32_TO_UI64, RMINM, false },
+ { "f32_to_ui64_r_min", F32_TO_UI64, RMIN, false },
+ { "f32_to_ui64_r_max", F32_TO_UI64, RMAX, false },
+ { "f32_to_ui64_r_near_maxMag", F32_TO_UI64, RNMAXM, false },
+ { "f32_to_i32_r_near_even", F32_TO_I32, RNEVEN, false },
+ { "f32_to_i32_r_minMag", F32_TO_I32, RMINM, false },
+ { "f32_to_i32_r_min", F32_TO_I32, RMIN, false },
+ { "f32_to_i32_r_max", F32_TO_I32, RMAX, false },
+ { "f32_to_i32_r_near_maxMag", F32_TO_I32, RNMAXM, false },
+ { "f32_to_i64_r_near_even", F32_TO_I64, RNEVEN, false },
+ { "f32_to_i64_r_minMag", F32_TO_I64, RMINM, false },
+ { "f32_to_i64_r_min", F32_TO_I64, RMIN, false },
+ { "f32_to_i64_r_max", F32_TO_I64, RMAX, false },
+ { "f32_to_i64_r_near_maxMag", F32_TO_I64, RNMAXM, false },
+ { "f32_to_ui32_rx_near_even", F32_TO_UI32, RNEVEN, true },
+ { "f32_to_ui32_rx_minMag", F32_TO_UI32, RMINM, true },
+ { "f32_to_ui32_rx_min", F32_TO_UI32, RMIN, true },
+ { "f32_to_ui32_rx_max", F32_TO_UI32, RMAX, true },
+ { "f32_to_ui32_rx_near_maxMag", F32_TO_UI32, RNMAXM, true },
+ { "f32_to_ui64_rx_near_even", F32_TO_UI64, RNEVEN, true },
+ { "f32_to_ui64_rx_minMag", F32_TO_UI64, RMINM, true },
+ { "f32_to_ui64_rx_min", F32_TO_UI64, RMIN, true },
+ { "f32_to_ui64_rx_max", F32_TO_UI64, RMAX, true },
+ { "f32_to_ui64_rx_near_maxMag", F32_TO_UI64, RNMAXM, true },
+ { "f32_to_i32_rx_near_even", F32_TO_I32, RNEVEN, true },
+ { "f32_to_i32_rx_minMag", F32_TO_I32, RMINM, true },
+ { "f32_to_i32_rx_min", F32_TO_I32, RMIN, true },
+ { "f32_to_i32_rx_max", F32_TO_I32, RMAX, true },
+ { "f32_to_i32_rx_near_maxMag", F32_TO_I32, RNMAXM, true },
+ { "f32_to_i64_rx_near_even", F32_TO_I64, RNEVEN, true },
+ { "f32_to_i64_rx_minMag", F32_TO_I64, RMINM, true },
+ { "f32_to_i64_rx_min", F32_TO_I64, RMIN, true },
+ { "f32_to_i64_rx_max", F32_TO_I64, RMAX, true },
+ { "f32_to_i64_rx_near_maxMag", F32_TO_I64, RNMAXM, true },
+ { "f32_to_f64", F32_TO_F64, 0, 0 },
+#ifdef EXTFLOAT80
+ { "f32_to_extF80", F32_TO_EXTF80, 0, 0 },
+#endif
+#ifdef FLOAT128
+ { "f32_to_f128", F32_TO_F128, 0, 0 },
+#endif
+ { "f32_roundToInt_r_near_even", F32_ROUNDTOINT, RNEVEN, false },
+ { "f32_roundToInt_r_minMag", F32_ROUNDTOINT, RMINM, false },
+ { "f32_roundToInt_r_min", F32_ROUNDTOINT, RMIN, false },
+ { "f32_roundToInt_r_max", F32_ROUNDTOINT, RMAX, false },
+ { "f32_roundToInt_r_near_maxMag", F32_ROUNDTOINT, RNMAXM, false },
+ { "f32_roundToInt_x", F32_ROUNDTOINT, 0, true },
+ { "f32_add", F32_ADD, 0, 0 },
+ { "f32_sub", F32_SUB, 0, 0 },
+ { "f32_mul", F32_MUL, 0, 0 },
+ { "f32_mulAdd", F32_MULADD, 0, 0 },
+ { "f32_div", F32_DIV, 0, 0 },
+ { "f32_rem", F32_REM, 0, 0 },
+ { "f32_sqrt", F32_SQRT, 0, 0 },
+ { "f32_eq", F32_EQ, 0, 0 },
+ { "f32_le", F32_LE, 0, 0 },
+ { "f32_lt", F32_LT, 0, 0 },
+ { "f32_eq_signaling", F32_EQ_SIGNALING, 0, 0 },
+ { "f32_le_quiet", F32_LE_QUIET, 0, 0 },
+ { "f32_lt_quiet", F32_LT_QUIET, 0, 0 },
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ { "f64_to_ui32_r_near_even", F64_TO_UI32, RNEVEN, false },
+ { "f64_to_ui32_r_minMag", F64_TO_UI32, RMINM, false },
+ { "f64_to_ui32_r_min", F64_TO_UI32, RMIN, false },
+ { "f64_to_ui32_r_max", F64_TO_UI32, RMAX, false },
+ { "f64_to_ui32_r_near_maxMag", F64_TO_UI32, RNMAXM, false },
+ { "f64_to_ui64_r_near_even", F64_TO_UI64, RNEVEN, false },
+ { "f64_to_ui64_r_minMag", F64_TO_UI64, RMINM, false },
+ { "f64_to_ui64_r_min", F64_TO_UI64, RMIN, false },
+ { "f64_to_ui64_r_max", F64_TO_UI64, RMAX, false },
+ { "f64_to_ui64_r_near_maxMag", F64_TO_UI64, RNMAXM, false },
+ { "f64_to_i32_r_near_even", F64_TO_I32, RNEVEN, false },
+ { "f64_to_i32_r_minMag", F64_TO_I32, RMINM, false },
+ { "f64_to_i32_r_min", F64_TO_I32, RMIN, false },
+ { "f64_to_i32_r_max", F64_TO_I32, RMAX, false },
+ { "f64_to_i32_r_near_maxMag", F64_TO_I32, RNMAXM, false },
+ { "f64_to_i64_r_near_even", F64_TO_I64, RNEVEN, false },
+ { "f64_to_i64_r_minMag", F64_TO_I64, RMINM, false },
+ { "f64_to_i64_r_min", F64_TO_I64, RMIN, false },
+ { "f64_to_i64_r_max", F64_TO_I64, RMAX, false },
+ { "f64_to_i64_r_near_maxMag", F64_TO_I64, RNMAXM, false },
+ { "f64_to_ui32_rx_near_even", F64_TO_UI32, RNEVEN, true },
+ { "f64_to_ui32_rx_minMag", F64_TO_UI32, RMINM, true },
+ { "f64_to_ui32_rx_min", F64_TO_UI32, RMIN, true },
+ { "f64_to_ui32_rx_max", F64_TO_UI32, RMAX, true },
+ { "f64_to_ui32_rx_near_maxMag", F64_TO_UI32, RNMAXM, true },
+ { "f64_to_ui64_rx_near_even", F64_TO_UI64, RNEVEN, true },
+ { "f64_to_ui64_rx_minMag", F64_TO_UI64, RMINM, true },
+ { "f64_to_ui64_rx_min", F64_TO_UI64, RMIN, true },
+ { "f64_to_ui64_rx_max", F64_TO_UI64, RMAX, true },
+ { "f64_to_ui64_rx_near_maxMag", F64_TO_UI64, RNMAXM, true },
+ { "f64_to_i32_rx_near_even", F64_TO_I32, RNEVEN, true },
+ { "f64_to_i32_rx_minMag", F64_TO_I32, RMINM, true },
+ { "f64_to_i32_rx_min", F64_TO_I32, RMIN, true },
+ { "f64_to_i32_rx_max", F64_TO_I32, RMAX, true },
+ { "f64_to_i32_rx_near_maxMag", F64_TO_I32, RNMAXM, true },
+ { "f64_to_i64_rx_near_even", F64_TO_I64, RNEVEN, true },
+ { "f64_to_i64_rx_minMag", F64_TO_I64, RMINM, true },
+ { "f64_to_i64_rx_min", F64_TO_I64, RMIN, true },
+ { "f64_to_i64_rx_max", F64_TO_I64, RMAX, true },
+ { "f64_to_i64_rx_near_maxMag", F64_TO_I64, RNMAXM, true },
+ { "f64_to_f32", F64_TO_F32, 0, 0 },
+#ifdef EXTFLOAT80
+ { "f64_to_extF80", F64_TO_EXTF80, 0, 0 },
+#endif
+#ifdef FLOAT128
+ { "f64_to_f128", F64_TO_F128, 0, 0 },
+#endif
+ { "f64_roundToInt_r_near_even", F64_ROUNDTOINT, RNEVEN, false },
+ { "f64_roundToInt_r_minMag", F64_ROUNDTOINT, RMINM, false },
+ { "f64_roundToInt_r_min", F64_ROUNDTOINT, RMIN, false },
+ { "f64_roundToInt_r_max", F64_ROUNDTOINT, RMAX, false },
+ { "f64_roundToInt_r_near_maxMag", F64_ROUNDTOINT, RNMAXM, false },
+ { "f64_roundToInt_x", F64_ROUNDTOINT, 0, true },
+ { "f64_add", F64_ADD, 0, 0 },
+ { "f64_sub", F64_SUB, 0, 0 },
+ { "f64_mul", F64_MUL, 0, 0 },
+ { "f64_mulAdd", F64_MULADD, 0, 0 },
+ { "f64_div", F64_DIV, 0, 0 },
+ { "f64_rem", F64_REM, 0, 0 },
+ { "f64_sqrt", F64_SQRT, 0, 0 },
+ { "f64_eq", F64_EQ, 0, 0 },
+ { "f64_le", F64_LE, 0, 0 },
+ { "f64_lt", F64_LT, 0, 0 },
+ { "f64_eq_signaling", F64_EQ_SIGNALING, 0, 0 },
+ { "f64_le_quiet", F64_LE_QUIET, 0, 0 },
+ { "f64_lt_quiet", F64_LT_QUIET, 0, 0 },
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+ { "extF80_to_ui32_r_near_even", EXTF80_TO_UI32, RNEVEN, false },
+ { "extF80_to_ui32_r_minMag", EXTF80_TO_UI32, RMINM, false },
+ { "extF80_to_ui32_r_min", EXTF80_TO_UI32, RMIN, false },
+ { "extF80_to_ui32_r_max", EXTF80_TO_UI32, RMAX, false },
+ { "extF80_to_ui32_r_near_maxMag", EXTF80_TO_UI32, RNMAXM, false },
+ { "extF80_to_ui64_r_near_even", EXTF80_TO_UI64, RNEVEN, false },
+ { "extF80_to_ui64_r_minMag", EXTF80_TO_UI64, RMINM, false },
+ { "extF80_to_ui64_r_min", EXTF80_TO_UI64, RMIN, false },
+ { "extF80_to_ui64_r_max", EXTF80_TO_UI64, RMAX, false },
+ { "extF80_to_ui64_r_near_maxMag", EXTF80_TO_UI64, RNMAXM, false },
+ { "extF80_to_i32_r_near_even", EXTF80_TO_I32, RNEVEN, false },
+ { "extF80_to_i32_r_minMag", EXTF80_TO_I32, RMINM, false },
+ { "extF80_to_i32_r_min", EXTF80_TO_I32, RMIN, false },
+ { "extF80_to_i32_r_max", EXTF80_TO_I32, RMAX, false },
+ { "extF80_to_i32_r_near_maxMag", EXTF80_TO_I32, RNMAXM, false },
+ { "extF80_to_i64_r_near_even", EXTF80_TO_I64, RNEVEN, false },
+ { "extF80_to_i64_r_minMag", EXTF80_TO_I64, RMINM, false },
+ { "extF80_to_i64_r_min", EXTF80_TO_I64, RMIN, false },
+ { "extF80_to_i64_r_max", EXTF80_TO_I64, RMAX, false },
+ { "extF80_to_i64_r_near_maxMag", EXTF80_TO_I64, RNMAXM, false },
+ { "extF80_to_ui32_rx_near_even", EXTF80_TO_UI32, RNEVEN, true },
+ { "extF80_to_ui32_rx_minMag", EXTF80_TO_UI32, RMINM, true },
+ { "extF80_to_ui32_rx_min", EXTF80_TO_UI32, RMIN, true },
+ { "extF80_to_ui32_rx_max", EXTF80_TO_UI32, RMAX, true },
+ { "extF80_to_ui32_rx_near_maxMag", EXTF80_TO_UI32, RNMAXM, true },
+ { "extF80_to_ui64_rx_near_even", EXTF80_TO_UI64, RNEVEN, true },
+ { "extF80_to_ui64_rx_minMag", EXTF80_TO_UI64, RMINM, true },
+ { "extF80_to_ui64_rx_min", EXTF80_TO_UI64, RMIN, true },
+ { "extF80_to_ui64_rx_max", EXTF80_TO_UI64, RMAX, true },
+ { "extF80_to_ui64_rx_near_maxMag", EXTF80_TO_UI64, RNMAXM, true },
+ { "extF80_to_i32_rx_near_even", EXTF80_TO_I32, RNEVEN, true },
+ { "extF80_to_i32_rx_minMag", EXTF80_TO_I32, RMINM, true },
+ { "extF80_to_i32_rx_min", EXTF80_TO_I32, RMIN, true },
+ { "extF80_to_i32_rx_max", EXTF80_TO_I32, RMAX, true },
+ { "extF80_to_i32_rx_near_maxMag", EXTF80_TO_I32, RNMAXM, true },
+ { "extF80_to_i64_rx_near_even", EXTF80_TO_I64, RNEVEN, true },
+ { "extF80_to_i64_rx_minMag", EXTF80_TO_I64, RMINM, true },
+ { "extF80_to_i64_rx_min", EXTF80_TO_I64, RMIN, true },
+ { "extF80_to_i64_rx_max", EXTF80_TO_I64, RMAX, true },
+ { "extF80_to_i64_rx_near_maxMag", EXTF80_TO_I64, RNMAXM, true },
+ { "extF80_to_f32", EXTF80_TO_F32, 0, 0 },
+ { "extF80_to_f64", EXTF80_TO_F64, 0, 0 },
+#ifdef FLOAT128
+ { "extF80_to_f128", EXTF80_TO_F128, 0, 0 },
+#endif
+ { "extF80_roundToInt_r_near_even", EXTF80_ROUNDTOINT, RNEVEN, false },
+ { "extF80_roundToInt_r_minMag", EXTF80_ROUNDTOINT, RMINM, false },
+ { "extF80_roundToInt_r_min", EXTF80_ROUNDTOINT, RMIN, false },
+ { "extF80_roundToInt_r_max", EXTF80_ROUNDTOINT, RMAX, false },
+ { "extF80_roundToInt_r_near_maxMag", EXTF80_ROUNDTOINT, RNMAXM, false },
+ { "extF80_roundToInt_x", EXTF80_ROUNDTOINT, 0, true },
+ { "extF80_add", EXTF80_ADD, 0, 0 },
+ { "extF80_sub", EXTF80_SUB, 0, 0 },
+ { "extF80_mul", EXTF80_MUL, 0, 0 },
+ { "extF80_div", EXTF80_DIV, 0, 0 },
+ { "extF80_rem", EXTF80_REM, 0, 0 },
+ { "extF80_sqrt", EXTF80_SQRT, 0, 0 },
+ { "extF80_eq", EXTF80_EQ, 0, 0 },
+ { "extF80_le", EXTF80_LE, 0, 0 },
+ { "extF80_lt", EXTF80_LT, 0, 0 },
+ { "extF80_eq_signaling", EXTF80_EQ_SIGNALING, 0, 0 },
+ { "extF80_le_quiet", EXTF80_LE_QUIET, 0, 0 },
+ { "extF80_lt_quiet", EXTF80_LT_QUIET, 0, 0 },
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef FLOAT128
+ { "f128_to_ui32_r_near_even", F128_TO_UI32, RNEVEN, false },
+ { "f128_to_ui32_r_minMag", F128_TO_UI32, RMINM, false },
+ { "f128_to_ui32_r_min", F128_TO_UI32, RMIN, false },
+ { "f128_to_ui32_r_max", F128_TO_UI32, RMAX, false },
+ { "f128_to_ui32_r_near_maxMag", F128_TO_UI32, RNMAXM, false },
+ { "f128_to_ui64_r_near_even", F128_TO_UI64, RNEVEN, false },
+ { "f128_to_ui64_r_minMag", F128_TO_UI64, RMINM, false },
+ { "f128_to_ui64_r_min", F128_TO_UI64, RMIN, false },
+ { "f128_to_ui64_r_max", F128_TO_UI64, RMAX, false },
+ { "f128_to_ui64_r_near_maxMag", F128_TO_UI64, RNMAXM, false },
+ { "f128_to_i32_r_near_even", F128_TO_I32, RNEVEN, false },
+ { "f128_to_i32_r_minMag", F128_TO_I32, RMINM, false },
+ { "f128_to_i32_r_min", F128_TO_I32, RMIN, false },
+ { "f128_to_i32_r_max", F128_TO_I32, RMAX, false },
+ { "f128_to_i32_r_near_maxMag", F128_TO_I32, RNMAXM, false },
+ { "f128_to_i64_r_near_even", F128_TO_I64, RNEVEN, false },
+ { "f128_to_i64_r_minMag", F128_TO_I64, RMINM, false },
+ { "f128_to_i64_r_min", F128_TO_I64, RMIN, false },
+ { "f128_to_i64_r_max", F128_TO_I64, RMAX, false },
+ { "f128_to_i64_r_near_maxMag", F128_TO_I64, RNMAXM, false },
+ { "f128_to_ui32_rx_near_even", F128_TO_UI32, RNEVEN, true },
+ { "f128_to_ui32_rx_minMag", F128_TO_UI32, RMINM, true },
+ { "f128_to_ui32_rx_min", F128_TO_UI32, RMIN, true },
+ { "f128_to_ui32_rx_max", F128_TO_UI32, RMAX, true },
+ { "f128_to_ui32_rx_near_maxMag", F128_TO_UI32, RNMAXM, true },
+ { "f128_to_ui64_rx_near_even", F128_TO_UI64, RNEVEN, true },
+ { "f128_to_ui64_rx_minMag", F128_TO_UI64, RMINM, true },
+ { "f128_to_ui64_rx_min", F128_TO_UI64, RMIN, true },
+ { "f128_to_ui64_rx_max", F128_TO_UI64, RMAX, true },
+ { "f128_to_ui64_rx_near_maxMag", F128_TO_UI64, RNMAXM, true },
+ { "f128_to_i32_rx_near_even", F128_TO_I32, RNEVEN, true },
+ { "f128_to_i32_rx_minMag", F128_TO_I32, RMINM, true },
+ { "f128_to_i32_rx_min", F128_TO_I32, RMIN, true },
+ { "f128_to_i32_rx_max", F128_TO_I32, RMAX, true },
+ { "f128_to_i32_rx_near_maxMag", F128_TO_I32, RNMAXM, true },
+ { "f128_to_i64_rx_near_even", F128_TO_I64, RNEVEN, true },
+ { "f128_to_i64_rx_minMag", F128_TO_I64, RMINM, true },
+ { "f128_to_i64_rx_min", F128_TO_I64, RMIN, true },
+ { "f128_to_i64_rx_max", F128_TO_I64, RMAX, true },
+ { "f128_to_i64_rx_near_maxMag", F128_TO_I64, RNMAXM, true },
+ { "f128_to_f32", F128_TO_F32, 0, 0 },
+ { "f128_to_f64", F128_TO_F64, 0, 0 },
+#ifdef EXTFLOAT80
+ { "f128_to_extF80", F128_TO_EXTF80, 0, 0 },
+#endif
+ { "f128_roundToInt_r_near_even", F128_ROUNDTOINT, RNEVEN, false },
+ { "f128_roundToInt_r_minMag", F128_ROUNDTOINT, RMINM, false },
+ { "f128_roundToInt_r_min", F128_ROUNDTOINT, RMIN, false },
+ { "f128_roundToInt_r_max", F128_ROUNDTOINT, RMAX, false },
+ { "f128_roundToInt_r_near_maxMag", F128_ROUNDTOINT, RNMAXM, false },
+ { "f128_roundToInt_x", F128_ROUNDTOINT, 0, true },
+ { "f128_add", F128_ADD, 0, 0 },
+ { "f128_sub", F128_SUB, 0, 0 },
+ { "f128_mul", F128_MUL, 0, 0 },
+ { "f128_mulAdd", F128_MULADD, 0, 0 },
+ { "f128_div", F128_DIV, 0, 0 },
+ { "f128_rem", F128_REM, 0, 0 },
+ { "f128_sqrt", F128_SQRT, 0, 0 },
+ { "f128_eq", F128_EQ, 0, 0 },
+ { "f128_le", F128_LE, 0, 0 },
+ { "f128_lt", F128_LT, 0, 0 },
+ { "f128_eq_signaling", F128_EQ_SIGNALING, 0, 0 },
+ { "f128_le_quiet", F128_LE_QUIET, 0, 0 },
+ { "f128_lt_quiet", F128_LT_QUIET, 0, 0 },
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ { 0, 0, 0, 0 }
+};
+
diff --git a/source/subj-C/subjfloat.c b/source/subj-C/subjfloat.c
new file mode 100644
index 0000000..4d1a0d6
--- /dev/null
+++ b/source/subj-C/subjfloat.c
@@ -0,0 +1,734 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <fenv.h>
+#include <math.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "subjfloat_config.h"
+#include "subjfloat.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void subjfloat_setRoundingMode( uint_fast8_t roundingMode )
+{
+
+ fesetround(
+ (roundingMode == softfloat_round_near_even) ? FE_TONEAREST
+ : (roundingMode == softfloat_round_minMag) ? FE_TOWARDZERO
+ : (roundingMode == softfloat_round_min) ? FE_DOWNWARD
+ : FE_UPWARD
+ );
+
+}
+
+void subjfloat_setExtF80RoundingPrecision( uint_fast8_t roundingPrecision )
+{
+
+}
+
+uint_fast8_t subjfloat_clearExceptionFlags( void )
+{
+ int subjExceptionFlags;
+ uint_fast8_t exceptionFlags;
+
+ subjExceptionFlags =
+ fetestexcept(
+ FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT
+ );
+ feclearexcept(
+ FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT );
+ exceptionFlags = 0;
+ if ( subjExceptionFlags & FE_INVALID ) {
+ exceptionFlags |= softfloat_flag_invalid;
+ }
+ if ( subjExceptionFlags & FE_DIVBYZERO ) {
+ exceptionFlags |= softfloat_flag_infinite;
+ }
+ if ( subjExceptionFlags & FE_OVERFLOW ) {
+ exceptionFlags |= softfloat_flag_overflow;
+ }
+ if ( subjExceptionFlags & FE_UNDERFLOW ) {
+ exceptionFlags |= softfloat_flag_underflow;
+ }
+ if ( subjExceptionFlags & FE_INEXACT ) {
+ exceptionFlags |= softfloat_flag_inexact;
+ }
+ return exceptionFlags;
+
+}
+
+union f32_f { float32_t f32; float f; };
+union f64_d { float64_t f64; double d; };
+
+float32_t subj_ui32_to_f32( uint_fast32_t a )
+{
+ union f32_f uZ;
+
+ uZ.f = a;
+ return uZ.f32;
+
+}
+
+float64_t subj_ui32_to_f64( uint_fast32_t a )
+{
+ union f64_d uZ;
+
+ uZ.d = a;
+ return uZ.f64;
+
+}
+
+float32_t subj_ui64_to_f32( uint_fast64_t a )
+{
+ union f32_f uZ;
+
+ uZ.f = a;
+ return uZ.f32;
+
+}
+
+float64_t subj_ui64_to_f64( uint_fast64_t a )
+{
+ union f64_d uZ;
+
+ uZ.d = a;
+ return uZ.f64;
+
+}
+
+float32_t subj_i32_to_f32( int_fast32_t a )
+{
+ union f32_f uZ;
+
+ uZ.f = a;
+ return uZ.f32;
+
+}
+
+float64_t subj_i32_to_f64( int_fast32_t a )
+{
+ union f64_d uZ;
+
+ uZ.d = a;
+ return uZ.f64;
+
+}
+
+float32_t subj_i64_to_f32( int_fast64_t a )
+{
+ union f32_f uZ;
+
+ uZ.f = a;
+ return uZ.f32;
+
+}
+
+float64_t subj_i64_to_f64( int_fast64_t a )
+{
+ union f64_d uZ;
+
+ uZ.d = a;
+ return uZ.f64;
+
+}
+
+uint_fast32_t subj_f32_to_ui32_rx_minMag( float32_t a )
+{
+ union f32_f uA;
+
+ uA.f32 = a;
+ return (uint32_t) uA.f;
+
+}
+
+uint_fast64_t subj_f32_to_ui64_rx_minMag( float32_t a )
+{
+ union f32_f uA;
+
+ uA.f32 = a;
+ return (uint64_t) uA.f;
+
+}
+
+int_fast32_t subj_f32_to_i32_rx_minMag( float32_t a )
+{
+ union f32_f uA;
+
+ uA.f32 = a;
+ return (int32_t) uA.f;
+
+}
+
+int_fast64_t subj_f32_to_i64_rx_minMag( float32_t a )
+{
+ union f32_f uA;
+
+ uA.f32 = a;
+ return (int64_t) uA.f;
+
+}
+
+float64_t subj_f32_to_f64( float32_t a )
+{
+ union f32_f uA;
+ union f64_d uZ;
+
+ uA.f32 = a;
+ uZ.d = uA.f;
+ return uZ.f64;
+
+}
+
+float32_t subj_f32_add( float32_t a, float32_t b )
+{
+ union f32_f uA, uB, uZ;
+
+ uA.f32 = a;
+ uB.f32 = b;
+ uZ.f = uA.f + uB.f;
+ return uZ.f32;
+
+}
+
+float32_t subj_f32_sub( float32_t a, float32_t b )
+{
+ union f32_f uA, uB, uZ;
+
+ uA.f32 = a;
+ uB.f32 = b;
+ uZ.f = uA.f - uB.f;
+ return uZ.f32;
+
+}
+
+float32_t subj_f32_mul( float32_t a, float32_t b )
+{
+ union f32_f uA, uB, uZ;
+
+ uA.f32 = a;
+ uB.f32 = b;
+ uZ.f = uA.f * uB.f;
+ return uZ.f32;
+
+}
+
+float32_t subj_f32_div( float32_t a, float32_t b )
+{
+ union f32_f uA, uB, uZ;
+
+ uA.f32 = a;
+ uB.f32 = b;
+ uZ.f = uA.f / uB.f;
+ return uZ.f32;
+
+}
+
+bool subj_f32_eq( float32_t a, float32_t b )
+{
+ union f32_f uA, uB;
+
+ uA.f32 = a;
+ uB.f32 = b;
+ return (uA.f == uB.f);
+
+}
+
+bool subj_f32_le( float32_t a, float32_t b )
+{
+ union f32_f uA, uB;
+
+ uA.f32 = a;
+ uB.f32 = b;
+ return (uA.f <= uB.f);
+
+}
+
+bool subj_f32_lt( float32_t a, float32_t b )
+{
+ union f32_f uA, uB;
+
+ uA.f32 = a;
+ uB.f32 = b;
+ return (uA.f < uB.f);
+
+}
+
+uint_fast32_t subj_f64_to_ui32_rx_minMag( float64_t a )
+{
+ union f64_d uA;
+
+ uA.f64 = a;
+ return (uint32_t) uA.d;
+
+}
+
+uint_fast64_t subj_f64_to_ui64_rx_minMag( float64_t a )
+{
+ union f64_d uA;
+
+ uA.f64 = a;
+ return (uint64_t) uA.d;
+
+}
+
+int_fast32_t subj_f64_to_i32_rx_minMag( float64_t a )
+{
+ union f64_d uA;
+
+ uA.f64 = a;
+ return (int32_t) uA.d;
+
+}
+
+int_fast64_t subj_f64_to_i64_rx_minMag( float64_t a )
+{
+ union f64_d uA;
+
+ uA.f64 = a;
+ return (int64_t) uA.d;
+
+}
+
+float32_t subj_f64_to_f32( float64_t a )
+{
+ union f64_d uA;
+ union f32_f uZ;
+
+ uA.f64 = a;
+ uZ.f = uA.d;
+ return uZ.f32;
+
+}
+
+float64_t subj_f64_add( float64_t a, float64_t b )
+{
+ union f64_d uA, uB, uZ;
+
+ uA.f64 = a;
+ uB.f64 = b;
+ uZ.d = uA.d + uB.d;
+ return uZ.f64;
+
+}
+
+float64_t subj_f64_sub( float64_t a, float64_t b )
+{
+ union f64_d uA, uB, uZ;
+
+ uA.f64 = a;
+ uB.f64 = b;
+ uZ.d = uA.d - uB.d;
+ return uZ.f64;
+
+}
+
+float64_t subj_f64_mul( float64_t a, float64_t b )
+{
+ union f64_d uA, uB, uZ;
+
+ uA.f64 = a;
+ uB.f64 = b;
+ uZ.d = uA.d * uB.d;
+ return uZ.f64;
+
+}
+
+float64_t subj_f64_div( float64_t a, float64_t b )
+{
+ union f64_d uA, uB, uZ;
+
+ uA.f64 = a;
+ uB.f64 = b;
+ uZ.d = uA.d / uB.d;
+ return uZ.f64;
+
+}
+
+float64_t subj_f64_sqrt( float64_t a )
+{
+ union f64_d uA, uZ;
+
+ uA.f64 = a;
+ uZ.d = sqrt( uA.d );
+ return uZ.f64;
+
+}
+
+bool subj_f64_eq( float64_t a, float64_t b )
+{
+ union f64_d uA, uB;
+
+ uA.f64 = a;
+ uB.f64 = b;
+ return (uA.d == uB.d);
+
+}
+
+bool subj_f64_le( float64_t a, float64_t b )
+{
+ union f64_d uA, uB;
+
+ uA.f64 = a;
+ uB.f64 = b;
+ return (uA.d <= uB.d);
+
+}
+
+bool subj_f64_lt( float64_t a, float64_t b )
+{
+ union f64_d uA, uB;
+
+ uA.f64 = a;
+ uB.f64 = b;
+ return (uA.d < uB.d);
+
+}
+
+#if defined EXTFLOAT80 && defined LONG_DOUBLE_IS_EXTFLOAT80
+
+void subj_ui32_to_extF80M( uint_fast32_t a, extFloat80_t *zPtr )
+{
+
+ *((long double *) zPtr) = a;
+
+}
+
+void subj_ui64_to_extF80M( uint_fast64_t a, extFloat80_t *zPtr )
+{
+
+ *((long double *) zPtr) = a;
+
+}
+
+void subj_i32_to_extF80M( int_fast32_t a, extFloat80_t *zPtr )
+{
+
+ *((long double *) zPtr) = a;
+
+}
+
+void subj_i64_to_extF80M( int_fast64_t a, extFloat80_t *zPtr )
+{
+
+ *((long double *) zPtr) = a;
+
+}
+
+void subj_f32_to_extF80M( float32_t a, extFloat80_t *zPtr )
+{
+ union f32_f uA;
+
+ uA.f32 = a;
+ *((long double *) zPtr) = uA.f;
+
+}
+
+void subj_f64_to_extF80M( float64_t a, extFloat80_t *zPtr )
+{
+ union f64_d uA;
+
+ uA.f64 = a;
+ *((long double *) zPtr) = uA.d;
+
+}
+
+uint_fast32_t subj_extF80M_to_ui32_rx_minMag( const extFloat80_t *aPtr )
+{
+
+ return *((const long double *) aPtr);
+
+}
+
+uint_fast64_t subj_extF80M_to_ui64_rx_minMag( const extFloat80_t *aPtr )
+{
+
+ return *((const long double *) aPtr);
+
+}
+
+int_fast32_t subj_extF80M_to_i32_rx_minMag( const extFloat80_t *aPtr )
+{
+
+ return *((const long double *) aPtr);
+
+}
+
+int_fast64_t subj_extF80M_to_i64_rx_minMag( const extFloat80_t *aPtr )
+{
+
+ return *((const long double *) aPtr);
+
+}
+
+float32_t subj_extF80M_to_f32( const extFloat80_t *aPtr )
+{
+ union f32_f uZ;
+
+ uZ.f = *((const long double *) aPtr);
+ return uZ.f32;
+
+}
+
+float64_t subj_extF80M_to_f64( const extFloat80_t *aPtr )
+{
+ union f64_d uZ;
+
+ uZ.d = *((const long double *) aPtr);
+ return uZ.f64;
+
+}
+
+void
+ subj_extF80M_add(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+
+ *((long double *) zPtr) =
+ *((const long double *) aPtr) + *((const long double *) bPtr);
+
+}
+
+void
+ subj_extF80M_sub(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+
+ *((long double *) zPtr) =
+ *((const long double *) aPtr) - *((const long double *) bPtr);
+
+}
+
+void
+ subj_extF80M_mul(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+
+ *((long double *) zPtr) =
+ *((const long double *) aPtr) * *((const long double *) bPtr);
+
+}
+
+void
+ subj_extF80M_div(
+ const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr )
+{
+
+ *((long double *) zPtr) =
+ *((const long double *) aPtr) / *((const long double *) bPtr);
+
+}
+
+bool subj_extF80M_eq( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+
+ return (*((const long double *) aPtr) == *((const long double *) bPtr));
+
+}
+
+bool subj_extF80M_le( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+
+ return (*((const long double *) aPtr) <= *((const long double *) bPtr));
+
+}
+
+bool subj_extF80M_lt( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+
+ return (*((const long double *) aPtr) < *((const long double *) bPtr));
+
+}
+
+#endif
+
+#if defined FLOAT128 && defined LONG_DOUBLE_IS_FLOAT128
+
+void subj_ui32_to_f128M( uint_fast32_t a, float128_t *zPtr )
+{
+
+ *((long double *) zPtr) = a;
+
+}
+
+void subj_ui64_to_f128M( uint_fast64_t a, float128_t *zPtr )
+{
+
+ *((long double *) zPtr) = a;
+
+}
+
+void subj_i32_to_f128M( int_fast32_t a, float128_t *zPtr )
+{
+
+ *((long double *) zPtr) = a;
+
+}
+
+void subj_i64_to_f128M( int_fast64_t a, float128_t *zPtr )
+{
+
+ *((long double *) zPtr) = a;
+
+}
+
+void subj_f32_to_f128M( float32_t a, float128_t *zPtr )
+{
+ union f32_f uA;
+
+ uA.f32 = a;
+ *((long double *) zPtr) = uA.f;
+
+}
+
+void subj_f64_to_f128M( float64_t a, float128_t *zPtr )
+{
+ union f64_d uA;
+
+ uA.f64 = a;
+ *((long double *) zPtr) = uA.d;
+
+}
+
+uint_fast32_t subj_f128M_to_ui32_rx_minMag( const float128_t *aPtr )
+{
+
+ return *((const long double *) aPtr);
+
+}
+
+uint_fast64_t subj_f128M_to_ui64_rx_minMag( const float128_t *aPtr )
+{
+
+ return *((const long double *) aPtr);
+
+}
+
+int_fast32_t subj_f128M_to_i32_rx_minMag( const float128_t *aPtr )
+{
+
+ return *((const long double *) aPtr);
+
+}
+
+int_fast64_t subj_f128M_to_i64_rx_minMag( const float128_t *aPtr )
+{
+
+ return *((const long double *) aPtr);
+
+}
+
+float32_t subj_f128M_to_f32( const float128_t *aPtr )
+{
+ union f32_f uZ;
+
+ uZ.f = *((const long double *) aPtr);
+ return uZ.f32;
+
+}
+
+float64_t subj_f128M_to_f64( const float128_t *aPtr )
+{
+ union f64_d uZ;
+
+ uZ.d = *((const long double *) aPtr);
+ return uZ.f64;
+
+}
+
+void
+ subj_f128M_add(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+
+ *((long double *) zPtr) =
+ *((const long double *) aPtr) + *((const long double *) bPtr);
+
+}
+
+void
+ subj_f128M_sub(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+
+ *((long double *) zPtr) =
+ *((const long double *) aPtr) - *((const long double *) bPtr);
+
+}
+
+void
+ subj_f128M_mul(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+
+ *((long double *) zPtr) =
+ *((const long double *) aPtr) * *((const long double *) bPtr);
+
+}
+
+void
+ subj_f128M_div(
+ const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr )
+{
+
+ *((long double *) zPtr) =
+ *((const long double *) aPtr) / *((const long double *) bPtr);
+
+}
+
+bool subj_f128M_eq( const float128_t *aPtr, const float128_t *bPtr )
+{
+
+ return (*((const long double *) aPtr) == *((const long double *) bPtr));
+
+}
+
+bool subj_f128M_le( const float128_t *aPtr, const float128_t *bPtr )
+{
+
+ return (*((const long double *) aPtr) <= *((const long double *) bPtr));
+
+}
+
+bool subj_f128M_lt( const float128_t *aPtr, const float128_t *bPtr )
+{
+
+ return (*((const long double *) aPtr) < *((const long double *) bPtr));
+
+}
+
+#endif
+
diff --git a/source/subj-C/subjfloat_config.h b/source/subj-C/subjfloat_config.h
new file mode 100644
index 0000000..74ef090
--- /dev/null
+++ b/source/subj-C/subjfloat_config.h
@@ -0,0 +1,94 @@
+
+/*----------------------------------------------------------------------------
+| The following macros are defined to indicate all the subject functions that
+| exist.
+*----------------------------------------------------------------------------*/
+
+#define SUBJ_UI32_TO_F32
+#define SUBJ_UI32_TO_F64
+#define SUBJ_UI64_TO_F32
+#define SUBJ_UI64_TO_F64
+#define SUBJ_I32_TO_F32
+#define SUBJ_I32_TO_F64
+#define SUBJ_I64_TO_F32
+#define SUBJ_I64_TO_F64
+
+#define SUBJ_F32_TO_UI32_RX_MINMAG
+#define SUBJ_F32_TO_UI64_RX_MINMAG
+#define SUBJ_F32_TO_I32_RX_MINMAG
+#define SUBJ_F32_TO_I64_RX_MINMAG
+#define SUBJ_F32_TO_F64
+#define SUBJ_F32_ADD
+#define SUBJ_F32_SUB
+#define SUBJ_F32_MUL
+#define SUBJ_F32_DIV
+#define SUBJ_F32_EQ
+#define SUBJ_F32_LE
+#define SUBJ_F32_LT
+
+#define SUBJ_F64_TO_UI32_RX_MINMAG
+#define SUBJ_F64_TO_UI64_RX_MINMAG
+#define SUBJ_F64_TO_I32_RX_MINMAG
+#define SUBJ_F64_TO_I64_RX_MINMAG
+#define SUBJ_F64_TO_F32
+#define SUBJ_F64_ADD
+#define SUBJ_F64_SUB
+#define SUBJ_F64_MUL
+#define SUBJ_F64_DIV
+#define SUBJ_F64_SQRT
+#define SUBJ_F64_EQ
+#define SUBJ_F64_LE
+#define SUBJ_F64_LT
+
+#if defined EXTFLOAT80 && defined LONG_DOUBLE_IS_EXTFLOAT80
+
+#define SUBJ_UI32_TO_EXTF80
+#define SUBJ_UI64_TO_EXTF80
+#define SUBJ_I32_TO_EXTF80
+#define SUBJ_I64_TO_EXTF80
+
+#define SUBJ_F32_TO_EXTF80
+#define SUBJ_F64_TO_EXTF80
+
+#define SUBJ_EXTF80_TO_UI32_RX_MINMAG
+#define SUBJ_EXTF80_TO_UI64_RX_MINMAG
+#define SUBJ_EXTF80_TO_I32_RX_MINMAG
+#define SUBJ_EXTF80_TO_I64_RX_MINMAG
+#define SUBJ_EXTF80_TO_F32
+#define SUBJ_EXTF80_TO_F64
+#define SUBJ_EXTF80_ADD
+#define SUBJ_EXTF80_SUB
+#define SUBJ_EXTF80_MUL
+#define SUBJ_EXTF80_DIV
+#define SUBJ_EXTF80_EQ
+#define SUBJ_EXTF80_LE
+#define SUBJ_EXTF80_LT
+
+#endif
+
+#if defined FLOAT128 && defined LONG_DOUBLE_IS_FLOAT128
+
+#define SUBJ_UI32_TO_F128
+#define SUBJ_UI64_TO_F128
+#define SUBJ_I32_TO_F128
+#define SUBJ_I64_TO_F128
+
+#define SUBJ_F32_TO_F128
+#define SUBJ_F64_TO_F128
+
+#define SUBJ_F128_TO_UI32_RX_MINMAG
+#define SUBJ_F128_TO_UI64_RX_MINMAG
+#define SUBJ_F128_TO_I32_RX_MINMAG
+#define SUBJ_F128_TO_I64_RX_MINMAG
+#define SUBJ_F128_TO_F32
+#define SUBJ_F128_TO_F64
+#define SUBJ_F128_ADD
+#define SUBJ_F128_SUB
+#define SUBJ_F128_MUL
+#define SUBJ_F128_DIV
+#define SUBJ_F128_EQ
+#define SUBJ_F128_LE
+#define SUBJ_F128_LT
+
+#endif
+
diff --git a/source/subjfloat.h b/source/subjfloat.h
new file mode 100644
index 0000000..4423944
--- /dev/null
+++ b/source/subjfloat.h
@@ -0,0 +1,392 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "softfloat.h"
+
+extern void (*const subjfloat_functions[])();
+
+void subjfloat_setRoundingMode( uint_fast8_t );
+void subjfloat_setExtF80RoundingPrecision( uint_fast8_t );
+uint_fast8_t subjfloat_clearExceptionFlags( void );
+
+/*----------------------------------------------------------------------------
+| Subject function declarations. (Many of these functions may not exist.)
+| WARNING:
+| This file should not normally be modified. Use "subjfloat_config.h" to
+| specify which of these functions actually exist.
+*----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+float32_t subj_ui32_to_f32( uint_fast32_t );
+float64_t subj_ui32_to_f64( uint_fast32_t );
+#ifdef EXTFLOAT80
+void subj_ui32_to_extF80M( uint_fast32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void subj_ui32_to_f128M( uint_fast32_t, float128_t * );
+#endif
+float32_t subj_ui64_to_f32( uint_fast64_t );
+float64_t subj_ui64_to_f64( uint_fast64_t );
+#ifdef EXTFLOAT80
+void subj_ui64_to_extF80M( uint_fast64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void subj_ui64_to_f128M( uint_fast64_t, float128_t * );
+#endif
+float32_t subj_i32_to_f32( int_fast32_t );
+float64_t subj_i32_to_f64( int_fast32_t );
+#ifdef EXTFLOAT80
+void subj_i32_to_extF80M( int_fast32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void subj_i32_to_f128M( int_fast32_t, float128_t * );
+#endif
+float32_t subj_i64_to_f32( int_fast64_t );
+float64_t subj_i64_to_f64( int_fast64_t );
+#ifdef EXTFLOAT80
+void subj_i64_to_extF80M( int_fast64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void subj_i64_to_f128M( int_fast64_t, float128_t * );
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+uint_fast32_t subj_f32_to_ui32_r_near_even( float32_t );
+uint_fast32_t subj_f32_to_ui32_r_minMag( float32_t );
+uint_fast32_t subj_f32_to_ui32_r_min( float32_t );
+uint_fast32_t subj_f32_to_ui32_r_max( float32_t );
+uint_fast32_t subj_f32_to_ui32_r_near_maxMag( float32_t );
+uint_fast64_t subj_f32_to_ui64_r_near_even( float32_t );
+uint_fast64_t subj_f32_to_ui64_r_minMag( float32_t );
+uint_fast64_t subj_f32_to_ui64_r_min( float32_t );
+uint_fast64_t subj_f32_to_ui64_r_max( float32_t );
+uint_fast64_t subj_f32_to_ui64_r_near_maxMag( float32_t );
+int_fast32_t subj_f32_to_i32_r_near_even( float32_t );
+int_fast32_t subj_f32_to_i32_r_minMag( float32_t );
+int_fast32_t subj_f32_to_i32_r_min( float32_t );
+int_fast32_t subj_f32_to_i32_r_max( float32_t );
+int_fast32_t subj_f32_to_i32_r_near_maxMag( float32_t );
+int_fast64_t subj_f32_to_i64_r_near_even( float32_t );
+int_fast64_t subj_f32_to_i64_r_minMag( float32_t );
+int_fast64_t subj_f32_to_i64_r_min( float32_t );
+int_fast64_t subj_f32_to_i64_r_max( float32_t );
+int_fast64_t subj_f32_to_i64_r_near_maxMag( float32_t );
+
+uint_fast32_t subj_f32_to_ui32_rx_near_even( float32_t );
+uint_fast32_t subj_f32_to_ui32_rx_minMag( float32_t );
+uint_fast32_t subj_f32_to_ui32_rx_min( float32_t );
+uint_fast32_t subj_f32_to_ui32_rx_max( float32_t );
+uint_fast32_t subj_f32_to_ui32_rx_near_maxMag( float32_t );
+uint_fast64_t subj_f32_to_ui64_rx_near_even( float32_t );
+uint_fast64_t subj_f32_to_ui64_rx_minMag( float32_t );
+uint_fast64_t subj_f32_to_ui64_rx_min( float32_t );
+uint_fast64_t subj_f32_to_ui64_rx_max( float32_t );
+uint_fast64_t subj_f32_to_ui64_rx_near_maxMag( float32_t );
+int_fast32_t subj_f32_to_i32_rx_near_even( float32_t );
+int_fast32_t subj_f32_to_i32_rx_minMag( float32_t );
+int_fast32_t subj_f32_to_i32_rx_min( float32_t );
+int_fast32_t subj_f32_to_i32_rx_max( float32_t );
+int_fast32_t subj_f32_to_i32_rx_near_maxMag( float32_t );
+int_fast64_t subj_f32_to_i64_rx_near_even( float32_t );
+int_fast64_t subj_f32_to_i64_rx_minMag( float32_t );
+int_fast64_t subj_f32_to_i64_rx_min( float32_t );
+int_fast64_t subj_f32_to_i64_rx_max( float32_t );
+int_fast64_t subj_f32_to_i64_rx_near_maxMag( float32_t );
+
+float64_t subj_f32_to_f64( float32_t );
+#ifdef EXTFLOAT80
+void subj_f32_to_extF80M( float32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void subj_f32_to_f128M( float32_t, float128_t * );
+#endif
+
+float32_t subj_f32_roundToInt_r_near_even( float32_t );
+float32_t subj_f32_roundToInt_r_minMag( float32_t );
+float32_t subj_f32_roundToInt_r_min( float32_t );
+float32_t subj_f32_roundToInt_r_max( float32_t );
+float32_t subj_f32_roundToInt_r_near_maxMag( float32_t );
+float32_t subj_f32_roundToInt_x( float32_t );
+float32_t subj_f32_add( float32_t, float32_t );
+float32_t subj_f32_sub( float32_t, float32_t );
+float32_t subj_f32_mul( float32_t, float32_t );
+float32_t subj_f32_mulAdd( float32_t, float32_t, float32_t );
+float32_t subj_f32_div( float32_t, float32_t );
+float32_t subj_f32_rem( float32_t, float32_t );
+float32_t subj_f32_sqrt( float32_t );
+bool subj_f32_eq( float32_t, float32_t );
+bool subj_f32_le( float32_t, float32_t );
+bool subj_f32_lt( float32_t, float32_t );
+bool subj_f32_eq_signaling( float32_t, float32_t );
+bool subj_f32_le_quiet( float32_t, float32_t );
+bool subj_f32_lt_quiet( float32_t, float32_t );
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+uint_fast32_t subj_f64_to_ui32_r_near_even( float64_t );
+uint_fast32_t subj_f64_to_ui32_r_minMag( float64_t );
+uint_fast32_t subj_f64_to_ui32_r_min( float64_t );
+uint_fast32_t subj_f64_to_ui32_r_max( float64_t );
+uint_fast32_t subj_f64_to_ui32_r_near_maxMag( float64_t );
+uint_fast64_t subj_f64_to_ui64_r_near_even( float64_t );
+uint_fast64_t subj_f64_to_ui64_r_minMag( float64_t );
+uint_fast64_t subj_f64_to_ui64_r_min( float64_t );
+uint_fast64_t subj_f64_to_ui64_r_max( float64_t );
+uint_fast64_t subj_f64_to_ui64_r_near_maxMag( float64_t );
+int_fast32_t subj_f64_to_i32_r_near_even( float64_t );
+int_fast32_t subj_f64_to_i32_r_minMag( float64_t );
+int_fast32_t subj_f64_to_i32_r_min( float64_t );
+int_fast32_t subj_f64_to_i32_r_max( float64_t );
+int_fast32_t subj_f64_to_i32_r_near_maxMag( float64_t );
+int_fast64_t subj_f64_to_i64_r_near_even( float64_t );
+int_fast64_t subj_f64_to_i64_r_minMag( float64_t );
+int_fast64_t subj_f64_to_i64_r_min( float64_t );
+int_fast64_t subj_f64_to_i64_r_max( float64_t );
+int_fast64_t subj_f64_to_i64_r_near_maxMag( float64_t );
+
+uint_fast32_t subj_f64_to_ui32_rx_near_even( float64_t );
+uint_fast32_t subj_f64_to_ui32_rx_minMag( float64_t );
+uint_fast32_t subj_f64_to_ui32_rx_min( float64_t );
+uint_fast32_t subj_f64_to_ui32_rx_max( float64_t );
+uint_fast32_t subj_f64_to_ui32_rx_near_maxMag( float64_t );
+uint_fast64_t subj_f64_to_ui64_rx_near_even( float64_t );
+uint_fast64_t subj_f64_to_ui64_rx_minMag( float64_t );
+uint_fast64_t subj_f64_to_ui64_rx_min( float64_t );
+uint_fast64_t subj_f64_to_ui64_rx_max( float64_t );
+uint_fast64_t subj_f64_to_ui64_rx_near_maxMag( float64_t );
+int_fast32_t subj_f64_to_i32_rx_near_even( float64_t );
+int_fast32_t subj_f64_to_i32_rx_minMag( float64_t );
+int_fast32_t subj_f64_to_i32_rx_min( float64_t );
+int_fast32_t subj_f64_to_i32_rx_max( float64_t );
+int_fast32_t subj_f64_to_i32_rx_near_maxMag( float64_t );
+int_fast64_t subj_f64_to_i64_rx_near_even( float64_t );
+int_fast64_t subj_f64_to_i64_rx_minMag( float64_t );
+int_fast64_t subj_f64_to_i64_rx_min( float64_t );
+int_fast64_t subj_f64_to_i64_rx_max( float64_t );
+int_fast64_t subj_f64_to_i64_rx_near_maxMag( float64_t );
+
+float32_t subj_f64_to_f32( float64_t );
+#ifdef EXTFLOAT80
+void subj_f64_to_extF80M( float64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+void subj_f64_to_f128M( float64_t, float128_t * );
+#endif
+
+float64_t subj_f64_roundToInt_r_near_even( float64_t );
+float64_t subj_f64_roundToInt_r_minMag( float64_t );
+float64_t subj_f64_roundToInt_r_min( float64_t );
+float64_t subj_f64_roundToInt_r_max( float64_t );
+float64_t subj_f64_roundToInt_r_near_maxMag( float64_t );
+float64_t subj_f64_roundToInt_x( float64_t );
+float64_t subj_f64_add( float64_t, float64_t );
+float64_t subj_f64_sub( float64_t, float64_t );
+float64_t subj_f64_mul( float64_t, float64_t );
+float64_t subj_f64_mulAdd( float64_t, float64_t, float64_t );
+float64_t subj_f64_div( float64_t, float64_t );
+float64_t subj_f64_rem( float64_t, float64_t );
+float64_t subj_f64_sqrt( float64_t );
+bool subj_f64_eq( float64_t, float64_t );
+bool subj_f64_le( float64_t, float64_t );
+bool subj_f64_lt( float64_t, float64_t );
+bool subj_f64_eq_signaling( float64_t, float64_t );
+bool subj_f64_le_quiet( float64_t, float64_t );
+bool subj_f64_lt_quiet( float64_t, float64_t );
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+
+uint_fast32_t subj_extF80M_to_ui32_r_near_even( const extFloat80_t * );
+uint_fast32_t subj_extF80M_to_ui32_r_minMag( const extFloat80_t * );
+uint_fast32_t subj_extF80M_to_ui32_r_min( const extFloat80_t * );
+uint_fast32_t subj_extF80M_to_ui32_r_max( const extFloat80_t * );
+uint_fast32_t subj_extF80M_to_ui32_r_near_maxMag( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_r_near_even( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_r_minMag( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_r_min( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_r_max( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_r_near_maxMag( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_r_near_even( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_r_minMag( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_r_min( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_r_max( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_r_near_maxMag( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_r_near_even( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_r_minMag( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_r_min( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_r_max( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_r_near_maxMag( const extFloat80_t * );
+
+uint_fast32_t subj_extF80M_to_ui32_rx_near_even( const extFloat80_t * );
+uint_fast32_t subj_extF80M_to_ui32_rx_minMag( const extFloat80_t * );
+uint_fast32_t subj_extF80M_to_ui32_rx_min( const extFloat80_t * );
+uint_fast32_t subj_extF80M_to_ui32_rx_max( const extFloat80_t * );
+uint_fast32_t subj_extF80M_to_ui32_rx_near_maxMag( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_rx_near_even( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_rx_minMag( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_rx_min( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_rx_max( const extFloat80_t * );
+uint_fast64_t subj_extF80M_to_ui64_rx_near_maxMag( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_rx_near_even( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_rx_minMag( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_rx_min( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_rx_max( const extFloat80_t * );
+int_fast32_t subj_extF80M_to_i32_rx_near_maxMag( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_rx_near_even( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_rx_minMag( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_rx_min( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_rx_max( const extFloat80_t * );
+int_fast64_t subj_extF80M_to_i64_rx_near_maxMag( const extFloat80_t * );
+
+float32_t subj_extF80M_to_f32( const extFloat80_t * );
+float64_t subj_extF80M_to_f64( const extFloat80_t * );
+#ifdef EXTFLOAT80
+void subj_extF80M_to_f128M( const extFloat80_t *, float128_t * );
+#endif
+
+void
+ subj_extF80M_roundToInt_r_near_even( const extFloat80_t *, extFloat80_t * );
+void subj_extF80M_roundToInt_r_minMag( const extFloat80_t *, extFloat80_t * );
+void subj_extF80M_roundToInt_r_min( const extFloat80_t *, extFloat80_t * );
+void subj_extF80M_roundToInt_r_max( const extFloat80_t *, extFloat80_t * );
+void
+ subj_extF80M_roundToInt_r_near_maxMag( const extFloat80_t *, extFloat80_t * );
+void subj_extF80M_roundToInt_x( const extFloat80_t *, extFloat80_t * );
+void
+ subj_extF80M_add(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void
+ subj_extF80M_sub(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void
+ subj_extF80M_mul(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void
+ subj_extF80M_div(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void
+ subj_extF80M_rem(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+void subj_extF80M_sqrt( const extFloat80_t *, extFloat80_t * );
+bool subj_extF80M_eq( const extFloat80_t *, const extFloat80_t * );
+bool subj_extF80M_le( const extFloat80_t *, const extFloat80_t * );
+bool subj_extF80M_lt( const extFloat80_t *, const extFloat80_t * );
+bool subj_extF80M_eq_signaling( const extFloat80_t *, const extFloat80_t * );
+bool subj_extF80M_le_quiet( const extFloat80_t *, const extFloat80_t * );
+bool subj_extF80M_lt_quiet( const extFloat80_t *, const extFloat80_t * );
+
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#ifdef FLOAT128
+
+uint_fast32_t subj_f128M_to_ui32_r_near_even( const float128_t * );
+uint_fast32_t subj_f128M_to_ui32_r_minMag( const float128_t * );
+uint_fast32_t subj_f128M_to_ui32_r_min( const float128_t * );
+uint_fast32_t subj_f128M_to_ui32_r_max( const float128_t * );
+uint_fast32_t subj_f128M_to_ui32_r_near_maxMag( extFloat80_t * );
+uint_fast64_t subj_f128M_to_ui64_r_near_even( const float128_t * );
+uint_fast64_t subj_f128M_to_ui64_r_minMag( const float128_t * );
+uint_fast64_t subj_f128M_to_ui64_r_min( const float128_t * );
+uint_fast64_t subj_f128M_to_ui64_r_max( const float128_t * );
+uint_fast64_t subj_f128M_to_ui64_r_near_maxMag( extFloat80_t * );
+int_fast32_t subj_f128M_to_i32_r_near_even( const float128_t * );
+int_fast32_t subj_f128M_to_i32_r_minMag( const float128_t * );
+int_fast32_t subj_f128M_to_i32_r_min( const float128_t * );
+int_fast32_t subj_f128M_to_i32_r_max( const float128_t * );
+int_fast32_t subj_f128M_to_i32_r_near_maxMag( extFloat80_t * );
+int_fast64_t subj_f128M_to_i64_r_near_even( const float128_t * );
+int_fast64_t subj_f128M_to_i64_r_minMag( const float128_t * );
+int_fast64_t subj_f128M_to_i64_r_min( const float128_t * );
+int_fast64_t subj_f128M_to_i64_r_max( const float128_t * );
+int_fast64_t subj_f128M_to_i64_r_near_maxMag( extFloat80_t * );
+
+uint_fast32_t subj_f128M_to_ui32_rx_near_even( const float128_t * );
+uint_fast32_t subj_f128M_to_ui32_rx_minMag( const float128_t * );
+uint_fast32_t subj_f128M_to_ui32_rx_min( const float128_t * );
+uint_fast32_t subj_f128M_to_ui32_rx_max( const float128_t * );
+uint_fast32_t subj_f128M_to_ui32_rx_near_maxMag( extFloat80_t * );
+uint_fast64_t subj_f128M_to_ui64_rx_near_even( const float128_t * );
+uint_fast64_t subj_f128M_to_ui64_rx_minMag( const float128_t * );
+uint_fast64_t subj_f128M_to_ui64_rx_min( const float128_t * );
+uint_fast64_t subj_f128M_to_ui64_rx_max( const float128_t * );
+uint_fast64_t subj_f128M_to_ui64_rx_near_maxMag( extFloat80_t * );
+int_fast32_t subj_f128M_to_i32_rx_near_even( const float128_t * );
+int_fast32_t subj_f128M_to_i32_rx_minMag( const float128_t * );
+int_fast32_t subj_f128M_to_i32_rx_min( const float128_t * );
+int_fast32_t subj_f128M_to_i32_rx_max( const float128_t * );
+int_fast32_t subj_f128M_to_i32_rx_near_maxMag( extFloat80_t * );
+int_fast64_t subj_f128M_to_i64_rx_near_even( const float128_t * );
+int_fast64_t subj_f128M_to_i64_rx_minMag( const float128_t * );
+int_fast64_t subj_f128M_to_i64_rx_min( const float128_t * );
+int_fast64_t subj_f128M_to_i64_rx_max( const float128_t * );
+int_fast64_t subj_f128M_to_i64_rx_near_maxMag( extFloat80_t * );
+
+float32_t subj_f128M_to_f32( const float128_t * );
+float64_t subj_f128M_to_f64( const float128_t * );
+#ifdef FLOAT128
+void subj_f128M_to_extF80M( const float128_t *, extFloat80_t * );
+#endif
+
+void subj_f128M_roundToInt_r_near_even( const float128_t, float128_t * );
+void subj_f128M_roundToInt_r_minMag( const float128_t, float128_t * );
+void subj_f128M_roundToInt_r_min( const float128_t, float128_t * );
+void subj_f128M_roundToInt_r_max( const float128_t, float128_t * );
+void subj_f128M_roundToInt_r_near_maxMag( const float128_t, float128_t * );
+void subj_f128M_roundToInt_x( const float128_t, float128_t * );
+void subj_f128M_add( const float128_t *, const float128_t *, float128_t * );
+void subj_f128M_sub( const float128_t *, const float128_t *, float128_t * );
+void subj_f128M_mul( const float128_t *, const float128_t *, float128_t * );
+void
+ subj_f128M_mulAdd(
+ const float128_t *, const float128_t *, const float128_t *, float128_t *
+ );
+void subj_f128M_div( const float128_t *, const float128_t *, float128_t * );
+void subj_f128M_rem( const float128_t *, const float128_t *, float128_t * );
+void subj_f128M_sqrt( const float128_t *, float128_t * );
+bool subj_f128M_eq( const float128_t *, const float128_t * );
+bool subj_f128M_le( const float128_t *, const float128_t * );
+bool subj_f128M_lt( const float128_t *, const float128_t * );
+bool subj_f128M_eq_signaling( const float128_t *, const float128_t * );
+bool subj_f128M_le_quiet( const float128_t *, const float128_t * );
+bool subj_f128M_lt_quiet( const float128_t *, const float128_t * );
+
+#endif
+
diff --git a/source/subjfloat_functions.c b/source/subjfloat_functions.c
new file mode 100644
index 0000000..392ffef
--- /dev/null
+++ b/source/subjfloat_functions.c
@@ -0,0 +1,1410 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include "platform.h"
+#include "subjfloat_config.h"
+#include "subjfloat.h"
+#include "functions.h"
+
+typedef void genericFuncType();
+
+/*----------------------------------------------------------------------------
+| WARNING:
+| This file should not normally be modified. See "subjfloat_config.h"
+| instead.
+| The order of these array entries must match the order in the array
+| `standardFunctionInfos'. Be careful about making changes.
+*----------------------------------------------------------------------------*/
+
+genericFuncType *const subjfloat_functions[] = {
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef SUBJ_UI32_TO_F32
+ (genericFuncType *) subj_ui32_to_f32,
+#else
+ 0,
+#endif
+#ifdef SUBJ_UI32_TO_F64
+ (genericFuncType *) subj_ui32_to_f64,
+#else
+ 0,
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_UI32_TO_EXTF80
+ (genericFuncType *) subj_ui32_to_extF80M,
+#else
+ 0,
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_UI32_TO_F128
+ (genericFuncType *) subj_ui32_to_f128M,
+#else
+ 0,
+#endif
+#endif
+#ifdef SUBJ_UI64_TO_F32
+ (genericFuncType *) subj_ui64_to_f32,
+#else
+ 0,
+#endif
+#ifdef SUBJ_UI64_TO_F64
+ (genericFuncType *) subj_ui64_to_f64,
+#else
+ 0,
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_UI64_TO_EXTF80
+ (genericFuncType *) subj_ui64_to_extF80M,
+#else
+ 0,
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_UI64_TO_F128
+ (genericFuncType *) subj_ui64_to_f128M,
+#else
+ 0,
+#endif
+#endif
+#ifdef SUBJ_I32_TO_F32
+ (genericFuncType *) subj_i32_to_f32,
+#else
+ 0,
+#endif
+#ifdef SUBJ_I32_TO_F64
+ (genericFuncType *) subj_i32_to_f64,
+#else
+ 0,
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_I32_TO_EXTF80
+ (genericFuncType *) subj_i32_to_extF80M,
+#else
+ 0,
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_I32_TO_F128
+ (genericFuncType *) subj_i32_to_f128M,
+#else
+ 0,
+#endif
+#endif
+#ifdef SUBJ_I64_TO_F32
+ (genericFuncType *) subj_i64_to_f32,
+#else
+ 0,
+#endif
+#ifdef SUBJ_I64_TO_F64
+ (genericFuncType *) subj_i64_to_f64,
+#else
+ 0,
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_I64_TO_EXTF80
+ (genericFuncType *) subj_i64_to_extF80M,
+#else
+ 0,
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_I64_TO_F128
+ (genericFuncType *) subj_i64_to_f128M,
+#else
+ 0,
+#endif
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef SUBJ_F32_TO_UI32_R_NEAR_EVEN
+ (genericFuncType *) subj_f32_to_ui32_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_R_MINMAG
+ (genericFuncType *) subj_f32_to_ui32_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_R_MIN
+ (genericFuncType *) subj_f32_to_ui32_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_R_MAX
+ (genericFuncType *) subj_f32_to_ui32_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_to_ui32_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_R_NEAR_EVEN
+ (genericFuncType *) subj_f32_to_ui64_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_R_MINMAG
+ (genericFuncType *) subj_f32_to_ui64_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_R_MIN
+ (genericFuncType *) subj_f32_to_ui64_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_R_MAX
+ (genericFuncType *) subj_f32_to_ui64_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_to_ui64_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_R_NEAR_EVEN
+ (genericFuncType *) subj_f32_to_i32_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_R_MINMAG
+ (genericFuncType *) subj_f32_to_i32_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_R_MIN
+ (genericFuncType *) subj_f32_to_i32_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_R_MAX
+ (genericFuncType *) subj_f32_to_i32_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_to_i32_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_R_NEAR_EVEN
+ (genericFuncType *) subj_f32_to_i64_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_R_MINMAG
+ (genericFuncType *) subj_f32_to_i64_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_R_MIN
+ (genericFuncType *) subj_f32_to_i64_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_R_MAX
+ (genericFuncType *) subj_f32_to_i64_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_to_i64_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_RX_NEAR_EVEN
+ (genericFuncType *) subj_f32_to_ui32_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_RX_MINMAG
+ (genericFuncType *) subj_f32_to_ui32_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_RX_MIN
+ (genericFuncType *) subj_f32_to_ui32_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_RX_MAX
+ (genericFuncType *) subj_f32_to_ui32_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI32_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_to_ui32_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_RX_NEAR_EVEN
+ (genericFuncType *) subj_f32_to_ui64_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_RX_MINMAG
+ (genericFuncType *) subj_f32_to_ui64_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_RX_MIN
+ (genericFuncType *) subj_f32_to_ui64_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_RX_MAX
+ (genericFuncType *) subj_f32_to_ui64_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_UI64_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_to_ui64_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_RX_NEAR_EVEN
+ (genericFuncType *) subj_f32_to_i32_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_RX_MINMAG
+ (genericFuncType *) subj_f32_to_i32_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_RX_MIN
+ (genericFuncType *) subj_f32_to_i32_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_RX_MAX
+ (genericFuncType *) subj_f32_to_i32_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I32_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_to_i32_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_RX_NEAR_EVEN
+ (genericFuncType *) subj_f32_to_i64_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_RX_MINMAG
+ (genericFuncType *) subj_f32_to_i64_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_RX_MIN
+ (genericFuncType *) subj_f32_to_i64_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_RX_MAX
+ (genericFuncType *) subj_f32_to_i64_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_I64_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_to_i64_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_TO_F64
+ (genericFuncType *) subj_f32_to_f64,
+#else
+ 0,
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_F32_TO_EXTF80
+ (genericFuncType *) subj_f32_to_extF80M,
+#else
+ 0,
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_F32_TO_F128
+ (genericFuncType *) subj_f32_to_f128M,
+#else
+ 0,
+#endif
+#endif
+#ifdef SUBJ_F32_ROUNDTOINT_R_NEAR_EVEN
+ (genericFuncType *) subj_f32_roundToInt_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_ROUNDTOINT_R_MINMAG
+ (genericFuncType *) subj_f32_roundToInt_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_ROUNDTOINT_R_MIN
+ (genericFuncType *) subj_f32_roundToInt_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_ROUNDTOINT_R_MAX
+ (genericFuncType *) subj_f32_roundToInt_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_ROUNDTOINT_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f32_roundToInt_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_ROUNDTOINT_X
+ (genericFuncType *) subj_f32_roundToInt_x,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_ADD
+ (genericFuncType *) subj_f32_add,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_SUB
+ (genericFuncType *) subj_f32_sub,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_MUL
+ (genericFuncType *) subj_f32_mul,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_MULADD
+ (genericFuncType *) subj_f32_mulAdd,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_DIV
+ (genericFuncType *) subj_f32_div,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_REM
+ (genericFuncType *) subj_f32_rem,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_SQRT
+ (genericFuncType *) subj_f32_sqrt,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_EQ
+ (genericFuncType *) subj_f32_eq,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_LE
+ (genericFuncType *) subj_f32_le,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_LT
+ (genericFuncType *) subj_f32_lt,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_EQ_SIGNALING
+ (genericFuncType *) subj_f32_eq_signaling,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_LE_QUIET
+ (genericFuncType *) subj_f32_le_quiet,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F32_LT_QUIET
+ (genericFuncType *) subj_f32_lt_quiet,
+#else
+ 0,
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef SUBJ_F64_TO_UI32_R_NEAR_EVEN
+ (genericFuncType *) subj_f64_to_ui32_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_R_MINMAG
+ (genericFuncType *) subj_f64_to_ui32_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_R_MIN
+ (genericFuncType *) subj_f64_to_ui32_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_R_MAX
+ (genericFuncType *) subj_f64_to_ui32_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_to_ui32_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_R_NEAR_EVEN
+ (genericFuncType *) subj_f64_to_ui64_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_R_MINMAG
+ (genericFuncType *) subj_f64_to_ui64_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_R_MIN
+ (genericFuncType *) subj_f64_to_ui64_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_R_MAX
+ (genericFuncType *) subj_f64_to_ui64_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_to_ui64_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_R_NEAR_EVEN
+ (genericFuncType *) subj_f64_to_i32_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_R_MINMAG
+ (genericFuncType *) subj_f64_to_i32_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_R_MIN
+ (genericFuncType *) subj_f64_to_i32_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_R_MAX
+ (genericFuncType *) subj_f64_to_i32_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_to_i32_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_R_NEAR_EVEN
+ (genericFuncType *) subj_f64_to_i64_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_R_MINMAG
+ (genericFuncType *) subj_f64_to_i64_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_R_MIN
+ (genericFuncType *) subj_f64_to_i64_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_R_MAX
+ (genericFuncType *) subj_f64_to_i64_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_to_i64_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_RX_NEAR_EVEN
+ (genericFuncType *) subj_f64_to_ui32_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_RX_MINMAG
+ (genericFuncType *) subj_f64_to_ui32_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_RX_MIN
+ (genericFuncType *) subj_f64_to_ui32_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_RX_MAX
+ (genericFuncType *) subj_f64_to_ui32_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI32_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_to_ui32_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_RX_NEAR_EVEN
+ (genericFuncType *) subj_f64_to_ui64_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_RX_MINMAG
+ (genericFuncType *) subj_f64_to_ui64_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_RX_MIN
+ (genericFuncType *) subj_f64_to_ui64_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_RX_MAX
+ (genericFuncType *) subj_f64_to_ui64_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_UI64_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_to_ui64_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_RX_NEAR_EVEN
+ (genericFuncType *) subj_f64_to_i32_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_RX_MINMAG
+ (genericFuncType *) subj_f64_to_i32_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_RX_MIN
+ (genericFuncType *) subj_f64_to_i32_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_RX_MAX
+ (genericFuncType *) subj_f64_to_i32_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I32_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_to_i32_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_RX_NEAR_EVEN
+ (genericFuncType *) subj_f64_to_i64_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_RX_MINMAG
+ (genericFuncType *) subj_f64_to_i64_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_RX_MIN
+ (genericFuncType *) subj_f64_to_i64_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_RX_MAX
+ (genericFuncType *) subj_f64_to_i64_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_I64_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_to_i64_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_TO_F32
+ (genericFuncType *) subj_f64_to_f32,
+#else
+ 0,
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_F64_TO_EXTF80
+ (genericFuncType *) subj_f64_to_extF80M,
+#else
+ 0,
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_F64_TO_F128
+ (genericFuncType *) subj_f64_to_f128M,
+#else
+ 0,
+#endif
+#endif
+#ifdef SUBJ_F64_ROUNDTOINT_R_NEAR_EVEN
+ (genericFuncType *) subj_f64_roundToInt_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_ROUNDTOINT_R_MINMAG
+ (genericFuncType *) subj_f64_roundToInt_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_ROUNDTOINT_R_MIN
+ (genericFuncType *) subj_f64_roundToInt_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_ROUNDTOINT_R_MAX
+ (genericFuncType *) subj_f64_roundToInt_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_ROUNDTOINT_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f64_roundToInt_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_ROUNDTOINT_X
+ (genericFuncType *) subj_f64_roundToInt_x,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_ADD
+ (genericFuncType *) subj_f64_add,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_SUB
+ (genericFuncType *) subj_f64_sub,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_MUL
+ (genericFuncType *) subj_f64_mul,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_MULADD
+ (genericFuncType *) subj_f64_mulAdd,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_DIV
+ (genericFuncType *) subj_f64_div,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_REM
+ (genericFuncType *) subj_f64_rem,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_SQRT
+ (genericFuncType *) subj_f64_sqrt,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_EQ
+ (genericFuncType *) subj_f64_eq,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_LE
+ (genericFuncType *) subj_f64_le,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_LT
+ (genericFuncType *) subj_f64_lt,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_EQ_SIGNALING
+ (genericFuncType *) subj_f64_eq_signaling,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_LE_QUIET
+ (genericFuncType *) subj_f64_le_quiet,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F64_LT_QUIET
+ (genericFuncType *) subj_f64_lt_quiet,
+#else
+ 0,
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+#ifdef SUBJ_EXTF80_TO_UI32_R_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_to_ui32_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_R_MINMAG
+ (genericFuncType *) subj_extF80M_to_ui32_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_R_MIN
+ (genericFuncType *) subj_extF80M_to_ui32_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_R_MAX
+ (genericFuncType *) subj_extF80M_to_ui32_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_R_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_to_ui32_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_R_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_to_ui64_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_R_MINMAG
+ (genericFuncType *) subj_extF80M_to_ui64_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_R_MIN
+ (genericFuncType *) subj_extF80M_to_ui64_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_R_MAX
+ (genericFuncType *) subj_extF80M_to_ui64_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_R_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_to_ui64_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_R_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_to_i32_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_R_MINMAG
+ (genericFuncType *) subj_extF80M_to_i32_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_R_MIN
+ (genericFuncType *) subj_extF80M_to_i32_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_R_MAX
+ (genericFuncType *) subj_extF80M_to_i32_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_R_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_to_i32_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_R_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_to_i64_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_R_MINMAG
+ (genericFuncType *) subj_extF80M_to_i64_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_R_MIN
+ (genericFuncType *) subj_extF80M_to_i64_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_R_MAX
+ (genericFuncType *) subj_extF80M_to_i64_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_R_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_to_i64_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_RX_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_to_ui32_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_RX_MINMAG
+ (genericFuncType *) subj_extF80M_to_ui32_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_RX_MIN
+ (genericFuncType *) subj_extF80M_to_ui32_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_RX_MAX
+ (genericFuncType *) subj_extF80M_to_ui32_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI32_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_to_ui32_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_RX_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_to_ui64_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_RX_MINMAG
+ (genericFuncType *) subj_extF80M_to_ui64_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_RX_MIN
+ (genericFuncType *) subj_extF80M_to_ui64_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_RX_MAX
+ (genericFuncType *) subj_extF80M_to_ui64_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_UI64_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_to_ui64_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_RX_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_to_i32_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_RX_MINMAG
+ (genericFuncType *) subj_extF80M_to_i32_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_RX_MIN
+ (genericFuncType *) subj_extF80M_to_i32_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_RX_MAX
+ (genericFuncType *) subj_extF80M_to_i32_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I32_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_to_i32_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_RX_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_to_i64_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_RX_MINMAG
+ (genericFuncType *) subj_extF80M_to_i64_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_RX_MIN
+ (genericFuncType *) subj_extF80M_to_i64_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_RX_MAX
+ (genericFuncType *) subj_extF80M_to_i64_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_I64_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_to_i64_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_F32
+ (genericFuncType *) subj_extF80M_to_f32,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_TO_F64
+ (genericFuncType *) subj_extF80M_to_f64,
+#else
+ 0,
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_EXTF80_TO_F128
+ (genericFuncType *) subj_extF80M_to_f128M,
+#else
+ 0,
+#endif
+#endif
+#ifdef SUBJ_EXTF80_ROUNDTOINT_R_NEAR_EVEN
+ (genericFuncType *) subj_extF80M_roundToInt_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_ROUNDTOINT_R_MINMAG
+ (genericFuncType *) subj_extF80M_roundToInt_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_ROUNDTOINT_R_MIN
+ (genericFuncType *) subj_extF80M_roundToInt_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_ROUNDTOINT_R_MAX
+ (genericFuncType *) subj_extF80M_roundToInt_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_ROUNDTOINT_R_NEAR_MAXMAG
+ (genericFuncType *) subj_extF80M_roundToInt_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_ROUNDTOINT_X
+ (genericFuncType *) subj_extF80M_roundToInt_x,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_ADD
+ (genericFuncType *) subj_extF80M_add,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_SUB
+ (genericFuncType *) subj_extF80M_sub,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_MUL
+ (genericFuncType *) subj_extF80M_mul,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_DIV
+ (genericFuncType *) subj_extF80M_div,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_REM
+ (genericFuncType *) subj_extF80M_rem,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_SQRT
+ (genericFuncType *) subj_extF80M_sqrt,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_EQ
+ (genericFuncType *) subj_extF80M_eq,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_LE
+ (genericFuncType *) subj_extF80M_le,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_LT
+ (genericFuncType *) subj_extF80M_lt,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_EQ_SIGNALING
+ (genericFuncType *) subj_extF80M_eq_signaling,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_LE_QUIET
+ (genericFuncType *) subj_extF80M_le_quiet,
+#else
+ 0,
+#endif
+#ifdef SUBJ_EXTF80_LT_QUIET
+ (genericFuncType *) subj_extF80M_lt_quiet,
+#else
+ 0,
+#endif
+#endif
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+#ifdef FLOAT128
+#ifdef SUBJ_F128_TO_UI32_R_NEAR_EVEN
+ (genericFuncType *) subj_f128M_to_ui32_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_R_MINMAG
+ (genericFuncType *) subj_f128M_to_ui32_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_R_MIN
+ (genericFuncType *) subj_f128M_to_ui32_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_R_MAX
+ (genericFuncType *) subj_f128M_to_ui32_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_to_ui32_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_R_NEAR_EVEN
+ (genericFuncType *) subj_f128M_to_ui64_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_R_MINMAG
+ (genericFuncType *) subj_f128M_to_ui64_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_R_MIN
+ (genericFuncType *) subj_f128M_to_ui64_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_R_MAX
+ (genericFuncType *) subj_f128M_to_ui64_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_to_ui64_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_R_NEAR_EVEN
+ (genericFuncType *) subj_f128M_to_i32_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_R_MINMAG
+ (genericFuncType *) subj_f128M_to_i32_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_R_MIN
+ (genericFuncType *) subj_f128M_to_i32_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_R_MAX
+ (genericFuncType *) subj_f128M_to_i32_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_to_i32_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_R_NEAR_EVEN
+ (genericFuncType *) subj_f128M_to_i64_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_R_MINMAG
+ (genericFuncType *) subj_f128M_to_i64_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_R_MIN
+ (genericFuncType *) subj_f128M_to_i64_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_R_MAX
+ (genericFuncType *) subj_f128M_to_i64_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_to_i64_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_RX_NEAR_EVEN
+ (genericFuncType *) subj_f128M_to_ui32_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_RX_MINMAG
+ (genericFuncType *) subj_f128M_to_ui32_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_RX_MIN
+ (genericFuncType *) subj_f128M_to_ui32_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_RX_MAX
+ (genericFuncType *) subj_f128M_to_ui32_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI32_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_to_ui32_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_RX_NEAR_EVEN
+ (genericFuncType *) subj_f128M_to_ui64_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_RX_MINMAG
+ (genericFuncType *) subj_f128M_to_ui64_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_RX_MIN
+ (genericFuncType *) subj_f128M_to_ui64_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_RX_MAX
+ (genericFuncType *) subj_f128M_to_ui64_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_UI64_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_to_ui64_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_RX_NEAR_EVEN
+ (genericFuncType *) subj_f128M_to_i32_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_RX_MINMAG
+ (genericFuncType *) subj_f128M_to_i32_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_RX_MIN
+ (genericFuncType *) subj_f128M_to_i32_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_RX_MAX
+ (genericFuncType *) subj_f128M_to_i32_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I32_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_to_i32_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_RX_NEAR_EVEN
+ (genericFuncType *) subj_f128M_to_i64_rx_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_RX_MINMAG
+ (genericFuncType *) subj_f128M_to_i64_rx_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_RX_MIN
+ (genericFuncType *) subj_f128M_to_i64_rx_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_RX_MAX
+ (genericFuncType *) subj_f128M_to_i64_rx_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_I64_RX_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_to_i64_rx_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_F32
+ (genericFuncType *) subj_f128M_to_f32,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_TO_F64
+ (genericFuncType *) subj_f128M_to_f64,
+#else
+ 0,
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_F128_TO_EXTF80
+ (genericFuncType *) subj_f128M_to_extF80M,
+#else
+ 0,
+#endif
+#endif
+#ifdef SUBJ_F128_ROUNDTOINT_R_NEAR_EVEN
+ (genericFuncType *) subj_f128M_roundToInt_r_near_even,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_ROUNDTOINT_R_MINMAG
+ (genericFuncType *) subj_f128M_roundToInt_r_minMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_ROUNDTOINT_R_MIN
+ (genericFuncType *) subj_f128M_roundToInt_r_min,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_ROUNDTOINT_R_MAX
+ (genericFuncType *) subj_f128M_roundToInt_r_max,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_ROUNDTOINT_R_NEAR_MAXMAG
+ (genericFuncType *) subj_f128M_roundToInt_r_near_maxMag,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_ROUNDTOINT_X
+ (genericFuncType *) subj_f128M_roundToInt_x,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_ADD
+ (genericFuncType *) subj_f128M_add,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_SUB
+ (genericFuncType *) subj_f128M_sub,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_MUL
+ (genericFuncType *) subj_f128M_mul,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_MULADD
+ (genericFuncType *) subj_f128M_mulAdd,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_DIV
+ (genericFuncType *) subj_f128M_div,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_REM
+ (genericFuncType *) subj_f128M_rem,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_SQRT
+ (genericFuncType *) subj_f128M_sqrt,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_EQ
+ (genericFuncType *) subj_f128M_eq,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_LE
+ (genericFuncType *) subj_f128M_le,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_LT
+ (genericFuncType *) subj_f128M_lt,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_EQ_SIGNALING
+ (genericFuncType *) subj_f128M_eq_signaling,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_LE_QUIET
+ (genericFuncType *) subj_f128M_le_quiet,
+#else
+ 0,
+#endif
+#ifdef SUBJ_F128_LT_QUIET
+ (genericFuncType *) subj_f128M_lt_quiet,
+#else
+ 0,
+#endif
+#endif
+};
+
diff --git a/source/testLoops.h b/source/testLoops.h
new file mode 100644
index 0000000..bed5df3
--- /dev/null
+++ b/source/testLoops.h
@@ -0,0 +1,466 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "softfloat.h"
+
+extern bool testLoops_forever;
+
+extern uint_fast8_t *testLoops_trueFlagsPtr;
+extern uint_fast8_t (*testLoops_subjFlagsFunction)( void );
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void test_a_ui32_z_f32( float32_t ( uint32_t ), float32_t ( uint32_t ) );
+void test_a_ui32_z_f64( float64_t ( uint32_t ), float64_t ( uint32_t ) );
+#ifdef EXTFLOAT80
+void
+ test_a_ui32_z_extF80(
+ void ( uint32_t, extFloat80_t * ), void ( uint32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void
+ test_a_ui32_z_f128(
+ void ( uint32_t, float128_t * ), void ( uint32_t, float128_t * )
+ );
+#endif
+void test_a_ui64_z_f32( float32_t ( uint64_t ), float32_t ( uint64_t ) );
+void test_a_ui64_z_f64( float64_t ( uint64_t ), float64_t ( uint64_t ) );
+#ifdef EXTFLOAT80
+void
+ test_a_ui64_z_extF80(
+ void ( uint64_t, extFloat80_t * ), void ( uint64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void
+ test_a_ui64_z_f128(
+ void ( uint64_t, float128_t * ), void ( uint64_t, float128_t * ) );
+#endif
+void test_a_i32_z_f32( float32_t ( int32_t ), float32_t ( int32_t ) );
+void test_a_i32_z_f64( float64_t ( int32_t ), float64_t ( int32_t ) );
+#ifdef EXTFLOAT80
+void
+ test_a_i32_z_extF80(
+ void ( int32_t, extFloat80_t * ), void ( int32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void
+ test_a_i32_z_f128(
+ void ( int32_t, float128_t * ), void ( int32_t, float128_t * ) );
+#endif
+void test_a_i64_z_f32( float32_t ( int64_t ), float32_t ( int64_t ) );
+void test_a_i64_z_f64( float64_t ( int64_t ), float64_t ( int64_t ) );
+#ifdef EXTFLOAT80
+void
+ test_a_i64_z_extF80(
+ void ( int64_t, extFloat80_t * ), void ( int64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void
+ test_a_i64_z_f128(
+ void ( int64_t, float128_t * ), void ( int64_t, float128_t * ) );
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void
+ test_a_f32_z_ui32_rx(
+ uint_fast32_t ( float32_t, uint_fast8_t, bool ),
+ uint_fast32_t ( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f32_z_ui64_rx(
+ uint_fast64_t ( float32_t, uint_fast8_t, bool ),
+ uint_fast64_t ( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f32_z_i32_rx(
+ int_fast32_t ( float32_t, uint_fast8_t, bool ),
+ int_fast32_t ( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f32_z_i64_rx(
+ int_fast64_t ( float32_t, uint_fast8_t, bool ),
+ int_fast64_t ( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f32_z_ui32_x(
+ uint_fast32_t ( float32_t, bool ), uint_fast32_t ( float32_t, bool ), bool
+ );
+void
+ test_a_f32_z_ui64_x(
+ uint_fast64_t ( float32_t, bool ), uint_fast64_t ( float32_t, bool ), bool
+ );
+void
+ test_a_f32_z_i32_x(
+ int_fast32_t ( float32_t, bool ), int_fast32_t ( float32_t, bool ), bool
+ );
+void
+ test_a_f32_z_i64_x(
+ int_fast64_t ( float32_t, bool ), int_fast64_t ( float32_t, bool ), bool
+ );
+void test_a_f32_z_f64( float64_t ( float32_t ), float64_t ( float32_t ) );
+#ifdef EXTFLOAT80
+void
+ test_a_f32_z_extF80(
+ void ( float32_t, extFloat80_t * ), void ( float32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void
+ test_a_f32_z_f128(
+ void ( float32_t, float128_t * ), void ( float32_t, float128_t * ) );
+#endif
+void test_az_f32( float32_t ( float32_t ), float32_t ( float32_t ) );
+void
+ test_az_f32_rx(
+ float32_t ( float32_t, uint_fast8_t, bool ),
+ float32_t ( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_abz_f32(
+ float32_t ( float32_t, float32_t ), float32_t ( float32_t, float32_t ) );
+void
+ test_abcz_f32(
+ float32_t ( float32_t, float32_t, float32_t ),
+ float32_t ( float32_t, float32_t, float32_t )
+ );
+void
+ test_ab_f32_z_bool(
+ bool ( float32_t, float32_t ), bool ( float32_t, float32_t ) );
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void
+ test_a_f64_z_ui32_rx(
+ uint_fast32_t ( float64_t, uint_fast8_t, bool ),
+ uint_fast32_t ( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f64_z_ui64_rx(
+ uint_fast64_t ( float64_t, uint_fast8_t, bool ),
+ uint_fast64_t ( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f64_z_i32_rx(
+ int_fast32_t ( float64_t, uint_fast8_t, bool ),
+ int_fast32_t ( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f64_z_i64_rx(
+ int_fast64_t ( float64_t, uint_fast8_t, bool ),
+ int_fast64_t ( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f64_z_ui32_x(
+ uint_fast32_t ( float64_t, bool ), uint_fast32_t ( float64_t, bool ), bool
+ );
+void
+ test_a_f64_z_ui64_x(
+ uint_fast64_t ( float64_t, bool ), uint_fast64_t ( float64_t, bool ), bool
+ );
+void
+ test_a_f64_z_i32_x(
+ int_fast32_t ( float64_t, bool ), int_fast32_t ( float64_t, bool ), bool
+ );
+void
+ test_a_f64_z_i64_x(
+ int_fast64_t ( float64_t, bool ), int_fast64_t ( float64_t, bool ), bool
+ );
+void test_a_f64_z_f32( float32_t ( float64_t ), float32_t ( float64_t ) );
+#ifdef EXTFLOAT80
+void
+ test_a_f64_z_extF80(
+ void ( float64_t, extFloat80_t * ), void ( float64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void
+ test_a_f64_z_f128(
+ void ( float64_t, float128_t * ), void ( float64_t, float128_t * ) );
+#endif
+void test_az_f64( float64_t ( float64_t ), float64_t ( float64_t ) );
+void
+ test_az_f64_rx(
+ float64_t ( float64_t, uint_fast8_t, bool ),
+ float64_t ( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_abz_f64(
+ float64_t ( float64_t, float64_t ), float64_t ( float64_t, float64_t ) );
+void
+ test_abcz_f64(
+ float64_t ( float64_t, float64_t, float64_t ),
+ float64_t ( float64_t, float64_t, float64_t )
+ );
+void
+ test_ab_f64_z_bool(
+ bool ( float64_t, float64_t ), bool ( float64_t, float64_t ) );
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+void
+ test_a_extF80_z_ui32_rx(
+ uint_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_extF80_z_ui64_rx(
+ uint_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_extF80_z_i32_rx(
+ int_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ int_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_extF80_z_i64_rx(
+ int_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ int_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_extF80_z_ui32_x(
+ uint_fast32_t ( const extFloat80_t *, bool ),
+ uint_fast32_t ( const extFloat80_t *, bool ),
+ bool
+ );
+void
+ test_a_extF80_z_ui64_x(
+ uint_fast64_t ( const extFloat80_t *, bool ),
+ uint_fast64_t ( const extFloat80_t *, bool ),
+ bool
+ );
+void
+ test_a_extF80_z_i32_x(
+ int_fast32_t ( const extFloat80_t *, bool ),
+ int_fast32_t ( const extFloat80_t *, bool ),
+ bool
+ );
+void
+ test_a_extF80_z_i64_x(
+ int_fast64_t ( const extFloat80_t *, bool ),
+ int_fast64_t ( const extFloat80_t *, bool ),
+ bool
+ );
+void
+ test_a_extF80_z_f32(
+ float32_t ( const extFloat80_t * ), float32_t ( const extFloat80_t * ) );
+void
+ test_a_extF80_z_f64(
+ float64_t ( const extFloat80_t * ), float64_t ( const extFloat80_t * ) );
+#ifdef FLOAT128
+void
+ test_a_extF80_z_f128(
+ void ( const extFloat80_t *, float128_t * ),
+ void ( const extFloat80_t *, float128_t * )
+ );
+#endif
+void
+ test_az_extF80(
+ void ( const extFloat80_t *, extFloat80_t * ),
+ void ( const extFloat80_t *, extFloat80_t * )
+ );
+void
+ test_az_extF80_rx(
+ void ( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ void ( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_abz_extF80(
+ void ( const extFloat80_t *, const extFloat80_t *, extFloat80_t * ),
+ void ( const extFloat80_t *, const extFloat80_t *, extFloat80_t * )
+ );
+void
+ test_abcz_extF80(
+ void
+ (
+ const extFloat80_t,
+ const extFloat80_t,
+ const extFloat80_t,
+ extFloat80_t *
+ ),
+ void
+ (
+ const extFloat80_t,
+ const extFloat80_t,
+ const extFloat80_t,
+ extFloat80_t *
+ )
+ );
+void
+ test_ab_extF80_z_bool(
+ bool ( const extFloat80_t *, const extFloat80_t * ),
+ bool ( const extFloat80_t *, const extFloat80_t * )
+ );
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#ifdef FLOAT128
+void
+ test_a_f128_z_ui32_rx(
+ uint_fast32_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast32_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f128_z_ui64_rx(
+ uint_fast64_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast64_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f128_z_i32_rx(
+ int_fast32_t ( const float128_t *, uint_fast8_t, bool ),
+ int_fast32_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f128_z_i64_rx(
+ int_fast64_t ( const float128_t *, uint_fast8_t, bool ),
+ int_fast64_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_a_f128_z_ui32_x(
+ uint_fast32_t ( const float128_t *, bool ),
+ uint_fast32_t ( const float128_t *, bool ),
+ bool
+ );
+void
+ test_a_f128_z_ui64_x(
+ uint_fast64_t ( const float128_t *, bool ),
+ uint_fast64_t ( const float128_t *, bool ),
+ bool
+ );
+void
+ test_a_f128_z_i32_x(
+ int_fast32_t ( const float128_t *, bool ),
+ int_fast32_t ( const float128_t *, bool ),
+ bool
+ );
+void
+ test_a_f128_z_i64_x(
+ int_fast64_t ( const float128_t *, bool ),
+ int_fast64_t ( const float128_t *, bool ),
+ bool
+ );
+void
+ test_a_f128_z_f32(
+ float32_t ( const float128_t * ), float32_t ( const float128_t * ) );
+void
+ test_a_f128_z_f64(
+ float64_t ( const float128_t * ), float64_t ( const float128_t * ) );
+#ifdef EXTFLOAT80
+void
+ test_a_f128_z_extF80(
+ void ( const float128_t *, extFloat80_t * ),
+ void ( const float128_t *, extFloat80_t * )
+ );
+#endif
+void
+ test_az_f128(
+ void ( const float128_t *, float128_t * ),
+ void ( const float128_t *, float128_t * )
+ );
+void
+ test_az_f128_rx(
+ void ( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ void ( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ uint_fast8_t,
+ bool
+ );
+void
+ test_abz_f128(
+ void ( const float128_t *, const float128_t *, float128_t * ),
+ void ( const float128_t *, const float128_t *, float128_t * )
+ );
+void
+ test_abcz_f128(
+ void
+ ( const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ ),
+ void
+ ( const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ )
+ );
+void
+ test_ab_f128_z_bool(
+ bool ( const float128_t *, const float128_t * ),
+ bool ( const float128_t *, const float128_t * )
+ );
+#endif
+
diff --git a/source/testLoops_common.c b/source/testLoops_common.c
new file mode 100644
index 0000000..f8d4f27
--- /dev/null
+++ b/source/testLoops_common.c
@@ -0,0 +1,44 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "testLoops.h"
+
+bool testLoops_forever = false;
+
+uint_fast8_t *testLoops_trueFlagsPtr;
+uint_fast8_t (*testLoops_subjFlagsFunction)( void );
+
diff --git a/source/test_a_extF80_z_f128.c b/source/test_a_extF80_z_f128.c
new file mode 100644
index 0000000..b71648b
--- /dev/null
+++ b/source/test_a_extF80_z_f128.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdio.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#if defined EXTFLOAT80 && defined FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_f128(
+ void trueFunction( const extFloat80_t *, float128_t * ),
+ void subjFunction( const extFloat80_t *, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_extF80_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( &genCases_extF80_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_f32.c b/source/test_a_extF80_z_f32.c
new file mode 100644
index 0000000..b10c48b
--- /dev/null
+++ b/source/test_a_extF80_z_f32.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdio.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_f32(
+ float32_t trueFunction( const extFloat80_t * ),
+ float32_t subjFunction( const extFloat80_t * )
+ )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_f64.c b/source/test_a_extF80_z_f64.c
new file mode 100644
index 0000000..3ad72da
--- /dev/null
+++ b/source/test_a_extF80_z_f64.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdio.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_f64(
+ float64_t trueFunction( const extFloat80_t * ),
+ float64_t subjFunction( const extFloat80_t * )
+ )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_i32_rx.c b/source/test_a_extF80_z_i32_rx.c
new file mode 100644
index 0000000..8d665bf
--- /dev/null
+++ b/source/test_a_extF80_z_i32_rx.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_i32_rx(
+ int_fast32_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ int_fast32_t subjFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_i32_x.c b/source/test_a_extF80_z_i32_x.c
new file mode 100644
index 0000000..0b98a01
--- /dev/null
+++ b/source/test_a_extF80_z_i32_x.c
@@ -0,0 +1,105 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_i32_x(
+ int_fast32_t trueFunction( const extFloat80_t *, bool ),
+ int_fast32_t subjFunction( const extFloat80_t *, bool ),
+ bool exact
+ )
+{
+ int count;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_i64_rx.c b/source/test_a_extF80_z_i64_rx.c
new file mode 100644
index 0000000..296fe4a
--- /dev/null
+++ b/source/test_a_extF80_z_i64_rx.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_i64_rx(
+ int_fast64_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ int_fast64_t subjFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, "\n\t" );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_i64_x.c b/source/test_a_extF80_z_i64_x.c
new file mode 100644
index 0000000..e9e9dd8
--- /dev/null
+++ b/source/test_a_extF80_z_i64_x.c
@@ -0,0 +1,105 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_i64_x(
+ int_fast64_t trueFunction( const extFloat80_t *, bool ),
+ int_fast64_t subjFunction( const extFloat80_t *, bool ),
+ bool exact
+ )
+{
+ int count;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, "\n\t" );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_ui32_rx.c b/source/test_a_extF80_z_ui32_rx.c
new file mode 100644
index 0000000..033caee
--- /dev/null
+++ b/source/test_a_extF80_z_ui32_rx.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_ui32_rx(
+ uint_fast32_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast32_t subjFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_ui32_x.c b/source/test_a_extF80_z_ui32_x.c
new file mode 100644
index 0000000..e2dd4ff
--- /dev/null
+++ b/source/test_a_extF80_z_ui32_x.c
@@ -0,0 +1,105 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_ui32_x(
+ uint_fast32_t trueFunction( const extFloat80_t *, bool ),
+ uint_fast32_t subjFunction( const extFloat80_t *, bool ),
+ bool exact
+ )
+{
+ int count;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_ui64_rx.c b/source/test_a_extF80_z_ui64_rx.c
new file mode 100644
index 0000000..83dff24
--- /dev/null
+++ b/source/test_a_extF80_z_ui64_rx.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_ui64_rx(
+ uint_fast64_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast64_t subjFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_extF80_z_ui64_x.c b/source/test_a_extF80_z_ui64_x.c
new file mode 100644
index 0000000..8e1560a
--- /dev/null
+++ b/source/test_a_extF80_z_ui64_x.c
@@ -0,0 +1,105 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_extF80_z_ui64_x(
+ uint_fast64_t trueFunction( const extFloat80_t *, bool ),
+ uint_fast64_t subjFunction( const extFloat80_t *, bool ),
+ bool exact
+ )
+{
+ int count;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, "\n\t" );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_extF80.c b/source/test_a_f128_z_extF80.c
new file mode 100644
index 0000000..7cec13f
--- /dev/null
+++ b/source/test_a_f128_z_extF80.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#if defined EXTFLOAT80 && defined FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_extF80(
+ void trueFunction( const float128_t *, extFloat80_t * ),
+ void subjFunction( const float128_t *, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_f128_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( &genCases_f128_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_f32.c b/source/test_a_f128_z_f32.c
new file mode 100644
index 0000000..22fa4ef
--- /dev/null
+++ b/source/test_a_f128_z_f32.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_f32(
+ float32_t trueFunction( const float128_t * ),
+ float32_t subjFunction( const float128_t * )
+ )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_f64.c b/source/test_a_f128_z_f64.c
new file mode 100644
index 0000000..0ad5241
--- /dev/null
+++ b/source/test_a_f128_z_f64.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_f64(
+ float64_t trueFunction( const float128_t * ),
+ float64_t subjFunction( const float128_t * )
+ )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, "\n\t" );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_i32_rx.c b/source/test_a_f128_z_i32_rx.c
new file mode 100644
index 0000000..8db9a4e
--- /dev/null
+++ b/source/test_a_f128_z_i32_rx.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_i32_rx(
+ int_fast32_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ int_fast32_t subjFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_i32_x.c b/source/test_a_f128_z_i32_x.c
new file mode 100644
index 0000000..3396e62
--- /dev/null
+++ b/source/test_a_f128_z_i32_x.c
@@ -0,0 +1,105 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_i32_x(
+ int_fast32_t trueFunction( const float128_t *, bool ),
+ int_fast32_t subjFunction( const float128_t *, bool ),
+ bool exact
+ )
+{
+ int count;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_i64_rx.c b/source/test_a_f128_z_i64_rx.c
new file mode 100644
index 0000000..7221618
--- /dev/null
+++ b/source/test_a_f128_z_i64_rx.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_i64_rx(
+ int_fast64_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ int_fast64_t subjFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, "\n\t" );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_i64_x.c b/source/test_a_f128_z_i64_x.c
new file mode 100644
index 0000000..0a4e815
--- /dev/null
+++ b/source/test_a_f128_z_i64_x.c
@@ -0,0 +1,105 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_i64_x(
+ int_fast64_t trueFunction( const float128_t *, bool ),
+ int_fast64_t subjFunction( const float128_t *, bool ),
+ bool exact
+ )
+{
+ int count;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, "\n\t" );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_ui32_rx.c b/source/test_a_f128_z_ui32_rx.c
new file mode 100644
index 0000000..4b5e87e
--- /dev/null
+++ b/source/test_a_f128_z_ui32_rx.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_ui32_rx(
+ uint_fast32_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast32_t subjFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_ui32_x.c b/source/test_a_f128_z_ui32_x.c
new file mode 100644
index 0000000..633e3ad
--- /dev/null
+++ b/source/test_a_f128_z_ui32_x.c
@@ -0,0 +1,105 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_ui32_x(
+ uint_fast32_t trueFunction( const float128_t *, bool ),
+ uint_fast32_t subjFunction( const float128_t *, bool ),
+ bool exact
+ )
+{
+ int count;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_ui64_rx.c b/source/test_a_f128_z_ui64_rx.c
new file mode 100644
index 0000000..096341c
--- /dev/null
+++ b/source/test_a_f128_z_ui64_rx.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_ui64_rx(
+ uint_fast64_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast64_t subjFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, "\n\t" );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f128_z_ui64_x.c b/source/test_a_f128_z_ui64_x.c
new file mode 100644
index 0000000..5cf0e0f
--- /dev/null
+++ b/source/test_a_f128_z_ui64_x.c
@@ -0,0 +1,105 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f128_z_ui64_x(
+ uint_fast64_t trueFunction( const float128_t *, bool ),
+ uint_fast64_t subjFunction( const float128_t *, bool ),
+ bool exact
+ )
+{
+ int count;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, "\n\t" );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f32_z_extF80.c b/source/test_a_f32_z_extF80.c
new file mode 100644
index 0000000..8effe53
--- /dev/null
+++ b/source/test_a_f32_z_extF80.c
@@ -0,0 +1,103 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_extF80(
+ void trueFunction( float32_t, extFloat80_t * ),
+ void subjFunction( float32_t, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_f32_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_f32_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f32_z_f128.c b/source/test_a_f32_z_f128.c
new file mode 100644
index 0000000..889c31d
--- /dev/null
+++ b/source/test_a_f32_z_f128.c
@@ -0,0 +1,103 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_f128(
+ void trueFunction( float32_t, float128_t * ),
+ void subjFunction( float32_t, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_f32_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_f32_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f32_z_f64.c b/source/test_a_f32_z_f64.c
new file mode 100644
index 0000000..c4e63d8
--- /dev/null
+++ b/source/test_a_f32_z_f64.c
@@ -0,0 +1,97 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_f64(
+ float64_t trueFunction( float32_t ), float64_t subjFunction( float32_t ) )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f32_z_i32_rx.c b/source/test_a_f32_z_i32_rx.c
new file mode 100644
index 0000000..a61c31d
--- /dev/null
+++ b/source/test_a_f32_z_i32_rx.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_i32_rx(
+ int_fast32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ int_fast32_t subjFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f32_z_i32_x.c b/source/test_a_f32_z_i32_x.c
new file mode 100644
index 0000000..d2b5097
--- /dev/null
+++ b/source/test_a_f32_z_i32_x.c
@@ -0,0 +1,100 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_i32_x(
+ int_fast32_t trueFunction( float32_t, bool ),
+ int_fast32_t subjFunction( float32_t, bool ),
+ bool exact
+ )
+{
+ int count;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f32_z_i64_rx.c b/source/test_a_f32_z_i64_rx.c
new file mode 100644
index 0000000..56b4704
--- /dev/null
+++ b/source/test_a_f32_z_i64_rx.c
@@ -0,0 +1,102 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_i64_rx(
+ int_fast64_t trueFunction( float32_t, uint_fast8_t, bool ),
+ int_fast64_t subjFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f32_z_i64_x.c b/source/test_a_f32_z_i64_x.c
new file mode 100644
index 0000000..fddf48f
--- /dev/null
+++ b/source/test_a_f32_z_i64_x.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_i64_x(
+ int_fast64_t trueFunction( float32_t, bool ),
+ int_fast64_t subjFunction( float32_t, bool ),
+ bool exact
+ )
+{
+ int count;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f32_z_ui32_rx.c b/source/test_a_f32_z_ui32_rx.c
new file mode 100644
index 0000000..9b478f2
--- /dev/null
+++ b/source/test_a_f32_z_ui32_rx.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_ui32_rx(
+ uint_fast32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast32_t subjFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f32_z_ui32_x.c b/source/test_a_f32_z_ui32_x.c
new file mode 100644
index 0000000..53283ed
--- /dev/null
+++ b/source/test_a_f32_z_ui32_x.c
@@ -0,0 +1,100 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_ui32_x(
+ uint_fast32_t trueFunction( float32_t, bool ),
+ uint_fast32_t subjFunction( float32_t, bool ),
+ bool exact
+ )
+{
+ int count;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f32_z_ui64_rx.c b/source/test_a_f32_z_ui64_rx.c
new file mode 100644
index 0000000..c0f88ae
--- /dev/null
+++ b/source/test_a_f32_z_ui64_rx.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_ui64_rx(
+ uint_fast64_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast64_t subjFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f32_z_ui64_x.c b/source/test_a_f32_z_ui64_x.c
new file mode 100644
index 0000000..0237244
--- /dev/null
+++ b/source/test_a_f32_z_ui64_x.c
@@ -0,0 +1,100 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f32_z_ui64_x(
+ uint_fast64_t trueFunction( float32_t, bool ),
+ uint_fast64_t subjFunction( float32_t, bool ),
+ bool exact
+ )
+{
+ int count;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_extF80.c b/source/test_a_f64_z_extF80.c
new file mode 100644
index 0000000..7607b2c
--- /dev/null
+++ b/source/test_a_f64_z_extF80.c
@@ -0,0 +1,103 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_extF80(
+ void trueFunction( float64_t, extFloat80_t * ),
+ void subjFunction( float64_t, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_f64_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_f64_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f64_z_f128.c b/source/test_a_f64_z_f128.c
new file mode 100644
index 0000000..ce125a4
--- /dev/null
+++ b/source/test_a_f64_z_f128.c
@@ -0,0 +1,103 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_f128(
+ void trueFunction( float64_t, float128_t * ),
+ void subjFunction( float64_t, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_f64_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_f64_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_f64_z_f32.c b/source/test_a_f64_z_f32.c
new file mode 100644
index 0000000..42bb130
--- /dev/null
+++ b/source/test_a_f64_z_f32.c
@@ -0,0 +1,97 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_f32(
+ float32_t trueFunction( float64_t ), float32_t subjFunction( float64_t ) )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_i32_rx.c b/source/test_a_f64_z_i32_rx.c
new file mode 100644
index 0000000..8a9cacf
--- /dev/null
+++ b/source/test_a_f64_z_i32_rx.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_i32_rx(
+ int_fast32_t trueFunction( float64_t, uint_fast8_t, bool ),
+ int_fast32_t subjFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_i32_x.c b/source/test_a_f64_z_i32_x.c
new file mode 100644
index 0000000..a22e26f
--- /dev/null
+++ b/source/test_a_f64_z_i32_x.c
@@ -0,0 +1,100 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_i32_x(
+ int_fast32_t trueFunction( float64_t, bool ),
+ int_fast32_t subjFunction( float64_t, bool ),
+ bool exact
+ )
+{
+ int count;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_i64_rx.c b/source/test_a_f64_z_i64_rx.c
new file mode 100644
index 0000000..9b67053
--- /dev/null
+++ b/source/test_a_f64_z_i64_rx.c
@@ -0,0 +1,102 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_i64_rx(
+ int_fast64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ int_fast64_t subjFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_i64_x.c b/source/test_a_f64_z_i64_x.c
new file mode 100644
index 0000000..d310ee2
--- /dev/null
+++ b/source/test_a_f64_z_i64_x.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_i64_x(
+ int_fast64_t trueFunction( float64_t, bool ),
+ int_fast64_t subjFunction( float64_t, bool ),
+ bool exact
+ )
+{
+ int count;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_ui32_rx.c b/source/test_a_f64_z_ui32_rx.c
new file mode 100644
index 0000000..f4cda96
--- /dev/null
+++ b/source/test_a_f64_z_ui32_rx.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_ui32_rx(
+ uint_fast32_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast32_t subjFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_ui32_x.c b/source/test_a_f64_z_ui32_x.c
new file mode 100644
index 0000000..0e73182
--- /dev/null
+++ b/source/test_a_f64_z_ui32_x.c
@@ -0,0 +1,100 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_ui32_x(
+ uint_fast32_t trueFunction( float64_t, bool ),
+ uint_fast32_t subjFunction( float64_t, bool ),
+ bool exact
+ )
+{
+ int count;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_ui64_rx.c b/source/test_a_f64_z_ui64_rx.c
new file mode 100644
index 0000000..1166604
--- /dev/null
+++ b/source/test_a_f64_z_ui64_rx.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_ui64_rx(
+ uint_fast64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast64_t subjFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_f64_z_ui64_x.c b/source/test_a_f64_z_ui64_x.c
new file mode 100644
index 0000000..4ff2c8f
--- /dev/null
+++ b/source/test_a_f64_z_ui64_x.c
@@ -0,0 +1,100 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_f64_z_ui64_x(
+ uint_fast64_t trueFunction( float64_t, bool ),
+ uint_fast64_t subjFunction( float64_t, bool ),
+ bool exact
+ )
+{
+ int count;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_i32_z_extF80.c b/source/test_a_i32_z_extF80.c
new file mode 100644
index 0000000..ec96d56
--- /dev/null
+++ b/source/test_a_i32_z_extF80.c
@@ -0,0 +1,98 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_i32_z_extF80(
+ void trueFunction( int32_t, extFloat80_t * ),
+ void subjFunction( int32_t, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_i32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_i32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_i32_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_i32_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i32( genCases_i32_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_i32_z_f128.c b/source/test_a_i32_z_f128.c
new file mode 100644
index 0000000..71d1d50
--- /dev/null
+++ b/source/test_a_i32_z_f128.c
@@ -0,0 +1,98 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_i32_z_f128(
+ void trueFunction( int32_t, float128_t * ),
+ void subjFunction( int32_t, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_i32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_i32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_i32_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_i32_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i32( genCases_i32_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_i32_z_f32.c b/source/test_a_i32_z_f32.c
new file mode 100644
index 0000000..54fc995
--- /dev/null
+++ b/source/test_a_i32_z_f32.c
@@ -0,0 +1,92 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_i32_z_f32(
+ float32_t trueFunction( int32_t ), float32_t subjFunction( int32_t ) )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_i32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_i32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_i32_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_i32_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i32( genCases_i32_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_i32_z_f64.c b/source/test_a_i32_z_f64.c
new file mode 100644
index 0000000..bd2196c
--- /dev/null
+++ b/source/test_a_i32_z_f64.c
@@ -0,0 +1,92 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_i32_z_f64(
+ float64_t trueFunction( int32_t ), float64_t subjFunction( int32_t ) )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_i32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_i32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_i32_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_i32_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i32( genCases_i32_a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_i64_z_extF80.c b/source/test_a_i64_z_extF80.c
new file mode 100644
index 0000000..90ae68a
--- /dev/null
+++ b/source/test_a_i64_z_extF80.c
@@ -0,0 +1,98 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_i64_z_extF80(
+ void trueFunction( int64_t, extFloat80_t * ),
+ void subjFunction( int64_t, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_i64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_i64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_i64_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_i64_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i64( genCases_i64_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_i64_z_f128.c b/source/test_a_i64_z_f128.c
new file mode 100644
index 0000000..4752a5d
--- /dev/null
+++ b/source/test_a_i64_z_f128.c
@@ -0,0 +1,98 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_i64_z_f128(
+ void trueFunction( int64_t, float128_t * ),
+ void subjFunction( int64_t, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_i64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_i64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_i64_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_i64_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i64( genCases_i64_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_i64_z_f32.c b/source/test_a_i64_z_f32.c
new file mode 100644
index 0000000..e13812a
--- /dev/null
+++ b/source/test_a_i64_z_f32.c
@@ -0,0 +1,92 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_i64_z_f32(
+ float32_t trueFunction( int64_t ), float32_t subjFunction( int64_t ) )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_i64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_i64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_i64_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_i64_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i64( genCases_i64_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_i64_z_f64.c b/source/test_a_i64_z_f64.c
new file mode 100644
index 0000000..cf1afb9
--- /dev/null
+++ b/source/test_a_i64_z_f64.c
@@ -0,0 +1,92 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_i64_z_f64(
+ float64_t trueFunction( int64_t ), float64_t subjFunction( int64_t ) )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_i64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_i64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_i64_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_i64_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i64( genCases_i64_a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_ui32_z_extF80.c b/source/test_a_ui32_z_extF80.c
new file mode 100644
index 0000000..069b16a
--- /dev/null
+++ b/source/test_a_ui32_z_extF80.c
@@ -0,0 +1,98 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_ui32_z_extF80(
+ void trueFunction( uint32_t, extFloat80_t * ),
+ void subjFunction( uint32_t, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_ui32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_ui32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_ui32_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_ui32_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui32( genCases_ui32_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_ui32_z_f128.c b/source/test_a_ui32_z_f128.c
new file mode 100644
index 0000000..394f2d5
--- /dev/null
+++ b/source/test_a_ui32_z_f128.c
@@ -0,0 +1,98 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_ui32_z_f128(
+ void trueFunction( uint32_t, float128_t * ),
+ void subjFunction( uint32_t, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_ui32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_ui32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_ui32_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_ui32_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui32( genCases_ui32_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_ui32_z_f32.c b/source/test_a_ui32_z_f32.c
new file mode 100644
index 0000000..8c79c7a
--- /dev/null
+++ b/source/test_a_ui32_z_f32.c
@@ -0,0 +1,92 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_ui32_z_f32(
+ float32_t trueFunction( uint32_t ), float32_t subjFunction( uint32_t ) )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_ui32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_ui32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_ui32_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_ui32_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui32( genCases_ui32_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_ui32_z_f64.c b/source/test_a_ui32_z_f64.c
new file mode 100644
index 0000000..c1ce51a
--- /dev/null
+++ b/source/test_a_ui32_z_f64.c
@@ -0,0 +1,92 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_ui32_z_f64(
+ float64_t trueFunction( uint32_t ), float64_t subjFunction( uint32_t ) )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_ui32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_ui32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_ui32_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_ui32_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui32( genCases_ui32_a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_ui64_z_extF80.c b/source/test_a_ui64_z_extF80.c
new file mode 100644
index 0000000..aa541ba
--- /dev/null
+++ b/source/test_a_ui64_z_extF80.c
@@ -0,0 +1,98 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_ui64_z_extF80(
+ void trueFunction( uint64_t, extFloat80_t * ),
+ void subjFunction( uint64_t, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_ui64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_ui64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_ui64_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_ui64_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui64( genCases_ui64_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_ui64_z_f128.c b/source/test_a_ui64_z_f128.c
new file mode 100644
index 0000000..7d7f1f2
--- /dev/null
+++ b/source/test_a_ui64_z_f128.c
@@ -0,0 +1,98 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_ui64_z_f128(
+ void trueFunction( uint64_t, float128_t * ),
+ void subjFunction( uint64_t, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_ui64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_ui64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( genCases_ui64_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( genCases_ui64_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui64( genCases_ui64_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_a_ui64_z_f32.c b/source/test_a_ui64_z_f32.c
new file mode 100644
index 0000000..d7ee290
--- /dev/null
+++ b/source/test_a_ui64_z_f32.c
@@ -0,0 +1,92 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_ui64_z_f32(
+ float32_t trueFunction( uint64_t ), float32_t subjFunction( uint64_t ) )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_ui64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_ui64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_ui64_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_ui64_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui64( genCases_ui64_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_a_ui64_z_f64.c b/source/test_a_ui64_z_f64.c
new file mode 100644
index 0000000..0bd74c8
--- /dev/null
+++ b/source/test_a_ui64_z_f64.c
@@ -0,0 +1,92 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_a_ui64_z_f64(
+ float64_t trueFunction( uint64_t ), float64_t subjFunction( uint64_t ) )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_ui64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_ui64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_ui64_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_ui64_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui64( genCases_ui64_a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_ab_extF80_z_bool.c b/source/test_ab_extF80_z_bool.c
new file mode 100644
index 0000000..88d9e96
--- /dev/null
+++ b/source/test_ab_extF80_z_bool.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_ab_extF80_z_bool(
+ bool trueFunction( const extFloat80_t *, const extFloat80_t * ),
+ bool subjFunction( const extFloat80_t *, const extFloat80_t * )
+ )
+{
+ int count;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+ bool subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_ab_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_ab_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_extF80_a, &genCases_extF80_b );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_extF80_a, &genCases_extF80_b );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (extF80M_isSignalingNaN( &genCases_extF80_a )
+ || extF80M_isSignalingNaN( &genCases_extF80_b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_extF80M(
+ &genCases_extF80_a, &genCases_extF80_b, " " );
+ writeCase_z_bool( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_ab_f128_z_bool.c b/source/test_ab_f128_z_bool.c
new file mode 100644
index 0000000..fbbb5f4
--- /dev/null
+++ b/source/test_ab_f128_z_bool.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_ab_f128_z_bool(
+ bool trueFunction( const float128_t *, const float128_t * ),
+ bool subjFunction( const float128_t *, const float128_t * )
+ )
+{
+ int count;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+ bool subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_ab_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_ab_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &genCases_f128_a, &genCases_f128_b );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( &genCases_f128_a, &genCases_f128_b );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f128M_isSignalingNaN( &genCases_f128_a )
+ || f128M_isSignalingNaN( &genCases_f128_b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f128M(
+ &genCases_f128_a, &genCases_f128_b, "\n\t" );
+ writeCase_z_bool( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_ab_f32_z_bool.c b/source/test_ab_f32_z_bool.c
new file mode 100644
index 0000000..8720ddd
--- /dev/null
+++ b/source/test_ab_f32_z_bool.c
@@ -0,0 +1,96 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_ab_f32_z_bool(
+ bool trueFunction( float32_t, float32_t ),
+ bool subjFunction( float32_t, float32_t )
+ )
+{
+ int count;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+ bool subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_ab_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_ab_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, genCases_f32_b );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, genCases_f32_b );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f32_isSignalingNaN( genCases_f32_a )
+ || f32_isSignalingNaN( genCases_f32_b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f32( genCases_f32_a, genCases_f32_b, " " );
+ writeCase_z_bool( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_ab_f64_z_bool.c b/source/test_ab_f64_z_bool.c
new file mode 100644
index 0000000..cd97c91
--- /dev/null
+++ b/source/test_ab_f64_z_bool.c
@@ -0,0 +1,96 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_ab_f64_z_bool(
+ bool trueFunction( float64_t, float64_t ),
+ bool subjFunction( float64_t, float64_t )
+ )
+{
+ int count;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+ bool subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_ab_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_ab_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, genCases_f64_b );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, genCases_f64_b );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f64_isSignalingNaN( genCases_f64_a )
+ || f64_isSignalingNaN( genCases_f64_b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f64( genCases_f64_a, genCases_f64_b, " " );
+ writeCase_z_bool( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_abcz_f128.c b/source/test_abcz_f128.c
new file mode 100644
index 0000000..c4df9ba
--- /dev/null
+++ b/source/test_abcz_f128.c
@@ -0,0 +1,126 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_abcz_f128(
+ void
+ trueFunction(
+ const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ ),
+ void
+ subjFunction(
+ const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_abc_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_abc_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction(
+ &genCases_f128_a, &genCases_f128_b, &genCases_f128_c, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction(
+ &genCases_f128_a, &genCases_f128_b, &genCases_f128_c, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && ( f128M_isSignalingNaN( &genCases_f128_a )
+ || f128M_isSignalingNaN( &genCases_f128_b )
+ || f128M_isSignalingNaN( &genCases_f128_c )
+ )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_abc_f128M(
+ &genCases_f128_a,
+ &genCases_f128_b,
+ &genCases_f128_c,
+ "\n\t"
+ );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_abcz_f32.c b/source/test_abcz_f32.c
new file mode 100644
index 0000000..29048a5
--- /dev/null
+++ b/source/test_abcz_f32.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_abcz_f32(
+ float32_t trueFunction( float32_t, float32_t, float32_t ),
+ float32_t subjFunction( float32_t, float32_t, float32_t )
+ )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_abc_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_abc_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, genCases_f32_b, genCases_f32_c );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, genCases_f32_b, genCases_f32_c );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && ( f32_isSignalingNaN( genCases_f32_a )
+ || f32_isSignalingNaN( genCases_f32_b )
+ || f32_isSignalingNaN( genCases_f32_c )
+ )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_abc_f32(
+ genCases_f32_a, genCases_f32_b, genCases_f32_c, "\n\t" );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_abcz_f64.c b/source/test_abcz_f64.c
new file mode 100644
index 0000000..067617b
--- /dev/null
+++ b/source/test_abcz_f64.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_abcz_f64(
+ float64_t trueFunction( float64_t, float64_t, float64_t ),
+ float64_t subjFunction( float64_t, float64_t, float64_t )
+ )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_abc_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_abc_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, genCases_f64_b, genCases_f64_c );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, genCases_f64_b, genCases_f64_c );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && ( f64_isSignalingNaN( genCases_f64_a )
+ || f64_isSignalingNaN( genCases_f64_b )
+ || f64_isSignalingNaN( genCases_f64_c )
+ )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_abc_f64(
+ genCases_f64_a, genCases_f64_b, genCases_f64_c, "\n\t" );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_abz_extF80.c b/source/test_abz_extF80.c
new file mode 100644
index 0000000..e6453d6
--- /dev/null
+++ b/source/test_abz_extF80.c
@@ -0,0 +1,110 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_abz_extF80(
+ void
+ trueFunction(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * ),
+ void
+ subjFunction(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_ab_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_ab_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_extF80_a, &genCases_extF80_b, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( &genCases_extF80_a, &genCases_extF80_b, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (extF80M_isSignalingNaN( &genCases_extF80_a )
+ || extF80M_isSignalingNaN( &genCases_extF80_b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_extF80M(
+ &genCases_extF80_a, &genCases_extF80_b, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_abz_f128.c b/source/test_abz_f128.c
new file mode 100644
index 0000000..95656f4
--- /dev/null
+++ b/source/test_abz_f128.c
@@ -0,0 +1,106 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_abz_f128(
+ void trueFunction( const float128_t *, const float128_t *, float128_t * ),
+ void subjFunction( const float128_t *, const float128_t *, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_ab_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_ab_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_f128_a, &genCases_f128_b, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( &genCases_f128_a, &genCases_f128_b, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f128M_isSignalingNaN( &genCases_f128_a )
+ || f128M_isSignalingNaN( &genCases_f128_b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f128M(
+ &genCases_f128_a, &genCases_f128_b, "\n\t" );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_abz_f32.c b/source/test_abz_f32.c
new file mode 100644
index 0000000..e224653
--- /dev/null
+++ b/source/test_abz_f32.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_abz_f32(
+ float32_t trueFunction( float32_t, float32_t ),
+ float32_t subjFunction( float32_t, float32_t )
+ )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_ab_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_ab_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, genCases_f32_b );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, genCases_f32_b );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f32_isSignalingNaN( genCases_f32_a )
+ || f32_isSignalingNaN( genCases_f32_b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f32( genCases_f32_a, genCases_f32_b, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_abz_f64.c b/source/test_abz_f64.c
new file mode 100644
index 0000000..5b04e14
--- /dev/null
+++ b/source/test_abz_f64.c
@@ -0,0 +1,101 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_abz_f64(
+ float64_t trueFunction( float64_t, float64_t ),
+ float64_t subjFunction( float64_t, float64_t )
+ )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_ab_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_ab_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, genCases_f64_b );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, genCases_f64_b );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f64_isSignalingNaN( genCases_f64_a )
+ || f64_isSignalingNaN( genCases_f64_b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f64( genCases_f64_a, genCases_f64_b, "\n\t" );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_az_extF80.c b/source/test_az_extF80.c
new file mode 100644
index 0000000..bb6f319
--- /dev/null
+++ b/source/test_az_extF80.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_az_extF80(
+ void trueFunction( const extFloat80_t *, extFloat80_t * ),
+ void subjFunction( const extFloat80_t *, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_extF80_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( &genCases_extF80_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_az_extF80_rx.c b/source/test_az_extF80_rx.c
new file mode 100644
index 0000000..e6559ae
--- /dev/null
+++ b/source/test_az_extF80_rx.c
@@ -0,0 +1,109 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef EXTFLOAT80
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_az_extF80_rx(
+ void
+ trueFunction( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ void
+ subjFunction( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_extF80_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_extF80_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_extF80_a, roundingMode, exact, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( &genCases_extF80_a, roundingMode, exact, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && extF80M_isSignalingNaN( &genCases_extF80_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &genCases_extF80_a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_az_f128.c b/source/test_az_f128.c
new file mode 100644
index 0000000..6237cf5
--- /dev/null
+++ b/source/test_az_f128.c
@@ -0,0 +1,104 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_az_f128(
+ void trueFunction( const float128_t *, float128_t * ),
+ void subjFunction( const float128_t *, float128_t * )
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_f128_a, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( &genCases_f128_a, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_az_f128_rx.c b/source/test_az_f128_rx.c
new file mode 100644
index 0000000..cf08cf1
--- /dev/null
+++ b/source/test_az_f128_rx.c
@@ -0,0 +1,107 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#ifdef FLOAT128
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_az_f128_rx(
+ void trueFunction( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ void subjFunction( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f128_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f128_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueFunction( &genCases_f128_a, roundingMode, exact, &trueZ );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjFunction( &genCases_f128_a, roundingMode, exact, &subjZ );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && f128M_isSignalingNaN( &genCases_f128_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &genCases_f128_a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/test_az_f32.c b/source/test_az_f32.c
new file mode 100644
index 0000000..9cbf6d5
--- /dev/null
+++ b/source/test_az_f32.c
@@ -0,0 +1,97 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_az_f32(
+ float32_t trueFunction( float32_t ), float32_t subjFunction( float32_t ) )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_az_f32_rx.c b/source/test_az_f32_rx.c
new file mode 100644
index 0000000..511669a
--- /dev/null
+++ b/source/test_az_f32_rx.c
@@ -0,0 +1,102 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_az_f32_rx(
+ float32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ float32_t subjFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f32_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f32_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f32_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f32_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f32_isSignalingNaN( genCases_f32_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( genCases_f32_a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_az_f64.c b/source/test_az_f64.c
new file mode 100644
index 0000000..17c7f2b
--- /dev/null
+++ b/source/test_az_f64.c
@@ -0,0 +1,97 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_az_f64(
+ float64_t trueFunction( float64_t ), float64_t subjFunction( float64_t ) )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/test_az_f64_rx.c b/source/test_az_f64_rx.c
new file mode 100644
index 0000000..a785378
--- /dev/null
+++ b/source/test_az_f64_rx.c
@@ -0,0 +1,102 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+#pragma STDC FENV_ACCESS ON
+
+void
+ test_az_f64_rx(
+ float64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ float64_t subjFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+
+ genCases_f64_a_init();
+ genCases_writeTestsTotal( testLoops_forever );
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! genCases_done || testLoops_forever ) {
+ genCases_f64_a_next();
+ *testLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( genCases_f64_a, roundingMode, exact );
+ trueFlags = *testLoops_trueFlagsPtr;
+ testLoops_subjFlagsFunction();
+ subjZ = subjFunction( genCases_f64_a, roundingMode, exact );
+ subjFlags = testLoops_subjFlagsFunction();
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs && f64_isSignalingNaN( genCases_f64_a )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( genCases_f64_a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
diff --git a/source/testfloat.c b/source/testfloat.c
new file mode 100644
index 0000000..73044f8
--- /dev/null
+++ b/source/testfloat.c
@@ -0,0 +1,1351 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <signal.h>
+#include "platform.h"
+#include "fail.h"
+#include "softfloat.h"
+#include "subjfloat_config.h"
+#include "subjfloat.h"
+#include "functions.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "testLoops.h"
+
+static void catchSIGINT( int signalCode )
+{
+
+ if ( verCases_stop ) exit( EXIT_FAILURE );
+ verCases_stop = true;
+
+}
+
+static void (*subjFunctionPtr)();
+
+typedef float32_t funcType_a_ui32_z_f32( uint_fast32_t );
+typedef float64_t funcType_a_ui32_z_f64( uint_fast32_t );
+#ifdef EXTFLOAT80
+typedef void funcType_a_ui32_z_extF80( uint_fast32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+typedef void funcType_a_ui32_z_f128( uint_fast32_t, float128_t * );
+#endif
+typedef float32_t funcType_a_ui64_z_f32( uint_fast64_t );
+typedef float64_t funcType_a_ui64_z_f64( uint_fast64_t );
+#ifdef EXTFLOAT80
+typedef void funcType_a_ui64_z_extF80( uint_fast64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+typedef void funcType_a_ui64_z_f128( uint_fast64_t, float128_t * );
+#endif
+typedef float32_t funcType_a_i32_z_f32( int_fast32_t );
+typedef float64_t funcType_a_i32_z_f64( int_fast32_t );
+#ifdef EXTFLOAT80
+typedef void funcType_a_i32_z_extF80( int_fast32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+typedef void funcType_a_i32_z_f128( int_fast32_t, float128_t * );
+#endif
+typedef float32_t funcType_a_i64_z_f32( int_fast64_t );
+typedef float64_t funcType_a_i64_z_f64( int_fast64_t );
+#ifdef EXTFLOAT80
+typedef void funcType_a_i64_z_extF80( int_fast64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+typedef void funcType_a_i64_z_f128( int_fast64_t, float128_t * );
+#endif
+
+typedef uint_fast32_t funcType_a_f32_z_ui32( float32_t );
+typedef uint_fast64_t funcType_a_f32_z_ui64( float32_t );
+typedef int_fast32_t funcType_a_f32_z_i32( float32_t );
+typedef int_fast64_t funcType_a_f32_z_i64( float32_t );
+typedef float64_t funcType_a_f32_z_f64( float32_t );
+#ifdef EXTFLOAT80
+typedef void funcType_a_f32_z_extF80( float32_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+typedef void funcType_a_f32_z_f128( float32_t, float128_t * );
+#endif
+typedef float32_t funcType_az_f32( float32_t );
+typedef float32_t funcType_abz_f32( float32_t, float32_t );
+typedef float32_t funcType_abcz_f32( float32_t, float32_t, float32_t );
+typedef bool funcType_ab_f32_z_bool( float32_t, float32_t );
+
+typedef uint_fast32_t funcType_a_f64_z_ui32( float64_t );
+typedef uint_fast64_t funcType_a_f64_z_ui64( float64_t );
+typedef int_fast32_t funcType_a_f64_z_i32( float64_t );
+typedef int_fast64_t funcType_a_f64_z_i64( float64_t );
+typedef float32_t funcType_a_f64_z_f32( float64_t );
+#ifdef EXTFLOAT80
+typedef void funcType_a_f64_z_extF80( float64_t, extFloat80_t * );
+#endif
+#ifdef FLOAT128
+typedef void funcType_a_f64_z_f128( float64_t, float128_t * );
+#endif
+typedef float64_t funcType_az_f64( float64_t );
+typedef float64_t funcType_abz_f64( float64_t, float64_t );
+typedef float64_t funcType_abcz_f64( float64_t, float64_t, float64_t );
+typedef bool funcType_ab_f64_z_bool( float64_t, float64_t );
+
+#ifdef EXTFLOAT80
+typedef uint_fast32_t funcType_a_extF80_z_ui32( const extFloat80_t * );
+typedef uint_fast64_t funcType_a_extF80_z_ui64( const extFloat80_t * );
+typedef int_fast32_t funcType_a_extF80_z_i32( const extFloat80_t * );
+typedef int_fast64_t funcType_a_extF80_z_i64( const extFloat80_t * );
+typedef float32_t funcType_a_extF80_z_f32( const extFloat80_t * );
+typedef float64_t funcType_a_extF80_z_f64( const extFloat80_t * );
+#ifdef FLOAT128
+typedef void funcType_a_extF80_z_f128( const extFloat80_t *, float128_t * );
+#endif
+typedef void funcType_az_extF80( const extFloat80_t *, extFloat80_t * );
+typedef
+ void
+ funcType_abz_extF80(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+typedef
+ bool funcType_ab_extF80_z_bool( const extFloat80_t *, const extFloat80_t * );
+#endif
+
+#ifdef FLOAT128
+typedef uint_fast32_t funcType_a_f128_z_ui32( const float128_t * );
+typedef uint_fast64_t funcType_a_f128_z_ui64( const float128_t * );
+typedef int_fast32_t funcType_a_f128_z_i32( const float128_t * );
+typedef int_fast64_t funcType_a_f128_z_i64( const float128_t * );
+typedef float32_t funcType_a_f128_z_f32( const float128_t * );
+typedef float64_t funcType_a_f128_z_f64( const float128_t * );
+#ifdef EXTFLOAT80
+typedef void funcType_a_f128_z_extF80( const float128_t *, extFloat80_t * );
+#endif
+typedef void funcType_az_f128( const float128_t *, float128_t * );
+typedef
+ void
+ funcType_abz_f128( const float128_t *, const float128_t *, float128_t * );
+typedef
+ void
+ funcType_abcz_f128(
+ const float128_t *, const float128_t *, const float128_t *, float128_t *
+ );
+typedef bool funcType_ab_f128_z_bool( const float128_t *, const float128_t * );
+#endif
+
+static
+ uint_fast32_t
+ subjFunction_a_f32_z_ui32_rx(
+ float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f32_z_ui32 *) subjFunctionPtr)( a );
+
+}
+
+static
+ uint_fast64_t
+ subjFunction_a_f32_z_ui64_rx(
+ float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f32_z_ui64 *) subjFunctionPtr)( a );
+
+}
+
+static
+ int_fast32_t
+ subjFunction_a_f32_z_i32_rx(
+ float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f32_z_i32 *) subjFunctionPtr)( a );
+
+}
+
+static
+ int_fast64_t
+ subjFunction_a_f32_z_i64_rx(
+ float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f32_z_i64 *) subjFunctionPtr)( a );
+
+}
+
+static
+ float32_t
+ subjFunction_az_f32_rx( float32_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_az_f32 *) subjFunctionPtr)( a );
+
+}
+
+static
+ uint_fast32_t
+ subjFunction_a_f64_z_ui32_rx(
+ float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f64_z_ui32 *) subjFunctionPtr)( a );
+
+}
+
+static
+ uint_fast64_t
+ subjFunction_a_f64_z_ui64_rx(
+ float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f64_z_ui64 *) subjFunctionPtr)( a );
+
+}
+
+static
+ int_fast32_t
+ subjFunction_a_f64_z_i32_rx(
+ float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f64_z_i32 *) subjFunctionPtr)( a );
+
+}
+
+static
+ int_fast64_t
+ subjFunction_a_f64_z_i64_rx(
+ float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f64_z_i64 *) subjFunctionPtr)( a );
+
+}
+
+static
+ float64_t
+ subjFunction_az_f64_rx( float64_t a, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_az_f64 *) subjFunctionPtr)( a );
+
+}
+
+#ifdef EXTFLOAT80
+
+static
+ uint_fast32_t
+ subjFunction_a_extF80_z_ui32_rx(
+ const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_extF80_z_ui32 *) subjFunctionPtr)( aPtr );
+
+}
+
+static
+ uint_fast64_t
+ subjFunction_a_extF80_z_ui64_rx(
+ const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_extF80_z_ui64 *) subjFunctionPtr)( aPtr );
+
+}
+
+static
+ int_fast32_t
+ subjFunction_a_extF80_z_i32_rx(
+ const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_extF80_z_i32 *) subjFunctionPtr)( aPtr );
+
+}
+
+static
+ int_fast64_t
+ subjFunction_a_extF80_z_i64_rx(
+ const extFloat80_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_extF80_z_i64 *) subjFunctionPtr)( aPtr );
+
+}
+
+static
+ void
+ subjFunction_az_extF80_rx(
+ const extFloat80_t *aPtr,
+ uint_fast8_t roundingMode,
+ bool exact,
+ extFloat80_t *zPtr
+ )
+{
+
+ return ((funcType_az_extF80 *) subjFunctionPtr)( aPtr, zPtr );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static
+ uint_fast32_t
+ subjFunction_a_f128_z_ui32_rx(
+ const float128_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f128_z_ui32 *) subjFunctionPtr)( aPtr );
+
+}
+
+static
+ uint_fast64_t
+ subjFunction_a_f128_z_ui64_rx(
+ const float128_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f128_z_ui64 *) subjFunctionPtr)( aPtr );
+
+}
+
+static
+ int_fast32_t
+ subjFunction_a_f128_z_i32_rx(
+ const float128_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f128_z_i32 *) subjFunctionPtr)( aPtr );
+
+}
+
+static
+ int_fast64_t
+ subjFunction_a_f128_z_i64_rx(
+ const float128_t *aPtr, uint_fast8_t roundingMode, bool exact )
+{
+
+ return ((funcType_a_f128_z_i64 *) subjFunctionPtr)( aPtr );
+
+}
+
+static
+ void
+ subjFunction_az_f128_rx(
+ const float128_t *aPtr,
+ uint_fast8_t roundingMode,
+ bool exact,
+ float128_t *zPtr
+ )
+{
+
+ return ((funcType_az_f128 *) subjFunctionPtr)( aPtr, zPtr );
+
+}
+
+#endif
+
+static
+ void
+ testFunctionInstance(
+ int functionCode, uint_fast8_t roundingMode, bool exact )
+{
+ funcType_abz_f32 *trueFunction_abz_f32;
+ funcType_ab_f32_z_bool *trueFunction_ab_f32_z_bool;
+ funcType_abz_f64 *trueFunction_abz_f64;
+ funcType_ab_f64_z_bool *trueFunction_ab_f64_z_bool;
+ funcType_abz_extF80 *trueFunction_abz_extF80;
+ funcType_ab_extF80_z_bool *trueFunction_ab_extF80_z_bool;
+ funcType_abz_f128 *trueFunction_abz_f128;
+ funcType_ab_f128_z_bool *trueFunction_ab_f128_z_bool;
+
+ fputs( "Testing ", stderr );
+ verCases_writeFunctionName( stderr );
+ fputs( ".\n", stderr );
+ switch ( functionCode ) {
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef SUBJ_UI32_TO_F32
+ case UI32_TO_F32:
+ test_a_ui32_z_f32(
+ ui32_to_f32, (funcType_a_ui32_z_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_UI32_TO_F64
+ case UI32_TO_F64:
+ test_a_ui32_z_f64(
+ ui32_to_f64, (funcType_a_ui32_z_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_UI32_TO_EXTF80
+ case UI32_TO_EXTF80:
+ test_a_ui32_z_extF80(
+ ui32_to_extF80M, (funcType_a_ui32_z_extF80 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_UI32_TO_F128
+ case UI32_TO_F128:
+ test_a_ui32_z_f128(
+ ui32_to_f128M, (funcType_a_ui32_z_f128 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef SUBJ_UI64_TO_F32
+ case UI64_TO_F32:
+ test_a_ui64_z_f32(
+ ui64_to_f32, (funcType_a_ui64_z_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_UI64_TO_F64
+ case UI64_TO_F64:
+ test_a_ui64_z_f64(
+ ui64_to_f64, (funcType_a_ui64_z_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_UI64_TO_EXTF80
+ case UI64_TO_EXTF80:
+ test_a_ui64_z_extF80(
+ ui64_to_extF80M, (funcType_a_ui64_z_extF80 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_UI64_TO_F128
+ case UI64_TO_F128:
+ test_a_ui64_z_f128(
+ ui64_to_f128M, (funcType_a_ui64_z_f128 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef SUBJ_I32_TO_F32
+ case I32_TO_F32:
+ test_a_i32_z_f32(
+ i32_to_f32, (funcType_a_i32_z_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_I32_TO_F64
+ case I32_TO_F64:
+ test_a_i32_z_f64(
+ i32_to_f64, (funcType_a_i32_z_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_I32_TO_EXTF80
+ case I32_TO_EXTF80:
+ test_a_i32_z_extF80(
+ i32_to_extF80M, (funcType_a_i32_z_extF80 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_I32_TO_F128
+ case I32_TO_F128:
+ test_a_i32_z_f128(
+ i32_to_f128M, (funcType_a_i32_z_f128 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef SUBJ_I64_TO_F32
+ case I64_TO_F32:
+ test_a_i64_z_f32(
+ i64_to_f32, (funcType_a_i64_z_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_I64_TO_F64
+ case I64_TO_F64:
+ test_a_i64_z_f64(
+ i64_to_f64, (funcType_a_i64_z_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_I64_TO_EXTF80
+ case I64_TO_EXTF80:
+ test_a_i64_z_extF80(
+ i64_to_extF80M, (funcType_a_i64_z_extF80 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_I64_TO_F128
+ case I64_TO_F128:
+ test_a_i64_z_f128(
+ i64_to_f128M, (funcType_a_i64_z_f128 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F32_TO_UI32:
+ test_a_f32_z_ui32_rx(
+ f32_to_ui32, subjFunction_a_f32_z_ui32_rx, roundingMode, exact );
+ break;
+ case F32_TO_UI64:
+ test_a_f32_z_ui64_rx(
+ f32_to_ui64, subjFunction_a_f32_z_ui64_rx, roundingMode, exact );
+ break;
+ case F32_TO_I32:
+ test_a_f32_z_i32_rx(
+ f32_to_i32, subjFunction_a_f32_z_i32_rx, roundingMode, exact );
+ break;
+ case F32_TO_I64:
+ test_a_f32_z_i64_rx(
+ f32_to_i64, subjFunction_a_f32_z_i64_rx, roundingMode, exact );
+ break;
+#ifdef SUBJ_F32_TO_F64
+ case F32_TO_F64:
+ test_a_f32_z_f64(
+ f32_to_f64, (funcType_a_f32_z_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_F32_TO_EXTF80
+ case F32_TO_EXTF80:
+ test_a_f32_z_extF80(
+ f32_to_extF80M, (funcType_a_f32_z_extF80 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_F32_TO_F128
+ case F32_TO_F128:
+ test_a_f32_z_f128(
+ f32_to_f128M, (funcType_a_f32_z_f128 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+ case F32_ROUNDTOINT:
+ test_az_f32_rx(
+ f32_roundToInt, subjFunction_az_f32_rx, roundingMode, exact );
+ break;
+#ifdef SUBJ_F32_ADD
+ case F32_ADD:
+ trueFunction_abz_f32 = f32_add;
+ goto test_abz_f32;
+#endif
+#ifdef SUBJ_F32_SUB
+ case F32_SUB:
+ trueFunction_abz_f32 = f32_sub;
+ goto test_abz_f32;
+#endif
+#ifdef SUBJ_F32_MUL
+ case F32_MUL:
+ trueFunction_abz_f32 = f32_mul;
+ goto test_abz_f32;
+#endif
+#ifdef SUBJ_F32_MULADD
+ case F32_MULADD:
+ test_abcz_f32( f32_mulAdd, (funcType_abcz_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_F32_DIV
+ case F32_DIV:
+ trueFunction_abz_f32 = f32_div;
+ goto test_abz_f32;
+#endif
+#ifdef SUBJ_F32_REM
+ case F32_REM:
+ trueFunction_abz_f32 = f32_rem;
+ goto test_abz_f32;
+#endif
+ test_abz_f32:
+ test_abz_f32(
+ trueFunction_abz_f32, (funcType_abz_f32 *) subjFunctionPtr );
+ break;
+#ifdef SUBJ_F32_SQRT
+ case F32_SQRT:
+ test_az_f32( f32_sqrt, (funcType_az_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_F32_EQ
+ case F32_EQ:
+ trueFunction_ab_f32_z_bool = f32_eq;
+ goto test_ab_f32_z_bool;
+#endif
+#ifdef SUBJ_F32_LE
+ case F32_LE:
+ trueFunction_ab_f32_z_bool = f32_le;
+ goto test_ab_f32_z_bool;
+#endif
+#ifdef SUBJ_F32_LT
+ case F32_LT:
+ trueFunction_ab_f32_z_bool = f32_lt;
+ goto test_ab_f32_z_bool;
+#endif
+#ifdef SUBJ_F32_EQ_SIGNALING
+ case F32_EQ_SIGNALING:
+ trueFunction_ab_f32_z_bool = f32_eq_signaling;
+ goto test_ab_f32_z_bool;
+#endif
+#ifdef SUBJ_F32_LE_QUIET
+ case F32_LE_QUIET:
+ trueFunction_ab_f32_z_bool = f32_le_quiet;
+ goto test_ab_f32_z_bool;
+#endif
+#ifdef SUBJ_F32_LT_QUIET
+ case F32_LT_QUIET:
+ trueFunction_ab_f32_z_bool = f32_lt_quiet;
+ goto test_ab_f32_z_bool;
+#endif
+ test_ab_f32_z_bool:
+ test_ab_f32_z_bool(
+ trueFunction_ab_f32_z_bool,
+ (funcType_ab_f32_z_bool *) subjFunctionPtr
+ );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F64_TO_UI32:
+ test_a_f64_z_ui32_rx(
+ f64_to_ui32, subjFunction_a_f64_z_ui32_rx, roundingMode, exact );
+ break;
+ case F64_TO_UI64:
+ test_a_f64_z_ui64_rx(
+ f64_to_ui64, subjFunction_a_f64_z_ui64_rx, roundingMode, exact );
+ break;
+ case F64_TO_I32:
+ test_a_f64_z_i32_rx(
+ f64_to_i32, subjFunction_a_f64_z_i32_rx, roundingMode, exact );
+ break;
+ case F64_TO_I64:
+ test_a_f64_z_i64_rx(
+ f64_to_i64, subjFunction_a_f64_z_i64_rx, roundingMode, exact );
+ break;
+#ifdef SUBJ_F64_TO_F32
+ case F64_TO_F32:
+ test_a_f64_z_f32(
+ f64_to_f32, (funcType_a_f64_z_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_F64_TO_EXTF80
+ case F64_TO_EXTF80:
+ test_a_f64_z_extF80(
+ f64_to_extF80M, (funcType_a_f64_z_extF80 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_F64_TO_F128
+ case F64_TO_F128:
+ test_a_f64_z_f128(
+ f64_to_f128M, (funcType_a_f64_z_f128 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+ case F64_ROUNDTOINT:
+ test_az_f64_rx(
+ f64_roundToInt, subjFunction_az_f64_rx, roundingMode, exact );
+ break;
+#ifdef SUBJ_F64_ADD
+ case F64_ADD:
+ trueFunction_abz_f64 = f64_add;
+ goto test_abz_f64;
+#endif
+#ifdef SUBJ_F64_SUB
+ case F64_SUB:
+ trueFunction_abz_f64 = f64_sub;
+ goto test_abz_f64;
+#endif
+#ifdef SUBJ_F64_MUL
+ case F64_MUL:
+ trueFunction_abz_f64 = f64_mul;
+ goto test_abz_f64;
+#endif
+#ifdef SUBJ_F64_MULADD
+ case F64_MULADD:
+ test_abcz_f64( f64_mulAdd, (funcType_abcz_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_F64_DIV
+ case F64_DIV:
+ trueFunction_abz_f64 = f64_div;
+ goto test_abz_f64;
+#endif
+#ifdef SUBJ_F64_REM
+ case F64_REM:
+ trueFunction_abz_f64 = f64_rem;
+ goto test_abz_f64;
+#endif
+ test_abz_f64:
+ test_abz_f64(
+ trueFunction_abz_f64, (funcType_abz_f64 *) subjFunctionPtr );
+ break;
+#ifdef SUBJ_F64_SQRT
+ case F64_SQRT:
+ test_az_f64( f64_sqrt, (funcType_az_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_F64_EQ
+ case F64_EQ:
+ trueFunction_ab_f64_z_bool = f64_eq;
+ goto test_ab_f64_z_bool;
+#endif
+#ifdef SUBJ_F64_LE
+ case F64_LE:
+ trueFunction_ab_f64_z_bool = f64_le;
+ goto test_ab_f64_z_bool;
+#endif
+#ifdef SUBJ_F64_LT
+ case F64_LT:
+ trueFunction_ab_f64_z_bool = f64_lt;
+ goto test_ab_f64_z_bool;
+#endif
+#ifdef SUBJ_F64_EQ_SIGNALING
+ case F64_EQ_SIGNALING:
+ trueFunction_ab_f64_z_bool = f64_eq_signaling;
+ goto test_ab_f64_z_bool;
+#endif
+#ifdef SUBJ_F64_LE_QUIET
+ case F64_LE_QUIET:
+ trueFunction_ab_f64_z_bool = f64_le_quiet;
+ goto test_ab_f64_z_bool;
+#endif
+#ifdef SUBJ_F64_LT_QUIET
+ case F64_LT_QUIET:
+ trueFunction_ab_f64_z_bool = f64_lt_quiet;
+ goto test_ab_f64_z_bool;
+#endif
+ test_ab_f64_z_bool:
+ test_ab_f64_z_bool(
+ trueFunction_ab_f64_z_bool,
+ (funcType_ab_f64_z_bool *) subjFunctionPtr
+ );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+ case EXTF80_TO_UI32:
+ test_a_extF80_z_ui32_rx(
+ extF80M_to_ui32,
+ subjFunction_a_extF80_z_ui32_rx,
+ roundingMode,
+ exact
+ );
+ break;
+ case EXTF80_TO_UI64:
+ test_a_extF80_z_ui64_rx(
+ extF80M_to_ui64,
+ subjFunction_a_extF80_z_ui64_rx,
+ roundingMode,
+ exact
+ );
+ break;
+ case EXTF80_TO_I32:
+ test_a_extF80_z_i32_rx(
+ extF80M_to_i32, subjFunction_a_extF80_z_i32_rx, roundingMode, exact
+ );
+ break;
+ case EXTF80_TO_I64:
+ test_a_extF80_z_i64_rx(
+ extF80M_to_i64, subjFunction_a_extF80_z_i64_rx, roundingMode, exact
+ );
+ break;
+#ifdef SUBJ_EXTF80_TO_F32
+ case EXTF80_TO_F32:
+ test_a_extF80_z_f32(
+ extF80M_to_f32, (funcType_a_extF80_z_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_EXTF80_TO_F64
+ case EXTF80_TO_F64:
+ test_a_extF80_z_f64(
+ extF80M_to_f64, (funcType_a_extF80_z_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef FLOAT128
+#ifdef SUBJ_EXTF80_TO_F128
+ case EXTF80_TO_F128:
+ test_a_extF80_z_f128(
+ extF80M_to_f128M, (funcType_a_extF80_z_f128 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+ case EXTF80_ROUNDTOINT:
+ test_az_extF80_rx(
+ extF80M_roundToInt, subjFunction_az_extF80_rx, roundingMode, exact
+ );
+ break;
+#ifdef SUBJ_EXTF80_ADD
+ case EXTF80_ADD:
+ trueFunction_abz_extF80 = extF80M_add;
+ goto test_abz_extF80;
+#endif
+#ifdef SUBJ_EXTF80_SUB
+ case EXTF80_SUB:
+ trueFunction_abz_extF80 = extF80M_sub;
+ goto test_abz_extF80;
+#endif
+#ifdef SUBJ_EXTF80_MUL
+ case EXTF80_MUL:
+ trueFunction_abz_extF80 = extF80M_mul;
+ goto test_abz_extF80;
+#endif
+#ifdef SUBJ_EXTF80_DIV
+ case EXTF80_DIV:
+ trueFunction_abz_extF80 = extF80M_div;
+ goto test_abz_extF80;
+#endif
+#ifdef SUBJ_EXTF80_REM
+ case EXTF80_REM:
+ trueFunction_abz_extF80 = extF80M_rem;
+ goto test_abz_extF80;
+#endif
+ test_abz_extF80:
+ test_abz_extF80(
+ trueFunction_abz_extF80, (funcType_abz_extF80 *) subjFunctionPtr );
+ break;
+#ifdef SUBJ_EXTF80_SQRT
+ case EXTF80_SQRT:
+ test_az_extF80( extF80M_sqrt, (funcType_az_extF80 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_EXTF80_EQ
+ case EXTF80_EQ:
+ trueFunction_ab_extF80_z_bool = extF80M_eq;
+ goto test_ab_extF80_z_bool;
+#endif
+#ifdef SUBJ_EXTF80_LE
+ case EXTF80_LE:
+ trueFunction_ab_extF80_z_bool = extF80M_le;
+ goto test_ab_extF80_z_bool;
+#endif
+#ifdef SUBJ_EXTF80_LT
+ case EXTF80_LT:
+ trueFunction_ab_extF80_z_bool = extF80M_lt;
+ goto test_ab_extF80_z_bool;
+#endif
+#ifdef SUBJ_EXTF80_EQ_SIGNALING
+ case EXTF80_EQ_SIGNALING:
+ trueFunction_ab_extF80_z_bool = extF80M_eq_signaling;
+ goto test_ab_extF80_z_bool;
+#endif
+#ifdef SUBJ_EXTF80_LE_QUIET
+ case EXTF80_LE_QUIET:
+ trueFunction_ab_extF80_z_bool = extF80M_le_quiet;
+ goto test_ab_extF80_z_bool;
+#endif
+#ifdef SUBJ_EXTF80_LT_QUIET
+ case EXTF80_LT_QUIET:
+ trueFunction_ab_extF80_z_bool = extF80M_lt_quiet;
+ goto test_ab_extF80_z_bool;
+#endif
+ test_ab_extF80_z_bool:
+ test_ab_extF80_z_bool(
+ trueFunction_ab_extF80_z_bool,
+ (funcType_ab_extF80_z_bool *) subjFunctionPtr
+ );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef FLOAT128
+ case F128_TO_UI32:
+ test_a_f128_z_ui32_rx(
+ f128M_to_ui32, subjFunction_a_f128_z_ui32_rx, roundingMode, exact
+ );
+ break;
+ case F128_TO_UI64:
+ test_a_f128_z_ui64_rx(
+ f128M_to_ui64, subjFunction_a_f128_z_ui64_rx, roundingMode, exact
+ );
+ break;
+ case F128_TO_I32:
+ test_a_f128_z_i32_rx(
+ f128M_to_i32, subjFunction_a_f128_z_i32_rx, roundingMode, exact );
+ break;
+ case F128_TO_I64:
+ test_a_f128_z_i64_rx(
+ f128M_to_i64, subjFunction_a_f128_z_i64_rx, roundingMode, exact );
+ break;
+#ifdef SUBJ_F128_TO_F32
+ case F128_TO_F32:
+ test_a_f128_z_f32(
+ f128M_to_f32, (funcType_a_f128_z_f32 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_F128_TO_F64
+ case F128_TO_F64:
+ test_a_f128_z_f64(
+ f128M_to_f64, (funcType_a_f128_z_f64 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef EXTFLOAT80
+#ifdef SUBJ_F128_TO_EXTF80
+ case F128_TO_EXTF80:
+ test_a_f128_z_extF80(
+ f128M_to_extF80M, (funcType_a_f128_z_extF80 *) subjFunctionPtr );
+ break;
+#endif
+#endif
+ case F128_ROUNDTOINT:
+ test_az_f128_rx(
+ f128M_roundToInt, subjFunction_az_f128_rx, roundingMode, exact );
+ break;
+#ifdef SUBJ_F128_ADD
+ case F128_ADD:
+ trueFunction_abz_f128 = f128M_add;
+ goto test_abz_f128;
+#endif
+#ifdef SUBJ_F128_SUB
+ case F128_SUB:
+ trueFunction_abz_f128 = f128M_sub;
+ goto test_abz_f128;
+#endif
+#ifdef SUBJ_F128_MUL
+ case F128_MUL:
+ trueFunction_abz_f128 = f128M_mul;
+ goto test_abz_f128;
+#endif
+#ifdef SUBJ_F128_MULADD
+ case F128_MULADD:
+ test_abcz_f128( f128M_mulAdd, (funcType_abcz_f128 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_F128_DIV
+ case F128_DIV:
+ trueFunction_abz_f128 = f128M_div;
+ goto test_abz_f128;
+#endif
+#ifdef SUBJ_F128_REM
+ case F128_REM:
+ trueFunction_abz_f128 = f128M_rem;
+ goto test_abz_f128;
+#endif
+ test_abz_f128:
+ test_abz_f128(
+ trueFunction_abz_f128, (funcType_abz_f128 *) subjFunctionPtr );
+ break;
+#ifdef SUBJ_F128_SQRT
+ case F128_SQRT:
+ test_az_f128( f128M_sqrt, (funcType_az_f128 *) subjFunctionPtr );
+ break;
+#endif
+#ifdef SUBJ_F128_EQ
+ case F128_EQ:
+ trueFunction_ab_f128_z_bool = f128M_eq;
+ goto test_ab_f128_z_bool;
+#endif
+#ifdef SUBJ_F128_LE
+ case F128_LE:
+ trueFunction_ab_f128_z_bool = f128M_le;
+ goto test_ab_f128_z_bool;
+#endif
+#ifdef SUBJ_F128_LT
+ case F128_LT:
+ trueFunction_ab_f128_z_bool = f128M_lt;
+ goto test_ab_f128_z_bool;
+#endif
+#ifdef SUBJ_F128_EQ_SIGNALING
+ case F128_EQ_SIGNALING:
+ trueFunction_ab_f128_z_bool = f128M_eq_signaling;
+ goto test_ab_f128_z_bool;
+#endif
+#ifdef SUBJ_F128_LE_QUIET
+ case F128_LE_QUIET:
+ trueFunction_ab_f128_z_bool = f128M_le_quiet;
+ goto test_ab_f128_z_bool;
+#endif
+#ifdef SUBJ_F128_LT_QUIET
+ case F128_LT_QUIET:
+ trueFunction_ab_f128_z_bool = f128M_lt_quiet;
+ goto test_ab_f128_z_bool;
+#endif
+ test_ab_f128_z_bool:
+ test_ab_f128_z_bool(
+ trueFunction_ab_f128_z_bool,
+ (funcType_ab_f128_z_bool *) subjFunctionPtr
+ );
+ break;
+#endif
+ }
+ if ( (verCases_errorStop && verCases_anyErrors) || verCases_stop ) {
+ verCases_exitWithStatus();
+ }
+
+}
+
+static
+ void
+ testFunction(
+ const struct standardFunctionInfo *standardFunctionInfoPtr,
+ uint_fast8_t roundingPrecisionIn,
+ int roundingCodeIn
+ )
+{
+ int functionCode, functionAttribs;
+ bool standardFunctionHasFixedRounding;
+ int roundingCode;
+ bool exact;
+ uint_fast8_t roundingPrecision, roundingMode;
+
+ functionCode = standardFunctionInfoPtr->functionCode;
+ functionAttribs = functionInfos[functionCode].attribs;
+ standardFunctionHasFixedRounding = false;
+ if ( functionAttribs & FUNC_ARG_ROUNDINGMODE ) {
+ roundingCode = standardFunctionInfoPtr->roundingCode;
+ if ( roundingCode ) {
+ standardFunctionHasFixedRounding = true;
+ roundingCodeIn = roundingCode;
+ }
+ }
+ exact = standardFunctionInfoPtr->exact;
+ verCases_functionNamePtr = standardFunctionInfoPtr->namePtr;
+ roundingPrecision = 32;
+ for (;;) {
+ if ( ! (functionAttribs & FUNC_EFF_ROUNDINGPRECISION) ) {
+ roundingPrecision = 0;
+ } else if ( roundingPrecisionIn ) {
+ roundingPrecision = roundingPrecisionIn;
+ }
+#ifdef EXTFLOAT80
+ verCases_roundingPrecision = roundingPrecision;
+ if ( roundingPrecision ) {
+ extF80_roundingPrecision = roundingPrecision;
+ subjfloat_setExtF80RoundingPrecision( roundingPrecision );
+ }
+#endif
+ for (
+ roundingCode = 1; roundingCode < NUM_ROUNDINGMODES; ++roundingCode
+ ) {
+#ifndef SUBJFLOAT_ROUND_NEAR_MAXMAG
+ if ( roundingCode != ROUND_NEAR_MAXMAG ) {
+#endif
+ if (
+ ! (functionAttribs
+ & (FUNC_ARG_ROUNDINGMODE | FUNC_EFF_ROUNDINGMODE))
+ ) {
+ roundingCode = 0;
+ } else if ( roundingCodeIn ) {
+ roundingCode = roundingCodeIn;
+ }
+ verCases_roundingCode =
+ standardFunctionHasFixedRounding ? 0 : roundingCode;
+ if ( roundingCode ) {
+ roundingMode = roundingModes[roundingCode];
+ softfloat_roundingMode = roundingMode;
+ if ( ! standardFunctionHasFixedRounding ) {
+ subjfloat_setRoundingMode( roundingMode );
+ }
+ }
+ testFunctionInstance( functionCode, roundingMode, exact );
+ if ( roundingCodeIn || ! roundingCode ) break;
+#ifndef SUBJFLOAT_ROUND_NEAR_MAXMAG
+ }
+#endif
+ }
+ if ( roundingPrecisionIn || ! roundingPrecision ) break;
+ if ( roundingPrecision == 80 ) {
+ break;
+ } else if ( roundingPrecision == 64 ) {
+ roundingPrecision = 80;
+ } else if ( roundingPrecision == 32 ) {
+ roundingPrecision = 64;
+ }
+ }
+
+}
+
+int main( int argc, char *argv[] )
+{
+ bool haveFunctionArg;
+ const struct standardFunctionInfo *standardFunctionInfoPtr;
+ int numOperands;
+ uint_fast8_t roundingPrecision;
+ int roundingCode;
+ const char *argPtr;
+ void (*const *subjFunctionPtrPtr)();
+ const char *functionNamePtr;
+ long i;
+
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ fail_programName = "testfloat";
+ if ( argc <= 1 ) goto writeHelpMessage;
+ genCases_setLevel( 1 );
+ verCases_maxErrorCount = 20;
+ testLoops_trueFlagsPtr = &softfloat_exceptionFlags;
+ testLoops_subjFlagsFunction = subjfloat_clearExceptionFlags;
+ haveFunctionArg = false;
+ standardFunctionInfoPtr = 0;
+ numOperands = 0;
+ roundingPrecision = 0;
+ roundingCode = 0;
+ for (;;) {
+ --argc;
+ if ( ! argc ) break;
+ argPtr = *++argv;
+ if ( ! argPtr ) break;
+ if ( argPtr[0] == '-' ) ++argPtr;
+ if (
+ ! strcmp( argPtr, "help" ) || ! strcmp( argPtr, "-help" )
+ || ! strcmp( argPtr, "h" )
+ ) {
+ writeHelpMessage:
+ fputs(
+"testfloat [<option>...] <function>\n"
+" <option>: (* is default)\n"
+" -help --Write this message and exit.\n"
+" -list --List all testable subject functions and exit.\n"
+" -level <num> --Testing level <num> (1 or 2).\n"
+" * -level 1\n"
+" -errors <num> --Stop each function test after <num> errors.\n"
+" * -errors 20\n"
+" -errorstop --Exit after first function with any error.\n"
+" -forever --Test one function repeatedly (implies `-level 2').\n"
+" -checkNaNs --Check for bitwise correctness of NaN results.\n"
+#ifdef EXTFLOAT80
+" -precision32 --For extF80, test only 32-bit rounding precision.\n"
+" -precision64 --For extF80, test only 64-bit rounding precision.\n"
+" -precision80 --For extF80, test only 80-bit rounding precision.\n"
+#endif
+" -r<round> --Test only specified rounding (if not inherent to\n"
+" function).\n"
+" -tininessbefore --Underflow tininess is detected before rounding.\n"
+" -tininessafter --Underflow tininess is detected after rounding.\n"
+" <function>:\n"
+" <int>_to_<float> <float>_add <float>_eq\n"
+" <float>_to_<int>_r_<round> <float>_sub <float>_le\n"
+" <float>_to_<int>_rx_<round> <float>_mul <float>_lt\n"
+" <float>_to_<float> <float>_mulAdd <float>_eq_signaling\n"
+" <float>_roundToInt_r_<round> <float>_div <float>_le_quiet\n"
+" <float>_roundToInt_x <float>_rem <float>_lt_quiet\n"
+" <float>_sqrt\n"
+" -all1 --All unary functions.\n"
+" -all2 --All binary functions.\n"
+" <int>:\n"
+" ui32 --Unsigned 32-bit integer.\n"
+" ui64 --Unsigned 64-bit integer.\n"
+" i32 --Signed 32-bit integer.\n"
+" i64 --Signed 64-bit integer.\n"
+" <float>:\n"
+" f32 --Binary 32-bit floating-point (single-precision).\n"
+" f64 --Binary 64-bit floating-point (double-precision).\n"
+#ifdef EXTFLOAT80
+" extF80 --Binary 80-bit extended floating-point.\n"
+#endif
+#ifdef FLOAT128
+" f128 --Binary 128-bit floating-point (quadruple-precision).\n"
+#endif
+" <round>:\n"
+" near_even --Round to nearest/even.\n"
+" minMag --Round to minimum magnitude (toward zero).\n"
+" min --Round to minimum (down).\n"
+" max --Round to maximum (up).\n"
+" near_maxMag --Round to nearest/maximum magnitude (nearest/away).\n"
+ ,
+ stdout
+ );
+ return EXIT_SUCCESS;
+ } else if ( ! strcmp( argPtr, "list" ) ) {
+ standardFunctionInfoPtr = standardFunctionInfos;
+ subjFunctionPtrPtr = subjfloat_functions;
+ for (;;) {
+ functionNamePtr = standardFunctionInfoPtr->namePtr;
+ if ( ! functionNamePtr ) break;
+ if ( *subjFunctionPtrPtr ) puts( functionNamePtr );
+ ++standardFunctionInfoPtr;
+ ++subjFunctionPtrPtr;
+ }
+ return EXIT_SUCCESS;
+ } else if ( ! strcmp( argPtr, "level" ) ) {
+ if ( argc < 2 ) goto optionError;
+ i = strtol( argv[1], (char **) &argPtr, 10 );
+ if ( *argPtr ) goto optionError;
+ genCases_setLevel( i );
+ --argc;
+ ++argv;
+ } else if ( ! strcmp( argPtr, "level1" ) ) {
+ genCases_setLevel( 1 );
+ } else if ( ! strcmp( argPtr, "level2" ) ) {
+ genCases_setLevel( 2 );
+ } else if ( ! strcmp( argPtr, "errors" ) ) {
+ if ( argc < 2 ) goto optionError;
+ i = strtol( argv[1], (char **) &argPtr, 10 );
+ if ( *argPtr ) goto optionError;
+ verCases_maxErrorCount = i;
+ --argc;
+ ++argv;
+ } else if ( ! strcmp( argPtr, "errorstop" ) ) {
+ verCases_errorStop = true;
+ } else if ( ! strcmp( argPtr, "forever" ) ) {
+ genCases_setLevel( 2 );
+ testLoops_forever = true;
+ } else if (
+ ! strcmp( argPtr, "checkNaNs" ) || ! strcmp( argPtr, "checknans" )
+ ) {
+ verCases_checkNaNs = true;
+#ifdef EXTFLOAT80
+ } else if ( ! strcmp( argPtr, "precision32" ) ) {
+ roundingPrecision = 32;
+ } else if ( ! strcmp( argPtr, "precision64" ) ) {
+ roundingPrecision = 64;
+ } else if ( ! strcmp( argPtr, "precision80" ) ) {
+ roundingPrecision = 80;
+#endif
+ } else if (
+ ! strcmp( argPtr, "rnear_even" )
+ || ! strcmp( argPtr, "rneareven" )
+ || ! strcmp( argPtr, "rnearest_even" )
+ ) {
+ roundingCode = ROUND_NEAR_EVEN;
+ } else if (
+ ! strcmp( argPtr, "rminmag" ) || ! strcmp( argPtr, "rminMag" )
+ ) {
+ roundingCode = ROUND_MINMAG;
+ } else if ( ! strcmp( argPtr, "rmin" ) ) {
+ roundingCode = ROUND_MIN;
+ } else if ( ! strcmp( argPtr, "rmax" ) ) {
+ roundingCode = ROUND_MAX;
+ } else if (
+ ! strcmp( argPtr, "rnear_maxmag" )
+ || ! strcmp( argPtr, "rnear_maxMag" )
+ || ! strcmp( argPtr, "rnearmaxmag" )
+ || ! strcmp( argPtr, "rnearest_maxmag" )
+ || ! strcmp( argPtr, "rnearest_maxMag" )
+ ) {
+#ifdef SUBJFLOAT_ROUND_NEAR_MAXMAG
+ roundingCode = ROUND_NEAR_MAXMAG;
+#else
+ fail(
+ "Rounding mode near_maxMag is not supported or cannot be tested"
+ );
+#endif
+ } else if ( ! strcmp( argPtr, "tininessbefore" ) ) {
+ softfloat_detectTininess = softfloat_tininess_beforeRounding;
+ } else if ( ! strcmp( argPtr, "tininessafter" ) ) {
+ softfloat_detectTininess = softfloat_tininess_afterRounding;
+ } else if ( ! strcmp( argPtr, "all1" ) ) {
+ haveFunctionArg = true;
+ standardFunctionInfoPtr = 0;
+ numOperands = 1;
+ } else if ( ! strcmp( argPtr, "all2" ) ) {
+ haveFunctionArg = true;
+ standardFunctionInfoPtr = 0;
+ numOperands = 2;
+ } else {
+ standardFunctionInfoPtr = standardFunctionInfos;
+ for (;;) {
+ functionNamePtr = standardFunctionInfoPtr->namePtr;
+ if ( ! functionNamePtr ) {
+ fail( "Invalid argument `%s'", *argv );
+ }
+ if ( ! strcmp( argPtr, functionNamePtr ) ) break;
+ ++standardFunctionInfoPtr;
+ }
+ subjFunctionPtr =
+ subjfloat_functions
+ [standardFunctionInfoPtr - standardFunctionInfos];
+ if ( ! subjFunctionPtr ) {
+ fail(
+ "Function `%s' is not supported or cannot be tested",
+ argPtr
+ );
+ }
+ haveFunctionArg = true;
+ }
+ }
+ if ( ! haveFunctionArg ) fail( "Function argument required" );
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ signal( SIGINT, catchSIGINT );
+ signal( SIGTERM, catchSIGINT );
+ if ( standardFunctionInfoPtr ) {
+ if ( testLoops_forever ) {
+ if ( ! roundingPrecision ) roundingPrecision = 80;
+ if ( ! roundingCode ) roundingCode = ROUND_NEAR_EVEN;
+ }
+ testFunction(
+ standardFunctionInfoPtr, roundingPrecision, roundingCode );
+ } else {
+ if ( testLoops_forever ) {
+ fail( "Can test only one function with `-forever' option" );
+ }
+ if ( numOperands == 1 ) {
+ standardFunctionInfoPtr = standardFunctionInfos;
+ subjFunctionPtrPtr = subjfloat_functions;
+ while ( standardFunctionInfoPtr->namePtr ) {
+ subjFunctionPtr = *subjFunctionPtrPtr;
+ if (
+ subjFunctionPtr
+ && ! (functionInfos
+ [standardFunctionInfoPtr->functionCode]
+ .attribs
+ & FUNC_ARG_BINARY)
+ ) {
+ testFunction(
+ standardFunctionInfoPtr,
+ roundingPrecision,
+ roundingCode
+ );
+ }
+ ++standardFunctionInfoPtr;
+ ++subjFunctionPtrPtr;
+ }
+ } else {
+ standardFunctionInfoPtr = standardFunctionInfos;
+ subjFunctionPtrPtr = subjfloat_functions;
+ while ( standardFunctionInfoPtr->namePtr ) {
+ subjFunctionPtr = *subjFunctionPtrPtr;
+ if (
+ subjFunctionPtr
+ && (functionInfos
+ [standardFunctionInfoPtr->functionCode]
+ .attribs
+ & FUNC_ARG_BINARY)
+ ) {
+ testFunction(
+ standardFunctionInfoPtr,
+ roundingPrecision,
+ roundingCode
+ );
+ }
+ ++standardFunctionInfoPtr;
+ ++subjFunctionPtrPtr;
+ }
+ }
+ }
+ verCases_exitWithStatus();
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ optionError:
+ fail( "`%s' option requires numeric argument", *argv );
+
+}
+
diff --git a/source/testfloat_gen.c b/source/testfloat_gen.c
new file mode 100644
index 0000000..b4ea5ed
--- /dev/null
+++ b/source/testfloat_gen.c
@@ -0,0 +1,762 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <signal.h>
+#include "platform.h"
+#include "fail.h"
+#include "softfloat.h"
+#include "functions.h"
+#include "genCases.h"
+#include "genLoops.h"
+
+enum {
+ TYPE_UI32 = NUM_FUNCTIONS,
+ TYPE_UI64,
+ TYPE_I32,
+ TYPE_I64,
+ TYPE_F32,
+ TYPE_F32_2,
+ TYPE_F32_3,
+ TYPE_F64,
+ TYPE_F64_2,
+ TYPE_F64_3,
+ TYPE_EXTF80,
+ TYPE_EXTF80_2,
+ TYPE_EXTF80_3,
+ TYPE_F128,
+ TYPE_F128_2,
+ TYPE_F128_3
+};
+
+static void catchSIGINT( int signalCode )
+{
+
+ if ( genLoops_stop ) exit( EXIT_FAILURE );
+ genLoops_stop = true;
+
+}
+
+int main( int argc, char *argv[] )
+{
+ const char *prefixTextPtr;
+ uint_fast8_t roundingMode;
+ bool exact;
+ int functionCode;
+ const char *argPtr;
+ long i;
+ int functionAttribs;
+ float32_t (*trueFunction_abz_f32)( float32_t, float32_t );
+ bool (*trueFunction_ab_f32_z_bool)( float32_t, float32_t );
+ float64_t (*trueFunction_abz_f64)( float64_t, float64_t );
+ bool (*trueFunction_ab_f64_z_bool)( float64_t, float64_t );
+#ifdef EXTFLOAT80
+ void
+ (*trueFunction_abz_extF80)(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+ bool
+ (*trueFunction_ab_extF80_z_bool)(
+ const extFloat80_t *, const extFloat80_t * );
+#endif
+#ifdef FLOAT128
+ void
+ (*trueFunction_abz_f128)(
+ const float128_t *, const float128_t *, float128_t * );
+ bool
+ (*trueFunction_ab_f128_z_bool)( const float128_t *, const float128_t * );
+#endif
+
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ fail_programName = "testfloat_gen";
+ if ( argc <= 1 ) goto writeHelpMessage;
+ prefixTextPtr = 0;
+ softfloat_detectTininess = softfloat_tininess_beforeRounding;
+#ifdef EXTFLOAT80
+ extF80_roundingPrecision = 80;
+#endif
+ roundingMode = softfloat_round_near_even;
+ exact = false;
+ genCases_setLevel( 1 );
+ genLoops_trueFlagsPtr = &softfloat_exceptionFlags;
+ genLoops_forever = false;
+ genLoops_givenCount = false;
+ functionCode = 0;
+ for (;;) {
+ --argc;
+ if ( ! argc ) break;
+ argPtr = *++argv;
+ if ( ! argPtr ) break;
+ if ( argPtr[0] == '-' ) ++argPtr;
+ if (
+ ! strcmp( argPtr, "help" ) || ! strcmp( argPtr, "-help" )
+ || ! strcmp( argPtr, "h" )
+ ) {
+ writeHelpMessage:
+ fputs(
+"testfloat_gen [<option>...] <type>|<function>\n"
+" <option>: (* is default)\n"
+" -help --Write this message and exit.\n"
+" -prefix <text> --Write <text> as a line of output before any test cases.\n"
+" -level <num> --Testing level <num> (1 or 2).\n"
+" * -level 1\n"
+" -n <num> --Generate <num> test cases.\n"
+" -forever --Generate test cases indefinitely (implies `-level 2').\n"
+#ifdef EXTFLOAT80
+" -precision32 --For extF80, rounding precision is 32 bits.\n"
+" -precision64 --For extF80, rounding precision is 64 bits.\n"
+" * -precision80 --For extF80, rounding precision is 80 bits.\n"
+#endif
+" * -rnear_even --Round to nearest/even.\n"
+" -rminMag --Round to minimum magnitude (toward zero).\n"
+" -rmin --Round to minimum (down).\n"
+" -rmax --Round to maximum (up).\n"
+" -rnear_maxMag --Round to nearest/maximum magnitude (nearest/away).\n"
+" * -tininessbefore --Detect underflow tininess before rounding.\n"
+" -tininessafter --Detect underflow tininess after rounding.\n"
+" * -notexact --Rounding to integer is not exact (no inexact\n"
+" exceptions).\n"
+" -exact --Rounding to integer is exact (raising inexact\n"
+" exceptions).\n"
+" <type>:\n"
+" <int> --Generate test cases with one integer operand.\n"
+" <float> --Generate test cases with one floating-point operand.\n"
+" <float> <num> --Generate test cases with <num> (1, 2, or 3)\n"
+" floating-point operands.\n"
+" <function>:\n"
+" <int>_to_<float> <float>_add <float>_eq\n"
+" <float>_to_<int> <float>_sub <float>_le\n"
+" <float>_to_<float> <float>_mul <float>_lt\n"
+" <float>_roundToInt <float>_mulAdd <float>_eq_signaling\n"
+" <float>_div <float>_le_quiet\n"
+" <float>_rem <float>_lt_quiet\n"
+" <float>_sqrt\n"
+" <int>:\n"
+" ui32 --Unsigned 32-bit integer.\n"
+" ui64 --Unsigned 64-bit integer.\n"
+" i32 --Signed 32-bit integer.\n"
+" i64 --Signed 64-bit integer.\n"
+" <float>:\n"
+" f32 --Binary 32-bit floating-point (single-precision).\n"
+" f64 --Binary 64-bit floating-point (double-precision).\n"
+#ifdef EXTFLOAT80
+" extF80 --Binary 80-bit extended floating-point.\n"
+#endif
+#ifdef FLOAT128
+" f128 --Binary 128-bit floating-point (quadruple-precision).\n"
+#endif
+ ,
+ stdout
+ );
+ return EXIT_SUCCESS;
+ } else if ( ! strcmp( argPtr, "prefix" ) ) {
+ if ( argc < 2 ) goto optionError;
+ prefixTextPtr = argv[1];
+ --argc;
+ ++argv;
+ } else if ( ! strcmp( argPtr, "level" ) ) {
+ if ( argc < 2 ) goto optionError;
+ i = strtol( argv[1], (char **) &argPtr, 10 );
+ if ( *argPtr ) goto optionError;
+ genCases_setLevel( i );
+ --argc;
+ ++argv;
+ } else if ( ! strcmp( argPtr, "level1" ) ) {
+ genCases_setLevel( 1 );
+ } else if ( ! strcmp( argPtr, "level2" ) ) {
+ genCases_setLevel( 2 );
+ } else if ( ! strcmp( argPtr, "n" ) ) {
+ if ( argc < 2 ) goto optionError;
+ genLoops_forever = true;
+ genLoops_givenCount = true;
+ i = strtol( argv[1], (char **) &argPtr, 10 );
+ if ( *argPtr ) goto optionError;
+ genLoops_count = i;
+ --argc;
+ ++argv;
+ } else if ( ! strcmp( argPtr, "forever" ) ) {
+ genCases_setLevel( 2 );
+ genLoops_forever = true;
+ genLoops_givenCount = false;
+#ifdef EXTFLOAT80
+ } else if ( ! strcmp( argPtr, "precision32" ) ) {
+ extF80_roundingPrecision = 32;
+ } else if ( ! strcmp( argPtr, "precision64" ) ) {
+ extF80_roundingPrecision = 64;
+ } else if ( ! strcmp( argPtr, "precision80" ) ) {
+ extF80_roundingPrecision = 80;
+#endif
+ } else if (
+ ! strcmp( argPtr, "rnear_even" )
+ || ! strcmp( argPtr, "rneareven" )
+ || ! strcmp( argPtr, "rnearest_even" )
+ ) {
+ roundingMode = softfloat_round_near_even;
+ } else if (
+ ! strcmp( argPtr, "rminmag" ) || ! strcmp( argPtr, "rminMag" )
+ ) {
+ roundingMode = softfloat_round_minMag;
+ } else if ( ! strcmp( argPtr, "rmin" ) ) {
+ roundingMode = softfloat_round_min;
+ } else if ( ! strcmp( argPtr, "rmax" ) ) {
+ roundingMode = softfloat_round_max;
+ } else if (
+ ! strcmp( argPtr, "rnear_maxmag" )
+ || ! strcmp( argPtr, "rnear_maxMag" )
+ || ! strcmp( argPtr, "rnearmaxmag" )
+ || ! strcmp( argPtr, "rnearest_maxmag" )
+ || ! strcmp( argPtr, "rnearest_maxMag" )
+ ) {
+ roundingMode = softfloat_round_near_maxMag;
+ } else if ( ! strcmp( argPtr, "tininessbefore" ) ) {
+ softfloat_detectTininess = softfloat_tininess_beforeRounding;
+ } else if ( ! strcmp( argPtr, "tininessafter" ) ) {
+ softfloat_detectTininess = softfloat_tininess_afterRounding;
+ } else if ( ! strcmp( argPtr, "notexact" ) ) {
+ exact = false;
+ } else if ( ! strcmp( argPtr, "exact" ) ) {
+ exact = true;
+ } else if (
+ ! strcmp( argPtr, "ui32" ) || ! strcmp( argPtr, "uint32" )
+ ) {
+ functionCode = TYPE_UI32;
+ if ( 2 <= argc ) goto absorbArg1;
+ } else if (
+ ! strcmp( argPtr, "ui64" ) || ! strcmp( argPtr, "uint64" )
+ ) {
+ functionCode = TYPE_UI64;
+ if ( 2 <= argc ) goto absorbArg1;
+ } else if (
+ ! strcmp( argPtr, "i32" ) || ! strcmp( argPtr, "int32" )
+ ) {
+ functionCode = TYPE_I32;
+ if ( 2 <= argc ) goto absorbArg1;
+ } else if (
+ ! strcmp( argPtr, "i64" ) || ! strcmp( argPtr, "int64" )
+ ) {
+ functionCode = TYPE_I64;
+ if ( 2 <= argc ) goto absorbArg1;
+ } else if (
+ ! strcmp( argPtr, "f32" ) || ! strcmp( argPtr, "float32" )
+ ) {
+ functionCode = TYPE_F32;
+ goto absorbArg;
+ } else if (
+ ! strcmp( argPtr, "f64" ) || ! strcmp( argPtr, "float64" )
+ ) {
+ functionCode = TYPE_F64;
+#ifdef EXTFLOAT80
+ goto absorbArg;
+ } else if (
+ ! strcmp( argPtr, "extF80" ) || ! strcmp( argPtr, "extFloat80" )
+ ) {
+ functionCode = TYPE_EXTF80;
+#endif
+#ifdef FLOAT128
+ goto absorbArg;
+ } else if (
+ ! strcmp( argPtr, "f128" ) || ! strcmp( argPtr, "float128" )
+ ) {
+ functionCode = TYPE_F128;
+#endif
+ absorbArg:
+ if ( 2 <= argc ) {
+ if ( ! strcmp( argv[1], "2" ) ) {
+ --argc;
+ ++argv;
+ ++functionCode;
+ } else if ( ! strcmp( argv[1], "3" ) ) {
+ --argc;
+ ++argv;
+ functionCode += 2;
+ } else {
+ absorbArg1:
+ if ( ! strcmp( argv[1], "1" ) ) {
+ --argc;
+ ++argv;
+ }
+ }
+ }
+ } else {
+ functionCode = 1;
+ while ( strcmp( argPtr, functionInfos[functionCode].namePtr ) ) {
+ ++functionCode;
+ if ( functionCode == NUM_FUNCTIONS ) goto invalidArg;
+ }
+ functionAttribs = functionInfos[functionCode].attribs;
+ if (
+ (functionAttribs & FUNC_ARG_EXACT)
+ && ! (functionAttribs & FUNC_ARG_ROUNDINGMODE)
+ ) {
+ goto invalidArg;
+ }
+ }
+ }
+ if ( ! functionCode ) fail( "Type or function argument required" );
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ if ( prefixTextPtr ) {
+ fputs( prefixTextPtr, stdout );
+ fputc( '\n', stdout );
+ }
+ softfloat_roundingMode = roundingMode;
+ signal( SIGINT, catchSIGINT );
+ signal( SIGTERM, catchSIGINT );
+ switch ( functionCode ) {
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case TYPE_UI32:
+ gen_a_ui32();
+ break;
+ case TYPE_UI64:
+ gen_a_ui64();
+ break;
+ case TYPE_I32:
+ gen_a_i32();
+ break;
+ case TYPE_I64:
+ gen_a_i64();
+ break;
+ case TYPE_F32:
+ gen_a_f32();
+ break;
+ case TYPE_F32_2:
+ gen_ab_f32();
+ break;
+ case TYPE_F32_3:
+ gen_abc_f32();
+ break;
+ case TYPE_F64:
+ gen_a_f64();
+ break;
+ case TYPE_F64_2:
+ gen_ab_f64();
+ break;
+ case TYPE_F64_3:
+ gen_abc_f64();
+ break;
+#ifdef EXTFLOAT80
+ case TYPE_EXTF80:
+ gen_a_extF80();
+ break;
+ case TYPE_EXTF80_2:
+ gen_ab_extF80();
+ break;
+ case TYPE_EXTF80_3:
+ gen_abc_extF80();
+ break;
+#endif
+#ifdef FLOAT128
+ case TYPE_F128:
+ gen_a_f128();
+ break;
+ case TYPE_F128_2:
+ gen_ab_f128();
+ break;
+ case TYPE_F128_3:
+ gen_abc_f128();
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case UI32_TO_F32:
+ gen_a_ui32_z_f32( ui32_to_f32 );
+ break;
+ case UI32_TO_F64:
+ gen_a_ui32_z_f64( ui32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case UI32_TO_EXTF80:
+ gen_a_ui32_z_extF80( ui32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case UI32_TO_F128:
+ gen_a_ui32_z_f128( ui32_to_f128M );
+ break;
+#endif
+ case UI64_TO_F32:
+ gen_a_ui64_z_f32( ui64_to_f32 );
+ break;
+ case UI64_TO_F64:
+ gen_a_ui64_z_f64( ui64_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case UI64_TO_EXTF80:
+ gen_a_ui64_z_extF80( ui64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case UI64_TO_F128:
+ gen_a_ui64_z_f128( ui64_to_f128M );
+ break;
+#endif
+ case I32_TO_F32:
+ gen_a_i32_z_f32( i32_to_f32 );
+ break;
+ case I32_TO_F64:
+ gen_a_i32_z_f64( i32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case I32_TO_EXTF80:
+ gen_a_i32_z_extF80( i32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case I32_TO_F128:
+ gen_a_i32_z_f128( i32_to_f128M );
+ break;
+#endif
+ case I64_TO_F32:
+ gen_a_i64_z_f32( i64_to_f32 );
+ break;
+ case I64_TO_F64:
+ gen_a_i64_z_f64( i64_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case I64_TO_EXTF80:
+ gen_a_i64_z_extF80( i64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case I64_TO_F128:
+ gen_a_i64_z_f128( i64_to_f128M );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F32_TO_UI32:
+ gen_a_f32_z_ui32_rx( f32_to_ui32, roundingMode, exact );
+ break;
+ case F32_TO_UI64:
+ gen_a_f32_z_ui64_rx( f32_to_ui64, roundingMode, exact );
+ break;
+ case F32_TO_I32:
+ gen_a_f32_z_i32_rx( f32_to_i32, roundingMode, exact );
+ break;
+ case F32_TO_I64:
+ gen_a_f32_z_i64_rx( f32_to_i64, roundingMode, exact );
+ break;
+ case F32_TO_F64:
+ gen_a_f32_z_f64( f32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case F32_TO_EXTF80:
+ gen_a_f32_z_extF80( f32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case F32_TO_F128:
+ gen_a_f32_z_f128( f32_to_f128M );
+ break;
+#endif
+ case F32_ROUNDTOINT:
+ gen_az_f32_rx( f32_roundToInt, roundingMode, exact );
+ break;
+ case F32_ADD:
+ trueFunction_abz_f32 = f32_add;
+ goto gen_abz_f32;
+ case F32_SUB:
+ trueFunction_abz_f32 = f32_sub;
+ goto gen_abz_f32;
+ case F32_MUL:
+ trueFunction_abz_f32 = f32_mul;
+ goto gen_abz_f32;
+ case F32_DIV:
+ trueFunction_abz_f32 = f32_div;
+ goto gen_abz_f32;
+ case F32_REM:
+ trueFunction_abz_f32 = f32_rem;
+ gen_abz_f32:
+ gen_abz_f32( trueFunction_abz_f32 );
+ break;
+ case F32_MULADD:
+ gen_abcz_f32( f32_mulAdd );
+ break;
+ case F32_SQRT:
+ gen_az_f32( f32_sqrt );
+ break;
+ case F32_EQ:
+ trueFunction_ab_f32_z_bool = f32_eq;
+ goto gen_ab_f32_z_bool;
+ case F32_LE:
+ trueFunction_ab_f32_z_bool = f32_le;
+ goto gen_ab_f32_z_bool;
+ case F32_LT:
+ trueFunction_ab_f32_z_bool = f32_lt;
+ goto gen_ab_f32_z_bool;
+ case F32_EQ_SIGNALING:
+ trueFunction_ab_f32_z_bool = f32_eq_signaling;
+ goto gen_ab_f32_z_bool;
+ case F32_LE_QUIET:
+ trueFunction_ab_f32_z_bool = f32_le_quiet;
+ goto gen_ab_f32_z_bool;
+ case F32_LT_QUIET:
+ trueFunction_ab_f32_z_bool = f32_lt_quiet;
+ gen_ab_f32_z_bool:
+ gen_ab_f32_z_bool( trueFunction_ab_f32_z_bool );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F64_TO_UI32:
+ gen_a_f64_z_ui32_rx( f64_to_ui32, roundingMode, exact );
+ break;
+ case F64_TO_UI64:
+ gen_a_f64_z_ui64_rx( f64_to_ui64, roundingMode, exact );
+ break;
+ case F64_TO_I32:
+ gen_a_f64_z_i32_rx( f64_to_i32, roundingMode, exact );
+ break;
+ case F64_TO_I64:
+ gen_a_f64_z_i64_rx( f64_to_i64, roundingMode, exact );
+ break;
+ case F64_TO_F32:
+ gen_a_f64_z_f32( f64_to_f32 );
+ break;
+#ifdef EXTFLOAT80
+ case F64_TO_EXTF80:
+ gen_a_f64_z_extF80( f64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case F64_TO_F128:
+ gen_a_f64_z_f128( f64_to_f128M );
+ break;
+#endif
+ case F64_ROUNDTOINT:
+ gen_az_f64_rx( f64_roundToInt, roundingMode, exact );
+ break;
+ case F64_ADD:
+ trueFunction_abz_f64 = f64_add;
+ goto gen_abz_f64;
+ case F64_SUB:
+ trueFunction_abz_f64 = f64_sub;
+ goto gen_abz_f64;
+ case F64_MUL:
+ trueFunction_abz_f64 = f64_mul;
+ goto gen_abz_f64;
+ case F64_DIV:
+ trueFunction_abz_f64 = f64_div;
+ goto gen_abz_f64;
+ case F64_REM:
+ trueFunction_abz_f64 = f64_rem;
+ gen_abz_f64:
+ gen_abz_f64( trueFunction_abz_f64 );
+ break;
+ case F64_MULADD:
+ gen_abcz_f64( f64_mulAdd );
+ break;
+ case F64_SQRT:
+ gen_az_f64( f64_sqrt );
+ break;
+ case F64_EQ:
+ trueFunction_ab_f64_z_bool = f64_eq;
+ goto gen_ab_f64_z_bool;
+ case F64_LE:
+ trueFunction_ab_f64_z_bool = f64_le;
+ goto gen_ab_f64_z_bool;
+ case F64_LT:
+ trueFunction_ab_f64_z_bool = f64_lt;
+ goto gen_ab_f64_z_bool;
+ case F64_EQ_SIGNALING:
+ trueFunction_ab_f64_z_bool = f64_eq_signaling;
+ goto gen_ab_f64_z_bool;
+ case F64_LE_QUIET:
+ trueFunction_ab_f64_z_bool = f64_le_quiet;
+ goto gen_ab_f64_z_bool;
+ case F64_LT_QUIET:
+ trueFunction_ab_f64_z_bool = f64_lt_quiet;
+ gen_ab_f64_z_bool:
+ gen_ab_f64_z_bool( trueFunction_ab_f64_z_bool );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+ case EXTF80_TO_UI32:
+ gen_a_extF80_z_ui32_rx( extF80M_to_ui32, roundingMode, exact );
+ break;
+ case EXTF80_TO_UI64:
+ gen_a_extF80_z_ui64_rx( extF80M_to_ui64, roundingMode, exact );
+ break;
+ case EXTF80_TO_I32:
+ gen_a_extF80_z_i32_rx( extF80M_to_i32, roundingMode, exact );
+ break;
+ case EXTF80_TO_I64:
+ gen_a_extF80_z_i64_rx( extF80M_to_i64, roundingMode, exact );
+ break;
+ case EXTF80_TO_F32:
+ gen_a_extF80_z_f32( extF80M_to_f32 );
+ break;
+ case EXTF80_TO_F64:
+ gen_a_extF80_z_f64( extF80M_to_f64 );
+ break;
+#ifdef FLOAT128
+ case EXTF80_TO_F128:
+ gen_a_extF80_z_f128( extF80M_to_f128M );
+ break;
+#endif
+ case EXTF80_ROUNDTOINT:
+ gen_az_extF80_rx( extF80M_roundToInt, roundingMode, exact );
+ break;
+ case EXTF80_ADD:
+ trueFunction_abz_extF80 = extF80M_add;
+ goto gen_abz_extF80;
+ case EXTF80_SUB:
+ trueFunction_abz_extF80 = extF80M_sub;
+ goto gen_abz_extF80;
+ case EXTF80_MUL:
+ trueFunction_abz_extF80 = extF80M_mul;
+ goto gen_abz_extF80;
+ case EXTF80_DIV:
+ trueFunction_abz_extF80 = extF80M_div;
+ goto gen_abz_extF80;
+ case EXTF80_REM:
+ trueFunction_abz_extF80 = extF80M_rem;
+ gen_abz_extF80:
+ gen_abz_extF80( trueFunction_abz_extF80 );
+ break;
+ case EXTF80_SQRT:
+ gen_az_extF80( extF80M_sqrt );
+ break;
+ case EXTF80_EQ:
+ trueFunction_ab_extF80_z_bool = extF80M_eq;
+ goto gen_ab_extF80_z_bool;
+ case EXTF80_LE:
+ trueFunction_ab_extF80_z_bool = extF80M_le;
+ goto gen_ab_extF80_z_bool;
+ case EXTF80_LT:
+ trueFunction_ab_extF80_z_bool = extF80M_lt;
+ goto gen_ab_extF80_z_bool;
+ case EXTF80_EQ_SIGNALING:
+ trueFunction_ab_extF80_z_bool = extF80M_eq_signaling;
+ goto gen_ab_extF80_z_bool;
+ case EXTF80_LE_QUIET:
+ trueFunction_ab_extF80_z_bool = extF80M_le_quiet;
+ goto gen_ab_extF80_z_bool;
+ case EXTF80_LT_QUIET:
+ trueFunction_ab_extF80_z_bool = extF80M_lt_quiet;
+ gen_ab_extF80_z_bool:
+ gen_ab_extF80_z_bool( trueFunction_ab_extF80_z_bool );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef FLOAT128
+ case F128_TO_UI32:
+ gen_a_f128_z_ui32_rx( f128M_to_ui32, roundingMode, exact );
+ break;
+ case F128_TO_UI64:
+ gen_a_f128_z_ui64_rx( f128M_to_ui64, roundingMode, exact );
+ break;
+ case F128_TO_I32:
+ gen_a_f128_z_i32_rx( f128M_to_i32, roundingMode, exact );
+ break;
+ case F128_TO_I64:
+ gen_a_f128_z_i64_rx( f128M_to_i64, roundingMode, exact );
+ break;
+ case F128_TO_F32:
+ gen_a_f128_z_f32( f128M_to_f32 );
+ break;
+ case F128_TO_F64:
+ gen_a_f128_z_f64( f128M_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case F128_TO_EXTF80:
+ gen_a_f128_z_extF80( f128M_to_extF80M );
+ break;
+#endif
+ case F128_ROUNDTOINT:
+ gen_az_f128_rx( f128M_roundToInt, roundingMode, exact );
+ break;
+ case F128_ADD:
+ trueFunction_abz_f128 = f128M_add;
+ goto gen_abz_f128;
+ case F128_SUB:
+ trueFunction_abz_f128 = f128M_sub;
+ goto gen_abz_f128;
+ case F128_MUL:
+ trueFunction_abz_f128 = f128M_mul;
+ goto gen_abz_f128;
+ case F128_DIV:
+ trueFunction_abz_f128 = f128M_div;
+ goto gen_abz_f128;
+ case F128_REM:
+ trueFunction_abz_f128 = f128M_rem;
+ gen_abz_f128:
+ gen_abz_f128( trueFunction_abz_f128 );
+ break;
+ case F128_MULADD:
+ gen_abcz_f128( f128M_mulAdd );
+ break;
+ case F128_SQRT:
+ gen_az_f128( f128M_sqrt );
+ break;
+ case F128_EQ:
+ trueFunction_ab_f128_z_bool = f128M_eq;
+ goto gen_ab_f128_z_bool;
+ case F128_LE:
+ trueFunction_ab_f128_z_bool = f128M_le;
+ goto gen_ab_f128_z_bool;
+ case F128_LT:
+ trueFunction_ab_f128_z_bool = f128M_lt;
+ goto gen_ab_f128_z_bool;
+ case F128_EQ_SIGNALING:
+ trueFunction_ab_f128_z_bool = f128M_eq_signaling;
+ goto gen_ab_f128_z_bool;
+ case F128_LE_QUIET:
+ trueFunction_ab_f128_z_bool = f128M_le_quiet;
+ goto gen_ab_f128_z_bool;
+ case F128_LT_QUIET:
+ trueFunction_ab_f128_z_bool = f128M_lt_quiet;
+ gen_ab_f128_z_bool:
+ gen_ab_f128_z_bool( trueFunction_ab_f128_z_bool );
+ break;
+#endif
+ }
+ return EXIT_SUCCESS;
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ optionError:
+ fail( "`%s' option requires numeric argument", *argv );
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ invalidArg:
+ fail( "Invalid argument `%s'", *argv );
+
+}
+
diff --git a/source/testfloat_ver.c b/source/testfloat_ver.c
new file mode 100644
index 0000000..97edcbf
--- /dev/null
+++ b/source/testfloat_ver.c
@@ -0,0 +1,622 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <signal.h>
+#include "platform.h"
+#include "fail.h"
+#include "softfloat.h"
+#include "functions.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "verLoops.h"
+
+static void catchSIGINT( int signalCode )
+{
+
+ if ( verCases_stop ) exit( EXIT_FAILURE );
+ verCases_stop = true;
+
+}
+
+int main( int argc, char *argv[] )
+{
+ bool exact;
+ int functionCode, roundingCode, tininessCode;
+ const char *argPtr;
+ long i;
+ int functionAttribs;
+ uint_fast8_t roundingMode;
+ float32_t (*trueFunction_abz_f32)( float32_t, float32_t );
+ bool (*trueFunction_ab_f32_z_bool)( float32_t, float32_t );
+ float64_t (*trueFunction_abz_f64)( float64_t, float64_t );
+ bool (*trueFunction_ab_f64_z_bool)( float64_t, float64_t );
+#ifdef EXTFLOAT80
+ void
+ (*trueFunction_abz_extF80)(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+ bool
+ (*trueFunction_ab_extF80_z_bool)(
+ const extFloat80_t *, const extFloat80_t * );
+#endif
+#ifdef FLOAT128
+ void
+ (*trueFunction_abz_f128)(
+ const float128_t *, const float128_t *, float128_t * );
+ bool
+ (*trueFunction_ab_f128_z_bool)( const float128_t *, const float128_t * );
+#endif
+
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ fail_programName = "testfloat_ver";
+ if ( argc <= 1 ) goto writeHelpMessage;
+ softfloat_detectTininess = softfloat_tininess_beforeRounding;
+#ifdef EXTFLOAT80
+ extF80_roundingPrecision = 80;
+#endif
+ roundingMode = softfloat_round_near_even;
+ exact = false;
+ verCases_maxErrorCount = 20;
+ verLoops_trueFlagsPtr = &softfloat_exceptionFlags;
+ functionCode = 0;
+ roundingCode = ROUND_NEAR_EVEN;
+ tininessCode = TININESS_BEFORE_ROUNDING;
+ for (;;) {
+ --argc;
+ if ( ! argc ) break;
+ argPtr = *++argv;
+ if ( ! argPtr ) break;
+ if ( argPtr[0] == '-' ) ++argPtr;
+ if (
+ ! strcmp( argPtr, "help" ) || ! strcmp( argPtr, "-help" )
+ || ! strcmp( argPtr, "h" )
+ ) {
+ writeHelpMessage:
+ fputs(
+"testfloat_ver [<option>...] <function>\n"
+" <option>: (* is default)\n"
+" -help --Write this message and exit.\n"
+" -errors <num> --Stop after <num> errors.\n"
+" * -errors 20\n"
+" -checkNaNs --Check for bitwise correctness of NaN results.\n"
+#ifdef EXTFLOAT80
+" -precision32 --For extF80, rounding precision is 32 bits.\n"
+" -precision64 --For extF80, rounding precision is 64 bits.\n"
+" * -precision80 --For extF80, rounding precision is 80 bits.\n"
+#endif
+" * -rnear_even --Round to nearest/even.\n"
+" -rminMag --Round to minimum magnitude (toward zero).\n"
+" -rmin --Round to minimum (down).\n"
+" -rmax --Round to maximum (up).\n"
+" -rnear_maxMag --Round to nearest/maximum magnitude (nearest/away).\n"
+" * -tininessbefore --Detect underflow tininess before rounding.\n"
+" -tininessafter --Detect underflow tininess after rounding.\n"
+" * -notexact --Rounding to integer is not exact (no inexact\n"
+" exceptions).\n"
+" -exact --Rounding to integer is exact (raising inexact\n"
+" exceptions).\n"
+" <function>:\n"
+" <int>_to_<float> <float>_add <float>_eq\n"
+" <float>_to_<int> <float>_sub <float>_le\n"
+" <float>_to_<float> <float>_mul <float>_lt\n"
+" <float>_roundToInt <float>_mulAdd <float>_eq_signaling\n"
+" <float>_div <float>_le_quiet\n"
+" <float>_rem <float>_lt_quiet\n"
+" <float>_sqrt\n"
+" <int>:\n"
+" ui32 --Unsigned 32-bit integer.\n"
+" ui64 --Unsigned 64-bit integer.\n"
+" i32 --Signed 32-bit integer.\n"
+" i64 --Signed 64-bit integer.\n"
+" <float>:\n"
+" f32 --Binary 32-bit floating-point (single-precision).\n"
+" f64 --Binary 64-bit floating-point (double-precision).\n"
+#ifdef EXTFLOAT80
+" extF80 --Binary 80-bit extended floating-point.\n"
+#endif
+#ifdef FLOAT128
+" f128 --Binary 128-bit floating-point (quadruple-precision).\n"
+#endif
+ ,
+ stdout
+ );
+ return EXIT_SUCCESS;
+ } else if ( ! strcmp( argPtr, "errors" ) ) {
+ if ( argc < 2 ) goto optionError;
+ i = strtol( argv[1], (char **) &argPtr, 10 );
+ if ( *argPtr ) goto optionError;
+ verCases_maxErrorCount = i;
+ --argc;
+ ++argv;
+ } else if (
+ ! strcmp( argPtr, "checkNaNs" ) || ! strcmp( argPtr, "checknans" )
+ ) {
+ verCases_checkNaNs = true;
+#ifdef EXTFLOAT80
+ } else if ( ! strcmp( argPtr, "precision32" ) ) {
+ extF80_roundingPrecision = 32;
+ } else if ( ! strcmp( argPtr, "precision64" ) ) {
+ extF80_roundingPrecision = 64;
+ } else if ( ! strcmp( argPtr, "precision80" ) ) {
+ extF80_roundingPrecision = 80;
+#endif
+ } else if (
+ ! strcmp( argPtr, "rnear_even" )
+ || ! strcmp( argPtr, "rneareven" )
+ || ! strcmp( argPtr, "rnearest_even" )
+ ) {
+ roundingCode = ROUND_NEAR_EVEN;
+ } else if (
+ ! strcmp( argPtr, "rminmag" ) || ! strcmp( argPtr, "rminMag" )
+ ) {
+ roundingCode = ROUND_MINMAG;
+ } else if ( ! strcmp( argPtr, "rmin" ) ) {
+ roundingCode = ROUND_MIN;
+ } else if ( ! strcmp( argPtr, "rmax" ) ) {
+ roundingCode = ROUND_MAX;
+ } else if (
+ ! strcmp( argPtr, "rnear_maxmag" )
+ || ! strcmp( argPtr, "rnear_maxMag" )
+ || ! strcmp( argPtr, "rnearmaxmag" )
+ || ! strcmp( argPtr, "rnearest_maxmag" )
+ || ! strcmp( argPtr, "rnearest_maxMag" )
+ ) {
+ roundingCode = ROUND_NEAR_MAXMAG;
+ } else if ( ! strcmp( argPtr, "tininessbefore" ) ) {
+ tininessCode = TININESS_BEFORE_ROUNDING;
+ } else if ( ! strcmp( argPtr, "tininessafter" ) ) {
+ tininessCode = TININESS_AFTER_ROUNDING;
+ } else if ( ! strcmp( argPtr, "notexact" ) ) {
+ exact = false;
+ } else if ( ! strcmp( argPtr, "exact" ) ) {
+ exact = true;
+ } else {
+ functionCode = 1;
+ while ( strcmp( argPtr, functionInfos[functionCode].namePtr ) ) {
+ ++functionCode;
+ if ( functionCode == NUM_FUNCTIONS ) goto invalidArg;
+ }
+ functionAttribs = functionInfos[functionCode].attribs;
+ if (
+ (functionAttribs & FUNC_ARG_EXACT)
+ && ! (functionAttribs & FUNC_ARG_ROUNDINGMODE)
+ ) {
+ goto invalidArg;
+ }
+ }
+ }
+ if ( ! functionCode ) fail( "Function argument required" );
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ verCases_functionNamePtr = functionInfos[functionCode].namePtr;
+#ifdef EXTFLOAT80
+ verCases_roundingPrecision =
+ functionAttribs & FUNC_EFF_ROUNDINGPRECISION ? extF80_roundingPrecision
+ : 0;
+#endif
+ verCases_roundingCode =
+ functionAttribs & (FUNC_ARG_ROUNDINGMODE | FUNC_EFF_ROUNDINGMODE)
+ ? roundingCode
+ : 0;
+ verCases_tininessCode =
+ functionAttribs
+ & (extF80_roundingPrecision && (extF80_roundingPrecision < 80)
+ ? FUNC_EFF_TININESSMODE_REDUCEDPREC
+ : FUNC_EFF_TININESSMODE)
+ ? tininessCode
+ : 0;
+ verCases_usesExact = ((functionAttribs & FUNC_ARG_EXACT) != 0);
+ verCases_exact = exact;
+ roundingMode = roundingModes[roundingCode];
+ softfloat_roundingMode = roundingMode;
+ softfloat_detectTininess = tininessModes[tininessCode];
+ signal( SIGINT, catchSIGINT );
+ signal( SIGTERM, catchSIGINT );
+ fputs( "Testing ", stderr );
+ verCases_writeFunctionName( stderr );
+ fputs( ".\n", stderr );
+ switch ( functionCode ) {
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case UI32_TO_F32:
+ ver_a_ui32_z_f32( ui32_to_f32 );
+ break;
+ case UI32_TO_F64:
+ ver_a_ui32_z_f64( ui32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case UI32_TO_EXTF80:
+ ver_a_ui32_z_extF80( ui32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case UI32_TO_F128:
+ ver_a_ui32_z_f128( ui32_to_f128M );
+ break;
+#endif
+ case UI64_TO_F32:
+ ver_a_ui64_z_f32( ui64_to_f32 );
+ break;
+ case UI64_TO_F64:
+ ver_a_ui64_z_f64( ui64_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case UI64_TO_EXTF80:
+ ver_a_ui64_z_extF80( ui64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case UI64_TO_F128:
+ ver_a_ui64_z_f128( ui64_to_f128M );
+ break;
+#endif
+ case I32_TO_F32:
+ ver_a_i32_z_f32( i32_to_f32 );
+ break;
+ case I32_TO_F64:
+ ver_a_i32_z_f64( i32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case I32_TO_EXTF80:
+ ver_a_i32_z_extF80( i32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case I32_TO_F128:
+ ver_a_i32_z_f128( i32_to_f128M );
+ break;
+#endif
+ case I64_TO_F32:
+ ver_a_i64_z_f32( i64_to_f32 );
+ break;
+ case I64_TO_F64:
+ ver_a_i64_z_f64( i64_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case I64_TO_EXTF80:
+ ver_a_i64_z_extF80( i64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case I64_TO_F128:
+ ver_a_i64_z_f128( i64_to_f128M );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F32_TO_UI32:
+ ver_a_f32_z_ui32_rx( f32_to_ui32, roundingMode, exact );
+ break;
+ case F32_TO_UI64:
+ ver_a_f32_z_ui64_rx( f32_to_ui64, roundingMode, exact );
+ break;
+ case F32_TO_I32:
+ ver_a_f32_z_i32_rx( f32_to_i32, roundingMode, exact );
+ break;
+ case F32_TO_I64:
+ ver_a_f32_z_i64_rx( f32_to_i64, roundingMode, exact );
+ break;
+ case F32_TO_F64:
+ ver_a_f32_z_f64( f32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case F32_TO_EXTF80:
+ ver_a_f32_z_extF80( f32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case F32_TO_F128:
+ ver_a_f32_z_f128( f32_to_f128M );
+ break;
+#endif
+ case F32_ROUNDTOINT:
+ ver_az_f32_rx( f32_roundToInt, roundingMode, exact );
+ break;
+ case F32_ADD:
+ trueFunction_abz_f32 = f32_add;
+ goto ver_abz_f32;
+ case F32_SUB:
+ trueFunction_abz_f32 = f32_sub;
+ goto ver_abz_f32;
+ case F32_MUL:
+ trueFunction_abz_f32 = f32_mul;
+ goto ver_abz_f32;
+ case F32_DIV:
+ trueFunction_abz_f32 = f32_div;
+ goto ver_abz_f32;
+ case F32_REM:
+ trueFunction_abz_f32 = f32_rem;
+ ver_abz_f32:
+ ver_abz_f32( trueFunction_abz_f32 );
+ break;
+ case F32_MULADD:
+ ver_abcz_f32( f32_mulAdd );
+ break;
+ case F32_SQRT:
+ ver_az_f32( f32_sqrt );
+ break;
+ case F32_EQ:
+ trueFunction_ab_f32_z_bool = f32_eq;
+ goto ver_ab_f32_z_bool;
+ case F32_LE:
+ trueFunction_ab_f32_z_bool = f32_le;
+ goto ver_ab_f32_z_bool;
+ case F32_LT:
+ trueFunction_ab_f32_z_bool = f32_lt;
+ goto ver_ab_f32_z_bool;
+ case F32_EQ_SIGNALING:
+ trueFunction_ab_f32_z_bool = f32_eq_signaling;
+ goto ver_ab_f32_z_bool;
+ case F32_LE_QUIET:
+ trueFunction_ab_f32_z_bool = f32_le_quiet;
+ goto ver_ab_f32_z_bool;
+ case F32_LT_QUIET:
+ trueFunction_ab_f32_z_bool = f32_lt_quiet;
+ ver_ab_f32_z_bool:
+ ver_ab_f32_z_bool( trueFunction_ab_f32_z_bool );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F64_TO_UI32:
+ ver_a_f64_z_ui32_rx( f64_to_ui32, roundingMode, exact );
+ break;
+ case F64_TO_UI64:
+ ver_a_f64_z_ui64_rx( f64_to_ui64, roundingMode, exact );
+ break;
+ case F64_TO_I32:
+ ver_a_f64_z_i32_rx( f64_to_i32, roundingMode, exact );
+ break;
+ case F64_TO_I64:
+ ver_a_f64_z_i64_rx( f64_to_i64, roundingMode, exact );
+ break;
+ case F64_TO_F32:
+ ver_a_f64_z_f32( f64_to_f32 );
+ break;
+#ifdef EXTFLOAT80
+ case F64_TO_EXTF80:
+ ver_a_f64_z_extF80( f64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case F64_TO_F128:
+ ver_a_f64_z_f128( f64_to_f128M );
+ break;
+#endif
+ case F64_ROUNDTOINT:
+ ver_az_f64_rx( f64_roundToInt, roundingMode, exact );
+ break;
+ case F64_ADD:
+ trueFunction_abz_f64 = f64_add;
+ goto ver_abz_f64;
+ case F64_SUB:
+ trueFunction_abz_f64 = f64_sub;
+ goto ver_abz_f64;
+ case F64_MUL:
+ trueFunction_abz_f64 = f64_mul;
+ goto ver_abz_f64;
+ case F64_DIV:
+ trueFunction_abz_f64 = f64_div;
+ goto ver_abz_f64;
+ case F64_REM:
+ trueFunction_abz_f64 = f64_rem;
+ ver_abz_f64:
+ ver_abz_f64( trueFunction_abz_f64 );
+ break;
+ case F64_MULADD:
+ ver_abcz_f64( f64_mulAdd );
+ break;
+ case F64_SQRT:
+ ver_az_f64( f64_sqrt );
+ break;
+ case F64_EQ:
+ trueFunction_ab_f64_z_bool = f64_eq;
+ goto ver_ab_f64_z_bool;
+ case F64_LE:
+ trueFunction_ab_f64_z_bool = f64_le;
+ goto ver_ab_f64_z_bool;
+ case F64_LT:
+ trueFunction_ab_f64_z_bool = f64_lt;
+ goto ver_ab_f64_z_bool;
+ case F64_EQ_SIGNALING:
+ trueFunction_ab_f64_z_bool = f64_eq_signaling;
+ goto ver_ab_f64_z_bool;
+ case F64_LE_QUIET:
+ trueFunction_ab_f64_z_bool = f64_le_quiet;
+ goto ver_ab_f64_z_bool;
+ case F64_LT_QUIET:
+ trueFunction_ab_f64_z_bool = f64_lt_quiet;
+ ver_ab_f64_z_bool:
+ ver_ab_f64_z_bool( trueFunction_ab_f64_z_bool );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+ case EXTF80_TO_UI32:
+ ver_a_extF80_z_ui32_rx( extF80M_to_ui32, roundingMode, exact );
+ break;
+ case EXTF80_TO_UI64:
+ ver_a_extF80_z_ui64_rx( extF80M_to_ui64, roundingMode, exact );
+ break;
+ case EXTF80_TO_I32:
+ ver_a_extF80_z_i32_rx( extF80M_to_i32, roundingMode, exact );
+ break;
+ case EXTF80_TO_I64:
+ ver_a_extF80_z_i64_rx( extF80M_to_i64, roundingMode, exact );
+ break;
+ case EXTF80_TO_F32:
+ ver_a_extF80_z_f32( extF80M_to_f32 );
+ break;
+ case EXTF80_TO_F64:
+ ver_a_extF80_z_f64( extF80M_to_f64 );
+ break;
+#ifdef FLOAT128
+ case EXTF80_TO_F128:
+ ver_a_extF80_z_f128( extF80M_to_f128M );
+ break;
+#endif
+ case EXTF80_ROUNDTOINT:
+ ver_az_extF80_rx( extF80M_roundToInt, roundingMode, exact );
+ break;
+ case EXTF80_ADD:
+ trueFunction_abz_extF80 = extF80M_add;
+ goto ver_abz_extF80;
+ case EXTF80_SUB:
+ trueFunction_abz_extF80 = extF80M_sub;
+ goto ver_abz_extF80;
+ case EXTF80_MUL:
+ trueFunction_abz_extF80 = extF80M_mul;
+ goto ver_abz_extF80;
+ case EXTF80_DIV:
+ trueFunction_abz_extF80 = extF80M_div;
+ goto ver_abz_extF80;
+ case EXTF80_REM:
+ trueFunction_abz_extF80 = extF80M_rem;
+ ver_abz_extF80:
+ ver_abz_extF80( trueFunction_abz_extF80 );
+ break;
+ case EXTF80_SQRT:
+ ver_az_extF80( extF80M_sqrt );
+ break;
+ case EXTF80_EQ:
+ trueFunction_ab_extF80_z_bool = extF80M_eq;
+ goto ver_ab_extF80_z_bool;
+ case EXTF80_LE:
+ trueFunction_ab_extF80_z_bool = extF80M_le;
+ goto ver_ab_extF80_z_bool;
+ case EXTF80_LT:
+ trueFunction_ab_extF80_z_bool = extF80M_lt;
+ goto ver_ab_extF80_z_bool;
+ case EXTF80_EQ_SIGNALING:
+ trueFunction_ab_extF80_z_bool = extF80M_eq_signaling;
+ goto ver_ab_extF80_z_bool;
+ case EXTF80_LE_QUIET:
+ trueFunction_ab_extF80_z_bool = extF80M_le_quiet;
+ goto ver_ab_extF80_z_bool;
+ case EXTF80_LT_QUIET:
+ trueFunction_ab_extF80_z_bool = extF80M_lt_quiet;
+ ver_ab_extF80_z_bool:
+ ver_ab_extF80_z_bool( trueFunction_ab_extF80_z_bool );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef FLOAT128
+ case F128_TO_UI32:
+ ver_a_f128_z_ui32_rx( f128M_to_ui32, roundingMode, exact );
+ break;
+ case F128_TO_UI64:
+ ver_a_f128_z_ui64_rx( f128M_to_ui64, roundingMode, exact );
+ break;
+ case F128_TO_I32:
+ ver_a_f128_z_i32_rx( f128M_to_i32, roundingMode, exact );
+ break;
+ case F128_TO_I64:
+ ver_a_f128_z_i64_rx( f128M_to_i64, roundingMode, exact );
+ break;
+ case F128_TO_F32:
+ ver_a_f128_z_f32( f128M_to_f32 );
+ break;
+ case F128_TO_F64:
+ ver_a_f128_z_f64( f128M_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case F128_TO_EXTF80:
+ ver_a_f128_z_extF80( f128M_to_extF80M );
+ break;
+#endif
+ case F128_ROUNDTOINT:
+ ver_az_f128_rx( f128M_roundToInt, roundingMode, exact );
+ break;
+ case F128_ADD:
+ trueFunction_abz_f128 = f128M_add;
+ goto ver_abz_f128;
+ case F128_SUB:
+ trueFunction_abz_f128 = f128M_sub;
+ goto ver_abz_f128;
+ case F128_MUL:
+ trueFunction_abz_f128 = f128M_mul;
+ goto ver_abz_f128;
+ case F128_DIV:
+ trueFunction_abz_f128 = f128M_div;
+ goto ver_abz_f128;
+ case F128_REM:
+ trueFunction_abz_f128 = f128M_rem;
+ ver_abz_f128:
+ ver_abz_f128( trueFunction_abz_f128 );
+ break;
+ case F128_MULADD:
+ ver_abcz_f128( f128M_mulAdd );
+ break;
+ case F128_SQRT:
+ ver_az_f128( f128M_sqrt );
+ break;
+ case F128_EQ:
+ trueFunction_ab_f128_z_bool = f128M_eq;
+ goto ver_ab_f128_z_bool;
+ case F128_LE:
+ trueFunction_ab_f128_z_bool = f128M_le;
+ goto ver_ab_f128_z_bool;
+ case F128_LT:
+ trueFunction_ab_f128_z_bool = f128M_lt;
+ goto ver_ab_f128_z_bool;
+ case F128_EQ_SIGNALING:
+ trueFunction_ab_f128_z_bool = f128M_eq_signaling;
+ goto ver_ab_f128_z_bool;
+ case F128_LE_QUIET:
+ trueFunction_ab_f128_z_bool = f128M_le_quiet;
+ goto ver_ab_f128_z_bool;
+ case F128_LT_QUIET:
+ trueFunction_ab_f128_z_bool = f128M_lt_quiet;
+ ver_ab_f128_z_bool:
+ ver_ab_f128_z_bool( trueFunction_ab_f128_z_bool );
+ break;
+#endif
+ }
+ verCases_exitWithStatus();
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ optionError:
+ fail( "`%s' option requires numeric argument", *argv );
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ invalidArg:
+ fail( "Invalid argument `%s'", *argv );
+
+}
+
diff --git a/source/testsoftfloat.c b/source/testsoftfloat.c
new file mode 100644
index 0000000..5ce6369
--- /dev/null
+++ b/source/testsoftfloat.c
@@ -0,0 +1,938 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <signal.h>
+#include "platform.h"
+#include "fail.h"
+#include "softfloat.h"
+#include "slowfloat.h"
+#include "functions.h"
+#include "genCases.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "testLoops.h"
+
+static void catchSIGINT( int signalCode )
+{
+
+ if ( verCases_stop ) exit( EXIT_FAILURE );
+ verCases_stop = true;
+
+}
+
+static uint_fast8_t softfloat_clearExceptionFlags( void )
+{
+ uint_fast8_t prevFlags;
+
+ prevFlags = softfloat_exceptionFlags;
+ softfloat_exceptionFlags = 0;
+ return prevFlags;
+
+}
+
+static
+ void
+ testFunctionInstance(
+ int functionCode, uint_fast8_t roundingMode, bool exact )
+{
+ float32_t (*trueFunction_abz_f32)( float32_t, float32_t );
+ float32_t (*subjFunction_abz_f32)( float32_t, float32_t );
+ bool (*trueFunction_ab_f32_z_bool)( float32_t, float32_t );
+ bool (*subjFunction_ab_f32_z_bool)( float32_t, float32_t );
+ float64_t (*trueFunction_abz_f64)( float64_t, float64_t );
+ float64_t (*subjFunction_abz_f64)( float64_t, float64_t );
+ bool (*trueFunction_ab_f64_z_bool)( float64_t, float64_t );
+ bool (*subjFunction_ab_f64_z_bool)( float64_t, float64_t );
+#ifdef EXTFLOAT80
+ void (*trueFunction_abz_extF80M)(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+ void (*subjFunction_abz_extF80M)(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+ bool (*trueFunction_ab_extF80M_z_bool)(
+ const extFloat80_t *, const extFloat80_t * );
+ bool (*subjFunction_ab_extF80M_z_bool)(
+ const extFloat80_t *, const extFloat80_t * );
+#endif
+#ifdef FLOAT128
+ void (*trueFunction_abz_f128M)(
+ const float128_t *, const float128_t *, float128_t * );
+ void (*subjFunction_abz_f128M)(
+ const float128_t *, const float128_t *, float128_t * );
+ bool (*trueFunction_ab_f128M_z_bool)(
+ const float128_t *, const float128_t * );
+ bool (*subjFunction_ab_f128M_z_bool)(
+ const float128_t *, const float128_t * );
+#endif
+
+ fputs( "Testing ", stderr );
+ verCases_writeFunctionName( stderr );
+ fputs( ".\n", stderr );
+ switch ( functionCode ) {
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case UI32_TO_F32:
+ test_a_ui32_z_f32( slow_ui32_to_f32, ui32_to_f32 );
+ break;
+ case UI32_TO_F64:
+ test_a_ui32_z_f64( slow_ui32_to_f64, ui32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case UI32_TO_EXTF80:
+ test_a_ui32_z_extF80( slow_ui32_to_extF80M, ui32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case UI32_TO_F128:
+ test_a_ui32_z_f128( slow_ui32_to_f128M, ui32_to_f128M );
+ break;
+#endif
+ case UI64_TO_F32:
+ test_a_ui64_z_f32( slow_ui64_to_f32, ui64_to_f32 );
+ break;
+ case UI64_TO_F64:
+ test_a_ui64_z_f64( slow_ui64_to_f64, ui64_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case UI64_TO_EXTF80:
+ test_a_ui64_z_extF80( slow_ui64_to_extF80M, ui64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case UI64_TO_F128:
+ test_a_ui64_z_f128( slow_ui64_to_f128M, ui64_to_f128M );
+ break;
+#endif
+ case I32_TO_F32:
+ test_a_i32_z_f32( slow_i32_to_f32, i32_to_f32 );
+ break;
+ case I32_TO_F64:
+ test_a_i32_z_f64( slow_i32_to_f64, i32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case I32_TO_EXTF80:
+ test_a_i32_z_extF80( slow_i32_to_extF80M, i32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case I32_TO_F128:
+ test_a_i32_z_f128( slow_i32_to_f128M, i32_to_f128M );
+ break;
+#endif
+ case I64_TO_F32:
+ test_a_i64_z_f32( slow_i64_to_f32, i64_to_f32 );
+ break;
+ case I64_TO_F64:
+ test_a_i64_z_f64( slow_i64_to_f64, i64_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case I64_TO_EXTF80:
+ test_a_i64_z_extF80( slow_i64_to_extF80M, i64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case I64_TO_F128:
+ test_a_i64_z_f128( slow_i64_to_f128M, i64_to_f128M );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F32_TO_UI32:
+ test_a_f32_z_ui32_rx(
+ slow_f32_to_ui32, f32_to_ui32, roundingMode, exact );
+ break;
+ case F32_TO_UI64:
+ test_a_f32_z_ui64_rx(
+ slow_f32_to_ui64, f32_to_ui64, roundingMode, exact );
+ break;
+ case F32_TO_I32:
+ test_a_f32_z_i32_rx(
+ slow_f32_to_i32, f32_to_i32, roundingMode, exact );
+ break;
+ case F32_TO_I64:
+ test_a_f32_z_i64_rx(
+ slow_f32_to_i64, f32_to_i64, roundingMode, exact );
+ break;
+ case F32_TO_UI32_R_MINMAG:
+ test_a_f32_z_ui32_x(
+ slow_f32_to_ui32_r_minMag, f32_to_ui32_r_minMag, exact );
+ break;
+ case F32_TO_UI64_R_MINMAG:
+ test_a_f32_z_ui64_x(
+ slow_f32_to_ui64_r_minMag, f32_to_ui64_r_minMag, exact );
+ break;
+ case F32_TO_I32_R_MINMAG:
+ test_a_f32_z_i32_x(
+ slow_f32_to_i32_r_minMag, f32_to_i32_r_minMag, exact );
+ break;
+ case F32_TO_I64_R_MINMAG:
+ test_a_f32_z_i64_x(
+ slow_f32_to_i64_r_minMag, f32_to_i64_r_minMag, exact );
+ break;
+ case F32_TO_F64:
+ test_a_f32_z_f64( slow_f32_to_f64, f32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case F32_TO_EXTF80:
+ test_a_f32_z_extF80( slow_f32_to_extF80M, f32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case F32_TO_F128:
+ test_a_f32_z_f128( slow_f32_to_f128M, f32_to_f128M );
+ break;
+#endif
+ case F32_ROUNDTOINT:
+ test_az_f32_rx(
+ slow_f32_roundToInt, f32_roundToInt, roundingMode, exact );
+ break;
+ case F32_ADD:
+ trueFunction_abz_f32 = slow_f32_add;
+ subjFunction_abz_f32 = f32_add;
+ goto test_abz_f32;
+ case F32_SUB:
+ trueFunction_abz_f32 = slow_f32_sub;
+ subjFunction_abz_f32 = f32_sub;
+ goto test_abz_f32;
+ case F32_MUL:
+ trueFunction_abz_f32 = slow_f32_mul;
+ subjFunction_abz_f32 = f32_mul;
+ goto test_abz_f32;
+ case F32_DIV:
+ trueFunction_abz_f32 = slow_f32_div;
+ subjFunction_abz_f32 = f32_div;
+ goto test_abz_f32;
+ case F32_REM:
+ trueFunction_abz_f32 = slow_f32_rem;
+ subjFunction_abz_f32 = f32_rem;
+ test_abz_f32:
+ test_abz_f32( trueFunction_abz_f32, subjFunction_abz_f32 );
+ break;
+ case F32_MULADD:
+ test_abcz_f32( slow_f32_mulAdd, f32_mulAdd );
+ break;
+ case F32_SQRT:
+ test_az_f32( slow_f32_sqrt, f32_sqrt );
+ break;
+ case F32_EQ:
+ trueFunction_ab_f32_z_bool = slow_f32_eq;
+ subjFunction_ab_f32_z_bool = f32_eq;
+ goto test_ab_f32_z_bool;
+ case F32_LE:
+ trueFunction_ab_f32_z_bool = slow_f32_le;
+ subjFunction_ab_f32_z_bool = f32_le;
+ goto test_ab_f32_z_bool;
+ case F32_LT:
+ trueFunction_ab_f32_z_bool = slow_f32_lt;
+ subjFunction_ab_f32_z_bool = f32_lt;
+ goto test_ab_f32_z_bool;
+ case F32_EQ_SIGNALING:
+ trueFunction_ab_f32_z_bool = slow_f32_eq_signaling;
+ subjFunction_ab_f32_z_bool = f32_eq_signaling;
+ goto test_ab_f32_z_bool;
+ case F32_LE_QUIET:
+ trueFunction_ab_f32_z_bool = slow_f32_le_quiet;
+ subjFunction_ab_f32_z_bool = f32_le_quiet;
+ goto test_ab_f32_z_bool;
+ case F32_LT_QUIET:
+ trueFunction_ab_f32_z_bool = slow_f32_lt_quiet;
+ subjFunction_ab_f32_z_bool = f32_lt_quiet;
+ test_ab_f32_z_bool:
+ test_ab_f32_z_bool(
+ trueFunction_ab_f32_z_bool, subjFunction_ab_f32_z_bool );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F64_TO_UI32:
+ test_a_f64_z_ui32_rx(
+ slow_f64_to_ui32, f64_to_ui32, roundingMode, exact );
+ break;
+ case F64_TO_UI64:
+ test_a_f64_z_ui64_rx(
+ slow_f64_to_ui64, f64_to_ui64, roundingMode, exact );
+ break;
+ case F64_TO_I32:
+ test_a_f64_z_i32_rx(
+ slow_f64_to_i32, f64_to_i32, roundingMode, exact );
+ break;
+ case F64_TO_I64:
+ test_a_f64_z_i64_rx(
+ slow_f64_to_i64, f64_to_i64, roundingMode, exact );
+ break;
+ case F64_TO_UI32_R_MINMAG:
+ test_a_f64_z_ui32_x(
+ slow_f64_to_ui32_r_minMag, f64_to_ui32_r_minMag, exact );
+ break;
+ case F64_TO_UI64_R_MINMAG:
+ test_a_f64_z_ui64_x(
+ slow_f64_to_ui64_r_minMag, f64_to_ui64_r_minMag, exact );
+ break;
+ case F64_TO_I32_R_MINMAG:
+ test_a_f64_z_i32_x(
+ slow_f64_to_i32_r_minMag, f64_to_i32_r_minMag, exact );
+ break;
+ case F64_TO_I64_R_MINMAG:
+ test_a_f64_z_i64_x(
+ slow_f64_to_i64_r_minMag, f64_to_i64_r_minMag, exact );
+ break;
+ case F64_TO_F32:
+ test_a_f64_z_f32( slow_f64_to_f32, f64_to_f32 );
+ break;
+#ifdef EXTFLOAT80
+ case F64_TO_EXTF80:
+ test_a_f64_z_extF80( slow_f64_to_extF80M, f64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case F64_TO_F128:
+ test_a_f64_z_f128( slow_f64_to_f128M, f64_to_f128M );
+ break;
+#endif
+ case F64_ROUNDTOINT:
+ test_az_f64_rx(
+ slow_f64_roundToInt, f64_roundToInt, roundingMode, exact );
+ break;
+ case F64_ADD:
+ trueFunction_abz_f64 = slow_f64_add;
+ subjFunction_abz_f64 = f64_add;
+ goto test_abz_f64;
+ case F64_SUB:
+ trueFunction_abz_f64 = slow_f64_sub;
+ subjFunction_abz_f64 = f64_sub;
+ goto test_abz_f64;
+ case F64_MUL:
+ trueFunction_abz_f64 = slow_f64_mul;
+ subjFunction_abz_f64 = f64_mul;
+ goto test_abz_f64;
+ case F64_DIV:
+ trueFunction_abz_f64 = slow_f64_div;
+ subjFunction_abz_f64 = f64_div;
+ goto test_abz_f64;
+ case F64_REM:
+ trueFunction_abz_f64 = slow_f64_rem;
+ subjFunction_abz_f64 = f64_rem;
+ test_abz_f64:
+ test_abz_f64( trueFunction_abz_f64, subjFunction_abz_f64 );
+ break;
+ case F64_MULADD:
+ test_abcz_f64( slow_f64_mulAdd, f64_mulAdd );
+ break;
+ case F64_SQRT:
+ test_az_f64( slow_f64_sqrt, f64_sqrt );
+ break;
+ case F64_EQ:
+ trueFunction_ab_f64_z_bool = slow_f64_eq;
+ subjFunction_ab_f64_z_bool = f64_eq;
+ goto test_ab_f64_z_bool;
+ case F64_LE:
+ trueFunction_ab_f64_z_bool = slow_f64_le;
+ subjFunction_ab_f64_z_bool = f64_le;
+ goto test_ab_f64_z_bool;
+ case F64_LT:
+ trueFunction_ab_f64_z_bool = slow_f64_lt;
+ subjFunction_ab_f64_z_bool = f64_lt;
+ goto test_ab_f64_z_bool;
+ case F64_EQ_SIGNALING:
+ trueFunction_ab_f64_z_bool = slow_f64_eq_signaling;
+ subjFunction_ab_f64_z_bool = f64_eq_signaling;
+ goto test_ab_f64_z_bool;
+ case F64_LE_QUIET:
+ trueFunction_ab_f64_z_bool = slow_f64_le_quiet;
+ subjFunction_ab_f64_z_bool = f64_le_quiet;
+ goto test_ab_f64_z_bool;
+ case F64_LT_QUIET:
+ trueFunction_ab_f64_z_bool = slow_f64_lt_quiet;
+ subjFunction_ab_f64_z_bool = f64_lt_quiet;
+ test_ab_f64_z_bool:
+ test_ab_f64_z_bool(
+ trueFunction_ab_f64_z_bool, subjFunction_ab_f64_z_bool );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+ case EXTF80_TO_UI32:
+ test_a_extF80_z_ui32_rx(
+ slow_extF80M_to_ui32, extF80M_to_ui32, roundingMode, exact );
+ break;
+ case EXTF80_TO_UI64:
+ test_a_extF80_z_ui64_rx(
+ slow_extF80M_to_ui64, extF80M_to_ui64, roundingMode, exact );
+ break;
+ case EXTF80_TO_I32:
+ test_a_extF80_z_i32_rx(
+ slow_extF80M_to_i32, extF80M_to_i32, roundingMode, exact );
+ break;
+ case EXTF80_TO_I64:
+ test_a_extF80_z_i64_rx(
+ slow_extF80M_to_i64, extF80M_to_i64, roundingMode, exact );
+ break;
+ case EXTF80_TO_UI32_R_MINMAG:
+ test_a_extF80_z_ui32_x(
+ slow_extF80M_to_ui32_r_minMag, extF80M_to_ui32_r_minMag, exact );
+ break;
+ case EXTF80_TO_UI64_R_MINMAG:
+ test_a_extF80_z_ui64_x(
+ slow_extF80M_to_ui64_r_minMag, extF80M_to_ui64_r_minMag, exact );
+ break;
+ case EXTF80_TO_I32_R_MINMAG:
+ test_a_extF80_z_i32_x(
+ slow_extF80M_to_i32_r_minMag, extF80M_to_i32_r_minMag, exact );
+ break;
+ case EXTF80_TO_I64_R_MINMAG:
+ test_a_extF80_z_i64_x(
+ slow_extF80M_to_i64_r_minMag, extF80M_to_i64_r_minMag, exact );
+ break;
+ case EXTF80_TO_F32:
+ test_a_extF80_z_f32( slow_extF80M_to_f32, extF80M_to_f32 );
+ break;
+ case EXTF80_TO_F64:
+ test_a_extF80_z_f64( slow_extF80M_to_f64, extF80M_to_f64 );
+ break;
+#ifdef FLOAT128
+ case EXTF80_TO_F128:
+ test_a_extF80_z_f128( slow_extF80M_to_f128M, extF80M_to_f128M );
+ break;
+#endif
+ case EXTF80_ROUNDTOINT:
+ test_az_extF80_rx(
+ slow_extF80M_roundToInt, extF80M_roundToInt, roundingMode, exact );
+ break;
+ case EXTF80_ADD:
+ trueFunction_abz_extF80M = slow_extF80M_add;
+ subjFunction_abz_extF80M = extF80M_add;
+ goto test_abz_extF80;
+ case EXTF80_SUB:
+ trueFunction_abz_extF80M = slow_extF80M_sub;
+ subjFunction_abz_extF80M = extF80M_sub;
+ goto test_abz_extF80;
+ case EXTF80_MUL:
+ trueFunction_abz_extF80M = slow_extF80M_mul;
+ subjFunction_abz_extF80M = extF80M_mul;
+ goto test_abz_extF80;
+ case EXTF80_DIV:
+ trueFunction_abz_extF80M = slow_extF80M_div;
+ subjFunction_abz_extF80M = extF80M_div;
+ goto test_abz_extF80;
+ case EXTF80_REM:
+ trueFunction_abz_extF80M = slow_extF80M_rem;
+ subjFunction_abz_extF80M = extF80M_rem;
+ test_abz_extF80:
+ test_abz_extF80( trueFunction_abz_extF80M, subjFunction_abz_extF80M );
+ break;
+ case EXTF80_SQRT:
+ test_az_extF80( slow_extF80M_sqrt, extF80M_sqrt );
+ break;
+ case EXTF80_EQ:
+ trueFunction_ab_extF80M_z_bool = slow_extF80M_eq;
+ subjFunction_ab_extF80M_z_bool = extF80M_eq;
+ goto test_ab_extF80_z_bool;
+ case EXTF80_LE:
+ trueFunction_ab_extF80M_z_bool = slow_extF80M_le;
+ subjFunction_ab_extF80M_z_bool = extF80M_le;
+ goto test_ab_extF80_z_bool;
+ case EXTF80_LT:
+ trueFunction_ab_extF80M_z_bool = slow_extF80M_lt;
+ subjFunction_ab_extF80M_z_bool = extF80M_lt;
+ goto test_ab_extF80_z_bool;
+ case EXTF80_EQ_SIGNALING:
+ trueFunction_ab_extF80M_z_bool = slow_extF80M_eq_signaling;
+ subjFunction_ab_extF80M_z_bool = extF80M_eq_signaling;
+ goto test_ab_extF80_z_bool;
+ case EXTF80_LE_QUIET:
+ trueFunction_ab_extF80M_z_bool = slow_extF80M_le_quiet;
+ subjFunction_ab_extF80M_z_bool = extF80M_le_quiet;
+ goto test_ab_extF80_z_bool;
+ case EXTF80_LT_QUIET:
+ trueFunction_ab_extF80M_z_bool = slow_extF80M_lt_quiet;
+ subjFunction_ab_extF80M_z_bool = extF80M_lt_quiet;
+ test_ab_extF80_z_bool:
+ test_ab_extF80_z_bool(
+ trueFunction_ab_extF80M_z_bool, subjFunction_ab_extF80M_z_bool );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef FLOAT128
+ case F128_TO_UI32:
+ test_a_f128_z_ui32_rx(
+ slow_f128M_to_ui32, f128M_to_ui32, roundingMode, exact );
+ break;
+ case F128_TO_UI64:
+ test_a_f128_z_ui64_rx(
+ slow_f128M_to_ui64, f128M_to_ui64, roundingMode, exact );
+ break;
+ case F128_TO_I32:
+ test_a_f128_z_i32_rx(
+ slow_f128M_to_i32, f128M_to_i32, roundingMode, exact );
+ break;
+ case F128_TO_I64:
+ test_a_f128_z_i64_rx(
+ slow_f128M_to_i64, f128M_to_i64, roundingMode, exact );
+ break;
+ case F128_TO_UI32_R_MINMAG:
+ test_a_f128_z_ui32_x(
+ slow_f128M_to_ui32_r_minMag, f128M_to_ui32_r_minMag, exact );
+ break;
+ case F128_TO_UI64_R_MINMAG:
+ test_a_f128_z_ui64_x(
+ slow_f128M_to_ui64_r_minMag, f128M_to_ui64_r_minMag, exact );
+ break;
+ case F128_TO_I32_R_MINMAG:
+ test_a_f128_z_i32_x(
+ slow_f128M_to_i32_r_minMag, f128M_to_i32_r_minMag, exact );
+ break;
+ case F128_TO_I64_R_MINMAG:
+ test_a_f128_z_i64_x(
+ slow_f128M_to_i64_r_minMag, f128M_to_i64_r_minMag, exact );
+ break;
+ case F128_TO_F32:
+ test_a_f128_z_f32( slow_f128M_to_f32, f128M_to_f32 );
+ break;
+ case F128_TO_F64:
+ test_a_f128_z_f64( slow_f128M_to_f64, f128M_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case F128_TO_EXTF80:
+ test_a_f128_z_extF80( slow_f128M_to_extF80M, f128M_to_extF80M );
+ break;
+#endif
+ case F128_ROUNDTOINT:
+ test_az_f128_rx(
+ slow_f128M_roundToInt, f128M_roundToInt, roundingMode, exact );
+ break;
+ case F128_ADD:
+ trueFunction_abz_f128M = slow_f128M_add;
+ subjFunction_abz_f128M = f128M_add;
+ goto test_abz_f128;
+ case F128_SUB:
+ trueFunction_abz_f128M = slow_f128M_sub;
+ subjFunction_abz_f128M = f128M_sub;
+ goto test_abz_f128;
+ case F128_MUL:
+ trueFunction_abz_f128M = slow_f128M_mul;
+ subjFunction_abz_f128M = f128M_mul;
+ goto test_abz_f128;
+ case F128_DIV:
+ trueFunction_abz_f128M = slow_f128M_div;
+ subjFunction_abz_f128M = f128M_div;
+ goto test_abz_f128;
+ case F128_REM:
+ trueFunction_abz_f128M = slow_f128M_rem;
+ subjFunction_abz_f128M = f128M_rem;
+ test_abz_f128:
+ test_abz_f128( trueFunction_abz_f128M, subjFunction_abz_f128M );
+ break;
+ case F128_MULADD:
+ test_abcz_f128( slow_f128M_mulAdd, f128M_mulAdd );
+ break;
+ case F128_SQRT:
+ test_az_f128( slow_f128M_sqrt, f128M_sqrt );
+ break;
+ case F128_EQ:
+ trueFunction_ab_f128M_z_bool = slow_f128M_eq;
+ subjFunction_ab_f128M_z_bool = f128M_eq;
+ goto test_ab_f128_z_bool;
+ case F128_LE:
+ trueFunction_ab_f128M_z_bool = slow_f128M_le;
+ subjFunction_ab_f128M_z_bool = f128M_le;
+ goto test_ab_f128_z_bool;
+ case F128_LT:
+ trueFunction_ab_f128M_z_bool = slow_f128M_lt;
+ subjFunction_ab_f128M_z_bool = f128M_lt;
+ goto test_ab_f128_z_bool;
+ case F128_EQ_SIGNALING:
+ trueFunction_ab_f128M_z_bool = slow_f128M_eq_signaling;
+ subjFunction_ab_f128M_z_bool = f128M_eq_signaling;
+ goto test_ab_f128_z_bool;
+ case F128_LE_QUIET:
+ trueFunction_ab_f128M_z_bool = slow_f128M_le_quiet;
+ subjFunction_ab_f128M_z_bool = f128M_le_quiet;
+ goto test_ab_f128_z_bool;
+ case F128_LT_QUIET:
+ trueFunction_ab_f128M_z_bool = slow_f128M_lt_quiet;
+ subjFunction_ab_f128M_z_bool = f128M_lt_quiet;
+ test_ab_f128_z_bool:
+ test_ab_f128_z_bool(
+ trueFunction_ab_f128M_z_bool, subjFunction_ab_f128M_z_bool );
+ break;
+#endif
+ }
+ if ( (verCases_errorStop && verCases_anyErrors) || verCases_stop ) {
+ verCases_exitWithStatus();
+ }
+
+}
+
+enum { EXACT_FALSE = 1, EXACT_TRUE };
+
+static
+ void
+ testFunction(
+ int functionCode,
+ uint_fast8_t roundingPrecisionIn,
+ int roundingCodeIn,
+ int tininessCodeIn,
+ int exactCodeIn
+ )
+{
+ int functionAttribs;
+ uint_fast8_t roundingPrecision;
+ int roundingCode;
+ uint_fast8_t roundingMode;
+ int exactCode;
+ bool exact;
+ int tininessCode;
+ uint_fast8_t tininessMode;
+
+ functionAttribs = functionInfos[functionCode].attribs;
+ verCases_functionNamePtr = functionInfos[functionCode].namePtr;
+ roundingPrecision = 32;
+ for (;;) {
+ if ( ! (functionAttribs & FUNC_EFF_ROUNDINGPRECISION) ) {
+ roundingPrecision = 0;
+ } else if ( roundingPrecisionIn ) {
+ roundingPrecision = roundingPrecisionIn;
+ }
+#ifdef EXTFLOAT80
+ verCases_roundingPrecision = roundingPrecision;
+ if ( roundingPrecision ) {
+ slow_extF80_roundingPrecision = roundingPrecision;
+ extF80_roundingPrecision = roundingPrecision;
+ }
+#endif
+ for (
+ roundingCode = 1; roundingCode < NUM_ROUNDINGMODES; ++roundingCode
+ ) {
+ if (
+ ! (functionAttribs
+ & (FUNC_ARG_ROUNDINGMODE | FUNC_EFF_ROUNDINGMODE))
+ ) {
+ roundingCode = 0;
+ } else if ( roundingCodeIn ) {
+ roundingCode = roundingCodeIn;
+ }
+ verCases_roundingCode = roundingCode;
+ if ( roundingCode ) {
+ roundingMode = roundingModes[roundingCode];
+ if ( functionAttribs & FUNC_EFF_ROUNDINGMODE ) {
+ slowfloat_roundingMode = roundingMode;
+ softfloat_roundingMode = roundingMode;
+ }
+ }
+ for (
+ exactCode = EXACT_FALSE; exactCode <= EXACT_TRUE; ++exactCode
+ ) {
+ if ( ! (functionAttribs & FUNC_ARG_EXACT) ) {
+ exactCode = 0;
+ } else if ( exactCodeIn ) {
+ exactCode = exactCodeIn;
+ }
+ exact = (exactCode == EXACT_TRUE);
+ verCases_usesExact = (exactCode != 0);
+ verCases_exact = exact;
+ for (
+ tininessCode = 1;
+ tininessCode < NUM_TININESSMODES;
+ ++tininessCode
+ ) {
+ if (
+ ! (functionAttribs
+ & (roundingPrecision && (roundingPrecision < 80)
+ ? FUNC_EFF_TININESSMODE_REDUCEDPREC
+ : FUNC_EFF_TININESSMODE))
+ ) {
+ tininessCode = 0;
+ } else if ( tininessCodeIn ) {
+ tininessCode = tininessCodeIn;
+ }
+ verCases_tininessCode = tininessCode;
+ if ( tininessCode ) {
+ tininessMode = tininessModes[tininessCode];
+ slowfloat_detectTininess = tininessMode;
+ softfloat_detectTininess = tininessMode;
+ }
+ testFunctionInstance( functionCode, roundingMode, exact );
+ if ( tininessCodeIn || ! tininessCode ) break;
+ }
+ if ( exactCodeIn || ! exactCode ) break;
+ }
+ if ( roundingCodeIn || ! roundingCode ) break;
+ }
+ if ( roundingPrecisionIn || ! roundingPrecision ) break;
+ if ( roundingPrecision == 80 ) {
+ break;
+ } else if ( roundingPrecision == 64 ) {
+ roundingPrecision = 80;
+ } else if ( roundingPrecision == 32 ) {
+ roundingPrecision = 64;
+ }
+ }
+
+}
+
+int main( int argc, char *argv[] )
+{
+ bool haveFunctionArg;
+ int functionCode, numOperands;
+ uint_fast8_t roundingPrecision;
+ int roundingCode, tininessCode, exactCode;
+ const char *argPtr;
+ long i;
+
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ fail_programName = "testsoftfloat";
+ if ( argc <= 1 ) goto writeHelpMessage;
+ genCases_setLevel( 1 );
+ verCases_maxErrorCount = 20;
+ testLoops_trueFlagsPtr = &slowfloat_exceptionFlags;
+ testLoops_subjFlagsFunction = softfloat_clearExceptionFlags;
+ haveFunctionArg = false;
+ functionCode = 0;
+ numOperands = 0;
+ roundingPrecision = 0;
+ roundingCode = 0;
+ tininessCode = 0;
+ exactCode = 0;
+ for (;;) {
+ --argc;
+ if ( ! argc ) break;
+ argPtr = *++argv;
+ if ( ! argPtr ) break;
+ if ( argPtr[0] == '-' ) ++argPtr;
+ if (
+ ! strcmp( argPtr, "help" ) || ! strcmp( argPtr, "-help" )
+ || ! strcmp( argPtr, "h" )
+ ) {
+ writeHelpMessage:
+ fputs(
+"testsoftfloat [<option>...] <function>\n"
+" <option>: (* is default)\n"
+" -help --Write this message and exit.\n"
+" -level <num> --Testing level <num> (1 or 2).\n"
+" * -level 1\n"
+" -errors <num> --Stop each function test after <num> errors.\n"
+" * -errors 20\n"
+" -errorstop --Exit after first function with any error.\n"
+" -forever --Test one function repeatedly (implies `-level 2').\n"
+#ifdef EXTFLOAT80
+" -precision32 --For extF80, test only 32-bit rounding precision.\n"
+" -precision64 --For extF80, test only 64-bit rounding precision.\n"
+" -precision80 --For extF80, test only 80-bit rounding precision.\n"
+#endif
+" -rnear_even --Test only rounding to nearest/even.\n"
+" -rminMag --Test only rounding to minimum magnitude (toward zero).\n"
+" -rmin --Test only rounding to minimum (down).\n"
+" -rmax --Test only rounding to maximum (up).\n"
+" -rnear_maxMag --Test only rounding to nearest/maximum magnitude\n"
+" (nearest/away).\n"
+" -tininessbefore --Test only underflow tininess detected before rounding.\n"
+" -tininessafter --Test only underflow tininess detected after rounding.\n"
+" -notexact --Test only non-exact rounding to integer (no inexact\n"
+" exceptions).\n"
+" -exact --Test only exact rounding to integer (raising inexact\n"
+" exceptions).\n"
+" <function>:\n"
+" <int>_to_<float> <float>_add <float>_eq\n"
+" <float>_to_<int> <float>_sub <float>_le\n"
+" <float>_to_<int>_r_minMag <float>_mul <float>_lt\n"
+" <float>_to_<float> <float>_mulAdd <float>_eq_signaling\n"
+" <float>_roundToInt <float>_div <float>_le_quiet\n"
+" <float>_rem <float>_lt_quiet\n"
+" <float>_sqrt\n"
+" -all1 --All unary functions.\n"
+" -all2 --All binary functions.\n"
+" <int>:\n"
+" ui32 --Unsigned 32-bit integer.\n"
+" ui64 --Unsigned 64-bit integer.\n"
+" i32 --Signed 32-bit integer.\n"
+" i64 --Signed 64-bit integer.\n"
+" <float>:\n"
+" f32 --Binary 32-bit floating-point (single-precision).\n"
+" f64 --Binary 64-bit floating-point (double-precision).\n"
+#ifdef EXTFLOAT80
+" extF80 --Binary 80-bit extended floating-point.\n"
+#endif
+#ifdef FLOAT128
+" f128 --Binary 128-bit floating-point (quadruple-precision).\n"
+#endif
+ ,
+ stdout
+ );
+ return EXIT_SUCCESS;
+ } else if ( ! strcmp( argPtr, "level" ) ) {
+ if ( argc < 2 ) goto optionError;
+ i = strtol( argv[1], (char **) &argPtr, 10 );
+ if ( *argPtr ) goto optionError;
+ genCases_setLevel( i );
+ --argc;
+ ++argv;
+ } else if ( ! strcmp( argPtr, "level1" ) ) {
+ genCases_setLevel( 1 );
+ } else if ( ! strcmp( argPtr, "level2" ) ) {
+ genCases_setLevel( 2 );
+ } else if ( ! strcmp( argPtr, "errors" ) ) {
+ if ( argc < 2 ) goto optionError;
+ i = strtol( argv[1], (char **) &argPtr, 10 );
+ if ( *argPtr ) goto optionError;
+ verCases_maxErrorCount = i;
+ --argc;
+ ++argv;
+ } else if ( ! strcmp( argPtr, "errorstop" ) ) {
+ verCases_errorStop = true;
+ } else if ( ! strcmp( argPtr, "forever" ) ) {
+ genCases_setLevel( 2 );
+ testLoops_forever = true;
+#ifdef EXTFLOAT80
+ } else if ( ! strcmp( argPtr, "precision32" ) ) {
+ roundingPrecision = 32;
+ } else if ( ! strcmp( argPtr, "precision64" ) ) {
+ roundingPrecision = 64;
+ } else if ( ! strcmp( argPtr, "precision80" ) ) {
+ roundingPrecision = 80;
+#endif
+ } else if (
+ ! strcmp( argPtr, "rnear_even" )
+ || ! strcmp( argPtr, "rneareven" )
+ || ! strcmp( argPtr, "rnearest_even" )
+ ) {
+ roundingCode = ROUND_NEAR_EVEN;
+ } else if (
+ ! strcmp( argPtr, "rminmag" ) || ! strcmp( argPtr, "rminMag" )
+ ) {
+ roundingCode = ROUND_MINMAG;
+ } else if ( ! strcmp( argPtr, "rmin" ) ) {
+ roundingCode = ROUND_MIN;
+ } else if ( ! strcmp( argPtr, "rmax" ) ) {
+ roundingCode = ROUND_MAX;
+ } else if (
+ ! strcmp( argPtr, "rnear_maxmag" )
+ || ! strcmp( argPtr, "rnear_maxMag" )
+ || ! strcmp( argPtr, "rnearmaxmag" )
+ || ! strcmp( argPtr, "rnearest_maxmag" )
+ || ! strcmp( argPtr, "rnearest_maxMag" )
+ ) {
+ roundingCode = ROUND_NEAR_MAXMAG;
+ } else if ( ! strcmp( argPtr, "tininessbefore" ) ) {
+ tininessCode = TININESS_BEFORE_ROUNDING;
+ } else if ( ! strcmp( argPtr, "tininessafter" ) ) {
+ tininessCode = TININESS_AFTER_ROUNDING;
+ } else if ( ! strcmp( argPtr, "notexact" ) ) {
+ exactCode = EXACT_FALSE;
+ } else if ( ! strcmp( argPtr, "exact" ) ) {
+ exactCode = EXACT_TRUE;
+ } else if ( ! strcmp( argPtr, "all1" ) ) {
+ haveFunctionArg = true;
+ functionCode = 0;
+ numOperands = 1;
+ } else if ( ! strcmp( argPtr, "all2" ) ) {
+ haveFunctionArg = true;
+ functionCode = 0;
+ numOperands = 2;
+ } else {
+ functionCode = 1;
+ while ( strcmp( argPtr, functionInfos[functionCode].namePtr ) ) {
+ ++functionCode;
+ if ( functionCode == NUM_FUNCTIONS ) {
+ fail( "Invalid argument `%s'", *argv );
+ }
+ }
+ haveFunctionArg = true;
+ }
+ }
+ if ( ! haveFunctionArg ) fail( "Function argument required" );
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ signal( SIGINT, catchSIGINT );
+ signal( SIGTERM, catchSIGINT );
+ if ( functionCode ) {
+ if ( testLoops_forever ) {
+ if ( ! roundingPrecision ) roundingPrecision = 80;
+ if ( ! roundingCode ) roundingCode = ROUND_NEAR_EVEN;
+ }
+ testFunction(
+ functionCode,
+ roundingPrecision,
+ roundingCode,
+ tininessCode,
+ exactCode
+ );
+ } else {
+ if ( testLoops_forever ) {
+ fail( "Can test only one function with `-forever' option" );
+ }
+ if ( numOperands == 1 ) {
+ for (
+ functionCode = 1; functionCode < NUM_FUNCTIONS; ++functionCode
+ ) {
+ if ( functionInfos[functionCode].attribs & FUNC_ARG_UNARY ) {
+ testFunction(
+ functionCode,
+ roundingPrecision,
+ roundingCode,
+ tininessCode,
+ exactCode
+ );
+ }
+ }
+ } else {
+ for (
+ functionCode = 1; functionCode < NUM_FUNCTIONS; ++functionCode
+ ) {
+ if (
+ functionInfos[functionCode].attribs & FUNC_ARG_BINARY
+ ) {
+ testFunction(
+ functionCode,
+ roundingPrecision,
+ roundingCode,
+ tininessCode,
+ exactCode
+ );
+ }
+ }
+ }
+ }
+ verCases_exitWithStatus();
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ optionError:
+ fail( "`%s' option requires numeric argument", *argv );
+
+}
+
diff --git a/source/timesoftfloat.c b/source/timesoftfloat.c
new file mode 100644
index 0000000..c52a0a6
--- /dev/null
+++ b/source/timesoftfloat.c
@@ -0,0 +1,3958 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+#include "platform.h"
+#include "uint128.h"
+#include "fail.h"
+#include "softfloat.h"
+#include "functions.h"
+
+enum { minIterations = 1000 };
+
+static const char *functionNamePtr;
+static uint_fast8_t roundingPrecision;
+static int roundingCode;
+static int tininessCode;
+static bool usesExact;
+static bool exact;
+
+static void reportTime( int_fast64_t count, clock_t clockTicks )
+{
+ static const char *roundingModeNames[NUM_ROUNDINGMODES] = {
+ 0,
+ ", rounding near_even",
+ ", rounding minMag",
+ ", rounding min",
+ ", rounding max",
+ ", rounding near_maxMag"
+ };
+
+ printf(
+ "%9.4f Mop/s: %s",
+ count / ((float) clockTicks / CLOCKS_PER_SEC) / 1000000,
+ functionNamePtr
+ );
+ if ( roundingCode ) {
+#ifdef EXTFLOAT80
+ if ( roundingPrecision ) {
+ printf( ", precision %d", (int) roundingPrecision );
+ }
+#endif
+ fputs( roundingModeNames[roundingCode], stdout );
+ if ( tininessCode ) {
+ fputs(
+ (tininessCode == TININESS_BEFORE_ROUNDING)
+ ? ", tininess before rounding"
+ : ", tininess after rounding",
+ stdout
+ );
+ }
+ }
+ if ( usesExact ) fputs( exact ? ", exact" : ", not exact", stdout );
+ fputc( '\n', stdout );
+ fflush( stdout );
+
+}
+
+union ui32_f32 { uint32_t ui; float32_t f; };
+union ui64_f64 { uint64_t ui; float64_t f; };
+
+enum { numInputs_ui32 = 32 };
+
+static const uint32_t inputs_ui32[numInputs_ui32] = {
+ 0x00004487, 0x405CF80F, 0x00000000, 0x000002FC,
+ 0x000DFFFE, 0x0C8EF795, 0x0FFFEE01, 0x000006CA,
+ 0x00009BFE, 0x00B79D1D, 0x60001002, 0x00000049,
+ 0x0BFF7FFF, 0x0000F37A, 0x0011DFFE, 0x00000006,
+ 0x000FDFFA, 0x0000082F, 0x10200003, 0x2172089B,
+ 0x00003E02, 0x000019E8, 0x0008FFFE, 0x000004A4,
+ 0x00208002, 0x07C42FBF, 0x0FFFE3FF, 0x040B9F13,
+ 0x40000008, 0x0001BF56, 0x000017F6, 0x000A908A
+};
+
+static void time_a_ui32_z_f32( float32_t function( uint32_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_ui32[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_ui32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_ui32[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_ui32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_ui32_z_f64( float64_t function( uint32_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_ui32[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_ui32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_ui32[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_ui32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef EXTFLOAT80
+
+static void time_a_ui32_z_extF80( void function( uint32_t, extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_ui32[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_ui32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_ui32[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_ui32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void time_a_ui32_z_f128( void function( uint32_t, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_ui32[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_ui32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_ui32[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_ui32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+enum { numInputs_ui64 = 32 };
+
+static const int64_t inputs_ui64[numInputs_ui64] = {
+ UINT64_C( 0x04003C0000000001 ), UINT64_C( 0x0000000003C589BC ),
+ UINT64_C( 0x00000000400013FE ), UINT64_C( 0x0000000000186171 ),
+ UINT64_C( 0x0000000000010406 ), UINT64_C( 0x000002861920038D ),
+ UINT64_C( 0x0000000010001DFF ), UINT64_C( 0x22E5F0F387AEC8F0 ),
+ UINT64_C( 0x00007C0000010002 ), UINT64_C( 0x00756EBD1AD0C1C7 ),
+ UINT64_C( 0x0003FDFFFFFFFFBE ), UINT64_C( 0x0007D0FB2C2CA951 ),
+ UINT64_C( 0x0007FC0007FFFFFE ), UINT64_C( 0x0000001F942B18BB ),
+ UINT64_C( 0x0000080101FFFFFE ), UINT64_C( 0x000000000000F688 ),
+ UINT64_C( 0x000000000008BFFF ), UINT64_C( 0x0000000006F5AF08 ),
+ UINT64_C( 0x0021008000000002 ), UINT64_C( 0x0000000000000003 ),
+ UINT64_C( 0x3FFFFFFFFF80007D ), UINT64_C( 0x0000000000000078 ),
+ UINT64_C( 0x0007FFFFFF802003 ), UINT64_C( 0x1BBC775B78016AB0 ),
+ UINT64_C( 0x0006FFE000000002 ), UINT64_C( 0x0002B89854671BC1 ),
+ UINT64_C( 0x0000010001FFFFE2 ), UINT64_C( 0x00000000000FB103 ),
+ UINT64_C( 0x07FFFFFFFFFFF7FF ), UINT64_C( 0x00036155C7076FB0 ),
+ UINT64_C( 0x00000020FBFFFFFE ), UINT64_C( 0x0000099AE6455357 )
+};
+
+static void time_a_ui64_z_f32( float32_t function( uint64_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_ui64[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_ui64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_ui64[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_ui64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_ui64_z_f64( float64_t function( uint64_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_ui64[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_ui64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_ui64[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_ui64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef EXTFLOAT80
+
+static void time_a_ui64_z_extF80( void function( uint64_t, extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_ui64[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_ui64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_ui64[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_ui64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void time_a_ui64_z_f128( void function( uint64_t, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_ui64[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_ui64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_ui64[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_ui64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+enum { numInputs_i32 = 32 };
+
+static const int32_t inputs_i32[numInputs_i32] = {
+ -0x00004487, 0x405CF80F, 0x00000000, -0x000002FC,
+ -0x000DFFFE, 0x0C8EF795, -0x0FFFEE01, 0x000006CA,
+ 0x00009BFE, -0x00B79D1D, -0x60001002, -0x00000049,
+ 0x0BFF7FFF, 0x0000F37A, 0x0011DFFE, 0x00000006,
+ -0x000FDFFA, -0x0000082F, 0x10200003, -0x2172089B,
+ 0x00003E02, 0x000019E8, 0x0008FFFE, -0x000004A4,
+ -0x00208002, 0x07C42FBF, 0x0FFFE3FF, 0x040B9F13,
+ -0x40000008, 0x0001BF56, 0x000017F6, 0x000A908A
+};
+
+static void time_a_i32_z_f32( float32_t function( int32_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_i32[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_i32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_i32[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_i32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_i32_z_f64( float64_t function( int32_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_i32[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_i32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_i32[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_i32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef EXTFLOAT80
+
+static void time_a_i32_z_extF80( void function( int32_t, extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_i32[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_i32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_i32[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_i32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void time_a_i32_z_f128( void function( int32_t, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_i32[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_i32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_i32[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_i32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+enum { numInputs_i64 = 32 };
+
+static const int64_t inputs_i64[numInputs_i64] = {
+ -INT64_C( 0x04003C0000000001 ), INT64_C( 0x0000000003C589BC ),
+ INT64_C( 0x00000000400013FE ), INT64_C( 0x0000000000186171 ),
+ -INT64_C( 0x0000000000010406 ), -INT64_C( 0x000002861920038D ),
+ INT64_C( 0x0000000010001DFF ), -INT64_C( 0x22E5F0F387AEC8F0 ),
+ -INT64_C( 0x00007C0000010002 ), INT64_C( 0x00756EBD1AD0C1C7 ),
+ INT64_C( 0x0003FDFFFFFFFFBE ), INT64_C( 0x0007D0FB2C2CA951 ),
+ INT64_C( 0x0007FC0007FFFFFE ), INT64_C( 0x0000001F942B18BB ),
+ INT64_C( 0x0000080101FFFFFE ), -INT64_C( 0x000000000000F688 ),
+ INT64_C( 0x000000000008BFFF ), INT64_C( 0x0000000006F5AF08 ),
+ -INT64_C( 0x0021008000000002 ), INT64_C( 0x0000000000000003 ),
+ INT64_C( 0x3FFFFFFFFF80007D ), INT64_C( 0x0000000000000078 ),
+ -INT64_C( 0x0007FFFFFF802003 ), INT64_C( 0x1BBC775B78016AB0 ),
+ -INT64_C( 0x0006FFE000000002 ), -INT64_C( 0x0002B89854671BC1 ),
+ -INT64_C( 0x0000010001FFFFE2 ), -INT64_C( 0x00000000000FB103 ),
+ INT64_C( 0x07FFFFFFFFFFF7FF ), -INT64_C( 0x00036155C7076FB0 ),
+ INT64_C( 0x00000020FBFFFFFE ), INT64_C( 0x0000099AE6455357 )
+};
+
+static void time_a_i64_z_f32( float32_t function( int64_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_i64[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_i64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_i64[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_i64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_i64_z_f64( float64_t function( int64_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_i64[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_i64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_i64[inputNum] );
+ inputNum = (inputNum + 1) & (numInputs_i64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef EXTFLOAT80
+
+static void time_a_i64_z_extF80( void function( int64_t, extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_i64[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_i64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_i64[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_i64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void time_a_i64_z_f128( void function( int64_t, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( inputs_i64[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_i64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( inputs_i64[inputNum], &z );
+ inputNum = (inputNum + 1) & (numInputs_i64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+enum { numInputs_f32 = 32 };
+
+static const uint32_t inputs_F32UI[numInputs_f32] = {
+ 0x4EFA0000, 0xC1D0B328, 0x80000000, 0x3E69A31E,
+ 0xAF803EFF, 0x3F800000, 0x17BF8000, 0xE74A301A,
+ 0x4E010003, 0x7EE3C75D, 0xBD803FE0, 0xBFFEFF00,
+ 0x7981F800, 0x431FFFFC, 0xC100C000, 0x3D87EFFF,
+ 0x4103FEFE, 0xBC000007, 0xBF01F7FF, 0x4E6C6B5C,
+ 0xC187FFFE, 0xC58B9F13, 0x4F88007F, 0xDF004007,
+ 0xB7FFD7FE, 0x7E8001FB, 0x46EFFBFF, 0x31C10000,
+ 0xDB428661, 0x33F89B1F, 0xA3BFEFFF, 0x537BFFBE
+};
+
+static
+ void
+ time_a_f32_z_ui32_rx(
+ uint_fast32_t function( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f32_z_ui64_rx(
+ uint_fast64_t function( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f32_z_i32_rx(
+ int_fast32_t function( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f32_z_i64_rx(
+ int_fast64_t function( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f32_z_ui32_x( uint_fast32_t function( float32_t, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f32_z_ui64_x( uint_fast64_t function( float32_t, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f32_z_i32_x( int_fast32_t function( float32_t, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f32_z_i64_x( int_fast64_t function( float32_t, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_f32_z_f64( float64_t function( float32_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef EXTFLOAT80
+
+static void time_a_f32_z_extF80( void function( float32_t, extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void time_a_f32_z_f128( void function( float32_t, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+static
+ void
+ time_az_f32_rx(
+ float32_t function( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_abz_f32( float32_t function( float32_t, float32_t ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA, uB;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNumA];
+ uB.ui = inputs_F32UI[inputNumB];
+ function( uA.f, uB.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f32 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNumA];
+ uB.ui = inputs_F32UI[inputNumB];
+ function( uA.f, uB.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f32 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void time_abcz_f32( float32_t function( float32_t, float32_t, float32_t ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB, inputNumC;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA, uB, uC;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ inputNumC = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNumA];
+ uB.ui = inputs_F32UI[inputNumB];
+ uC.ui = inputs_F32UI[inputNumC];
+ function( uA.f, uB.f, uC.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f32 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f32 - 1);
+ if ( ! inputNumB ) ++inputNumC;
+ inputNumC = (inputNumC + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ inputNumC = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNumA];
+ uB.ui = inputs_F32UI[inputNumB];
+ uC.ui = inputs_F32UI[inputNumC];
+ function( uA.f, uB.f, uC.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f32 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f32 - 1);
+ if ( ! inputNumB ) ++inputNumC;
+ inputNumC = (inputNumC + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_ab_f32_z_bool( bool function( float32_t, float32_t ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA, uB;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI[inputNumA];
+ uB.ui = inputs_F32UI[inputNumB];
+ function( uA.f, uB.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f32 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI[inputNumA];
+ uB.ui = inputs_F32UI[inputNumB];
+ function( uA.f, uB.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f32 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static const uint32_t inputs_F32UI_pos[numInputs_f32] = {
+ 0x4EFA0000, 0x41D0B328, 0x00000000, 0x3E69A31E,
+ 0x2F803EFF, 0x3F800000, 0x17BF8000, 0x674A301A,
+ 0x4E010003, 0x7EE3C75D, 0x3D803FE0, 0x3FFEFF00,
+ 0x7981F800, 0x431FFFFC, 0x4100C000, 0x3D87EFFF,
+ 0x4103FEFE, 0x3C000007, 0x3F01F7FF, 0x4E6C6B5C,
+ 0x4187FFFE, 0x458B9F13, 0x4F88007F, 0x5F004007,
+ 0x37FFD7FE, 0x7E8001FB, 0x46EFFBFF, 0x31C10000,
+ 0x5B428661, 0x33F89B1F, 0x23BFEFFF, 0x537BFFBE
+};
+
+static void time_az_f32_pos( float32_t function( float32_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui32_f32 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F32UI_pos[inputNum];
+ function( uA.f );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F32UI_pos[inputNum];
+ function( uA.f );
+ inputNum = (inputNum + 1) & (numInputs_f32 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+enum { numInputs_f64 = 32 };
+
+static const uint64_t inputs_F64UI[numInputs_f64] = {
+ UINT64_C( 0x422FFFC008000000 ),
+ UINT64_C( 0xB7E0000480000000 ),
+ UINT64_C( 0xF3FD2546120B7935 ),
+ UINT64_C( 0x3FF0000000000000 ),
+ UINT64_C( 0xCE07F766F09588D6 ),
+ UINT64_C( 0x8000000000000000 ),
+ UINT64_C( 0x3FCE000400000000 ),
+ UINT64_C( 0x8313B60F0032BED8 ),
+ UINT64_C( 0xC1EFFFFFC0002000 ),
+ UINT64_C( 0x3FB3C75D224F2B0F ),
+ UINT64_C( 0x7FD00000004000FF ),
+ UINT64_C( 0xA12FFF8000001FFF ),
+ UINT64_C( 0x3EE0000000FE0000 ),
+ UINT64_C( 0x0010000080000004 ),
+ UINT64_C( 0x41CFFFFE00000020 ),
+ UINT64_C( 0x40303FFFFFFFFFFD ),
+ UINT64_C( 0x3FD000003FEFFFFF ),
+ UINT64_C( 0xBFD0000010000000 ),
+ UINT64_C( 0xB7FC6B5C16CA55CF ),
+ UINT64_C( 0x413EEB940B9D1301 ),
+ UINT64_C( 0xC7E00200001FFFFF ),
+ UINT64_C( 0x47F00021FFFFFFFE ),
+ UINT64_C( 0xBFFFFFFFF80000FF ),
+ UINT64_C( 0xC07FFFFFE00FFFFF ),
+ UINT64_C( 0x001497A63740C5E8 ),
+ UINT64_C( 0xC4BFFFE0001FFFFF ),
+ UINT64_C( 0x96FFDFFEFFFFFFFF ),
+ UINT64_C( 0x403FC000000001FE ),
+ UINT64_C( 0xFFD00000000001F6 ),
+ UINT64_C( 0x0640400002000000 ),
+ UINT64_C( 0x479CEE1E4F789FE0 ),
+ UINT64_C( 0xC237FFFFFFFFFDFE )
+};
+
+static
+ void
+ time_a_f64_z_ui32_rx(
+ uint_fast32_t function( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f64_z_ui64_rx(
+ uint_fast64_t function( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f64_z_i32_rx(
+ int_fast32_t function( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f64_z_i64_rx(
+ int_fast64_t function( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f64_z_ui32_x( uint_fast32_t function( float64_t, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f64_z_ui64_x( uint_fast64_t function( float64_t, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f64_z_i32_x( int_fast32_t function( float64_t, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f64_z_i64_x( int_fast64_t function( float64_t, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_f64_z_f32( float32_t function( float64_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef EXTFLOAT80
+
+static void time_a_f64_z_extF80( void function( float64_t, extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void time_a_f64_z_f128( void function( float64_t, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+static
+ void
+ time_az_f64_rx(
+ float64_t function( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNum];
+ function( uA.f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_abz_f64( float64_t function( float64_t, float64_t ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA, uB;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNumA];
+ uB.ui = inputs_F64UI[inputNumB];
+ function( uA.f, uB.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f64 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNumA];
+ uB.ui = inputs_F64UI[inputNumB];
+ function( uA.f, uB.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f64 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void time_abcz_f64( float64_t function( float64_t, float64_t, float64_t ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB, inputNumC;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA, uB, uC;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ inputNumC = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNumA];
+ uB.ui = inputs_F64UI[inputNumB];
+ uC.ui = inputs_F64UI[inputNumC];
+ function( uA.f, uB.f, uC.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f64 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f64 - 1);
+ if ( ! inputNumB ) ++inputNumC;
+ inputNumC = (inputNumC + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ inputNumC = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNumA];
+ uB.ui = inputs_F64UI[inputNumB];
+ uC.ui = inputs_F64UI[inputNumC];
+ function( uA.f, uB.f, uC.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f64 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f64 - 1);
+ if ( ! inputNumB ) ++inputNumC;
+ inputNumC = (inputNumC + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_ab_f64_z_bool( bool function( float64_t, float64_t ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA, uB;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI[inputNumA];
+ uB.ui = inputs_F64UI[inputNumB];
+ function( uA.f, uB.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f64 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI[inputNumA];
+ uB.ui = inputs_F64UI[inputNumB];
+ function( uA.f, uB.f );
+ inputNumA = (inputNumA + 1) & (numInputs_f64 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static const uint64_t inputs_F64UI_pos[numInputs_f64] = {
+ UINT64_C( 0x422FFFC008000000 ),
+ UINT64_C( 0x37E0000480000000 ),
+ UINT64_C( 0x73FD2546120B7935 ),
+ UINT64_C( 0x3FF0000000000000 ),
+ UINT64_C( 0x4E07F766F09588D6 ),
+ UINT64_C( 0x0000000000000000 ),
+ UINT64_C( 0x3FCE000400000000 ),
+ UINT64_C( 0x0313B60F0032BED8 ),
+ UINT64_C( 0x41EFFFFFC0002000 ),
+ UINT64_C( 0x3FB3C75D224F2B0F ),
+ UINT64_C( 0x7FD00000004000FF ),
+ UINT64_C( 0x212FFF8000001FFF ),
+ UINT64_C( 0x3EE0000000FE0000 ),
+ UINT64_C( 0x0010000080000004 ),
+ UINT64_C( 0x41CFFFFE00000020 ),
+ UINT64_C( 0x40303FFFFFFFFFFD ),
+ UINT64_C( 0x3FD000003FEFFFFF ),
+ UINT64_C( 0x3FD0000010000000 ),
+ UINT64_C( 0x37FC6B5C16CA55CF ),
+ UINT64_C( 0x413EEB940B9D1301 ),
+ UINT64_C( 0x47E00200001FFFFF ),
+ UINT64_C( 0x47F00021FFFFFFFE ),
+ UINT64_C( 0x3FFFFFFFF80000FF ),
+ UINT64_C( 0x407FFFFFE00FFFFF ),
+ UINT64_C( 0x001497A63740C5E8 ),
+ UINT64_C( 0x44BFFFE0001FFFFF ),
+ UINT64_C( 0x16FFDFFEFFFFFFFF ),
+ UINT64_C( 0x403FC000000001FE ),
+ UINT64_C( 0x7FD00000000001F6 ),
+ UINT64_C( 0x0640400002000000 ),
+ UINT64_C( 0x479CEE1E4F789FE0 ),
+ UINT64_C( 0x4237FFFFFFFFFDFE )
+};
+
+static void time_az_f64_pos( float64_t function( float64_t ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ union ui64_f64 uA;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ uA.ui = inputs_F64UI_pos[inputNum];
+ function( uA.f );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ uA.ui = inputs_F64UI_pos[inputNum];
+ function( uA.f );
+ inputNum = (inputNum + 1) & (numInputs_f64 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef EXTFLOAT80
+
+#ifdef LITTLEENDIAN
+#define extF80Const( v64, v0 ) { UINT64_C( v0 ), v64 }
+#else
+#define extF80Const( v64, v0 ) { v64, UINT64_C( v0 ) }
+#endif
+
+enum { numInputs_extF80 = 32 };
+
+static
+ const union { struct extFloat80M s; extFloat80_t f; }
+ inputs_extF80[numInputs_extF80] = {
+ extF80Const( 0xC03F, 0xA9BE15A19C1E8B62 ),
+ extF80Const( 0x8000, 0x0000000000000000 ),
+ extF80Const( 0x75A8, 0xE59591E4788957A5 ),
+ extF80Const( 0xBFFF, 0xFFF0000000000040 ),
+ extF80Const( 0x0CD8, 0xFC000000000007FE ),
+ extF80Const( 0x43BA, 0x99A4000000000000 ),
+ extF80Const( 0x3FFF, 0x8000000000000000 ),
+ extF80Const( 0x4081, 0x94FBF1BCEB5545F0 ),
+ extF80Const( 0x403E, 0xFFF0000000002000 ),
+ extF80Const( 0x3FFE, 0xC860E3C75D224F28 ),
+ extF80Const( 0x407E, 0xFC00000FFFFFFFFE ),
+ extF80Const( 0x737A, 0x800000007FFDFFFE ),
+ extF80Const( 0x4044, 0xFFFFFF80000FFFFF ),
+ extF80Const( 0xBBFE, 0x8000040000001FFE ),
+ extF80Const( 0xC002, 0xFF80000000000020 ),
+ extF80Const( 0xDE8D, 0xFFFFFFFFFFE00004 ),
+ extF80Const( 0xC004, 0x8000000000003FFB ),
+ extF80Const( 0x407F, 0x800000000003FFFE ),
+ extF80Const( 0xC000, 0xA459EE6A5C16CA55 ),
+ extF80Const( 0x8003, 0xC42CBF7399AEEB94 ),
+ extF80Const( 0xBF7F, 0xF800000000000006 ),
+ extF80Const( 0xC07F, 0xBF56BE8871F28FEA ),
+ extF80Const( 0xC07E, 0xFFFF77FFFFFFFFFE ),
+ extF80Const( 0xADC9, 0x8000000FFFFFFFDE ),
+ extF80Const( 0xC001, 0xEFF7FFFFFFFFFFFF ),
+ extF80Const( 0x4001, 0xBE84F30125C497A6 ),
+ extF80Const( 0xC06B, 0xEFFFFFFFFFFFFFFF ),
+ extF80Const( 0x4080, 0xFFFFFFFFBFFFFFFF ),
+ extF80Const( 0x87E9, 0x81FFFFFFFFFFFBFF ),
+ extF80Const( 0xA63F, 0x801FFFFFFEFFFFFE ),
+ extF80Const( 0x403C, 0x801FFFFFFFF7FFFF ),
+ extF80Const( 0x4018, 0x8000000000080003 )
+};
+
+static
+ void
+ time_a_extF80_z_ui32_rx(
+ uint_fast32_t function( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_extF80_z_ui64_rx(
+ uint_fast64_t function( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_extF80_z_i32_rx(
+ int_fast32_t function( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_extF80_z_i64_rx(
+ int_fast64_t function( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_extF80_z_ui32_x(
+ uint_fast32_t function( const extFloat80_t *, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_extF80_z_ui64_x(
+ uint_fast64_t function( const extFloat80_t *, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_extF80_z_i32_x(
+ int_fast32_t function( const extFloat80_t *, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_extF80_z_i64_x(
+ int_fast64_t function( const extFloat80_t *, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_extF80_z_f32( float32_t function( const extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_extF80_z_f64( float64_t function( const extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef FLOAT128
+
+static
+ void
+ time_a_extF80_z_f128( void function( const extFloat80_t *, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, &z );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, &z );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+static
+ void
+ time_az_extF80_rx(
+ void
+ function( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact, &z );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, roundingMode, exact, &z );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_abz_extF80(
+ void
+ function( const extFloat80_t *, const extFloat80_t *, extFloat80_t * )
+ )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function(
+ &inputs_extF80[inputNumA].f, &inputs_extF80[inputNumB].f, &z );
+ inputNumA = (inputNumA + 1) & (numInputs_extF80 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function(
+ &inputs_extF80[inputNumA].f, &inputs_extF80[inputNumB].f, &z );
+ inputNumA = (inputNumA + 1) & (numInputs_extF80 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_abcz_extF80(
+ void
+ function(
+ const extFloat80_t *,
+ const extFloat80_t *,
+ const extFloat80_t *,
+ extFloat80_t *
+ )
+ )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB, inputNumC;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ inputNumC = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function(
+ &inputs_extF80[inputNumA].f,
+ &inputs_extF80[inputNumB].f,
+ &inputs_extF80[inputNumC].f,
+ &z
+ );
+ inputNumA = (inputNumA + 1) & (numInputs_extF80 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_extF80 - 1);
+ if ( ! inputNumB ) ++inputNumC;
+ inputNumC = (inputNumC + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ inputNumC = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function(
+ &inputs_extF80[inputNumA].f,
+ &inputs_extF80[inputNumB].f,
+ &inputs_extF80[inputNumC].f,
+ &z
+ );
+ inputNumA = (inputNumA + 1) & (numInputs_extF80 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_extF80 - 1);
+ if ( ! inputNumB ) ++inputNumC;
+ inputNumC = (inputNumC + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_ab_extF80_z_bool(
+ bool function( const extFloat80_t *, const extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function(
+ &inputs_extF80[inputNumA].f, &inputs_extF80[inputNumB].f );
+ inputNumA = (inputNumA + 1) & (numInputs_extF80 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNumA].f, &inputs_extF80[inputNumB].f );
+ inputNumA = (inputNumA + 1) & (numInputs_extF80 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ const union { struct extFloat80M s; extFloat80_t f; }
+ inputs_extF80_pos[numInputs_extF80] = {
+ extF80Const( 0x403F, 0xA9BE15A19C1E8B62 ),
+ extF80Const( 0x0000, 0x0000000000000000 ),
+ extF80Const( 0x75A8, 0xE59591E4788957A5 ),
+ extF80Const( 0x3FFF, 0xFFF0000000000040 ),
+ extF80Const( 0x0CD8, 0xFC000000000007FE ),
+ extF80Const( 0x43BA, 0x99A4000000000000 ),
+ extF80Const( 0x3FFF, 0x8000000000000000 ),
+ extF80Const( 0x4081, 0x94FBF1BCEB5545F0 ),
+ extF80Const( 0x403E, 0xFFF0000000002000 ),
+ extF80Const( 0x3FFE, 0xC860E3C75D224F28 ),
+ extF80Const( 0x407E, 0xFC00000FFFFFFFFE ),
+ extF80Const( 0x737A, 0x800000007FFDFFFE ),
+ extF80Const( 0x4044, 0xFFFFFF80000FFFFF ),
+ extF80Const( 0x3BFE, 0x8000040000001FFE ),
+ extF80Const( 0x4002, 0xFF80000000000020 ),
+ extF80Const( 0x5E8D, 0xFFFFFFFFFFE00004 ),
+ extF80Const( 0x4004, 0x8000000000003FFB ),
+ extF80Const( 0x407F, 0x800000000003FFFE ),
+ extF80Const( 0x4000, 0xA459EE6A5C16CA55 ),
+ extF80Const( 0x0003, 0xC42CBF7399AEEB94 ),
+ extF80Const( 0x3F7F, 0xF800000000000006 ),
+ extF80Const( 0x407F, 0xBF56BE8871F28FEA ),
+ extF80Const( 0x407E, 0xFFFF77FFFFFFFFFE ),
+ extF80Const( 0x2DC9, 0x8000000FFFFFFFDE ),
+ extF80Const( 0x4001, 0xEFF7FFFFFFFFFFFF ),
+ extF80Const( 0x4001, 0xBE84F30125C497A6 ),
+ extF80Const( 0x406B, 0xEFFFFFFFFFFFFFFF ),
+ extF80Const( 0x4080, 0xFFFFFFFFBFFFFFFF ),
+ extF80Const( 0x07E9, 0x81FFFFFFFFFFFBFF ),
+ extF80Const( 0x263F, 0x801FFFFFFEFFFFFE ),
+ extF80Const( 0x403C, 0x801FFFFFFFF7FFFF ),
+ extF80Const( 0x4018, 0x8000000000080003 )
+};
+
+static
+ void
+ time_az_extF80_pos( void function( const extFloat80_t *, extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_extF80[inputNum].f, &z );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_extF80[inputNum].f, &z );
+ inputNum = (inputNum + 1) & (numInputs_extF80 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+#ifdef LITTLEENDIAN
+#define f128Const( v64, v0 ) { UINT64_C( v0 ), UINT64_C( v64 ) }
+#else
+#define f128Const( v64, v0 ) { UINT64_C( v64 ), UINT64_C( v0 ) }
+#endif
+
+enum { numInputs_f128 = 32 };
+
+static
+ const union { struct uint128 ui; float128_t f; }
+ inputs_f128[numInputs_f128] = {
+ f128Const( 0x3FDA200000100000, 0x0000000000000000 ),
+ f128Const( 0x3FFF000000000000, 0x0000000000000000 ),
+ f128Const( 0x85F14776190C8306, 0xD8715F4E3D54BB92 ),
+ f128Const( 0xF2B00000007FFFFF, 0xFFFFFFFFFFF7FFFF ),
+ f128Const( 0x8000000000000000, 0x0000000000000000 ),
+ f128Const( 0xBFFFFFFFFFE00000, 0x0000008000000000 ),
+ f128Const( 0x407F1719CE722F3E, 0xDA6B3FE5FF29425B ),
+ f128Const( 0x43FFFF8000000000, 0x0000000000400000 ),
+ f128Const( 0x401E000000000100, 0x0000000000002000 ),
+ f128Const( 0x3FFED71DACDA8E47, 0x4860E3C75D224F28 ),
+ f128Const( 0xBF7ECFC1E90647D1, 0x7A124FE55623EE44 ),
+ f128Const( 0x0DF7007FFFFFFFFF, 0xFFFFFFFFEFFFFFFF ),
+ f128Const( 0x3FE5FFEFFFFFFFFF, 0xFFFFFFFFFFFFEFFF ),
+ f128Const( 0x403FFFFFFFFFFFFF, 0xFFFFFFFFFFFFFBFE ),
+ f128Const( 0xBFFB2FBF7399AFEB, 0xA459EE6A5C16CA55 ),
+ f128Const( 0xBDB8FFFFFFFFFFFC, 0x0000000000000400 ),
+ f128Const( 0x3FC8FFDFFFFFFFFF, 0xFFFFFFFFF0000000 ),
+ f128Const( 0x3FFBFFFFFFDFFFFF, 0xFFF8000000000000 ),
+ f128Const( 0x407043C11737BE84, 0xDDD58212ADC937F4 ),
+ f128Const( 0x8001000000000000, 0x0000001000000001 ),
+ f128Const( 0xC036FFFFFFFFFFFF, 0xFE40000000000000 ),
+ f128Const( 0x4002FFFFFE000002, 0x0000000000000000 ),
+ f128Const( 0x4000C3FEDE897773, 0x326AC4FD8EFBE6DC ),
+ f128Const( 0xBFFF0000000FFFFF, 0xFFFFFE0000000000 ),
+ f128Const( 0x62C3E502146E426D, 0x43F3CAA0DC7DF1A0 ),
+ f128Const( 0xB5CBD32E52BB570E, 0xBCC477CB11C6236C ),
+ f128Const( 0xE228FFFFFFC00000, 0x0000000000000000 ),
+ f128Const( 0x3F80000000000000, 0x0000000080000008 ),
+ f128Const( 0xC1AFFFDFFFFFFFFF, 0xFFFC000000000000 ),
+ f128Const( 0xC96F000000000000, 0x00000001FFFBFFFF ),
+ f128Const( 0x3DE09BFE7923A338, 0xBCC8FBBD7CEC1F4F ),
+ f128Const( 0x401CFFFFFFFFFFFF, 0xFFFFFFFEFFFFFF80 )
+};
+
+static
+ void
+ time_a_f128_z_ui32_rx(
+ uint_fast32_t function( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f128_z_ui64_rx(
+ uint_fast64_t function( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f128_z_i32_rx(
+ int_fast32_t function( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f128_z_i64_rx(
+ int_fast64_t function( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f128_z_ui32_x(
+ uint_fast32_t function( const float128_t *, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f128_z_ui64_x(
+ uint_fast64_t function( const float128_t *, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f128_z_i32_x(
+ int_fast32_t function( const float128_t *, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_a_f128_z_i64_x(
+ int_fast64_t function( const float128_t *, bool ), bool exact )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, exact );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_f128_z_f32( float32_t function( const float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static void time_a_f128_z_f64( float64_t function( const float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#ifdef EXTFLOAT80
+
+static
+ void
+ time_a_f128_z_extF80( void function( const float128_t *, extFloat80_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ extFloat80_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+static
+ void
+ time_az_f128_rx(
+ void function( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact, &z );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, roundingMode, exact, &z );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_abz_f128(
+ void function( const float128_t *, const float128_t *, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function(
+ &inputs_f128[inputNumA].f, &inputs_f128[inputNumB].f, &z );
+ inputNumA = (inputNumA + 1) & (numInputs_f128 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNumA].f, &inputs_f128[inputNumB].f, &z );
+ inputNumA = (inputNumA + 1) & (numInputs_f128 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_abcz_f128(
+ void
+ function(
+ const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ )
+ )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB, inputNumC;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ inputNumC = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function(
+ &inputs_f128[inputNumA].f,
+ &inputs_f128[inputNumB].f,
+ &inputs_f128[inputNumC].f,
+ &z
+ );
+ inputNumA = (inputNumA + 1) & (numInputs_f128 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f128 - 1);
+ if ( ! inputNumB ) ++inputNumC;
+ inputNumC = (inputNumC + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ inputNumC = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function(
+ &inputs_f128[inputNumA].f,
+ &inputs_f128[inputNumB].f,
+ &inputs_f128[inputNumC].f,
+ &z
+ );
+ inputNumA = (inputNumA + 1) & (numInputs_f128 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f128 - 1);
+ if ( ! inputNumB ) ++inputNumC;
+ inputNumC = (inputNumC + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ void
+ time_ab_f128_z_bool(
+ bool function( const float128_t *, const float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNumA, inputNumB;
+ clock_t startClock;
+ int_fast64_t i;
+ clock_t endClock;
+
+ count = 0;
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNumA].f, &inputs_f128[inputNumB].f );
+ inputNumA = (inputNumA + 1) & (numInputs_f128 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNumA = 0;
+ inputNumB = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNumA].f, &inputs_f128[inputNumB].f );
+ inputNumA = (inputNumA + 1) & (numInputs_f128 - 1);
+ if ( ! inputNumA ) ++inputNumB;
+ inputNumB = (inputNumB + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+static
+ const union { struct uint128 ui; float128_t f; }
+ inputs_f128_pos[numInputs_f128] = {
+ f128Const( 0x3FDA200000100000, 0x0000000000000000 ),
+ f128Const( 0x3FFF000000000000, 0x0000000000000000 ),
+ f128Const( 0x05F14776190C8306, 0xD8715F4E3D54BB92 ),
+ f128Const( 0x72B00000007FFFFF, 0xFFFFFFFFFFF7FFFF ),
+ f128Const( 0x0000000000000000, 0x0000000000000000 ),
+ f128Const( 0x3FFFFFFFFFE00000, 0x0000008000000000 ),
+ f128Const( 0x407F1719CE722F3E, 0xDA6B3FE5FF29425B ),
+ f128Const( 0x43FFFF8000000000, 0x0000000000400000 ),
+ f128Const( 0x401E000000000100, 0x0000000000002000 ),
+ f128Const( 0x3FFED71DACDA8E47, 0x4860E3C75D224F28 ),
+ f128Const( 0x3F7ECFC1E90647D1, 0x7A124FE55623EE44 ),
+ f128Const( 0x0DF7007FFFFFFFFF, 0xFFFFFFFFEFFFFFFF ),
+ f128Const( 0x3FE5FFEFFFFFFFFF, 0xFFFFFFFFFFFFEFFF ),
+ f128Const( 0x403FFFFFFFFFFFFF, 0xFFFFFFFFFFFFFBFE ),
+ f128Const( 0x3FFB2FBF7399AFEB, 0xA459EE6A5C16CA55 ),
+ f128Const( 0x3DB8FFFFFFFFFFFC, 0x0000000000000400 ),
+ f128Const( 0x3FC8FFDFFFFFFFFF, 0xFFFFFFFFF0000000 ),
+ f128Const( 0x3FFBFFFFFFDFFFFF, 0xFFF8000000000000 ),
+ f128Const( 0x407043C11737BE84, 0xDDD58212ADC937F4 ),
+ f128Const( 0x0001000000000000, 0x0000001000000001 ),
+ f128Const( 0x4036FFFFFFFFFFFF, 0xFE40000000000000 ),
+ f128Const( 0x4002FFFFFE000002, 0x0000000000000000 ),
+ f128Const( 0x4000C3FEDE897773, 0x326AC4FD8EFBE6DC ),
+ f128Const( 0x3FFF0000000FFFFF, 0xFFFFFE0000000000 ),
+ f128Const( 0x62C3E502146E426D, 0x43F3CAA0DC7DF1A0 ),
+ f128Const( 0x35CBD32E52BB570E, 0xBCC477CB11C6236C ),
+ f128Const( 0x6228FFFFFFC00000, 0x0000000000000000 ),
+ f128Const( 0x3F80000000000000, 0x0000000080000008 ),
+ f128Const( 0x41AFFFDFFFFFFFFF, 0xFFFC000000000000 ),
+ f128Const( 0x496F000000000000, 0x00000001FFFBFFFF ),
+ f128Const( 0x3DE09BFE7923A338, 0xBCC8FBBD7CEC1F4F ),
+ f128Const( 0x401CFFFFFFFFFFFF, 0xFFFFFFFEFFFFFF80 )
+};
+
+static
+ void time_az_f128_pos( void function( const float128_t *, float128_t * ) )
+{
+ int_fast64_t count;
+ int inputNum;
+ clock_t startClock;
+ int_fast64_t i;
+ float128_t z;
+ clock_t endClock;
+
+ count = 0;
+ inputNum = 0;
+ startClock = clock();
+ do {
+ for ( i = minIterations; i; --i ) {
+ function( &inputs_f128[inputNum].f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ count += minIterations;
+ } while ( clock() - startClock < CLOCKS_PER_SEC );
+ inputNum = 0;
+ startClock = clock();
+ for ( i = count; i; --i ) {
+ function( &inputs_f128[inputNum].f, &z );
+ inputNum = (inputNum + 1) & (numInputs_f128 - 1);
+ }
+ endClock = clock();
+ reportTime( count, endClock - startClock );
+
+}
+
+#endif
+
+static
+ void
+ timeFunctionInstance(
+ int functionCode, uint_fast8_t roundingMode, bool exact )
+{
+ float32_t (*function_abz_f32)( float32_t, float32_t );
+ bool (*function_ab_f32_z_bool)( float32_t, float32_t );
+ float64_t (*function_abz_f64)( float64_t, float64_t );
+ bool (*function_ab_f64_z_bool)( float64_t, float64_t );
+ void
+ (*function_abz_extF80)(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
+ bool
+ (*function_ab_extF80_z_bool)(
+ const extFloat80_t *, const extFloat80_t * );
+ void
+ (*function_abz_f128)(
+ const float128_t *, const float128_t *, float128_t * );
+ bool (*function_ab_f128_z_bool)( const float128_t *, const float128_t * );
+
+ switch ( functionCode ) {
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case UI32_TO_F32:
+ time_a_ui32_z_f32( ui32_to_f32 );
+ break;
+ case UI32_TO_F64:
+ time_a_ui32_z_f64( ui32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case UI32_TO_EXTF80:
+ time_a_ui32_z_extF80( ui32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case UI32_TO_F128:
+ time_a_ui32_z_f128( ui32_to_f128M );
+ break;
+#endif
+ case UI64_TO_F32:
+ time_a_ui64_z_f32( ui64_to_f32 );
+ break;
+ case UI64_TO_F64:
+ time_a_ui64_z_f64( ui64_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case UI64_TO_EXTF80:
+ time_a_ui64_z_extF80( ui64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case UI64_TO_F128:
+ time_a_ui64_z_f128( ui64_to_f128M );
+ break;
+#endif
+ case I32_TO_F32:
+ time_a_i32_z_f32( i32_to_f32 );
+ break;
+ case I32_TO_F64:
+ time_a_i32_z_f64( i32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case I32_TO_EXTF80:
+ time_a_i32_z_extF80( i32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case I32_TO_F128:
+ time_a_i32_z_f128( i32_to_f128M );
+ break;
+#endif
+ case I64_TO_F32:
+ time_a_i64_z_f32( i64_to_f32 );
+ break;
+ case I64_TO_F64:
+ time_a_i64_z_f64( i64_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case I64_TO_EXTF80:
+ time_a_i64_z_extF80( i64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case I64_TO_F128:
+ time_a_i64_z_f128( i64_to_f128M );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F32_TO_UI32:
+ time_a_f32_z_ui32_rx( f32_to_ui32, roundingMode, exact );
+ break;
+ case F32_TO_UI64:
+ time_a_f32_z_ui64_rx( f32_to_ui64, roundingMode, exact );
+ break;
+ case F32_TO_I32:
+ time_a_f32_z_i32_rx( f32_to_i32, roundingMode, exact );
+ break;
+ case F32_TO_I64:
+ time_a_f32_z_i64_rx( f32_to_i64, roundingMode, exact );
+ break;
+ case F32_TO_UI32_R_MINMAG:
+ time_a_f32_z_ui32_x( f32_to_ui32_r_minMag, exact );
+ break;
+ case F32_TO_UI64_R_MINMAG:
+ time_a_f32_z_ui64_x( f32_to_ui64_r_minMag, exact );
+ break;
+ case F32_TO_I32_R_MINMAG:
+ time_a_f32_z_i32_x( f32_to_i32_r_minMag, exact );
+ break;
+ case F32_TO_I64_R_MINMAG:
+ time_a_f32_z_i64_x( f32_to_i64_r_minMag, exact );
+ break;
+ case F32_TO_F64:
+ time_a_f32_z_f64( f32_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case F32_TO_EXTF80:
+ time_a_f32_z_extF80( f32_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case F32_TO_F128:
+ time_a_f32_z_f128( f32_to_f128M );
+ break;
+#endif
+ case F32_ROUNDTOINT:
+ time_az_f32_rx( f32_roundToInt, roundingMode, exact );
+ break;
+ case F32_ADD:
+ function_abz_f32 = f32_add;
+ goto time_abz_f32;
+ case F32_SUB:
+ function_abz_f32 = f32_sub;
+ goto time_abz_f32;
+ case F32_MUL:
+ function_abz_f32 = f32_mul;
+ goto time_abz_f32;
+ case F32_DIV:
+ function_abz_f32 = f32_div;
+ goto time_abz_f32;
+ case F32_REM:
+ function_abz_f32 = f32_rem;
+ time_abz_f32:
+ time_abz_f32( function_abz_f32 );
+ break;
+ case F32_MULADD:
+ time_abcz_f32( f32_mulAdd );
+ break;
+ case F32_SQRT:
+ time_az_f32_pos( f32_sqrt );
+ break;
+ case F32_EQ:
+ function_ab_f32_z_bool = f32_eq;
+ goto time_ab_f32_z_bool;
+ case F32_LE:
+ function_ab_f32_z_bool = f32_le;
+ goto time_ab_f32_z_bool;
+ case F32_LT:
+ function_ab_f32_z_bool = f32_lt;
+ goto time_ab_f32_z_bool;
+ case F32_EQ_SIGNALING:
+ function_ab_f32_z_bool = f32_eq_signaling;
+ goto time_ab_f32_z_bool;
+ case F32_LE_QUIET:
+ function_ab_f32_z_bool = f32_le_quiet;
+ goto time_ab_f32_z_bool;
+ case F32_LT_QUIET:
+ function_ab_f32_z_bool = f32_lt_quiet;
+ time_ab_f32_z_bool:
+ time_ab_f32_z_bool( function_ab_f32_z_bool );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+ case F64_TO_UI32:
+ time_a_f64_z_ui32_rx( f64_to_ui32, roundingMode, exact );
+ break;
+ case F64_TO_UI64:
+ time_a_f64_z_ui64_rx( f64_to_ui64, roundingMode, exact );
+ break;
+ case F64_TO_I32:
+ time_a_f64_z_i32_rx( f64_to_i32, roundingMode, exact );
+ break;
+ case F64_TO_I64:
+ time_a_f64_z_i64_rx( f64_to_i64, roundingMode, exact );
+ break;
+ case F64_TO_UI32_R_MINMAG:
+ time_a_f64_z_ui32_x( f64_to_ui32_r_minMag, exact );
+ break;
+ case F64_TO_UI64_R_MINMAG:
+ time_a_f64_z_ui64_x( f64_to_ui64_r_minMag, exact );
+ break;
+ case F64_TO_I32_R_MINMAG:
+ time_a_f64_z_i32_x( f64_to_i32_r_minMag, exact );
+ break;
+ case F64_TO_I64_R_MINMAG:
+ time_a_f64_z_i64_x( f64_to_i64_r_minMag, exact );
+ break;
+ case F64_TO_F32:
+ time_a_f64_z_f32( f64_to_f32 );
+ break;
+#ifdef EXTFLOAT80
+ case F64_TO_EXTF80:
+ time_a_f64_z_extF80( f64_to_extF80M );
+ break;
+#endif
+#ifdef FLOAT128
+ case F64_TO_F128:
+ time_a_f64_z_f128( f64_to_f128M );
+ break;
+#endif
+ case F64_ROUNDTOINT:
+ time_az_f64_rx( f64_roundToInt, roundingMode, exact );
+ break;
+ case F64_ADD:
+ function_abz_f64 = f64_add;
+ goto time_abz_f64;
+ case F64_SUB:
+ function_abz_f64 = f64_sub;
+ goto time_abz_f64;
+ case F64_MUL:
+ function_abz_f64 = f64_mul;
+ goto time_abz_f64;
+ case F64_DIV:
+ function_abz_f64 = f64_div;
+ goto time_abz_f64;
+ case F64_REM:
+ function_abz_f64 = f64_rem;
+ time_abz_f64:
+ time_abz_f64( function_abz_f64 );
+ break;
+ case F64_MULADD:
+ time_abcz_f64( f64_mulAdd );
+ break;
+ case F64_SQRT:
+ time_az_f64_pos( f64_sqrt );
+ break;
+ case F64_EQ:
+ function_ab_f64_z_bool = f64_eq;
+ goto time_ab_f64_z_bool;
+ case F64_LE:
+ function_ab_f64_z_bool = f64_le;
+ goto time_ab_f64_z_bool;
+ case F64_LT:
+ function_ab_f64_z_bool = f64_lt;
+ goto time_ab_f64_z_bool;
+ case F64_EQ_SIGNALING:
+ function_ab_f64_z_bool = f64_eq_signaling;
+ goto time_ab_f64_z_bool;
+ case F64_LE_QUIET:
+ function_ab_f64_z_bool = f64_le_quiet;
+ goto time_ab_f64_z_bool;
+ case F64_LT_QUIET:
+ function_ab_f64_z_bool = f64_lt_quiet;
+ time_ab_f64_z_bool:
+ time_ab_f64_z_bool( function_ab_f64_z_bool );
+ break;
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+ case EXTF80_TO_UI32:
+ time_a_extF80_z_ui32_rx( extF80M_to_ui32, roundingMode, exact );
+ break;
+ case EXTF80_TO_UI64:
+ time_a_extF80_z_ui64_rx( extF80M_to_ui64, roundingMode, exact );
+ break;
+ case EXTF80_TO_I32:
+ time_a_extF80_z_i32_rx( extF80M_to_i32, roundingMode, exact );
+ break;
+ case EXTF80_TO_I64:
+ time_a_extF80_z_i64_rx( extF80M_to_i64, roundingMode, exact );
+ break;
+ case EXTF80_TO_UI32_R_MINMAG:
+ time_a_extF80_z_ui32_x( extF80M_to_ui32_r_minMag, exact );
+ break;
+ case EXTF80_TO_UI64_R_MINMAG:
+ time_a_extF80_z_ui64_x( extF80M_to_ui64_r_minMag, exact );
+ break;
+ case EXTF80_TO_I32_R_MINMAG:
+ time_a_extF80_z_i32_x( extF80M_to_i32_r_minMag, exact );
+ break;
+ case EXTF80_TO_I64_R_MINMAG:
+ time_a_extF80_z_i64_x( extF80M_to_i64_r_minMag, exact );
+ break;
+ case EXTF80_TO_F32:
+ time_a_extF80_z_f32( extF80M_to_f32 );
+ break;
+ case EXTF80_TO_F64:
+ time_a_extF80_z_f64( extF80M_to_f64 );
+ break;
+#ifdef FLOAT128
+ case EXTF80_TO_F128:
+ time_a_extF80_z_f128( extF80M_to_f128M );
+ break;
+#endif
+ case EXTF80_ROUNDTOINT:
+ time_az_extF80_rx( extF80M_roundToInt, roundingMode, exact );
+ break;
+ case EXTF80_ADD:
+ function_abz_extF80 = extF80M_add;
+ goto time_abz_extF80;
+ case EXTF80_SUB:
+ function_abz_extF80 = extF80M_sub;
+ goto time_abz_extF80;
+ case EXTF80_MUL:
+ function_abz_extF80 = extF80M_mul;
+ goto time_abz_extF80;
+ case EXTF80_DIV:
+ function_abz_extF80 = extF80M_div;
+ goto time_abz_extF80;
+ case EXTF80_REM:
+ function_abz_extF80 = extF80M_rem;
+ time_abz_extF80:
+ time_abz_extF80( function_abz_extF80 );
+ break;
+ case EXTF80_SQRT:
+ time_az_extF80_pos( extF80M_sqrt );
+ break;
+ case EXTF80_EQ:
+ function_ab_extF80_z_bool = extF80M_eq;
+ goto time_ab_extF80_z_bool;
+ case EXTF80_LE:
+ function_ab_extF80_z_bool = extF80M_le;
+ goto time_ab_extF80_z_bool;
+ case EXTF80_LT:
+ function_ab_extF80_z_bool = extF80M_lt;
+ goto time_ab_extF80_z_bool;
+ case EXTF80_EQ_SIGNALING:
+ function_ab_extF80_z_bool = extF80M_eq_signaling;
+ goto time_ab_extF80_z_bool;
+ case EXTF80_LE_QUIET:
+ function_ab_extF80_z_bool = extF80M_le_quiet;
+ goto time_ab_extF80_z_bool;
+ case EXTF80_LT_QUIET:
+ function_ab_extF80_z_bool = extF80M_lt_quiet;
+ time_ab_extF80_z_bool:
+ time_ab_extF80_z_bool( function_ab_extF80_z_bool );
+ break;
+#endif
+ /*--------------------------------------------------------------------
+ *--------------------------------------------------------------------*/
+#ifdef FLOAT128
+ case F128_TO_UI32:
+ time_a_f128_z_ui32_rx( f128M_to_ui32, roundingMode, exact );
+ break;
+ case F128_TO_UI64:
+ time_a_f128_z_ui64_rx( f128M_to_ui64, roundingMode, exact );
+ break;
+ case F128_TO_I32:
+ time_a_f128_z_i32_rx( f128M_to_i32, roundingMode, exact );
+ break;
+ case F128_TO_I64:
+ time_a_f128_z_i64_rx( f128M_to_i64, roundingMode, exact );
+ break;
+ case F128_TO_UI32_R_MINMAG:
+ time_a_f128_z_ui32_x( f128M_to_ui32_r_minMag, exact );
+ break;
+ case F128_TO_UI64_R_MINMAG:
+ time_a_f128_z_ui64_x( f128M_to_ui64_r_minMag, exact );
+ break;
+ case F128_TO_I32_R_MINMAG:
+ time_a_f128_z_i32_x( f128M_to_i32_r_minMag, exact );
+ break;
+ case F128_TO_I64_R_MINMAG:
+ time_a_f128_z_i64_x( f128M_to_i64_r_minMag, exact );
+ break;
+ case F128_TO_F32:
+ time_a_f128_z_f32( f128M_to_f32 );
+ break;
+ case F128_TO_F64:
+ time_a_f128_z_f64( f128M_to_f64 );
+ break;
+#ifdef EXTFLOAT80
+ case F128_TO_EXTF80:
+ time_a_f128_z_extF80( f128M_to_extF80M );
+ break;
+#endif
+ case F128_ROUNDTOINT:
+ time_az_f128_rx( f128M_roundToInt, roundingMode, exact );
+ break;
+ case F128_ADD:
+ function_abz_f128 = f128M_add;
+ goto time_abz_f128;
+ case F128_SUB:
+ function_abz_f128 = f128M_sub;
+ goto time_abz_f128;
+ case F128_MUL:
+ function_abz_f128 = f128M_mul;
+ goto time_abz_f128;
+ case F128_DIV:
+ function_abz_f128 = f128M_div;
+ goto time_abz_f128;
+ case F128_REM:
+ function_abz_f128 = f128M_rem;
+ time_abz_f128:
+ time_abz_f128( function_abz_f128 );
+ break;
+ case F128_MULADD:
+ time_abcz_f128( f128M_mulAdd );
+ break;
+ case F128_SQRT:
+ time_az_f128_pos( f128M_sqrt );
+ break;
+ case F128_EQ:
+ function_ab_f128_z_bool = f128M_eq;
+ goto time_ab_f128_z_bool;
+ case F128_LE:
+ function_ab_f128_z_bool = f128M_le;
+ goto time_ab_f128_z_bool;
+ case F128_LT:
+ function_ab_f128_z_bool = f128M_lt;
+ goto time_ab_f128_z_bool;
+ case F128_EQ_SIGNALING:
+ function_ab_f128_z_bool = f128M_eq_signaling;
+ goto time_ab_f128_z_bool;
+ case F128_LE_QUIET:
+ function_ab_f128_z_bool = f128M_le_quiet;
+ goto time_ab_f128_z_bool;
+ case F128_LT_QUIET:
+ function_ab_f128_z_bool = f128M_lt_quiet;
+ time_ab_f128_z_bool:
+ time_ab_f128_z_bool( function_ab_f128_z_bool );
+ break;
+#endif
+ }
+
+}
+
+enum { EXACT_FALSE = 1, EXACT_TRUE };
+
+static
+ void
+ timeFunction(
+ int functionCode,
+ uint_fast8_t roundingPrecisionIn,
+ int roundingCodeIn,
+ int tininessCodeIn,
+ int exactCodeIn
+ )
+{
+ int functionAttribs, exactCode;
+ uint_fast8_t roundingMode, tininessMode;
+
+ functionNamePtr = functionInfos[functionCode].namePtr;
+ functionAttribs = functionInfos[functionCode].attribs;
+ roundingPrecision = 32;
+ for (;;) {
+ if ( ! (functionAttribs & FUNC_EFF_ROUNDINGPRECISION) ) {
+ roundingPrecision = 0;
+ } else if ( roundingPrecisionIn ) {
+ roundingPrecision = roundingPrecisionIn;
+ }
+#ifdef EXTFLOAT80
+ if ( roundingPrecision ) extF80_roundingPrecision = roundingPrecision;
+#endif
+ for (
+ roundingCode = 1; roundingCode < NUM_ROUNDINGMODES; ++roundingCode
+ ) {
+ if (
+ ! (functionAttribs
+ & (FUNC_ARG_ROUNDINGMODE | FUNC_EFF_ROUNDINGMODE))
+ ) {
+ roundingCode = 0;
+ } else if ( roundingCodeIn ) {
+ roundingCode = roundingCodeIn;
+ }
+ if ( roundingCode ) {
+ roundingMode = roundingModes[roundingCode];
+ if ( functionAttribs & FUNC_EFF_ROUNDINGMODE ) {
+ softfloat_roundingMode = roundingMode;
+ }
+ }
+ for (
+ exactCode = EXACT_FALSE; exactCode <= EXACT_TRUE; ++exactCode
+ ) {
+ if ( ! (functionAttribs & FUNC_ARG_EXACT) ) {
+ exactCode = 0;
+ } else if ( exactCodeIn ) {
+ exactCode = exactCodeIn;
+ }
+ exact = (exactCode == EXACT_TRUE );
+ usesExact = (exactCode != 0 );
+ for (
+ tininessCode = 1;
+ tininessCode < NUM_TININESSMODES;
+ ++tininessCode
+ ) {
+ if (
+ ! (functionAttribs
+ & (roundingPrecision && (roundingPrecision < 80)
+ ? FUNC_EFF_TININESSMODE_REDUCEDPREC
+ : FUNC_EFF_TININESSMODE))
+ ) {
+ tininessCode = 0;
+ } else if ( tininessCodeIn ) {
+ tininessCode = tininessCodeIn;
+ }
+ if ( tininessCode ) {
+ tininessMode = tininessModes[tininessCode];
+ softfloat_detectTininess = tininessMode;
+ }
+ timeFunctionInstance( functionCode, roundingMode, exact );
+ if ( tininessCodeIn || ! tininessCode ) break;
+ }
+ if ( exactCodeIn || ! exactCode ) break;
+ }
+ if ( roundingCodeIn || ! roundingCode ) break;
+ }
+ if ( roundingPrecisionIn || ! roundingPrecision ) break;
+ if ( roundingPrecision == 80 ) {
+ break;
+ } else if ( roundingPrecision == 64 ) {
+ roundingPrecision = 80;
+ } else if ( roundingPrecision == 32 ) {
+ roundingPrecision = 64;
+ }
+ }
+
+}
+
+int main( int argc, char *argv[] )
+{
+ bool haveFunctionArg;
+ int functionCode, numOperands;
+ uint_fast8_t roundingPrecision;
+ int roundingCode, tininessCode, exactCode;
+ const char *argPtr;
+
+ fail_programName = "timesoftfloat";
+ if ( argc <= 1 ) goto writeHelpMessage;
+ haveFunctionArg = false;
+ functionCode = 0;
+ numOperands = 0;
+ roundingPrecision = 0;
+ roundingCode = 0;
+ tininessCode = 0;
+ exactCode = 0;
+ for (;;) {
+ --argc;
+ if ( ! argc ) break;
+ argPtr = *++argv;
+ if ( ! argPtr ) break;
+ if ( argPtr[0] == '-' ) ++argPtr;
+ if (
+ ! strcmp( argPtr, "help" ) || ! strcmp( argPtr, "-help" )
+ || ! strcmp( argPtr, "h" )
+ ) {
+ writeHelpMessage:
+ fputs(
+"timesoftfloat [<option>...] <function>\n"
+" <option>: (* is default)\n"
+" -help --Write this message and exit.\n"
+#ifdef EXTFLOAT80
+" -precision32 --For extF80, time only 32-bit rounding precision.\n"
+" -precision64 --For extF80, time only 64-bit rounding precision.\n"
+" -precision80 --For extF80, time only 80-bit rounding precision.\n"
+#endif
+" -rnear_even --Time only rounding to nearest/even.\n"
+" -rminMag --Time only rounding to minimum magnitude (toward zero).\n"
+" -rmin --Time only rounding to minimum (down).\n"
+" -rmax --Time only rounding to maximum (up).\n"
+" -rnear_maxMag --Time only rounding to nearest/maximum magnitude\n"
+" (nearest/away).\n"
+" -tininessbefore --Time only underflow tininess detected before rounding.\n"
+" -tininessafter --Time only underflow tininess detected after rounding.\n"
+" -notexact --Time only non-exact rounding to integer (no inexact\n"
+" exception).\n"
+" -exact --Time only exact rounding to integer (allow inexact\n"
+" exception).\n"
+" <function>:\n"
+" <int>_to_<float> <float>_add <float>_eq\n"
+" <float>_to_<int> <float>_sub <float>_le\n"
+" <float>_to_<int>_r_minMag <float>_mul <float>_lt\n"
+" <float>_to_<float> <float>_mulAdd <float>_eq_signaling\n"
+" <float>_roundToInt <float>_div <float>_le_quiet\n"
+" <float>_rem <float>_lt_quiet\n"
+" <float>_sqrt\n"
+" -all1 --All unary functions.\n"
+" -all2 --All binary functions.\n"
+" -all --All functions.\n"
+" <int>:\n"
+" ui32 --Unsigned 32-bit integer.\n"
+" ui64 --Unsigned 64-bit integer.\n"
+" i32 --Signed 32-bit integer.\n"
+" i64 --Signed 64-bit integer.\n"
+" <float>:\n"
+" f32 --Binary 32-bit floating-point (single-precision).\n"
+" f64 --Binary 64-bit floating-point (double-precision).\n"
+#ifdef EXTFLOAT80
+" extF80 --Binary 80-bit extended floating-point.\n"
+#endif
+#ifdef FLOAT128
+" f128 --Binary 128-bit floating-point (quadruple-precision).\n"
+#endif
+ ,
+ stdout
+ );
+ return EXIT_SUCCESS;
+#ifdef EXTFLOAT80
+ } else if ( ! strcmp( argPtr, "precision32" ) ) {
+ roundingPrecision = 32;
+ } else if ( ! strcmp( argPtr, "precision64" ) ) {
+ roundingPrecision = 64;
+ } else if ( ! strcmp( argPtr, "precision80" ) ) {
+ roundingPrecision = 80;
+#endif
+ } else if (
+ ! strcmp( argPtr, "rnear_even" )
+ || ! strcmp( argPtr, "rneareven" )
+ || ! strcmp( argPtr, "rnearest_even" )
+ ) {
+ roundingCode = ROUND_NEAR_EVEN;
+ } else if (
+ ! strcmp( argPtr, "rminmag" ) || ! strcmp( argPtr, "rminMag" )
+ ) {
+ roundingCode = ROUND_MINMAG;
+ } else if ( ! strcmp( argPtr, "rmin" ) ) {
+ roundingCode = ROUND_MIN;
+ } else if ( ! strcmp( argPtr, "rmax" ) ) {
+ roundingCode = ROUND_MAX;
+ } else if (
+ ! strcmp( argPtr, "rnear_maxmag" )
+ || ! strcmp( argPtr, "rnear_maxMag" )
+ || ! strcmp( argPtr, "rnearmaxmag" )
+ || ! strcmp( argPtr, "rnearest_maxmag" )
+ || ! strcmp( argPtr, "rnearest_maxMag" )
+ ) {
+ roundingCode = ROUND_NEAR_MAXMAG;
+ } else if ( ! strcmp( argPtr, "tininessbefore" ) ) {
+ tininessCode = TININESS_BEFORE_ROUNDING;
+ } else if ( ! strcmp( argPtr, "tininessafter" ) ) {
+ tininessCode = TININESS_AFTER_ROUNDING;
+ } else if ( ! strcmp( argPtr, "notexact" ) ) {
+ exactCode = EXACT_FALSE;
+ } else if ( ! strcmp( argPtr, "exact" ) ) {
+ exactCode = EXACT_TRUE;
+ } else if ( ! strcmp( argPtr, "all1" ) ) {
+ haveFunctionArg = true;
+ functionCode = 0;
+ numOperands = 1;
+ } else if ( ! strcmp( argPtr, "all2" ) ) {
+ haveFunctionArg = true;
+ functionCode = 0;
+ numOperands = 2;
+ } else if ( ! strcmp( argPtr, "all" ) ) {
+ haveFunctionArg = true;
+ functionCode = 0;
+ numOperands = 0;
+ } else {
+ functionCode = 1;
+ while ( strcmp( argPtr, functionInfos[functionCode].namePtr ) ) {
+ ++functionCode;
+ if ( functionCode == NUM_FUNCTIONS ) {
+ fail( "Invalid argument `%s'", *argv );
+ }
+ }
+ haveFunctionArg = true;
+ }
+ }
+ if ( ! haveFunctionArg ) fail( "Function argument required" );
+ if ( functionCode ) {
+ timeFunction(
+ functionCode,
+ roundingPrecision,
+ roundingCode,
+ tininessCode,
+ exactCode
+ );
+ } else {
+ for (
+ functionCode = 1; functionCode < NUM_FUNCTIONS; ++functionCode
+ ) {
+ if (
+ ! numOperands
+ || (functionInfos[functionCode].attribs
+ & (numOperands == 1) ? FUNC_ARG_UNARY
+ : FUNC_ARG_BINARY)
+ ) {
+ timeFunction(
+ functionCode,
+ roundingPrecision,
+ roundingCode,
+ tininessCode,
+ exactCode
+ );
+ }
+ }
+ }
+ return EXIT_SUCCESS;
+
+}
+
diff --git a/source/uint128.c b/source/uint128.c
new file mode 100644
index 0000000..04520cf
--- /dev/null
+++ b/source/uint128.c
@@ -0,0 +1,96 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "platform.h"
+#include "uint128.h"
+
+struct uint128 shortShiftLeft128( struct uint128 a, int count )
+{
+ struct uint128 z;
+
+ z.v64 = a.v64<<count | a.v0>>(-count & 63);
+ z.v0 = a.v0<<count;
+ return z;
+
+}
+
+struct uint128 shortShiftRight128( struct uint128 a, int count )
+{
+ struct uint128 z;
+
+ z.v64 = a.v64>>count;
+ z.v0 = a.v64<<(-count & 63) | a.v0>>count;
+ return z;
+
+}
+
+struct uint128 shortShiftRightJam128( struct uint128 a, int count )
+{
+ int negCount;
+ struct uint128 z;
+
+ negCount = -count;
+ z.v64 = a.v64>>count;
+ z.v0 =
+ a.v64<<(negCount & 63) | a.v0>>count
+ | ((uint64_t) (a.v0<<(negCount & 63)) != 0);
+ return z;
+
+}
+
+struct uint128 neg128( struct uint128 a )
+{
+
+ if ( a.v0 ) {
+ a.v64 = ~a.v64;
+ a.v0 = -a.v0;
+ } else {
+ a.v64 = -a.v64;
+ }
+ return a;
+
+}
+
+struct uint128 add128( struct uint128 a, struct uint128 b )
+{
+ struct uint128 z;
+
+ z.v0 = a.v0 + b.v0;
+ z.v64 = a.v64 + b.v64 + (z.v0 < a.v0);
+ return z;
+
+}
+
diff --git a/source/uint128.h b/source/uint128.h
new file mode 100644
index 0000000..db73950
--- /dev/null
+++ b/source/uint128.h
@@ -0,0 +1,63 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#ifndef uint128_h
+#define uint128_h 1
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#ifdef LITTLEENDIAN
+struct uint128 { uint64_t v0, v64; };
+#else
+struct uint128 { uint64_t v64, v0; };
+#endif
+
+INLINE bool eq128( struct uint128 a, struct uint128 b )
+ { return (a.v64 == b.v64) && (a.v0 == b.v0); }
+
+INLINE bool le128( struct uint128 a, struct uint128 b )
+ { return (a.v64 < b.v64) || ((a.v64 == b.v64) && (a.v0 <= b.v0)); }
+
+INLINE bool lt128( struct uint128 a, struct uint128 b )
+ { return (a.v64 < b.v64) || ((a.v64 == b.v64) && (a.v0 < b.v0)); }
+
+struct uint128 shortShiftLeft128( struct uint128, int );
+struct uint128 shortShiftRight128( struct uint128, int );
+struct uint128 shortShiftRightJam128( struct uint128, int );
+struct uint128 neg128( struct uint128 );
+struct uint128 add128( struct uint128, struct uint128 );
+
+#endif
+
diff --git a/source/verCases.h b/source/verCases.h
new file mode 100644
index 0000000..3f96673
--- /dev/null
+++ b/source/verCases.h
@@ -0,0 +1,141 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "uint128.h"
+#include "softfloat.h"
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+
+extern const char *verCases_functionNamePtr;
+extern uint_fast8_t verCases_roundingPrecision;
+extern int verCases_roundingCode;
+extern int verCases_tininessCode;
+extern bool verCases_usesExact, verCases_exact;
+extern bool verCases_checkNaNs;
+extern uint_fast32_t verCases_maxErrorCount;
+extern bool verCases_errorStop;
+
+void verCases_writeFunctionName( FILE * );
+
+extern volatile bool verCases_stop;
+
+extern bool verCases_anyErrors;
+
+void verCases_exitWithStatus( void );
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+
+INLINE bool f32_same( float32_t a, float32_t b )
+{
+ union { uint32_t ui; float32_t f; } uA, uB;
+ uA.f = a;
+ uB.f = b;
+ return (uA.ui == uB.ui);
+}
+
+INLINE bool f32_isNaN( float32_t a )
+{
+ union { uint32_t ui; float32_t f; } uA;
+ uA.f = a;
+ return 0x7F800000 < (uA.ui & 0x7FFFFFFF);
+}
+
+INLINE bool f64_same( float64_t a, float64_t b )
+{
+ union { uint64_t ui; float64_t f; } uA, uB;
+ uA.f = a;
+ uB.f = b;
+ return (uA.ui == uB.ui);
+}
+
+INLINE bool f64_isNaN( float64_t a )
+{
+ union { uint64_t ui; float64_t f; } uA;
+ uA.f = a;
+ return
+ UINT64_C( 0x7FF0000000000000 )
+ < (uA.ui & UINT64_C( 0x7FFFFFFFFFFFFFFF ));
+}
+
+#ifdef EXTFLOAT80
+
+INLINE bool extF80M_same( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
+{
+ const struct extFloat80M *aSPtr = (const struct extFloat80M *) aPtr;
+ const struct extFloat80M *bSPtr = (const struct extFloat80M *) bPtr;
+ return
+ (aSPtr->signExp == bSPtr->signExp) && (aSPtr->signif == bSPtr->signif);
+}
+
+INLINE bool extF80M_isNaN( const extFloat80_t *aPtr )
+{
+ const struct extFloat80M *aSPtr = (const struct extFloat80M *) aPtr;
+ return
+ ((aSPtr->signExp & 0x7FFF) == 0x7FFF)
+ && (aSPtr->signif & UINT64_C( 0x7FFFFFFFFFFFFFFF ));
+}
+
+#endif
+
+#ifdef FLOAT128
+
+INLINE bool f128M_same( const float128_t *aPtr, const float128_t *bPtr )
+{
+ const struct uint128 *uiAPtr = (const struct uint128 *) aPtr;
+ const struct uint128 *uiBPtr = (const struct uint128 *) bPtr;
+ return (uiAPtr->v64 == uiBPtr->v64) && (uiAPtr->v0 == uiBPtr->v0);
+}
+
+INLINE bool f128M_isNaN( const float128_t *aPtr )
+{
+ const struct uint128 *uiAPtr = (const struct uint128 *) aPtr;
+ uint_fast64_t absA64 = uiAPtr->v64 & UINT64_C( 0x7FFFFFFFFFFFFFFF );
+ return
+ (UINT64_C( 0x7FFF000000000000 ) < absA64)
+ || ((absA64 == UINT64_C( 0x7FFF000000000000 )) && uiAPtr->v0);
+}
+
+#endif
+
+extern uint_fast32_t verCases_tenThousandsCount, verCases_errorCount;
+
+void verCases_writeTestsPerformed( int );
+void verCases_perTenThousand( void );
+void verCases_writeErrorFound( int );
+
diff --git a/source/verCases_common.c b/source/verCases_common.c
new file mode 100644
index 0000000..d1f0e9b
--- /dev/null
+++ b/source/verCases_common.c
@@ -0,0 +1,133 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "platform.h"
+#include "verCases.h"
+
+const char *verCases_functionNamePtr;
+uint_fast8_t verCases_roundingPrecision = 0;
+int verCases_roundingCode = 0;
+int verCases_tininessCode = 0;
+bool verCases_usesExact = false;
+bool verCases_exact;
+bool verCases_checkNaNs = false;
+uint_fast32_t verCases_maxErrorCount = 0;
+bool verCases_errorStop = false;
+
+volatile bool verCases_stop = false;
+
+bool verCases_anyErrors = false;
+
+void verCases_exitWithStatus( void )
+{
+
+ exit( verCases_anyErrors ? EXIT_FAILURE : EXIT_SUCCESS );
+
+}
+
+uint_fast32_t verCases_tenThousandsCount, verCases_errorCount;
+
+void verCases_writeTestsPerformed( int count )
+{
+
+ if ( verCases_tenThousandsCount ) {
+ fprintf(
+ stderr,
+ "\r%lu%04d tests performed",
+ (unsigned long) verCases_tenThousandsCount,
+ count
+ );
+ } else {
+ fprintf( stderr, "\r%d tests performed", count );
+ }
+ if ( verCases_errorCount ) {
+ fprintf(
+ stderr,
+ "; %lu error%s found.\n",
+ (unsigned long) verCases_errorCount,
+ (verCases_errorCount == 1) ? "" : "s"
+ );
+ } else {
+ fputs( ".\n", stderr );
+ if ( verCases_tenThousandsCount ) {
+ fprintf(
+ stdout,
+ "In %lu%04d tests, no errors found in ",
+ (unsigned long) verCases_tenThousandsCount,
+ count
+ );
+ } else {
+ fprintf( stdout, "In %d tests, no errors found in ", count );
+ }
+ verCases_writeFunctionName( stdout );
+ fputs( ".\n", stdout );
+ fflush( stdout );
+ }
+
+}
+
+void verCases_perTenThousand( void )
+{
+
+ ++verCases_tenThousandsCount;
+ if ( verCases_stop ) {
+ verCases_writeTestsPerformed( 0 );
+ verCases_exitWithStatus();
+ }
+ fprintf(
+ stderr, "\r%3lu0000", (unsigned long) verCases_tenThousandsCount );
+
+}
+
+void verCases_writeErrorFound( int count )
+{
+
+ fputc( '\r', stderr );
+ if ( verCases_errorCount == 1 ) {
+ fputs( "Errors found in ", stdout );
+ verCases_writeFunctionName( stdout );
+ fputs( ":\n", stdout );
+ }
+ if ( verCases_stop ) {
+ verCases_writeTestsPerformed( count );
+ verCases_exitWithStatus();
+ }
+ verCases_anyErrors = true;
+
+}
+
diff --git a/source/verCases_writeFunctionName.c b/source/verCases_writeFunctionName.c
new file mode 100644
index 0000000..54e1971
--- /dev/null
+++ b/source/verCases_writeFunctionName.c
@@ -0,0 +1,73 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdio.h>
+#include "platform.h"
+#include "functions.h"
+#include "verCases.h"
+
+void verCases_writeFunctionName( FILE *streamPtr )
+{
+ static const char *roundingModeNames[NUM_ROUNDINGMODES] = {
+ 0,
+ ", rounding near_even",
+ ", rounding minMag",
+ ", rounding min",
+ ", rounding max",
+ ", rounding near_maxMag"
+ };
+
+ fputs( verCases_functionNamePtr, streamPtr );
+ if ( verCases_roundingCode ) {
+ if ( verCases_roundingPrecision ) {
+ fprintf(
+ streamPtr, ", precision %d", (int) verCases_roundingPrecision
+ );
+ }
+ fputs( roundingModeNames[verCases_roundingCode], streamPtr );
+ if ( verCases_tininessCode ) {
+ fputs(
+ (verCases_tininessCode == TININESS_BEFORE_ROUNDING)
+ ? ", tininess before rounding"
+ : ", tininess after rounding",
+ streamPtr
+ );
+ }
+ }
+ if ( verCases_usesExact ) {
+ fputs( verCases_exact ? ", exact" : ", not exact", streamPtr );
+ }
+
+}
+
diff --git a/source/verLoops.c b/source/verLoops.c
new file mode 100644
index 0000000..b607a4d
--- /dev/null
+++ b/source/verLoops.c
@@ -0,0 +1,4141 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "platform.h"
+#include "uint128.h"
+#include "fail.h"
+#include "softfloat.h"
+#include "readHex.h"
+#include "verCases.h"
+#include "writeCase.h"
+#include "verLoops.h"
+
+uint_fast8_t *verLoops_trueFlagsPtr;
+
+static bool atEndOfInput( void )
+{
+ int i;
+
+ i = fgetc( stdin );
+ if ( i == EOF ) {
+ if ( ! ferror( stdin ) && feof( stdin ) ) return true;
+ fail( "Error reading input" );
+ }
+ ungetc( i, stdin );
+ return false;
+
+}
+
+static void failFromBadInput( void )
+{
+
+ fail( "Invalid input format" );
+
+}
+
+static void readVerInput_bool( bool *aPtr )
+{
+
+ if ( ! readHex_bool( aPtr, ' ' ) ) failFromBadInput();
+
+}
+
+static void readVerInput_ui32( uint_fast32_t *aPtr )
+{
+ uint32_t a;
+
+ if ( ! readHex_ui32( &a, ' ' ) ) failFromBadInput();
+ *aPtr = a;
+
+}
+
+static void readVerInput_ui64( uint_fast64_t *aPtr )
+{
+ uint64_t a;
+
+ if ( ! readHex_ui64( &a, ' ' ) ) failFromBadInput();
+ *aPtr = a;
+
+}
+
+static void readVerInput_i32( int_fast32_t *aPtr )
+{
+ union { uint32_t ui; int32_t i; } uA;
+
+ if ( ! readHex_ui32( &uA.ui, ' ' ) ) failFromBadInput();
+ *aPtr = uA.i;
+
+}
+
+static void readVerInput_i64( int_fast64_t *aPtr )
+{
+ union { uint64_t ui; int64_t i; } uA;
+
+ if ( ! readHex_ui64( &uA.ui, ' ' ) ) failFromBadInput();
+ *aPtr = uA.i;
+
+}
+
+static void readVerInput_f32( float32_t *aPtr )
+{
+ union { uint32_t ui; float32_t f; } uA;
+
+ if ( ! readHex_ui32( &uA.ui, ' ' ) ) failFromBadInput();
+ *aPtr = uA.f;
+
+}
+
+static void readVerInput_f64( float64_t *aPtr )
+{
+ union { uint64_t ui; float64_t f; } uA;
+
+ if ( ! readHex_ui64( &uA.ui, ' ' ) ) failFromBadInput();
+ *aPtr = uA.f;
+
+}
+
+#ifdef EXTFLOAT80
+
+static void readVerInput_extF80( extFloat80_t *aPtr )
+{
+ struct extFloat80M *aSPtr;
+
+ aSPtr = (struct extFloat80M *) aPtr;
+ if (
+ ! readHex_ui16( &aSPtr->signExp, 0 )
+ || ! readHex_ui64( &aSPtr->signif, ' ' )
+ ) {
+ failFromBadInput();
+ }
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+static void readVerInput_f128( float128_t *aPtr )
+{
+ struct uint128 *uiAPtr;
+
+ uiAPtr = (struct uint128 *) aPtr;
+ if (
+ ! readHex_ui64( &uiAPtr->v64, 0 ) || ! readHex_ui64( &uiAPtr->v0, ' ' )
+ ) {
+ failFromBadInput();
+ }
+
+}
+
+#endif
+
+static void readVerInput_flags( uint_fast8_t *flagsPtr )
+{
+ uint_least8_t commonFlags;
+ uint_fast8_t flags;
+
+ if ( ! readHex_ui8( &commonFlags, '\n' ) || (0x20 <= commonFlags) ) {
+ failFromBadInput();
+ }
+ flags = 0;
+ if ( commonFlags & 0x10 ) flags |= softfloat_flag_invalid;
+ if ( commonFlags & 0x08 ) flags |= softfloat_flag_infinite;
+ if ( commonFlags & 0x04 ) flags |= softfloat_flag_overflow;
+ if ( commonFlags & 0x02 ) flags |= softfloat_flag_underflow;
+ if ( commonFlags & 0x01 ) flags |= softfloat_flag_inexact;
+ *flagsPtr = flags;
+
+}
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void ver_a_ui32_z_f32( float32_t trueFunction( uint_fast32_t ) )
+{
+ int count;
+ uint_fast32_t a;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_ui32( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui32( a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_ui32_z_f64( float64_t trueFunction( uint_fast32_t ) )
+{
+ int count;
+ uint_fast32_t a;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_ui32( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui32( a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#ifdef EXTFLOAT80
+
+void ver_a_ui32_z_extF80( void trueFunction( uint_fast32_t, extFloat80_t * ) )
+{
+ int count;
+ uint_fast32_t a;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_ui32( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui32( a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void ver_a_ui32_z_f128( void trueFunction( uint_fast32_t, float128_t * ) )
+{
+ int count;
+ uint_fast32_t a;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_ui32( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui32( a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void ver_a_ui64_z_f32( float32_t trueFunction( uint_fast64_t ) )
+{
+ int count;
+ uint_fast64_t a;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_ui64( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui64( a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_ui64_z_f64( float64_t trueFunction( uint_fast64_t ) )
+{
+ int count;
+ uint_fast64_t a;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_ui64( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui64( a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#ifdef EXTFLOAT80
+
+void ver_a_ui64_z_extF80( void trueFunction( uint_fast64_t, extFloat80_t * ) )
+{
+ int count;
+ uint_fast64_t a;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_ui64( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui64( a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void ver_a_ui64_z_f128( void trueFunction( uint_fast64_t, float128_t * ) )
+{
+ int count;
+ uint_fast64_t a;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_ui64( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_ui64( a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void ver_a_i32_z_f32( float32_t trueFunction( int_fast32_t ) )
+{
+ int count;
+ int_fast32_t a;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_i32( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i32( a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_i32_z_f64( float64_t trueFunction( int_fast32_t ) )
+{
+ int count;
+ int_fast32_t a;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_i32( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i32( a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#ifdef EXTFLOAT80
+
+void ver_a_i32_z_extF80( void trueFunction( int_fast32_t, extFloat80_t * ) )
+{
+ int count;
+ int_fast32_t a;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_i32( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i32( a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void ver_a_i32_z_f128( void trueFunction( int_fast32_t, float128_t * ) )
+{
+ int count;
+ int_fast32_t a;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_i32( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i32( a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void ver_a_i64_z_f32( float32_t trueFunction( int_fast64_t ) )
+{
+ int count;
+ int_fast64_t a;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_i64( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i64( a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_i64_z_f64( float64_t trueFunction( int_fast64_t ) )
+{
+ int count;
+ int_fast64_t a;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_i64( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i64( a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#ifdef EXTFLOAT80
+
+void ver_a_i64_z_extF80( void trueFunction( int_fast64_t, extFloat80_t * ) )
+{
+ int count;
+ int_fast64_t a;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_i64( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i64( a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void ver_a_i64_z_f128( void trueFunction( int_fast64_t, float128_t * ) )
+{
+ int count;
+ int_fast64_t a;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_i64( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_i64( a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void
+ ver_a_f32_z_ui32_rx(
+ uint_fast32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float32_t a;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_ui32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f32_z_ui64_rx(
+ uint_fast64_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float32_t a;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_ui64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f32_z_i32_rx(
+ int_fast32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float32_t a;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_i32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f32_z_i64_rx(
+ int_fast64_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float32_t a;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_i64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f32_z_ui32_x(
+ uint_fast32_t trueFunction( float32_t, bool ), bool exact )
+{
+ int count;
+ float32_t a;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_ui32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f32_z_ui64_x(
+ uint_fast64_t trueFunction( float32_t, bool ), bool exact )
+{
+ int count;
+ float32_t a;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_ui64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f32_z_i32_x(
+ int_fast32_t trueFunction( float32_t, bool ), bool exact )
+{
+ int count;
+ float32_t a;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_i32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f32_z_i64_x(
+ int_fast64_t trueFunction( float32_t, bool ), bool exact )
+{
+ int count;
+ float32_t a;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_i64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_f32_z_f64( float64_t trueFunction( float32_t ) )
+{
+ int count;
+ float32_t a;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#ifdef EXTFLOAT80
+
+void ver_a_f32_z_extF80( void trueFunction( float32_t, extFloat80_t * ) )
+{
+ int count;
+ float32_t a;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void ver_a_f32_z_f128( void trueFunction( float32_t, float128_t * ) )
+{
+ int count;
+ float32_t a;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+void ver_az_f32( float32_t trueFunction( float32_t ) )
+{
+ int count;
+ float32_t a, subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_az_f32_rx(
+ float32_t trueFunction( float32_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float32_t a, subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f32_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f32( a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_abz_f32( float32_t trueFunction( float32_t, float32_t ) )
+{
+ int count;
+ float32_t a, b, subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_f32( &b );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, b );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f32_isSignalingNaN( a ) || f32_isSignalingNaN( b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f32( a, b, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_abcz_f32( float32_t trueFunction( float32_t, float32_t, float32_t ) )
+{
+ int count;
+ float32_t a, b, c, subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_f32( &b );
+ readVerInput_f32( &c );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, b, c );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f32_isSignalingNaN( a ) || f32_isSignalingNaN( b )
+ || f32_isSignalingNaN( c ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_abc_f32( a, b, c, "\n\t" );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_ab_f32_z_bool( bool trueFunction( float32_t, float32_t ) )
+{
+ int count;
+ float32_t a, b;
+ bool subjZ;
+ uint_fast8_t subjFlags;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f32( &a );
+ readVerInput_f32( &b );
+ readVerInput_bool( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, b );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f32_isSignalingNaN( a ) || f32_isSignalingNaN( b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f32( a, b, " " );
+ writeCase_z_bool( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+void
+ ver_a_f64_z_ui32_rx(
+ uint_fast32_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float64_t a;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_ui32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f64_z_ui64_rx(
+ uint_fast64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float64_t a;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_ui64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f64_z_i32_rx(
+ int_fast32_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float64_t a;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_i32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f64_z_i64_rx(
+ int_fast64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float64_t a;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_i64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f64_z_ui32_x(
+ uint_fast32_t trueFunction( float64_t, bool ), bool exact )
+{
+ int count;
+ float64_t a;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_ui32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f64_z_ui64_x(
+ uint_fast64_t trueFunction( float64_t, bool ), bool exact )
+{
+ int count;
+ float64_t a;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_ui64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f64_z_i32_x(
+ int_fast32_t trueFunction( float64_t, bool ), bool exact )
+{
+ int count;
+ float64_t a;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_i32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f64_z_i64_x(
+ int_fast64_t trueFunction( float64_t, bool ), bool exact )
+{
+ int count;
+ float64_t a;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_i64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_f64_z_f32( float32_t trueFunction( float64_t ) )
+{
+ int count;
+ float64_t a;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#ifdef EXTFLOAT80
+
+void ver_a_f64_z_extF80( void trueFunction( float64_t, extFloat80_t * ) )
+{
+ int count;
+ float64_t a;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void ver_a_f64_z_f128( void trueFunction( float64_t, float128_t * ) )
+{
+ int count;
+ float64_t a;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+void ver_az_f64( float64_t trueFunction( float64_t ) )
+{
+ int count;
+ float64_t a, subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_az_f64_rx(
+ float64_t trueFunction( float64_t, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float64_t a, subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f64_isSignalingNaN( a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f64( a, " " );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_abz_f64( float64_t trueFunction( float64_t, float64_t ) )
+{
+ int count;
+ float64_t a, b, subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_f64( &b );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, b );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f64_isSignalingNaN( a ) || f64_isSignalingNaN( b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f64( a, b, "\n\t" );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_abcz_f64( float64_t trueFunction( float64_t, float64_t, float64_t ) )
+{
+ int count;
+ float64_t a, b, c, subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_f64( &b );
+ readVerInput_f64( &c );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, b, c );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f64_isSignalingNaN( a ) || f64_isSignalingNaN( b )
+ || f64_isSignalingNaN( c ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_abc_f64( a, b, c, "\n\t" );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_ab_f64_z_bool( bool trueFunction( float64_t, float64_t ) )
+{
+ int count;
+ float64_t a, b;
+ bool subjZ;
+ uint_fast8_t subjFlags;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f64( &a );
+ readVerInput_f64( &b );
+ readVerInput_bool( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( a, b );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f64_isSignalingNaN( a ) || f64_isSignalingNaN( b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f64( a, b, " " );
+ writeCase_z_bool( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#ifdef EXTFLOAT80
+
+void
+ ver_a_extF80_z_ui32_rx(
+ uint_fast32_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ extFloat80_t a;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_ui32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_extF80_z_ui64_rx(
+ uint_fast64_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ extFloat80_t a;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_ui64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, "\n\t" );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_extF80_z_i32_rx(
+ int_fast32_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ extFloat80_t a;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_i32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_extF80_z_i64_rx(
+ int_fast64_t trueFunction( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ extFloat80_t a;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_i64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, "\n\t" );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_extF80_z_ui32_x(
+ uint_fast32_t trueFunction( const extFloat80_t *, bool ), bool exact )
+{
+ int count;
+ extFloat80_t a;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_ui32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_extF80_z_ui64_x(
+ uint_fast64_t trueFunction( const extFloat80_t *, bool ), bool exact )
+{
+ int count;
+ extFloat80_t a;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_ui64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, "\n\t" );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_extF80_z_i32_x(
+ int_fast32_t trueFunction( const extFloat80_t *, bool ), bool exact )
+{
+ int count;
+ extFloat80_t a;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_i32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_extF80_z_i64_x(
+ int_fast64_t trueFunction( const extFloat80_t *, bool ), bool exact )
+{
+ int count;
+ extFloat80_t a;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_i64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, "\n\t" );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_extF80_z_f32( float32_t trueFunction( const extFloat80_t * ) )
+{
+ int count;
+ extFloat80_t a;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, "\n\t" );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_extF80_z_f64( float64_t trueFunction( const extFloat80_t * ) )
+{
+ int count;
+ extFloat80_t a;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, "\n\t" );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#ifdef FLOAT128
+
+void
+ ver_a_extF80_z_f128( void trueFunction( const extFloat80_t *, float128_t * ) )
+{
+ int count;
+ extFloat80_t a;
+ float128_t subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, "\n\t" );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+void ver_az_extF80( void trueFunction( const extFloat80_t *, extFloat80_t * ) )
+{
+ int count;
+ extFloat80_t a, subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_az_extF80_rx(
+ void
+ trueFunction( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ extFloat80_t a, subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, roundingMode, exact, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && extF80M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_extF80M( &a, " " );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_abz_extF80(
+ void
+ trueFunction(
+ const extFloat80_t *, const extFloat80_t *, extFloat80_t * )
+ )
+{
+ int count;
+ extFloat80_t a, b, subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_extF80( &b );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, &b, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (extF80M_isSignalingNaN( &a )
+ || extF80M_isSignalingNaN( &b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_extF80M( &a, &b, "\n\t" );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_abcz_extF80(
+ void
+ trueFunction(
+ const extFloat80_t *,
+ const extFloat80_t *,
+ const extFloat80_t *,
+ extFloat80_t *
+ )
+ )
+{
+ int count;
+ extFloat80_t a, b, c, subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_extF80( &b );
+ readVerInput_extF80( &c );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, &b, &c, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && ( extF80M_isSignalingNaN( &a )
+ || extF80M_isSignalingNaN( &b )
+ || extF80M_isSignalingNaN( &c )
+ )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_abc_extF80M( &a, &b, &c, "\n\t" );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_ab_extF80_z_bool(
+ bool trueFunction( const extFloat80_t *, const extFloat80_t * ) )
+{
+ int count;
+ extFloat80_t a, b;
+ bool subjZ;
+ uint_fast8_t subjFlags;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_extF80( &a );
+ readVerInput_extF80( &b );
+ readVerInput_bool( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, &b );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (extF80M_isSignalingNaN( &a )
+ || extF80M_isSignalingNaN( &b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_extF80M( &a, &b, " " );
+ writeCase_z_bool( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+/*----------------------------------------------------------------------------
+*----------------------------------------------------------------------------*/
+#ifdef FLOAT128
+
+void
+ ver_a_f128_z_ui32_rx(
+ uint_fast32_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float128_t a;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_ui32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f128_z_ui64_rx(
+ uint_fast64_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float128_t a;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_ui64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, "\n\t" );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f128_z_i32_rx(
+ int_fast32_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float128_t a;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_i32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f128_z_i64_rx(
+ int_fast64_t trueFunction( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float128_t a;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_i64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, roundingMode, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, "\n\t" );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f128_z_ui32_x(
+ uint_fast32_t trueFunction( const float128_t *, bool ), bool exact )
+{
+ int count;
+ float128_t a;
+ uint_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_ui32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0xFFFFFFFF)
+ || (subjZ != 0xFFFFFFFF)
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, " " );
+ writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f128_z_ui64_x(
+ uint_fast64_t trueFunction( const float128_t *, bool ), bool exact )
+{
+ int count;
+ float128_t a;
+ uint_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ uint_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_ui64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (subjZ != UINT64_C( 0xFFFFFFFFFFFFFFFF ))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, "\n\t" );
+ writeCase_z_ui64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f128_z_i32_x(
+ int_fast32_t trueFunction( const float128_t *, bool ), bool exact )
+{
+ int count;
+ float128_t a;
+ int_fast32_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_i32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != 0x7FFFFFFF)
+ || ((subjZ != 0x7FFFFFFF) && (subjZ != -0x7FFFFFFF - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, " " );
+ writeCase_z_i32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_a_f128_z_i64_x(
+ int_fast64_t trueFunction( const float128_t *, bool ), bool exact )
+{
+ int count;
+ float128_t a;
+ int_fast64_t subjZ;
+ uint_fast8_t subjFlags;
+ int_fast64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_i64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, exact );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ (trueZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ || ((subjZ != INT64_C( 0x7FFFFFFFFFFFFFFF ))
+ && (subjZ != -INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1))
+ || (trueFlags != softfloat_flag_invalid)
+ || (subjFlags != softfloat_flag_invalid)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, "\n\t" );
+ writeCase_z_i64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_f128_z_f32( float32_t trueFunction( const float128_t * ) )
+{
+ int count;
+ float128_t a;
+ float32_t subjZ;
+ uint_fast8_t subjFlags;
+ float32_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_f32( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f32_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f32_isNaN( trueZ )
+ || ! f32_isNaN( subjZ )
+ || f32_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, "\n\t" );
+ writeCase_z_f32( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void ver_a_f128_z_f64( float64_t trueFunction( const float128_t * ) )
+{
+ int count;
+ float128_t a;
+ float64_t subjZ;
+ uint_fast8_t subjFlags;
+ float64_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_f64( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f64_same( trueZ, subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f64_isNaN( trueZ )
+ || ! f64_isNaN( subjZ )
+ || f64_isSignalingNaN( subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, "\n\t" );
+ writeCase_z_f64( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#ifdef EXTFLOAT80
+
+void
+ ver_a_f128_z_extF80( void trueFunction( const float128_t *, extFloat80_t * ) )
+{
+ int count;
+ float128_t a;
+ extFloat80_t subjZ;
+ uint_fast8_t subjFlags;
+ extFloat80_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_extF80( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! extF80M_isNaN( &trueZ )
+ || ! extF80M_isNaN( &subjZ )
+ || extF80M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, "\n\t" );
+ writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
+void ver_az_f128( void trueFunction( const float128_t *, float128_t * ) )
+{
+ int count;
+ float128_t a, subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_az_f128_rx(
+ void trueFunction( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ uint_fast8_t roundingMode,
+ bool exact
+ )
+{
+ int count;
+ float128_t a, subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, roundingMode, exact, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if ( ! verCases_checkNaNs && f128M_isSignalingNaN( &a ) ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_a_f128M( &a, " " );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_abz_f128(
+ void trueFunction( const float128_t *, const float128_t *, float128_t * )
+ )
+{
+ int count;
+ float128_t a, b, subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_f128( &b );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, &b, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f128M_isSignalingNaN( &a )
+ || f128M_isSignalingNaN( &b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f128M( &a, &b, "\n\t" );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_abcz_f128(
+ void
+ trueFunction(
+ const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ )
+ )
+{
+ int count;
+ float128_t a, b, c, subjZ;
+ uint_fast8_t subjFlags;
+ float128_t trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_f128( &b );
+ readVerInput_f128( &c );
+ readVerInput_f128( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueFunction( &a, &b, &c, &trueZ );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( ! f128M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && ( f128M_isSignalingNaN( &a )
+ || f128M_isSignalingNaN( &b )
+ || f128M_isSignalingNaN( &c )
+ )
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if (
+ verCases_checkNaNs
+ || ! f128M_isNaN( &trueZ )
+ || ! f128M_isNaN( &subjZ )
+ || f128M_isSignalingNaN( &subjZ )
+ || (trueFlags != subjFlags)
+ ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_abc_f128M( &a, &b, &c, "\n\t" );
+ writeCase_z_f128M( &trueZ, trueFlags, &subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+void
+ ver_ab_f128_z_bool(
+ bool trueFunction( const float128_t *, const float128_t * ) )
+{
+ int count;
+ float128_t a, b;
+ bool subjZ;
+ uint_fast8_t subjFlags;
+ bool trueZ;
+ uint_fast8_t trueFlags;
+
+ verCases_errorCount = 0;
+ verCases_tenThousandsCount = 0;
+ count = 10000;
+ while ( ! atEndOfInput() ) {
+ readVerInput_f128( &a );
+ readVerInput_f128( &b );
+ readVerInput_bool( &subjZ );
+ readVerInput_flags( &subjFlags );
+ *verLoops_trueFlagsPtr = 0;
+ trueZ = trueFunction( &a, &b );
+ trueFlags = *verLoops_trueFlagsPtr;
+ --count;
+ if ( ! count ) {
+ verCases_perTenThousand();
+ count = 10000;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ if (
+ ! verCases_checkNaNs
+ && (f128M_isSignalingNaN( &a )
+ || f128M_isSignalingNaN( &b ))
+ ) {
+ trueFlags |= softfloat_flag_invalid;
+ }
+ if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
+ ++verCases_errorCount;
+ verCases_writeErrorFound( 10000 - count );
+ writeCase_ab_f128M( &a, &b, " " );
+ writeCase_z_bool( trueZ, trueFlags, subjZ, subjFlags );
+ if ( verCases_errorCount == verCases_maxErrorCount ) break;
+ }
+ }
+ }
+ verCases_writeTestsPerformed( 10000 - count );
+
+}
+
+#endif
+
diff --git a/source/verLoops.h b/source/verLoops.h
new file mode 100644
index 0000000..b575641
--- /dev/null
+++ b/source/verLoops.h
@@ -0,0 +1,251 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "softfloat.h"
+
+extern uint_fast8_t *verLoops_trueFlagsPtr;
+
+void ver_a_ui32_z_f32( float32_t ( uint_fast32_t ) );
+void ver_a_ui32_z_f64( float64_t ( uint_fast32_t ) );
+#ifdef EXTFLOAT80
+void ver_a_ui32_z_extF80( void ( uint_fast32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void ver_a_ui32_z_f128( void ( uint_fast32_t, float128_t * ) );
+#endif
+void ver_a_ui64_z_f32( float32_t ( uint_fast64_t ) );
+void ver_a_ui64_z_f64( float64_t ( uint_fast64_t ) );
+#ifdef EXTFLOAT80
+void ver_a_ui64_z_extF80( void ( uint_fast64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void ver_a_ui64_z_f128( void ( uint_fast64_t, float128_t * ) );
+#endif
+void ver_a_i32_z_f32( float32_t ( int_fast32_t ) );
+void ver_a_i32_z_f64( float64_t ( int_fast32_t ) );
+#ifdef EXTFLOAT80
+void ver_a_i32_z_extF80( void ( int_fast32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void ver_a_i32_z_f128( void ( int_fast32_t, float128_t * ) );
+#endif
+void ver_a_i64_z_f32( float32_t ( int_fast64_t ) );
+void ver_a_i64_z_f64( float64_t ( int_fast64_t ) );
+#ifdef EXTFLOAT80
+void ver_a_i64_z_extF80( void ( int_fast64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void ver_a_i64_z_f128( void ( int_fast64_t, float128_t * ) );
+#endif
+
+void
+ ver_a_f32_z_ui32_rx(
+ uint_fast32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ ver_a_f32_z_ui64_rx(
+ uint_fast64_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ ver_a_f32_z_i32_rx(
+ int_fast32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ ver_a_f32_z_i64_rx(
+ int_fast64_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void ver_a_f32_z_ui32_x( uint_fast32_t ( float32_t, bool ), bool );
+void ver_a_f32_z_ui64_x( uint_fast64_t ( float32_t, bool ), bool );
+void ver_a_f32_z_i32_x( int_fast32_t ( float32_t, bool ), bool );
+void ver_a_f32_z_i64_x( int_fast64_t ( float32_t, bool ), bool );
+void ver_a_f32_z_f64( float64_t ( float32_t ) );
+#ifdef EXTFLOAT80
+void ver_a_f32_z_extF80( void ( float32_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void ver_a_f32_z_f128( void ( float32_t, float128_t * ) );
+#endif
+void ver_az_f32( float32_t ( float32_t ) );
+void
+ ver_az_f32_rx(
+ float32_t ( float32_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void ver_abz_f32( float32_t ( float32_t, float32_t ) );
+void ver_abcz_f32( float32_t ( float32_t, float32_t, float32_t ) );
+void ver_ab_f32_z_bool( bool ( float32_t, float32_t ) );
+
+void
+ ver_a_f64_z_ui32_rx(
+ uint_fast32_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ ver_a_f64_z_ui64_rx(
+ uint_fast64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ ver_a_f64_z_i32_rx(
+ int_fast32_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void
+ ver_a_f64_z_i64_rx(
+ int_fast64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void ver_a_f64_z_ui32_x( uint_fast32_t ( float64_t, bool ), bool );
+void ver_a_f64_z_ui64_x( uint_fast64_t ( float64_t, bool ), bool );
+void ver_a_f64_z_i32_x( int_fast32_t ( float64_t, bool ), bool );
+void ver_a_f64_z_i64_x( int_fast64_t ( float64_t, bool ), bool );
+void ver_a_f64_z_f32( float32_t ( float64_t ) );
+#ifdef EXTFLOAT80
+void ver_a_f64_z_extF80( void ( float64_t, extFloat80_t * ) );
+#endif
+#ifdef FLOAT128
+void ver_a_f64_z_f128( void ( float64_t, float128_t * ) );
+#endif
+void ver_az_f64( float64_t ( float64_t ) );
+void
+ ver_az_f64_rx(
+ float64_t ( float64_t, uint_fast8_t, bool ), uint_fast8_t, bool );
+void ver_abz_f64( float64_t ( float64_t, float64_t ) );
+void ver_abcz_f64( float64_t ( float64_t, float64_t, float64_t ) );
+void ver_ab_f64_z_bool( bool ( float64_t, float64_t ) );
+
+#ifdef EXTFLOAT80
+void
+ ver_a_extF80_z_ui32_rx(
+ uint_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_a_extF80_z_ui64_rx(
+ uint_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_a_extF80_z_i32_rx(
+ int_fast32_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_a_extF80_z_i64_rx(
+ int_fast64_t ( const extFloat80_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_a_extF80_z_ui32_x( uint_fast32_t ( const extFloat80_t *, bool ), bool );
+void
+ ver_a_extF80_z_ui64_x( uint_fast64_t ( const extFloat80_t *, bool ), bool );
+void ver_a_extF80_z_i32_x( int_fast32_t ( const extFloat80_t *, bool ), bool );
+void ver_a_extF80_z_i64_x( int_fast64_t ( const extFloat80_t *, bool ), bool );
+void ver_a_extF80_z_f32( float32_t ( const extFloat80_t * ) );
+void ver_a_extF80_z_f64( float64_t ( const extFloat80_t * ) );
+#ifdef FLOAT128
+void ver_a_extF80_z_f128( void ( const extFloat80_t *, float128_t * ) );
+#endif
+void ver_az_extF80( void ( const extFloat80_t *, extFloat80_t * ) );
+void
+ ver_az_extF80_rx(
+ void ( const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_abz_extF80(
+ void ( const extFloat80_t *, const extFloat80_t *, extFloat80_t * ) );
+void
+ ver_abcz_extF80(
+ void
+ (
+ const extFloat80_t *,
+ const extFloat80_t *,
+ const extFloat80_t *,
+ extFloat80_t *
+ )
+ );
+void
+ ver_ab_extF80_z_bool( bool ( const extFloat80_t *, const extFloat80_t * ) );
+#endif
+
+#ifdef FLOAT128
+void
+ ver_a_f128_z_ui32_rx(
+ uint_fast32_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_a_f128_z_ui64_rx(
+ uint_fast64_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_a_f128_z_i32_rx(
+ int_fast32_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_a_f128_z_i64_rx(
+ int_fast64_t ( const float128_t *, uint_fast8_t, bool ),
+ uint_fast8_t,
+ bool
+ );
+void ver_a_f128_z_ui32_x( uint_fast32_t ( const float128_t *, bool ), bool );
+void ver_a_f128_z_ui64_x( uint_fast64_t ( const float128_t *, bool ), bool );
+void ver_a_f128_z_i32_x( int_fast32_t ( const float128_t *, bool ), bool );
+void ver_a_f128_z_i64_x( int_fast64_t ( const float128_t *, bool ), bool );
+void ver_a_f128_z_f32( float32_t ( const float128_t * ) );
+void ver_a_f128_z_f64( float64_t ( const float128_t * ) );
+#ifdef EXTFLOAT80
+void ver_a_f128_z_extF80( void ( const float128_t *, extFloat80_t * ) );
+#endif
+void ver_az_f128( void ( const float128_t *, float128_t * ) );
+void
+ ver_az_f128_rx(
+ void ( const float128_t *, uint_fast8_t, bool, float128_t * ),
+ uint_fast8_t,
+ bool
+ );
+void
+ ver_abz_f128( void ( const float128_t *, const float128_t *, float128_t * ) );
+void
+ ver_abcz_f128(
+ void
+ (
+ const float128_t *,
+ const float128_t *,
+ const float128_t *,
+ float128_t *
+ )
+ );
+void ver_ab_f128_z_bool( bool ( const float128_t *, const float128_t * ) );
+#endif
+
diff --git a/source/writeCase.h b/source/writeCase.h
new file mode 100644
index 0000000..bcb96c3
--- /dev/null
+++ b/source/writeCase.h
@@ -0,0 +1,91 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "softfloat.h"
+
+void writeCase_a_ui32( uint_fast32_t, const char * );
+void writeCase_a_ui64( uint_fast64_t, const char * );
+#define writeCase_a_i32 writeCase_a_ui32
+#define writeCase_a_i64 writeCase_a_ui64
+void writeCase_a_f32( float32_t, const char * );
+void writeCase_ab_f32( float32_t, float32_t, const char * );
+void writeCase_abc_f32( float32_t, float32_t, float32_t, const char * );
+void writeCase_a_f64( float64_t, const char * );
+void writeCase_ab_f64( float64_t, float64_t, const char * );
+void writeCase_abc_f64( float64_t, float64_t, float64_t, const char * );
+#ifdef EXTFLOAT80
+void writeCase_a_extF80M( const extFloat80_t *, const char * );
+void
+ writeCase_ab_extF80M(
+ const extFloat80_t *, const extFloat80_t *, const char * );
+void
+ writeCase_abc_extF80M(
+ const extFloat80_t *,
+ const extFloat80_t *,
+ const extFloat80_t *,
+ const char *
+ );
+#endif
+#ifdef FLOAT128
+void writeCase_a_f128M( const float128_t *, const char * );
+void
+ writeCase_ab_f128M( const float128_t *, const float128_t *, const char * );
+void
+ writeCase_abc_f128M(
+ const float128_t *, const float128_t *, const float128_t *, const char *
+ );
+#endif
+
+void writeCase_z_bool( bool, uint_fast8_t, bool, uint_fast8_t );
+void
+ writeCase_z_ui32( uint_fast32_t, uint_fast8_t, uint_fast32_t, uint_fast8_t );
+void
+ writeCase_z_ui64( uint_fast64_t, uint_fast8_t, uint_fast64_t, uint_fast8_t );
+#define writeCase_z_i32 writeCase_z_ui32
+#define writeCase_z_i64 writeCase_z_ui64
+void writeCase_z_f32( float32_t, uint_fast8_t, float32_t, uint_fast8_t );
+void writeCase_z_f64( float64_t, uint_fast8_t, float64_t, uint_fast8_t );
+#ifdef EXTFLOAT80
+void
+ writeCase_z_extF80M(
+ const extFloat80_t *, uint_fast8_t, const extFloat80_t *, uint_fast8_t );
+#endif
+#ifdef FLOAT128
+void
+ writeCase_z_f128M(
+ const float128_t *, uint_fast8_t, const float128_t *, uint_fast8_t );
+#endif
+
diff --git a/source/writeCase_a_extF80M.c b/source/writeCase_a_extF80M.c
new file mode 100644
index 0000000..87f0fe0
--- /dev/null
+++ b/source/writeCase_a_extF80M.c
@@ -0,0 +1,52 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+#ifdef EXTFLOAT80
+
+void writeCase_a_extF80M( const extFloat80_t *aPtr, const char *sepStringPtr )
+{
+
+ writeHex_extF80M( aPtr, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
+#endif
+
diff --git a/source/writeCase_a_f128M.c b/source/writeCase_a_f128M.c
new file mode 100644
index 0000000..e98bbbc
--- /dev/null
+++ b/source/writeCase_a_f128M.c
@@ -0,0 +1,52 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+#ifdef FLOAT128
+
+void writeCase_a_f128M( const float128_t *aPtr, const char *sepStringPtr )
+{
+
+ writeHex_f128M( aPtr, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
+#endif
+
diff --git a/source/writeCase_a_f32.c b/source/writeCase_a_f32.c
new file mode 100644
index 0000000..c9612d5
--- /dev/null
+++ b/source/writeCase_a_f32.c
@@ -0,0 +1,48 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void writeCase_a_f32( float32_t a, const char *sepStringPtr )
+{
+
+ writeHex_f32( a, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
diff --git a/source/writeCase_a_f64.c b/source/writeCase_a_f64.c
new file mode 100644
index 0000000..43e8130
--- /dev/null
+++ b/source/writeCase_a_f64.c
@@ -0,0 +1,48 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void writeCase_a_f64( float64_t a, const char *sepStringPtr )
+{
+
+ writeHex_f64( a, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
diff --git a/source/writeCase_a_ui32.c b/source/writeCase_a_ui32.c
new file mode 100644
index 0000000..e8eed9a
--- /dev/null
+++ b/source/writeCase_a_ui32.c
@@ -0,0 +1,48 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void writeCase_a_ui32( uint_fast32_t a, const char *sepStringPtr )
+{
+
+ writeHex_ui32( a, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
diff --git a/source/writeCase_a_ui64.c b/source/writeCase_a_ui64.c
new file mode 100644
index 0000000..e19612d
--- /dev/null
+++ b/source/writeCase_a_ui64.c
@@ -0,0 +1,48 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void writeCase_a_ui64( uint_fast64_t a, const char *sepStringPtr )
+{
+
+ writeHex_ui64( a, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
diff --git a/source/writeCase_ab_extF80M.c b/source/writeCase_ab_extF80M.c
new file mode 100644
index 0000000..e4dfe48
--- /dev/null
+++ b/source/writeCase_ab_extF80M.c
@@ -0,0 +1,59 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+#ifdef EXTFLOAT80
+
+void
+ writeCase_ab_extF80M(
+ const extFloat80_t *aPtr,
+ const extFloat80_t *bPtr,
+ const char *sepStringPtr
+ )
+{
+
+ writeHex_extF80M( aPtr, 0 );
+ fputs( " ", stdout );
+ writeHex_extF80M( bPtr, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
+#endif
+
diff --git a/source/writeCase_ab_f128M.c b/source/writeCase_ab_f128M.c
new file mode 100644
index 0000000..d5630a9
--- /dev/null
+++ b/source/writeCase_ab_f128M.c
@@ -0,0 +1,56 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+#ifdef FLOAT128
+
+void
+ writeCase_ab_f128M(
+ const float128_t *aPtr, const float128_t *bPtr, const char *sepStringPtr )
+{
+
+ writeHex_f128M( aPtr, 0 );
+ fputs( " ", stdout );
+ writeHex_f128M( bPtr, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
+#endif
+
diff --git a/source/writeCase_ab_f32.c b/source/writeCase_ab_f32.c
new file mode 100644
index 0000000..093af84
--- /dev/null
+++ b/source/writeCase_ab_f32.c
@@ -0,0 +1,50 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void writeCase_ab_f32( float32_t a, float32_t b, const char *sepStringPtr )
+{
+
+ writeHex_f32( a, 0 );
+ fputs( " ", stdout );
+ writeHex_f32( b, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
diff --git a/source/writeCase_ab_f64.c b/source/writeCase_ab_f64.c
new file mode 100644
index 0000000..6ecae16
--- /dev/null
+++ b/source/writeCase_ab_f64.c
@@ -0,0 +1,50 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void writeCase_ab_f64( float64_t a, float64_t b, const char *sepStringPtr )
+{
+
+ writeHex_f64( a, 0 );
+ fputs( " ", stdout );
+ writeHex_f64( b, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
diff --git a/source/writeCase_abc_extF80M.c b/source/writeCase_abc_extF80M.c
new file mode 100644
index 0000000..3bcc411
--- /dev/null
+++ b/source/writeCase_abc_extF80M.c
@@ -0,0 +1,62 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+#ifdef EXTFLOAT80
+
+void
+ writeCase_abc_extF80M(
+ const extFloat80_t *aPtr,
+ const extFloat80_t *bPtr,
+ const extFloat80_t *cPtr,
+ const char *sepStringPtr
+ )
+{
+
+ writeHex_extF80M( aPtr, 0 );
+ fputs( " ", stdout );
+ writeHex_extF80M( bPtr, 0 );
+ fputs( "\n\t", stdout );
+ writeHex_extF80M( cPtr, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
+#endif
+
diff --git a/source/writeCase_abc_f128M.c b/source/writeCase_abc_f128M.c
new file mode 100644
index 0000000..193f895
--- /dev/null
+++ b/source/writeCase_abc_f128M.c
@@ -0,0 +1,62 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+#ifdef FLOAT128
+
+void
+ writeCase_abc_f128M(
+ const float128_t *aPtr,
+ const float128_t *bPtr,
+ const float128_t *cPtr,
+ const char *sepStringPtr
+ )
+{
+
+ writeHex_f128M( aPtr, 0 );
+ fputs( " ", stdout );
+ writeHex_f128M( bPtr, 0 );
+ fputs( "\n\t", stdout );
+ writeHex_f128M( cPtr, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
+#endif
+
diff --git a/source/writeCase_abc_f32.c b/source/writeCase_abc_f32.c
new file mode 100644
index 0000000..ae2f71a
--- /dev/null
+++ b/source/writeCase_abc_f32.c
@@ -0,0 +1,54 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void
+ writeCase_abc_f32(
+ float32_t a, float32_t b, float32_t c, const char *sepStringPtr )
+{
+
+ writeHex_f32( a, 0 );
+ fputs( " ", stdout );
+ writeHex_f32( b, 0 );
+ fputs( " ", stdout );
+ writeHex_f32( c, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
diff --git a/source/writeCase_abc_f64.c b/source/writeCase_abc_f64.c
new file mode 100644
index 0000000..8938b57
--- /dev/null
+++ b/source/writeCase_abc_f64.c
@@ -0,0 +1,54 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void
+ writeCase_abc_f64(
+ float64_t a, float64_t b, float64_t c, const char *sepStringPtr )
+{
+
+ writeHex_f64( a, 0 );
+ fputs( " ", stdout );
+ writeHex_f64( b, 0 );
+ fputs( " ", stdout );
+ writeHex_f64( c, 0 );
+ fputs( sepStringPtr, stdout );
+
+}
+
diff --git a/source/writeCase_z_bool.c b/source/writeCase_z_bool.c
new file mode 100644
index 0000000..fd0dd74
--- /dev/null
+++ b/source/writeCase_z_bool.c
@@ -0,0 +1,56 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void
+ writeCase_z_bool(
+ bool trueZ, uint_fast8_t trueFlags, bool subjZ, uint_fast8_t subjFlags )
+{
+
+ fputs( "=> ", stdout );
+ writeHex_bool( subjZ, ' ' );
+ writeHex_softfloat_flags( subjFlags, 0 );
+ fputs( " expected ", stdout );
+ writeHex_bool( trueZ, ' ' );
+ writeHex_softfloat_flags( trueFlags, '\n' );
+ fflush( stdout );
+
+}
+
diff --git a/source/writeCase_z_extF80M.c b/source/writeCase_z_extF80M.c
new file mode 100644
index 0000000..9016f9c
--- /dev/null
+++ b/source/writeCase_z_extF80M.c
@@ -0,0 +1,64 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+#ifdef EXTFLOAT80
+
+void
+ writeCase_z_extF80M(
+ const extFloat80_t *trueZPtr,
+ uint_fast8_t trueFlags,
+ const extFloat80_t *subjZPtr,
+ uint_fast8_t subjFlags
+ )
+{
+
+ fputs( "=> ", stdout );
+ writeHex_extF80M( subjZPtr, ' ' );
+ writeHex_softfloat_flags( subjFlags, 0 );
+ fputs( "\n\texpected ", stdout );
+ writeHex_extF80M( trueZPtr, ' ' );
+ writeHex_softfloat_flags( trueFlags, '\n' );
+ fflush( stdout );
+
+}
+
+#endif
+
diff --git a/source/writeCase_z_f128M.c b/source/writeCase_z_f128M.c
new file mode 100644
index 0000000..e5072ab
--- /dev/null
+++ b/source/writeCase_z_f128M.c
@@ -0,0 +1,64 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+#ifdef FLOAT128
+
+void
+ writeCase_z_f128M(
+ const float128_t *trueZPtr,
+ uint_fast8_t trueFlags,
+ const float128_t *subjZPtr,
+ uint_fast8_t subjFlags
+ )
+{
+
+ fputs( "=> ", stdout );
+ writeHex_f128M( subjZPtr, ' ' );
+ writeHex_softfloat_flags( subjFlags, 0 );
+ fputs( "\n\texpected ", stdout );
+ writeHex_f128M( trueZPtr, ' ' );
+ writeHex_softfloat_flags( trueFlags, '\n' );
+ fflush( stdout );
+
+}
+
+#endif
+
diff --git a/source/writeCase_z_f32.c b/source/writeCase_z_f32.c
new file mode 100644
index 0000000..44d90ce
--- /dev/null
+++ b/source/writeCase_z_f32.c
@@ -0,0 +1,60 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void
+ writeCase_z_f32(
+ float32_t trueZ,
+ uint_fast8_t trueFlags,
+ float32_t subjZ,
+ uint_fast8_t subjFlags
+ )
+{
+
+ fputs( "=> ", stdout );
+ writeHex_f32( subjZ, ' ' );
+ writeHex_softfloat_flags( subjFlags, 0 );
+ fputs( " expected ", stdout );
+ writeHex_f32( trueZ, ' ' );
+ writeHex_softfloat_flags( trueFlags, '\n' );
+ fflush( stdout );
+
+}
+
diff --git a/source/writeCase_z_f64.c b/source/writeCase_z_f64.c
new file mode 100644
index 0000000..8eafa8f
--- /dev/null
+++ b/source/writeCase_z_f64.c
@@ -0,0 +1,60 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "softfloat.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void
+ writeCase_z_f64(
+ float64_t trueZ,
+ uint_fast8_t trueFlags,
+ float64_t subjZ,
+ uint_fast8_t subjFlags
+ )
+{
+
+ fputs( "=> ", stdout );
+ writeHex_f64( subjZ, ' ' );
+ writeHex_softfloat_flags( subjFlags, 0 );
+ fputs( " expected ", stdout );
+ writeHex_f64( trueZ, ' ' );
+ writeHex_softfloat_flags( trueFlags, '\n' );
+ fflush( stdout );
+
+}
+
diff --git a/source/writeCase_z_ui32.c b/source/writeCase_z_ui32.c
new file mode 100644
index 0000000..3466cfa
--- /dev/null
+++ b/source/writeCase_z_ui32.c
@@ -0,0 +1,59 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void
+ writeCase_z_ui32(
+ uint_fast32_t trueZ,
+ uint_fast8_t trueFlags,
+ uint_fast32_t subjZ,
+ uint_fast8_t subjFlags
+ )
+{
+
+ fputs( "=> ", stdout );
+ writeHex_ui32( subjZ, ' ' );
+ writeHex_softfloat_flags( subjFlags, 0 );
+ fputs( " expected ", stdout );
+ writeHex_ui32( trueZ, ' ' );
+ writeHex_softfloat_flags( trueFlags, '\n' );
+ fflush( stdout );
+
+}
+
diff --git a/source/writeCase_z_ui64.c b/source/writeCase_z_ui64.c
new file mode 100644
index 0000000..b0a9b85
--- /dev/null
+++ b/source/writeCase_z_ui64.c
@@ -0,0 +1,59 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "writeHex.h"
+#include "writeCase.h"
+
+void
+ writeCase_z_ui64(
+ uint_fast64_t trueZ,
+ uint_fast8_t trueFlags,
+ uint_fast64_t subjZ,
+ uint_fast8_t subjFlags
+ )
+{
+
+ fputs( "=> ", stdout );
+ writeHex_ui64( subjZ, ' ' );
+ writeHex_softfloat_flags( subjFlags, 0 );
+ fputs( " expected ", stdout );
+ writeHex_ui64( trueZ, ' ' );
+ writeHex_softfloat_flags( trueFlags, '\n' );
+ fflush( stdout );
+
+}
+
diff --git a/source/writeHex.c b/source/writeHex.c
new file mode 100644
index 0000000..311ddea
--- /dev/null
+++ b/source/writeHex.c
@@ -0,0 +1,193 @@
+
+/*============================================================================
+
+This C source file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "platform.h"
+#include "uint128.h"
+#include "softfloat.h"
+#include "writeHex.h"
+
+void writeHex_bool( bool a, char sepChar )
+{
+
+ fputc( a ? '1' : '0', stdout );
+ if ( sepChar ) fputc( sepChar, stdout );
+
+}
+
+void writeHex_ui8( uint_fast8_t a, char sepChar )
+{
+ int digit;
+
+ digit = a>>4 & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ digit = a & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ if ( sepChar ) fputc( sepChar, stdout );
+
+}
+
+static void writeHex_ui12( uint_fast16_t a, char sepChar )
+{
+ int digit;
+
+ digit = a>>8 & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ digit = a>>4 & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ digit = a & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ if ( sepChar ) fputc( sepChar, stdout );
+
+}
+
+void writeHex_ui16( uint_fast16_t a, char sepChar )
+{
+ int digit;
+
+ digit = a>>12 & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ digit = a>>8 & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ digit = a>>4 & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ digit = a & 0xF;
+ if ( 9 < digit ) digit += 'A' - ('0' + 10);
+ fputc( '0' + digit, stdout );
+ if ( sepChar ) fputc( sepChar, stdout );
+
+}
+
+void writeHex_ui32( uint_fast32_t a, char sepChar )
+{
+
+ writeHex_ui16( a>>16, 0 );
+ writeHex_ui16( a, sepChar );
+
+}
+
+void writeHex_ui64( uint_fast64_t a, char sepChar )
+{
+
+ writeHex_ui32( a>>32, 0 );
+ writeHex_ui32( a, sepChar );
+
+}
+
+void writeHex_f32( float32_t a, char sepChar )
+{
+ union { uint32_t ui; float32_t f; } uA;
+ uint_fast32_t uiA;
+
+ uA.f = a;
+ uiA = uA.ui;
+ fputc( (0x80000000 <= uiA) ? '8' : '0', stdout );
+ writeHex_ui8( uiA>>23, 0 );
+ fputc( '.', stdout );
+ writeHex_ui8( uiA>>16 & 0x7F, 0 );
+ writeHex_ui16( uiA, sepChar );
+
+}
+
+void writeHex_f64( float64_t a, char sepChar )
+{
+ union { uint64_t ui; float64_t f; } uA;
+ uint_fast64_t uiA;
+
+ uA.f = a;
+ uiA = uA.ui;
+ writeHex_ui12( uiA>>52, 0 );
+ fputc( '.', stdout );
+ writeHex_ui12( uiA>>40, 0 );
+ writeHex_ui8( uiA>>32, 0 );
+ writeHex_ui32( uiA, sepChar );
+
+}
+
+#ifdef EXTFLOAT80
+
+void writeHex_extF80M( const extFloat80_t *aPtr, char sepChar )
+{
+ const struct extFloat80M *aSPtr;
+
+ aSPtr = (const struct extFloat80M *) aPtr;
+ writeHex_ui16( aSPtr->signExp, 0 );
+ fputc( '.', stdout );
+ writeHex_ui64( aSPtr->signif, sepChar );
+
+}
+
+#endif
+
+#ifdef FLOAT128
+
+void writeHex_f128M( const float128_t *aPtr, char sepChar )
+{
+ const struct uint128 *uiAPtr;
+ uint_fast64_t uiA64;
+
+ uiAPtr = (const struct uint128 *) aPtr;
+ uiA64 = uiAPtr->v64;
+ writeHex_ui16( uiA64>>48, 0 );
+ fputc( '.', stdout );
+ writeHex_ui16( uiA64>>32, 0 );
+ writeHex_ui32( uiA64, 0 );
+ writeHex_ui64( uiAPtr->v0, sepChar );
+
+}
+
+#endif
+
+void writeHex_softfloat_flags( uint_fast8_t flags, char sepChar )
+{
+
+ fputc( flags & softfloat_flag_invalid ? 'v' : '.', stdout );
+ fputc( flags & softfloat_flag_infinite ? 'i' : '.', stdout );
+ fputc( flags & softfloat_flag_overflow ? 'o' : '.', stdout );
+ fputc( flags & softfloat_flag_underflow ? 'u' : '.', stdout );
+ fputc( flags & softfloat_flag_inexact ? 'x' : '.', stdout );
+ if ( sepChar ) fputc( sepChar, stdout );
+
+}
+
diff --git a/source/writeHex.h b/source/writeHex.h
new file mode 100644
index 0000000..cf26c66
--- /dev/null
+++ b/source/writeHex.h
@@ -0,0 +1,53 @@
+
+/*============================================================================
+
+This C header file is part of TestFloat, Release 3, a package of programs for
+testing the correctness of floating-point arithmetic complying with the IEEE
+Standard for Floating-Point, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
+(Regents). All Rights Reserved. Redistribution and use in source and binary
+forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions, and the following two paragraphs of disclaimer in the
+documentation and/or other materials provided with the distribution. Neither
+the name of the Regents nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "softfloat.h"
+
+void writeHex_bool( bool, char );
+void writeHex_ui8( uint_fast8_t, char );
+void writeHex_ui16( uint_fast16_t, char );
+void writeHex_ui32( uint_fast32_t, char );
+void writeHex_ui64( uint_fast64_t, char );
+void writeHex_f32( float32_t, char );
+void writeHex_f64( float64_t, char );
+#ifdef EXTFLOAT80
+void writeHex_extF80M( const extFloat80_t *, char );
+#endif
+#ifdef FLOAT128
+void writeHex_f128M( const float128_t *, char );
+#endif
+void writeHex_softfloat_flags( uint_fast8_t, char );
+