Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 2010 20:47:59 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r206917 - in vendor/testfloat: . processors testfloat testfloat/386-Win32-gcc testfloat/SPARC-Solaris-gcc testfloat/templates
Message-ID:  <201004202047.o3KKlxPG039942@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Tue Apr 20 20:47:58 2010
New Revision: 206917
URL: http://svn.freebsd.org/changeset/base/206917

Log:
  Initial import of TestFloat 2a.
  
  Obtained from:	http://www.jhauser.us/arithmetic/TestFloat.html

Added:
  vendor/testfloat/
  vendor/testfloat/processors/
  vendor/testfloat/processors/386-gcc.h   (contents, props changed)
  vendor/testfloat/processors/SPARC-gcc.h   (contents, props changed)
  vendor/testfloat/testfloat/
  vendor/testfloat/testfloat/386-Win32-gcc/
  vendor/testfloat/testfloat/386-Win32-gcc/Makefile   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/milieu.h   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systflags.S   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systfloat.S   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systfloat.h   (contents, props changed)
  vendor/testfloat/testfloat/386-Win32-gcc/systmodes.S   (contents, props changed)
  vendor/testfloat/testfloat/README.txt   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/Makefile   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/milieu.h   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systflags.c   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systfloat.S   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systfloat.h   (contents, props changed)
  vendor/testfloat/testfloat/SPARC-Solaris-gcc/systmodes.c   (contents, props changed)
  vendor/testfloat/testfloat/fail.c   (contents, props changed)
  vendor/testfloat/testfloat/fail.h   (contents, props changed)
  vendor/testfloat/testfloat/random.c   (contents, props changed)
  vendor/testfloat/testfloat/random.h   (contents, props changed)
  vendor/testfloat/testfloat/slowfloat-32.c   (contents, props changed)
  vendor/testfloat/testfloat/slowfloat-64.c   (contents, props changed)
  vendor/testfloat/testfloat/slowfloat.c   (contents, props changed)
  vendor/testfloat/testfloat/slowfloat.h   (contents, props changed)
  vendor/testfloat/testfloat/systemBugs.txt   (contents, props changed)
  vendor/testfloat/testfloat/systflags.h   (contents, props changed)
  vendor/testfloat/testfloat/systfloat.c   (contents, props changed)
  vendor/testfloat/testfloat/systfloat.h   (contents, props changed)
  vendor/testfloat/testfloat/systmodes.h   (contents, props changed)
  vendor/testfloat/testfloat/templates/
  vendor/testfloat/testfloat/templates/Makefile   (contents, props changed)
  vendor/testfloat/testfloat/templates/milieu.h   (contents, props changed)
  vendor/testfloat/testfloat/templates/systflags.c   (contents, props changed)
  vendor/testfloat/testfloat/templates/systmodes.c   (contents, props changed)
  vendor/testfloat/testfloat/testCases.c   (contents, props changed)
  vendor/testfloat/testfloat/testCases.h   (contents, props changed)
  vendor/testfloat/testfloat/testFunction.c   (contents, props changed)
  vendor/testfloat/testfloat/testFunction.h   (contents, props changed)
  vendor/testfloat/testfloat/testLoops.c   (contents, props changed)
  vendor/testfloat/testfloat/testLoops.h   (contents, props changed)
  vendor/testfloat/testfloat/testfloat-history.txt   (contents, props changed)
  vendor/testfloat/testfloat/testfloat-source.txt   (contents, props changed)
  vendor/testfloat/testfloat/testfloat.c   (contents, props changed)
  vendor/testfloat/testfloat/testfloat.txt   (contents, props changed)
  vendor/testfloat/testfloat/testsoftfloat.c   (contents, props changed)
  vendor/testfloat/testfloat/writeHex.c   (contents, props changed)
  vendor/testfloat/testfloat/writeHex.h   (contents, props changed)

