summaryrefslogtreecommitdiff
path: root/testfloat/templates
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2010-04-20 20:47:58 +0000
committerMarius Strobl <marius@FreeBSD.org>2010-04-20 20:47:58 +0000
commit2669f95457b9136a7c9fa78e879cc53f68799078 (patch)
tree008bd766a310a0d9d6236ccda7937063e4aeaf57 /testfloat/templates
Notes
Diffstat (limited to 'testfloat/templates')
-rw-r--r--testfloat/templates/Makefile67
-rw-r--r--testfloat/templates/milieu.h62
-rw-r--r--testfloat/templates/systflags.c41
-rw-r--r--testfloat/templates/systmodes.c58
4 files changed, 228 insertions, 0 deletions
diff --git a/testfloat/templates/Makefile b/testfloat/templates/Makefile
new file mode 100644
index 0000000000000..f5f3cde713cc0
--- /dev/null
+++ b/testfloat/templates/Makefile
@@ -0,0 +1,67 @@
+
+PROCESSOR_H = ../../processors/!!!processor.h
+SOFTFLOAT_VERSION = bits64
+TARGET = !!!target
+SOFTFLOAT_DIR = ../../softfloat/$(SOFTFLOAT_VERSION)/$(TARGET)
+
+OBJ = .o
+EXE =
+INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR)
+COMPILE_C = gcc -c -o $@ $(INCLUDES) -I- -O2
+COMPILE_SLOWFLOAT_C = gcc -c -o $@ $(INCLUDES) -I- -O3
+LINK = gcc -o $@
+
+SOFTFLOAT_H = $(SOFTFLOAT_DIR)/softfloat.h
+SOFTFLOAT_OBJ = $(SOFTFLOAT_DIR)/softfloat$(OBJ)
+
+ALL: testsoftfloat$(EXE) testfloat$(EXE)
+
+systmodes$(OBJ): milieu.h ../systmodes.h systmodes.c
+ $(COMPILE_C) systmodes.c
+
+systflags$(OBJ): milieu.h ../systflags.h systflags.c
+ $(COMPILE_C) systflags.c
+
+systfloat$(OBJ): milieu.h $(SOFTFLOAT_H) ../systfloat.h ../systfloat.c
+ $(COMPILE_C) ../systfloat.c
+
+#------------------------------------------------------------------------------
+# Probably O.K. below here.
+#------------------------------------------------------------------------------
+
+milieu.h: $(PROCESSOR_H)
+ touch milieu.h
+
+fail$(OBJ): milieu.h ../fail.h
+ $(COMPILE_C) ../fail.c
+
+random$(OBJ): milieu.h ../random.h
+ $(COMPILE_C) ../random.c
+
+testCases$(OBJ): milieu.h ../fail.h ../random.h $(SOFTFLOAT_H) ../testCases.h ../testCases.c
+ $(COMPILE_C) ../testCases.c
+
+writeHex$(OBJ): milieu.h $(SOFTFLOAT_H) ../writeHex.h ../writeHex.c
+ $(COMPILE_C) ../writeHex.c
+
+testLoops$(OBJ): milieu.h $(SOFTFLOAT_H) ../testCases.h ../writeHex.h ../testLoops.h ../testLoops.c
+ $(COMPILE_C) ../testLoops.c
+
+slowfloat$(OBJ): milieu.h $(SOFTFLOAT_H) ../slowfloat.h ../slowfloat-32.c ../slowfloat-64.c ../slowfloat.c
+ $(COMPILE_SLOWFLOAT_C) ../slowfloat.c
+
+testsoftfloat$(OBJ): milieu.h ../fail.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../slowfloat.h ../testsoftfloat.c
+ $(COMPILE_C) ../testsoftfloat.c
+
+testsoftfloat$(EXE): fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) slowfloat$(OBJ) testsoftfloat$(OBJ)
+ $(LINK) fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) slowfloat$(OBJ) testsoftfloat$(OBJ)
+
+testFunction$(OBJ): milieu.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../systmodes.h ../systflags.h systfloat.h ../testFunction.h ../testFunction.c
+ $(COMPILE_C) ../testFunction.c
+
+testfloat$(OBJ): milieu.h ../fail.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../systflags.h ../testFunction.h testfloat.c
+ $(COMPILE_C) testfloat.c
+
+testfloat$(EXE): fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) systmodes$(OBJ) systflags$(OBJ) systfloat$(OBJ) testFunction$(OBJ) testfloat$(OBJ)
+ $(LINK) fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) systmodes$(OBJ) systflags$(OBJ) systfloat$(OBJ) testFunction$(OBJ) testfloat$(OBJ)
+
diff --git a/testfloat/templates/milieu.h b/testfloat/templates/milieu.h
new file mode 100644
index 0000000000000..56d3ac49a9afe
--- /dev/null
+++ b/testfloat/templates/milieu.h
@@ -0,0 +1,62 @@
+
+/*
+===============================================================================
+
+This C header file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser. More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.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 ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+/*
+-------------------------------------------------------------------------------
+Include common integer types and flags.
+-------------------------------------------------------------------------------
+*/
+#include "../../processors/!!!processor.h"
+
+/*
+-------------------------------------------------------------------------------
+If the `BITS64' macro is defined by the processor header file but the
+version of SoftFloat being used/tested is the 32-bit one (`bits32'), the
+`BITS64' macro must be undefined here.
+-------------------------------------------------------------------------------
+#undef BITS64
+*/
+
+/*
+-------------------------------------------------------------------------------
+The macro `LONG_DOUBLE_IS_FLOATX80' can be defined to indicate that the
+C compiler supports the type `long double' as an extended double-precision
+format. Alternatively, the macro `LONG_DOUBLE_IS_FLOAT128' can be defined
+to indicate that `long double' is a quadruple-precision format. If neither
+of these macros is defined, `long double' will be ignored.
+-------------------------------------------------------------------------------
+#define LONG_DOUBLE_IS_FLOATX80
+*/
+
+/*
+-------------------------------------------------------------------------------
+Symbolic Boolean literals.
+-------------------------------------------------------------------------------
+*/
+enum {
+ FALSE = 0,
+ TRUE = 1
+};
+
diff --git a/testfloat/templates/systflags.c b/testfloat/templates/systflags.c
new file mode 100644
index 0000000000000..3eb86c1ade86d
--- /dev/null
+++ b/testfloat/templates/systflags.c
@@ -0,0 +1,41 @@
+
+/*
+===============================================================================
+
+This C source file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser. More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.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 ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+#include "milieu.h"
+#include "systflags.h"
+
+/*
+-------------------------------------------------------------------------------
+Clears the system's IEC/IEEE floating-point exception flags. Returns the
+previous value of the flags.
+-------------------------------------------------------------------------------
+*/
+int8 syst_float_flags_clear( void )
+{
+
+ !!!code
+
+}
+
diff --git a/testfloat/templates/systmodes.c b/testfloat/templates/systmodes.c
new file mode 100644
index 0000000000000..49450ab258b94
--- /dev/null
+++ b/testfloat/templates/systmodes.c
@@ -0,0 +1,58 @@
+
+/*
+===============================================================================
+
+This C source file is part of TestFloat, Release 2a, a package of programs
+for testing the correctness of floating-point arithmetic complying to the
+IEC/IEEE Standard for Floating-Point.
+
+Written by John R. Hauser. More information is available through the Web
+page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.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 ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
+
+===============================================================================
+*/
+
+#include "milieu.h"
+#include "systmodes.h"
+
+/*
+-------------------------------------------------------------------------------
+Sets the system's IEC/IEEE floating-point rounding mode. Also disables all
+system exception traps.
+-------------------------------------------------------------------------------
+*/
+void syst_float_set_rounding_mode( int8 roundingMode )
+{
+
+ !!!code
+
+}
+
+/*
+-------------------------------------------------------------------------------
+Sets the rounding precision of subsequent extended double-precision
+operations. The `precision' argument should be one of 0, 32, 64, or 80.
+If `precision' is 32, the rounding precision is set equivalent to single
+precision; else if `precision' is 64, the rounding precision is set
+equivalent to double precision; else the rounding precision is set to full
+extended double precision.
+-------------------------------------------------------------------------------
+*/
+void syst_float_set_rounding_precision( int8 precision )
+{
+
+ !!!code (possibly empty)
+
+}
+