From 0e6767a6dee84f2bc2472f483cf37f7633c4b4a8 Mon Sep 17 00:00:00 2001 From: Matthias Heil Date: Mon, 4 Aug 2003 13:45:02 +0000 Subject: [PATCH] testsuite for flating point module [r1631] --- ir/tv/IeeeCC754/Makefile | 58 ++++++++++++++++++++++++++++++++ ir/tv/IeeeCC754/readme.usage | 64 ++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 ir/tv/IeeeCC754/Makefile create mode 100644 ir/tv/IeeeCC754/readme.usage diff --git a/ir/tv/IeeeCC754/Makefile b/ir/tv/IeeeCC754/Makefile new file mode 100644 index 000000000..d699630ec --- /dev/null +++ b/ir/tv/IeeeCC754/Makefile @@ -0,0 +1,58 @@ +#################################################################### +# +# Makefile for the IeeeCC754 suite +# Generated by heil at Thu Jul 10 12:01:06 CEST 2003 +# Edited some time later, ugly yet effective +# +# Compiler: g++ +# Math lib directory: +# Math include directory: -I.. <- here be dragons +# Platform: fltcalc +# Target: BasicOperations +# +#################################################################### + + +CXX=g++ +CC=gcc + +CXXFLAGS=-Iinclude -Wall -g + +PLATFORMLIBDIR= +PLATFORM=fltcalc +DEFINES= -DIntelPentium + +SOURCES=src/bitstring.cc src/fp.cc src/hex.cc src/IeeeCC754.cc +OBJECTS=src/bitstring.o src/fp.o src/hex.o src/IeeeCC754.o + +TYPE=BasicOperations +TYPEDIR=BasicOp + +SOFTWARE=FLTCALC_TEST +SOFTWAREINCDIR=-I.. + +BasicOperations=${TYPEDIR}/${PLATFORM}/fpenv_fltcalc.o \ + ${TYPEDIR}/${PLATFORM}/BasicOptest.o + +all: IeeeCC754 + +IeeeCC754: ${OBJECTS} strcalc.o fltcalc.o ${${TYPE}} + g++ -oIeeeCC754 src/IeeeCC754.o src/fp.o src/hex.o src/bitstring.o BasicOp/fltcalc/fpenv_fltcalc.o BasicOp/fltcalc/BasicOptest.o fltcalc.o strcalc.o + +%.o:../%.c + ${CC} ${DEFINES} ${CFLAGS} -c -o $@ $< +.cc.o: + ${CXX} ${DEFINES} -D${TYPE} -D${SOFTWARE} -c ${CXXFLAGS} ${SOFTWAREINCDIR} -o $@ $< + +clean: + -rm -f IeeeCC754 + -rm -f ${OBJECTS} ${${TYPE}} fltcalc.o strcalc.o + -rm -f add.log multiply.log divide.log + +test: all + ./IeeeCC754 -d -f add.log -c BasicOp/testsets/add > /dev/null + ./IeeeCC754 -d -f multiply.log -c BasicOp/testsets/multiply > /dev/null + ./IeeeCC754 -d -f divide.log -c BasicOp/testsets/divide > /dev/null + @grep "sign\|exponent\|mantissa" add.log multiply.log divide.log && echo Test failed! || true + +.SUFFIXES: .c .o diff --git a/ir/tv/IeeeCC754/readme.usage b/ir/tv/IeeeCC754/readme.usage new file mode 100644 index 000000000..959d09572 --- /dev/null +++ b/ir/tv/IeeeCC754/readme.usage @@ -0,0 +1,64 @@ +How to call the driver program IeeeCC754 +======================================== + +Summary: + +IeeeCC754 -c {-s|-d|-l|-q|-m|{-e -t [-h]}} + -r {n|p|m|z} -i -n {i|o|x|z|u|tiny|nan|inf|snz} + -f logfile testfile + +IeeeCC754 -u -r {n|p|m|z} -i -n {i|o|x|z|u|tiny|nan|inf|snz} + -f logfile testfile + +IeeeCC754 -o {-s|-d|-l|-q|-m|{-e -t [-h]}} + -r {n|p|m|z} -i -n {i|o|x|z|u|tiny|nan|inf|snz} + -f logfile testfile + +The required argument 'testfile' is a file of test vectors in extended +Coonen syntax (the default) or SUN-UCB format. + +The options of the driver program can be subdivided in three categories, +listed below. + +(1) Options to specify the purpose of the run. Use precisely one of the + following three options: + -c : perform testing: file of test vectors is in Coonen syntax + -u : perform testing: file of test vectors is in SUN-UCB format + -o : do not perform testing but only translate testdata from + Coonen syntax to hexadecimal SUN-UCB format and output + to + +(2) Options to specify the precision and exponent range of the source (and + for some conversions also the destination) floating-point format, when + the file of test vectors is in extended Coonen syntax. + When the file of test vectors is in SUN-UCB format, the precision and + exponent range are specified in the testfile itself, and the options + below should be skipped. + -s : single precision (same as -e 8 -t 24 -h) + -d : double precision (same as -e 11 -t 53 -h) + -l : long double precision (same as -e 15 -t 64) + -q : quadruple precision (same as -e 15 -t 113 -h) + -m : 240 bit multiprecision (same as -e 15 -t 240) + -e : provide bits to represent exponent + -t : provide bits precision + -h : leading bit is hidden + -ds : single precision destination + -dd : double precision destination + -dl : long double precision destination + -dq : quadruple precision destination + -dm : 240 bit multiprecision destination + -de : size of destination exponent + -dt : destination precision + -dh : leading bit is hidden in destination + +(3) Options to influence the actual testing phase (optional) + -r {n|p|m|z}: test only the specified rounding modes + -n {i|o|x|z|u|tiny|nan|inf|snz}: do not test the specified + exceptions, denormalized numbers, NaNs, signed + infinities or signed zeroes + -j {o|u|i|z}: jump/skip test vectors raising the overflow, underflow, + invalid or divide by zero exception + -ieee: test conversions only within range specified by IEEE + -i: idem as -ieee + -f logfile: output log of testing to 'logfile'; the default value + for 'logfile' is ieee.log -- 2.20.1