Added: vendor/testfloat/processors/386-gcc.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/processors/386-gcc.h	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,80 @@
+
+/*
+-------------------------------------------------------------------------------
+One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
+-------------------------------------------------------------------------------
+*/
+#define LITTLEENDIAN
+
+/*
+-------------------------------------------------------------------------------
+The macro `BITS64' can be defined to indicate that 64-bit integer types are
+supported by the compiler.
+-------------------------------------------------------------------------------
+*/
+#define BITS64
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines the most convenient type that holds
+integers of at least as many bits as specified.  For example, `uint8' should
+be the most convenient type that can hold unsigned integers of as many as
+8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
+implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
+to the same as `int'.
+-------------------------------------------------------------------------------
+*/
+typedef char flag;
+typedef unsigned char uint8;
+typedef signed char int8;
+typedef int uint16;
+typedef int int16;
+typedef unsigned int uint32;
+typedef signed int int32;
+#ifdef BITS64
+typedef unsigned long long int uint64;
+typedef signed long long int int64;
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines a type that holds integers
+of _exactly_ the number of bits specified.  For instance, for most
+implementation of C, `bits16' and `sbits16' should be `typedef'ed to
+`unsigned short int' and `signed short int' (or `short int'), respectively.
+-------------------------------------------------------------------------------
+*/
+typedef unsigned char bits8;
+typedef signed char sbits8;
+typedef unsigned short int bits16;
+typedef signed short int sbits16;
+typedef unsigned int bits32;
+typedef signed int sbits32;
+#ifdef BITS64
+typedef unsigned long long int bits64;
+typedef signed long long int sbits64;
+#endif
+
+#ifdef BITS64
+/*
+-------------------------------------------------------------------------------
+The `LIT64' macro takes as its argument a textual integer literal and
+if necessary ``marks'' the literal as having a 64-bit integer type.
+For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
+appended with the letters `LL' standing for `long long', which is `gcc's
+name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
+defined as the identity macro:  `#define LIT64( a ) a'.
+-------------------------------------------------------------------------------
+*/
+#define LIT64( a ) a##LL
+#endif
+
+/*
+-------------------------------------------------------------------------------
+The macro `INLINE' can be used before functions that should be inlined.  If
+a compiler does not support explicit inlining, this macro should be defined
+to be `static'.
+-------------------------------------------------------------------------------
+*/
+#define INLINE extern inline
+

