diff options
author | Marius Strobl <marius@FreeBSD.org> | 2010-04-20 20:47:58 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2010-04-20 20:47:58 +0000 |
commit | 2669f95457b9136a7c9fa78e879cc53f68799078 (patch) | |
tree | 008bd766a310a0d9d6236ccda7937063e4aeaf57 /testfloat/SPARC-Solaris-gcc |
Notes
Diffstat (limited to 'testfloat/SPARC-Solaris-gcc')
-rw-r--r-- | testfloat/SPARC-Solaris-gcc/Makefile | 64 | ||||
-rw-r--r-- | testfloat/SPARC-Solaris-gcc/milieu.h | 51 | ||||
-rw-r--r-- | testfloat/SPARC-Solaris-gcc/systflags.c | 42 | ||||
-rw-r--r-- | testfloat/SPARC-Solaris-gcc/systfloat.S | 941 | ||||
-rw-r--r-- | testfloat/SPARC-Solaris-gcc/systfloat.h | 205 | ||||
-rw-r--r-- | testfloat/SPARC-Solaris-gcc/systmodes.c | 51 |
6 files changed, 1354 insertions, 0 deletions
diff --git a/testfloat/SPARC-Solaris-gcc/Makefile b/testfloat/SPARC-Solaris-gcc/Makefile new file mode 100644 index 0000000000000..ee53aa19d334c --- /dev/null +++ b/testfloat/SPARC-Solaris-gcc/Makefile @@ -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) +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): milieu.h ../systmodes.h systmodes.c + $(COMPILE_C) systmodes.c + +systflags$(OBJ): milieu.h ../systflags.h systflags.c + $(COMPILE_C) systflags.c + +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) + diff --git a/testfloat/SPARC-Solaris-gcc/milieu.h b/testfloat/SPARC-Solaris-gcc/milieu.h new file mode 100644 index 0000000000000..4aa7b13f0ea9c --- /dev/null +++ b/testfloat/SPARC-Solaris-gcc/milieu.h @@ -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/SPARC-gcc.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 +*/ + +/* +------------------------------------------------------------------------------- +Symbolic Boolean literals. +------------------------------------------------------------------------------- +*/ +enum { + FALSE = 0, + TRUE = 1 +}; + diff --git a/testfloat/SPARC-Solaris-gcc/systflags.c b/testfloat/SPARC-Solaris-gcc/systflags.c new file mode 100644 index 0000000000000..d0e29a1a4b2d6 --- /dev/null +++ b/testfloat/SPARC-Solaris-gcc/systflags.c @@ -0,0 +1,42 @@ + +/* +=============================================================================== + +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 <ieeefp.h> +#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 ) +{ + + return fpsetsticky( 0 ); + +} + diff --git a/testfloat/SPARC-Solaris-gcc/systfloat.S b/testfloat/SPARC-Solaris-gcc/systfloat.S new file mode 100644 index 0000000000000..1c0264d5bf602 --- /dev/null +++ b/testfloat/SPARC-Solaris-gcc/systfloat.S @@ -0,0 +1,941 @@ + +/* +=============================================================================== + +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 4 + .global syst_int32_to_float32 +syst_int32_to_float32: + save %sp,-128,%sp + + st %i0,[%sp+96] + ld [%sp+96],%f0 + fitos %f0,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_int32_to_float64 +syst_int32_to_float64: + save %sp,-128,%sp + + st %i0,[%sp+96] + ld [%sp+96],%f0 + fitod %f0,%f0 + std %f0,[%sp+96] + ldd [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_int32_to_float128 +syst_int32_to_float128: + save %sp,-128,%sp + + st %i0,[%sp+96] + ld [%sp+96],%f0 + fitoq %f0,%f0 + ld [%sp+192],%o0 + std %f0,[%o0] + std %f2,[%o0+8] + + jmp %i7+12 + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_to_int32_round_to_zero +syst_float32_to_int32_round_to_zero: + save %sp,-128,%sp + + st %i0,[%sp+96] + ld [%sp+96],%f0 + fstoi %f0,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_to_float64 +syst_float32_to_float64: + save %sp,-128,%sp + + st %i0,[%sp+96] + ld [%sp+96],%f0 + fstod %f0,%f0 + std %f0,[%sp+96] + ldd [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_to_float128 +syst_float32_to_float128: + save %sp,-128,%sp + + st %i0,[%sp+96] + ld [%sp+96],%f0 + fstoq %f0,%f0 + ld [%sp+192],%o0 + std %f0,[%o0] + std %f2,[%o0+8] + + jmp %i7+12 + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_add +syst_float32_add: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fadds %f0,%f1,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_sub +syst_float32_sub: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fsubs %f0,%f1,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_mul +syst_float32_mul: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fmuls %f0,%f1,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_div +syst_float32_div: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fdivs %f0,%f1,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_sqrt +syst_float32_sqrt: + save %sp,-128,%sp + + st %i0,[%sp+96] + ld [%sp+96],%f0 + fsqrts %f0,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_eq +syst_float32_eq: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fcmps %f0,%f1 + mov 0,%i0 + fbe,a float32EqExit + mov 1,%i0 +float32EqExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_le +syst_float32_le: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fcmpes %f0,%f1 + mov 0,%i0 + fble,a float32LeExit + mov 1,%i0 +float32LeExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_lt +syst_float32_lt: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fcmpes %f0,%f1 + mov 0,%i0 + fbl,a float32LtExit + mov 1,%i0 +float32LtExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_eq_signaling +syst_float32_eq_signaling: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fcmpes %f0,%f1 + mov 0,%i0 + fbe,a float32EqSignalingExit + mov 1,%i0 +float32EqSignalingExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_le_quiet +syst_float32_le_quiet: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fcmps %f0,%f1 + mov 0,%i0 + fble,a float32LeQuietExit + mov 1,%i0 +float32LeQuietExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float32_lt_quiet +syst_float32_lt_quiet: + save %sp,-128,%sp + + st %i0,[%sp+96] + st %i1,[%sp+100] + ld [%sp+96],%f0 + ld [%sp+100],%f1 + fcmps %f0,%f1 + mov 0,%i0 + fbl,a float32LtQuietExit + mov 1,%i0 +float32LtQuietExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_to_int32_round_to_zero +syst_float64_to_int32_round_to_zero: + save %sp,-128,%sp + + std %i0,[%sp+96] + ldd [%sp+96],%f0 + fdtoi %f0,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_to_float32 +syst_float64_to_float32: + save %sp,-128,%sp + + std %i0,[%sp+96] + ldd [%sp+96],%f0 + fdtos %f0,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_to_float128 +syst_float64_to_float128: + save %sp,-128,%sp + + std %i0,[%sp+96] + ldd [%sp+96],%f0 + fdtoq %f0,%f0 + ld [%sp+192],%o0 + std %f0,[%o0] + std %f2,[%o0+8] + + jmp %i7+12 + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_add +syst_float64_add: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + faddd %f0,%f2,%f0 + std %f0,[%sp+96] + ldd [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_sub +syst_float64_sub: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fsubd %f0,%f2,%f0 + std %f0,[%sp+96] + ldd [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_mul +syst_float64_mul: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fmuld %f0,%f2,%f0 + std %f0,[%sp+96] + ldd [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_div +syst_float64_div: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fdivd %f0,%f2,%f0 + std %f0,[%sp+96] + ldd [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_sqrt +syst_float64_sqrt: + save %sp,-128,%sp + + std %i0,[%sp+96] + ldd [%sp+96],%f0 + fsqrtd %f0,%f0 + std %f0,[%sp+96] + ldd [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_eq +syst_float64_eq: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fcmpd %f0,%f2 + mov 0,%i0 + fbe,a float64EqExit + mov 1,%i0 +float64EqExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_le +syst_float64_le: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fcmped %f0,%f2 + mov 0,%i0 + fble,a float64LeExit + mov 1,%i0 +float64LeExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_lt +syst_float64_lt: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fcmped %f0,%f2 + mov 0,%i0 + fbl,a float64LtExit + mov 1,%i0 +float64LtExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_eq_signaling +syst_float64_eq_signaling: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fcmped %f0,%f2 + mov 0,%i0 + fbe,a float64EqSignalingExit + mov 1,%i0 +float64EqSignalingExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_le_quiet +syst_float64_le_quiet: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fcmpd %f0,%f2 + mov 0,%i0 + fble,a float64LeQuietExit + mov 1,%i0 +float64LeQuietExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float64_lt_quiet +syst_float64_lt_quiet: + save %sp,-128,%sp + + std %i0,[%sp+96] + std %i2,[%sp+104] + ldd [%sp+96],%f0 + ldd [%sp+104],%f2 + fcmpd %f0,%f2 + mov 0,%i0 + fbl,a float64LtQuietExit + mov 1,%i0 +float64LtQuietExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_to_int32_round_to_zero +syst_float128_to_int32_round_to_zero: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + fqtoi %f0,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_to_float32 +syst_float128_to_float32: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + fqtos %f0,%f0 + st %f0,[%sp+96] + ld [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_to_float64 +syst_float128_to_float64: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + fqtod %f0,%f0 + std %f0,[%sp+96] + ldd [%sp+96],%i0 + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_add +syst_float128_add: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + faddq %f0,%f4,%f0 + ld [%sp+192],%o0 + std %f0,[%o0] + std %f2,[%o0+8] + + jmp %i7+12 + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_sub +syst_float128_sub: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fsubq %f0,%f4,%f0 + ld [%sp+192],%o0 + std %f0,[%o0] + std %f2,[%o0+8] + + jmp %i7+12 + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_mul +syst_float128_mul: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fmulq %f0,%f4,%f0 + ld [%sp+192],%o0 + std %f0,[%o0] + std %f2,[%o0+8] + + jmp %i7+12 + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_div +syst_float128_div: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fdivq %f0,%f4,%f0 + ld [%sp+192],%o0 + std %f0,[%o0] + std %f2,[%o0+8] + + jmp %i7+12 + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_sqrt +syst_float128_sqrt: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + fsqrtq %f0,%f0 + ld [%sp+192],%o0 + std %f0,[%o0] + std %f2,[%o0+8] + + jmp %i7+12 + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_eq +syst_float128_eq: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fcmpq %f0,%f4 + mov 0,%i0 + fbe,a float128EqExit + mov 1,%i0 +float128EqExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_le +syst_float128_le: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fcmpeq %f0,%f4 + mov 0,%i0 + fble,a float128Le + mov 1,%i0 +float128Le: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_lt +syst_float128_lt: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fcmpeq %f0,%f4 + mov 0,%i0 + fbl,a float128Lt + mov 1,%i0 +float128Lt: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_eq_signaling +syst_float128_eq_signaling: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fcmpeq %f0,%f4 + mov 0,%i0 + fbe,a float128EqSignalingExit + mov 1,%i0 +float128EqSignalingExit: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_le_quiet +syst_float128_le_quiet: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fcmpq %f0,%f4 + mov 0,%i0 + fble,a float128LeQuiet + mov 1,%i0 +float128LeQuiet: + + ret + restore + +/* +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +*/ + .align 4 + .global syst_float128_lt_quiet +syst_float128_lt_quiet: + save %sp,-128,%sp + + ldd [%i0],%f0 + ldd [%i0+8],%f2 + ldd [%i1],%f4 + ldd [%i1+8],%f6 + fcmpq %f0,%f4 + mov 0,%i0 + fbl,a float128LtQuiet + mov 1,%i0 +float128LtQuiet: + + ret + restore + diff --git a/testfloat/SPARC-Solaris-gcc/systfloat.h b/testfloat/SPARC-Solaris-gcc/systfloat.h new file mode 100644 index 0000000000000..956e470f4fbda --- /dev/null +++ b/testfloat/SPARC-Solaris-gcc/systfloat.h @@ -0,0 +1,205 @@ + +/* +=============================================================================== + +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_FLOAT32 +#define SYST_INT32_TO_FLOAT64 +#define SYST_INT32_TO_FLOAT128 +#define SYST_FLOAT32_TO_INT32_ROUND_TO_ZERO +#define SYST_FLOAT32_TO_FLOAT64 +#define SYST_FLOAT32_TO_FLOAT128 +#define SYST_FLOAT32_ADD +#define SYST_FLOAT32_SUB +#define SYST_FLOAT32_MUL +#define SYST_FLOAT32_DIV +#define SYST_FLOAT32_SQRT +#define SYST_FLOAT32_EQ +#define SYST_FLOAT32_LE +#define SYST_FLOAT32_LT +#define SYST_FLOAT32_EQ_SIGNALING +#define SYST_FLOAT32_LE_QUIET +#define SYST_FLOAT32_LT_QUIET +#define SYST_FLOAT64_TO_INT32_ROUND_TO_ZERO +#define SYST_FLOAT64_TO_FLOAT32 +#define SYST_FLOAT64_TO_FLOAT128 +#define SYST_FLOAT64_ADD +#define SYST_FLOAT64_SUB +#define SYST_FLOAT64_MUL +#define SYST_FLOAT64_DIV +#define SYST_FLOAT64_SQRT +#define SYST_FLOAT64_EQ +#define SYST_FLOAT64_LE +#define SYST_FLOAT64_LT +#define SYST_FLOAT64_EQ_SIGNALING +#define SYST_FLOAT64_LE_QUIET +#define SYST_FLOAT64_LT_QUIET +#define SYST_FLOAT128_TO_INT32_ROUND_TO_ZERO +#define SYST_FLOAT128_TO_FLOAT32 +#define SYST_FLOAT128_TO_FLOAT64 +#define SYST_FLOAT128_ADD +#define SYST_FLOAT128_SUB +#define SYST_FLOAT128_MUL +#define SYST_FLOAT128_DIV +#define SYST_FLOAT128_SQRT +#define SYST_FLOAT128_EQ +#define SYST_FLOAT128_LE +#define SYST_FLOAT128_LT +#define SYST_FLOAT128_EQ_SIGNALING +#define SYST_FLOAT128_LE_QUIET +#define SYST_FLOAT128_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 + diff --git a/testfloat/SPARC-Solaris-gcc/systmodes.c b/testfloat/SPARC-Solaris-gcc/systmodes.c new file mode 100644 index 0000000000000..3981cd79a6a78 --- /dev/null +++ b/testfloat/SPARC-Solaris-gcc/systmodes.c @@ -0,0 +1,51 @@ + +/* +=============================================================================== + +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 <ieeefp.h> +#include "milieu.h" +#include "systmodes.h" + +/* +------------------------------------------------------------------------------- +Sets the system's IEC/IEEE floating-point rounding mode. +------------------------------------------------------------------------------- +*/ +void syst_float_set_rounding_mode( int8 roundingMode ) +{ + + (void) fpsetround( roundingMode ); + +} + +/* +------------------------------------------------------------------------------- +Does nothing. +------------------------------------------------------------------------------- +*/ +void syst_float_set_rounding_precision( int8 precision ) +{ + +} + |