Added: vendor/testfloat/processors/SPARC-gcc.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/processors/SPARC-gcc.h	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,80 @@
+
+/*
+-------------------------------------------------------------------------------
+One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
+-------------------------------------------------------------------------------
+*/
+#define BIGENDIAN
+
+/*
+-------------------------------------------------------------------------------
+The macro `BITS64' can be defined to indicate that 64-bit integer types are
+supported by the compiler.
+-------------------------------------------------------------------------------
+*/
+#define BITS64
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines the most convenient type that holds
+integers of at least as many bits as specified.  For example, `uint8' should
+be the most convenient type that can hold unsigned integers of as many as
+8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
+implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
+to the same as `int'.
+-------------------------------------------------------------------------------
+*/
+typedef int flag;
+typedef int uint8;
+typedef int int8;
+typedef int uint16;
+typedef int int16;
+typedef unsigned int uint32;
+typedef signed int int32;
+#ifdef BITS64
+typedef unsigned long long int uint64;
+typedef signed long long int int64;
+#endif
+
+/*
+-------------------------------------------------------------------------------
+Each of the following `typedef's defines a type that holds integers
+of _exactly_ the number of bits specified.  For instance, for most
+implementation of C, `bits16' and `sbits16' should be `typedef'ed to
+`unsigned short int' and `signed short int' (or `short int'), respectively.
+-------------------------------------------------------------------------------
+*/
+typedef unsigned char bits8;
+typedef signed char sbits8;
+typedef unsigned short int bits16;
+typedef signed short int sbits16;
+typedef unsigned int bits32;
+typedef signed int sbits32;
+#ifdef BITS64
+typedef unsigned long long int bits64;
+typedef signed long long int sbits64;
+#endif
+
+#ifdef BITS64
+/*
+-------------------------------------------------------------------------------
+The `LIT64' macro takes as its argument a textual integer literal and
+if necessary ``marks'' the literal as having a 64-bit integer type.
+For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
+appended with the letters `LL' standing for `long long', which is `gcc's
+name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
+defined as the identity macro:  `#define LIT64( a ) a'.
+-------------------------------------------------------------------------------
+*/
+#define LIT64( a ) a##LL
+#endif
+
+/*
+-------------------------------------------------------------------------------
+The macro `INLINE' can be used before functions that should be inlined.  If
+a compiler does not support explicit inlining, this macro should be defined
+to be `static'.
+-------------------------------------------------------------------------------
+*/
+#define INLINE extern inline
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/Makefile	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,64 @@
+
+PROCESSOR_H = ../../processors/386-gcc.h
+SOFTFLOAT_VERSION = bits64
+TARGET = 386-Win32-gcc
+SOFTFLOAT_DIR = ../../softfloat/$(SOFTFLOAT_VERSION)/$(TARGET)
+
+OBJ = .o
+EXE = .exe
+INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR)
+COMPILE_ASM = gcc -c -o $@
+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)
+
+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)
+
+systmodes$(OBJ): systmodes.S
+	$(COMPILE_ASM) systmodes.S
+
+systflags$(OBJ): systflags.S
+	$(COMPILE_ASM) systflags.S
+
+systfloat$(OBJ): systfloat.S
+	$(COMPILE_ASM) systfloat.S
+
+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)
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/milieu.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/milieu.h	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,51 @@
+
+/*
+===============================================================================
+
+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/386-gcc.h"
+
+/*
+-------------------------------------------------------------------------------
+If the `BITS64' macro is defined by the processor header file but the
+version of SoftFloat being tested is the 32-bit one (`bits32'), the `BITS64'
+macro must be undefined here.
+-------------------------------------------------------------------------------
+#undef BITS64
+*/
+
+/*
+-------------------------------------------------------------------------------
+Symbolic Boolean literals.
+-------------------------------------------------------------------------------
+*/
+enum {
+    FALSE = 0,
+    TRUE  = 1
+};
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/systflags.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/systflags.S	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,41 @@
+
+/*
+===============================================================================
+
+This GNU assembler 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.
+
+===============================================================================
+*/
+
+	.text
+
+/*
+-------------------------------------------------------------------------------
+Clears the system's IEC/IEEE floating-point exception flags.  Returns the
+previous value of the flags.
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_float_flags_clear
+_syst_float_flags_clear:
+	fnstsw %ax
+	fnclex
+	andl $61,%eax
+	ret
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/systfloat.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/systfloat.S	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,332 @@
+
+/*
+===============================================================================
+
+This GNU assembler 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.
+
+===============================================================================
+*/
+
+	.text
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_int32_to_floatx80
+_syst_int32_to_floatx80:
+	fildl 8(%esp)
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_int64_to_floatx80
+_syst_int64_to_floatx80:
+	fildq 8(%esp)
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_float32_to_floatx80
+_syst_float32_to_floatx80:
+	flds 8(%esp)
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_float64_to_floatx80
+_syst_float64_to_floatx80:
+	fldl 8(%esp)
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_to_int32
+_syst_floatx80_to_int32:
+	fldt 4(%esp)
+	subl $4,%esp
+	fistpl (%esp)
+	movl (%esp),%eax
+	addl $4,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_to_int64
+_syst_floatx80_to_int64:
+	fldt 4(%esp)
+	subl $8,%esp
+	fistpq (%esp)
+	movl (%esp),%eax
+	movl 4(%esp),%edx
+	addl $8,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_to_float32
+_syst_floatx80_to_float32:
+	fldt 4(%esp)
+	subl $4,%esp
+	fstps (%esp)
+	movl (%esp),%eax
+	addl $4,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_to_float64
+_syst_floatx80_to_float64:
+	fldt 4(%esp)
+	subl $8,%esp
+	fstpl (%esp)
+	movl 4(%esp),%edx
+	movl (%esp),%eax
+	addl $8,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_round_to_int
+_syst_floatx80_round_to_int:
+	fldt 8(%esp)
+	frndint
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_add
+_syst_floatx80_add:
+	fldt 8(%esp)
+	fldt 20(%esp)
+	faddp
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_sub
+_syst_floatx80_sub:
+	fldt 8(%esp)
+	fldt 20(%esp)
+	fsubrp
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_mul
+_syst_floatx80_mul:
+	fldt 8(%esp)
+	fldt 20(%esp)
+	fmulp
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_div
+_syst_floatx80_div:
+	fldt 8(%esp)
+	fldt 20(%esp)
+	fdivrp
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_rem
+_syst_floatx80_rem:
+	fldt 20(%esp)
+	fldt 8(%esp)
+floatx80_rem_loop:
+	fprem1
+	fnstsw %ax
+	btw $10,%ax
+	jc floatx80_rem_loop
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	fstp %st(0)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_sqrt
+_syst_floatx80_sqrt:
+	fldt 8(%esp)
+	fsqrt
+	movl 4(%esp),%eax
+	fstpt (%eax)
+	ret $4
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_eq
+_syst_floatx80_eq:
+	fldt 16(%esp)
+	fldt 4(%esp)
+	fucompp
+	fnstsw %ax
+	andw $17664,%ax
+	cmpw $16384,%ax
+	seteb %al
+	movzb %al,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_le
+_syst_floatx80_le:
+	fldt 4(%esp)
+	fldt 16(%esp)
+	fcompp
+	fnstsw %ax
+	notl %eax
+	shrl $8,%eax
+	andl $1,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_lt
+_syst_floatx80_lt:
+	fldt 4(%esp)
+	fldt 16(%esp)
+	fcompp
+	fnstsw %ax
+	andw $17664,%ax
+	setzb %al
+	movzb %al,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_eq_signaling
+_syst_floatx80_eq_signaling:
+	fldt 16(%esp)
+	fldt 4(%esp)
+	fcompp
+	fnstsw %ax
+	andw $17664,%ax
+	cmpw $16384,%ax
+	seteb %al
+	movzb %al,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_le_quiet
+_syst_floatx80_le_quiet:
+	fldt 4(%esp)
+	fldt 16(%esp)
+	fucompp
+	fnstsw %ax
+	notl %eax
+	shrl $8,%eax
+	andl $1,%eax
+	ret
+
+/*
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
+*/
+	.align 2
+.globl _syst_floatx80_lt_quiet
+_syst_floatx80_lt_quiet:
+	fldt 4(%esp)
+	fldt 16(%esp)
+	fucompp
+	fnstsw %ax
+	andw $17664,%ax
+	setzb %al
+	movzb %al,%eax
+	ret
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/systfloat.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/systfloat.h	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,181 @@
+
+/*
+===============================================================================
+
+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.
+
+===============================================================================
+*/
+
+/*
+-------------------------------------------------------------------------------
+The following macros are defined to indicate that the corresponding
+functions exist.
+-------------------------------------------------------------------------------
+*/
+#define SYST_INT32_TO_FLOATX80
+#define SYST_INT64_TO_FLOATX80
+#define SYST_FLOAT32_TO_FLOATX80
+#define SYST_FLOAT64_TO_FLOATX80
+#define SYST_FLOATX80_TO_INT32
+#define SYST_FLOATX80_TO_INT64
+#define SYST_FLOATX80_TO_FLOAT32
+#define SYST_FLOATX80_TO_FLOAT64
+#define SYST_FLOATX80_ROUND_TO_INT
+#define SYST_FLOATX80_ADD
+#define SYST_FLOATX80_SUB
+#define SYST_FLOATX80_MUL
+#define SYST_FLOATX80_DIV
+#define SYST_FLOATX80_REM
+#define SYST_FLOATX80_SQRT
+#define SYST_FLOATX80_EQ
+#define SYST_FLOATX80_LE
+#define SYST_FLOATX80_LT
+#define SYST_FLOATX80_EQ_SIGNALING
+#define SYST_FLOATX80_LE_QUIET
+#define SYST_FLOATX80_LT_QUIET
+
+/*
+-------------------------------------------------------------------------------
+System function declarations.  (Some of these functions may not exist.)
+-------------------------------------------------------------------------------
+*/
+float32 syst_int32_to_float32( int32 );
+float64 syst_int32_to_float64( int32 );
+#ifdef FLOATX80
+floatx80 syst_int32_to_floatx80( int32 );
+#endif
+#ifdef FLOAT128
+float128 syst_int32_to_float128( int32 );
+#endif
+#ifdef BITS64
+float32 syst_int64_to_float32( int64 );
+float64 syst_int64_to_float64( int64 );
+#ifdef FLOATX80
+floatx80 syst_int64_to_floatx80( int64 );
+#endif
+#ifdef FLOAT128
+float128 syst_int64_to_float128( int64 );
+#endif
+#endif
+int32 syst_float32_to_int32( float32 );
+int32 syst_float32_to_int32_round_to_zero( float32 );
+#ifdef BITS64
+int64 syst_float32_to_int64( float32 );
+int64 syst_float32_to_int64_round_to_zero( float32 );
+#endif
+float64 syst_float32_to_float64( float32 );
+#ifdef FLOATX80
+floatx80 syst_float32_to_floatx80( float32 );
+#endif
+#ifdef FLOAT128
+float128 syst_float32_to_float128( float32 );
+#endif
+float32 syst_float32_round_to_int( float32 );
+float32 syst_float32_add( float32, float32 );
+float32 syst_float32_sub( float32, float32 );
+float32 syst_float32_mul( float32, float32 );
+float32 syst_float32_div( float32, float32 );
+float32 syst_float32_rem( float32, float32 );
+float32 syst_float32_sqrt( float32 );
+flag syst_float32_eq( float32, float32 );
+flag syst_float32_le( float32, float32 );
+flag syst_float32_lt( float32, float32 );
+flag syst_float32_eq_signaling( float32, float32 );
+flag syst_float32_le_quiet( float32, float32 );
+flag syst_float32_lt_quiet( float32, float32 );
+int32 syst_float64_to_int32( float64 );
+int32 syst_float64_to_int32_round_to_zero( float64 );
+#ifdef BITS64
+int64 syst_float64_to_int64( float64 );
+int64 syst_float64_to_int64_round_to_zero( float64 );
+#endif
+float32 syst_float64_to_float32( float64 );
+#ifdef FLOATX80
+floatx80 syst_float64_to_floatx80( float64 );
+#endif
+#ifdef FLOAT128
+float128 syst_float64_to_float128( float64 );
+#endif
+float64 syst_float64_round_to_int( float64 );
+float64 syst_float64_add( float64, float64 );
+float64 syst_float64_sub( float64, float64 );
+float64 syst_float64_mul( float64, float64 );
+float64 syst_float64_div( float64, float64 );
+float64 syst_float64_rem( float64, float64 );
+float64 syst_float64_sqrt( float64 );
+flag syst_float64_eq( float64, float64 );
+flag syst_float64_le( float64, float64 );
+flag syst_float64_lt( float64, float64 );
+flag syst_float64_eq_signaling( float64, float64 );
+flag syst_float64_le_quiet( float64, float64 );
+flag syst_float64_lt_quiet( float64, float64 );
+#ifdef FLOATX80
+int32 syst_floatx80_to_int32( floatx80 );
+int32 syst_floatx80_to_int32_round_to_zero( floatx80 );
+#ifdef BITS64
+int64 syst_floatx80_to_int64( floatx80 );
+int64 syst_floatx80_to_int64_round_to_zero( floatx80 );
+#endif
+float32 syst_floatx80_to_float32( floatx80 );
+float64 syst_floatx80_to_float64( floatx80 );
+#ifdef FLOAT128
+float128 syst_floatx80_to_float128( floatx80 );
+#endif
+floatx80 syst_floatx80_round_to_int( floatx80 );
+floatx80 syst_floatx80_add( floatx80, floatx80 );
+floatx80 syst_floatx80_sub( floatx80, floatx80 );
+floatx80 syst_floatx80_mul( floatx80, floatx80 );
+floatx80 syst_floatx80_div( floatx80, floatx80 );
+floatx80 syst_floatx80_rem( floatx80, floatx80 );
+floatx80 syst_floatx80_sqrt( floatx80 );
+flag syst_floatx80_eq( floatx80, floatx80 );
+flag syst_floatx80_le( floatx80, floatx80 );
+flag syst_floatx80_lt( floatx80, floatx80 );
+flag syst_floatx80_eq_signaling( floatx80, floatx80 );
+flag syst_floatx80_le_quiet( floatx80, floatx80 );
+flag syst_floatx80_lt_quiet( floatx80, floatx80 );
+#endif
+#ifdef FLOAT128
+int32 syst_float128_to_int32( float128 );
+int32 syst_float128_to_int32_round_to_zero( float128 );
+#ifdef BITS64
+int64 syst_float128_to_int64( float128 );
+int64 syst_float128_to_int64_round_to_zero( float128 );
+#endif
+float32 syst_float128_to_float32( float128 );
+float64 syst_float128_to_float64( float128 );
+#ifdef FLOATX80
+floatx80 syst_float128_to_floatx80( float128 );
+#endif
+float128 syst_float128_round_to_int( float128 );
+float128 syst_float128_add( float128, float128 );
+float128 syst_float128_sub( float128, float128 );
+float128 syst_float128_mul( float128, float128 );
+float128 syst_float128_div( float128, float128 );
+float128 syst_float128_rem( float128, float128 );
+float128 syst_float128_sqrt( float128 );
+flag syst_float128_eq( float128, float128 );
+flag syst_float128_le( float128, float128 );
+flag syst_float128_lt( float128, float128 );
+flag syst_float128_eq_signaling( float128, float128 );
+flag syst_float128_le_quiet( float128, float128 );
+flag syst_float128_lt_quiet( float128, float128 );
+#endif
+

Added: vendor/testfloat/testfloat/386-Win32-gcc/systmodes.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/386-Win32-gcc/systmodes.S	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,82 @@
+
+/*
+===============================================================================
+
+This GNU assembler 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.
+
+===============================================================================
+*/
+
+	.text
+
+/*
+-------------------------------------------------------------------------------
+Sets the system's IEC/IEEE floating-point rounding mode.  Also disables all
+system exception traps.
+-------------------------------------------------------------------------------
+*/
+	.align 4
+	.global _syst_float_set_rounding_mode
+_syst_float_set_rounding_mode:
+	movb 4(%esp),%al
+	andb $3,%al
+	shlw $10,%ax
+	orw $63,%ax
+	subl $2,%esp
+	fnstcw 0(%esp)
+	andw $768,0(%esp)
+	orw %ax,0(%esp)
+	fldcw 0(%esp)
+	addl $2,%esp
+	ret
+
+/*
+-------------------------------------------------------------------------------
+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.
+-------------------------------------------------------------------------------
+*/
+	.align 4
+	.global _syst_float_set_rounding_precision
+_syst_float_set_rounding_precision:
+	movb 4(%esp),%al
+	movb $0,%ah
+	cmpb $32,%al
+	je setRoundingPrecision
+	movb $2,%ah
+	cmpb $64,%al
+	je setRoundingPrecision
+	movb $3,%ah
+	cmpb $80,%al
+	je setRoundingPrecision
+	movb $0,%ah
+setRoundingPrecision:
+	movb $0,%al
+	subl $2,%esp
+	fnstcw 0(%esp)
+	andw $64767,0(%esp)
+	orw %ax,0(%esp)
+	fldcw 0(%esp)
+	addl $2,%esp
+	ret
+

Added: vendor/testfloat/testfloat/README.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/README.txt	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,50 @@
+
+Package Overview for TestFloat Release 2a
+
+John R. Hauser
+1998 December 16
+
+
+TestFloat is a program for testing that a floating-point implementation
+conforms to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
+TestFloat is distributed in the form of C source code.  The TestFloat
+package actually provides two related programs:
+
+-- The `testfloat' program tests a system's floating-point for conformance
+   to the IEC/IEEE Standard.  This program uses the SoftFloat software
+   floating-point implementation as a basis for comparison.
+
+-- The `testsoftfloat' program tests SoftFloat itself for conformance to
+   the IEC/IEEE Standard.  These tests are performed by comparing against a
+   separate, slower software floating-point that is included in the TestFloat
+   package.
+
+TestFloat depends on SoftFloat, but SoftFloat is not included in the
+TestFloat package.  SoftFloat can be obtained through the Web page `http://
+HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/SoftFloat.html'.
+
+TestFloat is documented in three text files:
+
+   testfloat.txt          Documentation for using the TestFloat programs
+                              (both `testfloat' and `testsoftfloat').
+   testfloat-source.txt   Documentation for porting and compiling TestFloat.
+   testfloat-history.txt  History of major changes to TestFloat.
+
+The following file is also provided:
+
+   systemBugs.txt         Information about processor bugs found using
+                              TestFloat.
+
+Other files in the package comprise the source code for TestFloat.
+
+Please be aware that some work is involved in porting this software to other
+targets.  It is not just a matter of getting `make' to complete without
+error messages.  I would have written the code that way if I could, but
+there are fundamental differences between systems that I can't make go away.
+You should not attempt to compile the TestFloat sources without first
+reading `testfloat-source.txt'.
+
+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 `http://
+HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
+

Added: vendor/testfloat/testfloat/SPARC-Solaris-gcc/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/testfloat/testfloat/SPARC-Solaris-gcc/Makefile	Tue Apr 20 20:47:58 2010	(r206917)
@@ -0,0 +1,64 @@
+
+PROCESSOR_H = ../../processors/SPARC-gcc.h
+SOFTFLOAT_VERSION = bits64
+TARGET = SPARC-Solaris-gcc
+SOFTFLOAT_DIR = ../../softfloat/$(SOFTFLOAT_VERSION)/$(TARGET)
+
+OBJ = .o
+EXE =
+INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004202047.o3KKlxPG039942>