From 8619df0c981a372d91a02b54e0a71d2029dc945a Mon Sep 17 00:00:00 2001 From: enge Date: Sat, 21 Feb 2009 11:22:56 +0000 Subject: moved content of trunk/tools to misc git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@423 211d60ee-9f03-0410-a15a-8952a2c7a4e4 --- tools/README.coverage | 15 -- tools/README.pipol | 50 ----- tools/README.testgen | 3 - tools/coverage | 53 ----- tools/pipol/nightly/multiopt | 248 --------------------- tools/pipol/rc.amd64-linux-debian-etch | 4 - tools/pipol/rc.amd64-linux-fedora | 9 - tools/pipol/rc.amd64-linux-mandriva | 6 - tools/pipol/rc.amd64-linux-suse-LES10 | 15 -- tools/pipol/rc.amd64-linux-ubuntu-feisty | 8 - tools/pipol/rc.amd64-linux-ubuntu-hardy | 6 - tools/pipol/rc.fedora | 9 - tools/pipol/rc.i386-linux-debian-etch | 26 --- tools/pipol/rc.i386-linux-debian-testing | 20 -- tools/pipol/rc.i386-linux-fedora-core8 | 9 - tools/pipol/rc.i386-linux-fedora-core9 | 9 - tools/pipol/rc.i386-linux-mandriva | 6 - tools/pipol/rc.ia64-linux-fedora | 14 -- tools/pipol/rc.mac | 12 - tools/pipol/rc.redhat | 15 -- tools/pipol/scripts/compile-svn.sh | 33 --- tools/pipol/scripts/get-svn.sh | 17 -- tools/pipol/yum.repos.d/fedora-development.repo | 48 ---- .../pipol/yum.repos.d/fedora-updates-testing.repo | 26 --- tools/pipol/yum.repos.d/fedora-updates.repo | 26 --- tools/pipol/yum.repos.d/fedora.repo | 26 --- tools/testgen/makefile | 30 --- tools/testgen/write_test.h | 231 ------------------- tools/testgen/write_test_div.c | 68 ------ tools/testgen/write_test_divfr.c | 60 ----- tools/testgen/write_test_frdiv.c | 63 ------ tools/testgen/write_test_frsub.c | 60 ----- tools/testgen/write_test_mulfr.c | 60 ----- tools/testgen/write_test_norm.c | 49 ---- tools/testgen/write_test_subfr.c | 71 ------ 35 files changed, 1405 deletions(-) delete mode 100644 tools/README.coverage delete mode 100644 tools/README.pipol delete mode 100644 tools/README.testgen delete mode 100755 tools/coverage delete mode 100755 tools/pipol/nightly/multiopt delete mode 100644 tools/pipol/rc.amd64-linux-debian-etch delete mode 100755 tools/pipol/rc.amd64-linux-fedora delete mode 100755 tools/pipol/rc.amd64-linux-mandriva delete mode 100755 tools/pipol/rc.amd64-linux-suse-LES10 delete mode 100755 tools/pipol/rc.amd64-linux-ubuntu-feisty delete mode 100755 tools/pipol/rc.amd64-linux-ubuntu-hardy delete mode 100755 tools/pipol/rc.fedora delete mode 100755 tools/pipol/rc.i386-linux-debian-etch delete mode 100755 tools/pipol/rc.i386-linux-debian-testing delete mode 100755 tools/pipol/rc.i386-linux-fedora-core8 delete mode 100755 tools/pipol/rc.i386-linux-fedora-core9 delete mode 100644 tools/pipol/rc.i386-linux-mandriva delete mode 100755 tools/pipol/rc.ia64-linux-fedora delete mode 100755 tools/pipol/rc.mac delete mode 100755 tools/pipol/rc.redhat delete mode 100755 tools/pipol/scripts/compile-svn.sh delete mode 100755 tools/pipol/scripts/get-svn.sh delete mode 100644 tools/pipol/yum.repos.d/fedora-development.repo delete mode 100644 tools/pipol/yum.repos.d/fedora-updates-testing.repo delete mode 100644 tools/pipol/yum.repos.d/fedora-updates.repo delete mode 100644 tools/pipol/yum.repos.d/fedora.repo delete mode 100644 tools/testgen/makefile delete mode 100644 tools/testgen/write_test.h delete mode 100644 tools/testgen/write_test_div.c delete mode 100644 tools/testgen/write_test_divfr.c delete mode 100644 tools/testgen/write_test_frdiv.c delete mode 100644 tools/testgen/write_test_frsub.c delete mode 100644 tools/testgen/write_test_mulfr.c delete mode 100644 tools/testgen/write_test_norm.c delete mode 100644 tools/testgen/write_test_subfr.c (limited to 'tools') diff --git a/tools/README.coverage b/tools/README.coverage deleted file mode 100644 index 1fa271c..0000000 --- a/tools/README.coverage +++ /dev/null @@ -1,15 +0,0 @@ -The script "coverage" computes the test suite coverage of MPC -in terms of lines of code and summarises it on web pages. -You will need gcov and lcov (http://ltp.sourceforge.net/coverage/lcov.php). - -Usage: -cd path_to_mpc_sources/tools -./coverage additional_parameters_to_configure - -After execution, the html pages lie in the directory /tmp/ompc-gcov/html. - -Colour thresholds can be tuned in a configuration file $HOME/.lcovrc, -containing, for instance: -genhtml_hi_limit = 100 -genhtml_med_limit = 95 -genhtml_legend = yes diff --git a/tools/README.pipol b/tools/README.pipol deleted file mode 100644 index 30ae318..0000000 --- a/tools/README.pipol +++ /dev/null @@ -1,50 +0,0 @@ -This file details the files contained in the pipol directory and how to -install nightly-build scripts on the PIPOL platform. - -Files ------ -yum.repos.d/fedora.repo -yum.repos.d/fedora-updates.repo -yum.repos.d/fedora-development.repo -yum.repos.d/fedora-updates-testing.repo -These repositories are usefull when upgrading RedHat EL-5.0 from non-official -directories (copied by rc.redhat into /etc/yum.repos.d). - -rc.amd64-linux-debian-etch -rc.amd64-linux-fedora -rc.amd64-linux-mandriva -rc.amd64-linux-suse-LES10 -rc.amd64-linux-ubuntu-feisty -rc.amd64-linux-ubuntu-hardy -rc.i386-linux-debian-etch -rc.i386-linux-debian-testing -rc.i386-linux-fedora-core8 -rc.i386-linux-fedora-core9 -rc.i386-linux-mandriva -rc.ia64-linux-fedora -rc.mac -rc.redhat -These 'run command' files update/install all the packages needed for mpfr and -mpc compilation. -Note that a binary mpfr-2.3.2 tarball is needed by rc.ia64-linux-fedora, read -this file for further informations. - -nightly/multiopt -The nightly-test script. It downloads the last development version of the -code from the subversion repository and try to compile it. Results are -recorded in a log file '.pipol/log/-multiopt'. - -scripts/get-svn.sh -Helper script that downloads code source. Run it without parameter to display -help. - -scripts/compile-svn.sh -Helper script that compiles code. Run it without parameter to display help. - -Nightly-build HOWTO -------------------- -1. Copy 'pipol/' directory content into the '.pipol/' directory of your pipol -homedir. -2. Check that all scripts and run command files are executable. -3. Wait until the scripts in the 'nightly/' directory are executed. -4. Check results in '.pipol/log/' dir. diff --git a/tools/README.testgen b/tools/README.testgen deleted file mode 100644 index 281ee17..0000000 --- a/tools/README.testgen +++ /dev/null @@ -1,3 +0,0 @@ -The subdirectory "testgen" contains some C programs for computing with -special values that are represented as strings "+inf", "nan" and so on. -These have been used to obtain data files for some tests. diff --git a/tools/coverage b/tools/coverage deleted file mode 100755 index f73f916..0000000 --- a/tools/coverage +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Test coverage using gcov & lcov -# download lcov in http://ltp.sourceforge.net/coverage/lcov.php -# -# An adaptation of Patrick Pelissier's script in MPFR -# additional parameters to mpc configure are passed on the command line -# -# Copyright (C) 2008 Philippe Th\'eveny, Andreas Enge -# This file is part of the MPC Library. - -# The MPC Library is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or (at your -# option) any later version. - -# The MPC Library is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -# License for more details. - -# You should have received a copy of the GNU Lesser General Public License -# along with the MPC Library; see the file COPYING.LIB. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA. - -SRC_DIR=`pwd`/.. -DEST_DIR=/tmp/ompc-gcov -REVISION=$(cd ..; svn info|sed -n '/Revision: / p'); - -# First Build MPC in /tmp/ -echo "Erasing previous " $DEST_DIR -rm -rf $DEST_DIR -mkdir $DEST_DIR -echo "Copying MPC sources to "$DEST_DIR -cp $SRC_DIR/* $DEST_DIR 2>/dev/null -mkdir $DEST_DIR/doc -cp $SRC_DIR/doc/* $DEST_DIR/doc -mkdir $DEST_DIR/src -cp $SRC_DIR/src/{Makefile*,*.h,*.c} $DEST_DIR/src -mkdir $DEST_DIR/tests -cp $SRC_DIR/tests/{Makefile*,*.h,*.c,*.dat} $DEST_DIR/tests -cd $DEST_DIR -echo "Building MPC" -./configure --enable-assert --disable-shared --enable-static $@ \ - CFLAGS="-fprofile-arcs -ftest-coverage -g" -make check -j -l 2 - -mkdir html -lcov -o html/mpc.capture -t "$REVISION" -d src -c -lcov -o html/mpc.info -r html/mpc.capture *gmp*.h -genhtml -o html --no-prefix -t "$REVISION" html/mpc.info - -echo "See results in "$DEST_DIR"/html/index.html" diff --git a/tools/pipol/nightly/multiopt b/tools/pipol/nightly/multiopt deleted file mode 100755 index c897c62..0000000 --- a/tools/pipol/nightly/multiopt +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/bash -SCRIPTS_DIR=$PIPOL_HOMEDIR/.pipol/scripts - -# Return value (set it to 1 if a script fails) -RET=0 - -# -# Set RANDOM_OPT to random compiler options -# [no parameter] -# -function random_opt() -{ -CONFIGURE_OPTIONS=(\ - --enable-assert=full \ - --disable-shared) -# some options are not available everywhere -case $PIPOL_IMAGE in - *mac*) - : ;; - *linux*) - CONFIGURE_OPTIONS[${#CONFIGURE_OPTIONS[*]}] = --enable-thread-safe - ;; -esac - -# we did already compile with --enable-assert=full, so don't use zero value -local number=${RANDOM:-3} - -unset RANDOM_OPT -for ((i=0; i < ${#CONFIGURE_OPTIONS[*]}; i++)); do - if [ $(($((2**i)) & number)) -ne 0 ]; then - RANDOM_OPT+=" "${CONFIGURE_OPTIONS[$i]} - fi -done - -unset CFLAGS_OPT -CFLAGS_OPTIONS=(\ - -O3 \ - -ansi \ - -std=c99 \ - -fno-common) -# some options are not available everywhere -case $PIPOL_IMAGE in - *mac*) - : ;; - *linux*) - CFLAGS_OPTIONS[${#CFLAGS_OPTIONS[*]}]="-D_FORTIFY_SOURCE=2" - CFLAGS_OPTIONS[${#CFLAGS_OPTIONS[*]}]="-D_XOPEN_SOURCE=500" - ;; -esac - -for ((i=0; i < ${#CFLAGS_OPTIONS[*]}; i++)); do - j=$i+${#CONFIGURE_OPTIONS[*]} - if [ $(($((2**j)) & number)) -ne 0 ]; then - CFLAGS_OPT+=${CFLAGS_OPTIONS[$i]}" " - fi -done -if [ -n "$CFLAGS_OPT" ]; then - RANDOM_OPT+=" CFLAGS=\"$CFLAGS_OPT\"" -fi -} - -# -# Write script result in LOG_FILE -# [first parameter: command to be executed while logging results] -# [optional other parameters: command parameters] -# -LOG_FILE=$PIPOL_HOMEDIR/.pipol/log/`date +%y%m%d`-`basename $0` - -function log() -{ -# execute and log in a temp file -if $* >$PIPOL_WDIR/execution.tmp; then - RESULT="OK: " -else - # something wrong happened: record execution log - cat $PIPOL_WDIR/execution.tmp - RESULT="FAILED:" - RET=1 -fi; -# write result in images global file -SCRIPT_NAME=`basename $1` -shift -echo $RESULT $REVISION $PIPOL_IMAGE $PIPOL_JOB_ID $SCRIPT_NAME $* >>$LOG_FILE -} - -# -# Set REVISION to the current revision number of the parameter -# [parameter: svn directory] -# -function get_revision() -{ -REVISION=$(cd $1; svn info|sed -n 's/Revision: // p') -} - -# -# Make clean in compile directory without changing current working dir -# [parameter: build directory] -# -function clean_compile_dir() -{ -( - cd $1; - make clean >$PIPOL_WDIR/clean.tmp - if [ $? != 0 ]; then - # something wrong happened: save log file - cat $PIPOL_WDIR/clean.tmp - fi -) -} - - -### - -# -# Deploy images -# -#PIPOL esn amd64-linux-fedora-core9.dd.gz none 02:00 --silent --user -#PIPOL esn i386-linux-fedora-core9.dd.gz none 02:00 --silent --user -#PIPOL esn ia64-linux-fedora-core9.dd none 02:00 --silent --user -#PIPOL esn i386-linux-debian-testing.dd.gz none 02:00 --silent --user - -#PIPOL esn i386_mac-mac-osx-server-leopard.dd.gz none 02:00 --silent --user - -### -### Following commands are executed on each and all deployed images -### - -# -# image-dependant configurations -# -# architecture-dependant -case $PIPOL_IMAGE in - *i386-linux*) # set path to SUN studio compiler - export PATH=/net/i386/sunstudio/sunstudio12/bin:$PATH - # set path to Intel compiler (bin, lib, and so on) - . /net/i386/icc/11.0.074/bin/iccvars.sh ia32 - ;; - *amd64-linux*) # set path to Intel compiler (bin, lib, and so on) - . /net/amd64/icc/11.0.074/bin/iccvars.sh intel64 - ;; - *ia64-linux*) # set path to Intel compiler (bin, lib, and so on) - . /net/ia64/icc/11.0.074/bin/iccvars.sh ia64 - ;; -esac - -# system-dependant -case $PIPOL_IMAGE in - *mac*) # new packages are installed in /opt subdirectories - export C_INCLUDE_PATH=/opt/local/include:$C_INCLUDE_PATH - export LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH - export LIBRARY_PATH=/opt/local/lib:$LIBRARY_PATH - ;; - *redhatEL*) # path to recent mpfr lib - export C_INCLUDE_PATH=$PIPOL_WDIR/include:$C_INCLUDE_PATH - export LD_LIBRARY_PATH=$PIPOL_WDIR/lib:$LD_LIBRARY_PATH - export LIBRARY_PATH=$PIPOL_WDIR/lib:$LIBRARY_PATH - ;; -esac - -# Setting random seed enables replay -#RANDOM=$PIPOL_JOB -RANDOM=$$ - -# this is understood by both mpc and mpfr compilation processes -export GMP_CHECK_RANDOMIZE=1 - -# -# Get mpfr trunk and compile it with various options -# -unset REVISION -log $SCRIPTS_DIR/get-svn.sh mpfr/trunk mpfr-trunk -get_revision $PIPOL_WDIR/mpfr-trunk -REVISION="mpfr(r$REVISION)" -export MPFR_CHECK_MAX=1 -export MPFR_CHECK_SUSPICIOUS_OVERFLOW=1 -export MPFR_CHECK_LIBC_PRINTF=1 -log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk - -clean_compile_dir $PIPOL_WDIR/mpfr-trunk -log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk --enable-assert=full - -clean_compile_dir $PIPOL_WDIR/mpfr-trunk -random_opt -log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk $RANDOM_OPT - -# Compile mpfr with non-GNU compilers -case $PIPOL_IMAGE in - *i386-linux*) - # SUN Studio compiler - clean_compile_dir $PIPOL_WDIR/mpfr-trunk - log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk CC=cc - # Intel compiler - clean_compile_dir $PIPOL_WDIR/mpfr-trunk - log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk CC=icc CFLAGS=\"-Wno-error\" - ;; - *amd64-linux*) - # Intel compiler - clean_compile_dir $PIPOL_WDIR/mpfr-trunk - log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk CC="icc" - ;; - *ia64-linux*) - # Intel compiler - clean_compile_dir $PIPOL_WDIR/mpfr-trunk - log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk CC=icc CFLAGS=\"-Wno-error\" - ;; -esac - -# -# Get mpc trunk and compile it -# -unset REVISION -log $SCRIPTS_DIR/get-svn.sh mpc/trunk mpc-trunk -get_revision $PIPOL_WDIR/mpc-trunk -REVISION="mpc(r$REVISION)" -log $SCRIPTS_DIR/compile-svn.sh mpc-trunk - -clean_compile_dir $PIPOL_WDIR/mpc-trunk -log $SCRIPTS_DIR/compile-svn.sh mpc-trunk --disable-shared - -clean_compile_dir $PIPOL_WDIR/mpc-trunk -log $SCRIPTS_DIR/compile-svn.sh mpc-trunk --disable-static - -# Compile mpc with non-GNU compilers -case $PIPOL_IMAGE in - *i386-linux*) - # SUN Studio compiler - clean_compile_dir $PIPOL_WDIR/mpc-trunk - log $SCRIPTS_DIR/compile-svn.sh mpc-trunk CC="cc" - # Intel compiler - clean_compile_dir $PIPOL_WDIR/mpc-trunk - log $SCRIPTS_DIR/compile-svn.sh mpc-trunk CC=icc CFLAGS=\"-Wno-error\" - ;; - *amd64-linux*) - # Intel compiler - clean_compile_dir $PIPOL_WDIR/mpc-trunk - log $SCRIPTS_DIR/compile-svn.sh mpc-trunk CC=icc CFLAGS=\"-Wno-error\" - ;; - *ia64-linux*) - # Intel compiler - clean_compile_dir $PIPOL_WDIR/mpc-trunk - log $SCRIPTS_DIR/compile-svn.sh mpc-trunk CC=icc CFLAGS=\"-Wno-error\" - ;; -esac - -# -# Return value is 0 if no script failed -# -exit $RET; diff --git a/tools/pipol/rc.amd64-linux-debian-etch b/tools/pipol/rc.amd64-linux-debian-etch deleted file mode 100644 index 82d8d87..0000000 --- a/tools/pipol/rc.amd64-linux-debian-etch +++ /dev/null @@ -1,4 +0,0 @@ -apt-get update -apt-get install -q=2 libgmp3-dev -apt-get install -q=2 libmpfr-dev -apt-get install -q=2 libstdc++5 diff --git a/tools/pipol/rc.amd64-linux-fedora b/tools/pipol/rc.amd64-linux-fedora deleted file mode 100755 index bff9bb9..0000000 --- a/tools/pipol/rc.amd64-linux-fedora +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -yum -y remove ccache - -yum -y install compat-libstdc++-33 -yum -y upgrade automake -yum -y install libtool -yum -y install texinfo -yum -y install gmp-devel -yum -y install mpfr-devel diff --git a/tools/pipol/rc.amd64-linux-mandriva b/tools/pipol/rc.amd64-linux-mandriva deleted file mode 100755 index 832e9c2..0000000 --- a/tools/pipol/rc.amd64-linux-mandriva +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -urpmi.update -a --quiet -urpmi --force --quiet lib64gmp3-devel -urpmi --force --quiet lib64mpfr1 -urpmi --force --quiet lib64mpfr1-devel - diff --git a/tools/pipol/rc.amd64-linux-suse-LES10 b/tools/pipol/rc.amd64-linux-suse-LES10 deleted file mode 100755 index 04e994d..0000000 --- a/tools/pipol/rc.amd64-linux-suse-LES10 +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -smart channel --yes --disable 'openSUSE:Tools' -smart channel --yes --disable 'OpenOffice.org:STABLE' -smart channel --yes --disable 'OpenOffice.org:EXTRAS' -smart channel --yes --add openSUSE type=yast2 name=current baseurl="http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/" -smart channel --yes --enable openSUSE -smart update -smart install rpm --yes -smart upgrade smart --yes -smart install autoconf --yes -smart install automake --yes -smart install gmp-devel --yes -smart install texinfo --yes -smart install libmpfr1-2.3.1 --yes - diff --git a/tools/pipol/rc.amd64-linux-ubuntu-feisty b/tools/pipol/rc.amd64-linux-ubuntu-feisty deleted file mode 100755 index 2af20ae..0000000 --- a/tools/pipol/rc.amd64-linux-ubuntu-feisty +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -dpkg --configure -a -apt-get -q=2 install autoconf -apt-get -q=2 install automake -apt-get -q=2 install texinfo -apt-get -q=2 install libtool -apt-get -q=2 install libgmp3-dev -apt-get -q=2 install libmpfr-dev diff --git a/tools/pipol/rc.amd64-linux-ubuntu-hardy b/tools/pipol/rc.amd64-linux-ubuntu-hardy deleted file mode 100755 index 3ccc36b..0000000 --- a/tools/pipol/rc.amd64-linux-ubuntu-hardy +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -apt-get -y -q=2 install automake -apt-get -y -q=2 install texinfo -apt-get -y -q=2 install libtool -apt-get -y -q=2 install libgmp3-dev -apt-get -y -q=2 install libmpfr-dev diff --git a/tools/pipol/rc.fedora b/tools/pipol/rc.fedora deleted file mode 100755 index 1112066..0000000 --- a/tools/pipol/rc.fedora +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -yum -y remove ccache - -yum --enablerepo=development -y install compat-libstdc++-33.i386 -yum --enablerepo=development -y upgrade automake -yum --enablerepo=development -y install libtool -yum --enablerepo=development -y install texinfo -yum --enablerepo=development -y install gmp-devel -yum --enablerepo=development -y install mpfr-devel diff --git a/tools/pipol/rc.i386-linux-debian-etch b/tools/pipol/rc.i386-linux-debian-etch deleted file mode 100755 index b3f2bc6..0000000 --- a/tools/pipol/rc.i386-linux-debian-etch +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# AUTOMAKE 1.10.1 is in version 'Lenny' -cat >>/etc/apt/sources.list <>/etc/apt/apt.conf.d/100MpfrChanges <>/etc/apt/apt.conf.d/100MpfrChanges < -#include - -char* licence = -"# This file is part of the MPC Library.\n" -"#\n" -"# The MPC Library is free software; you can redistribute it and/or modify\n" -"# it under the terms of the GNU Lesser General Public License as published by\n" -"# the Free Software Foundation; either version 2.1 of the License, or (at your\n" -"# option) any later version.\n" -"#\n" -"# The MPC Library is distributed in the hope that it will be useful, but\n" -"# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n" -"# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\n" -"# License for more details.\n" -"#\n" -"# You should have received a copy of the GNU Lesser General Public License\n" -"# along with the MPC Library; see the file COPYING.LIB. If not, write to\n" -"# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,\n" -"# MA 02111-1307, USA.\n" -"#\n" -; - -char* values [] = {"-inf", "-1", "-0", "+0", "1", "+inf", "nan"}; -int valueslen = 7; -char* infvalues [] = {"-inf", "+inf", "nan"}; -int infvalueslen = 3; - -int equals (char* a, char* b) { - return !strcmp (a, b); -} - -int index (char** table, int length, char* value) { - // returns the index of value in the table, - // or -1 if it is not found - int i; - for (i = 0; i < length; i++) - if (equals (table [i], value)) - return i; - return -1; -} - -char* mul_fr_fr (char *op1, char *op2) { - // returns op1*op2 - if (equals (op1, "nan") || equals (op2, "nan")) - return "nan"; - // none is nan - else if (equals (op1, "-inf")) { - // res = op1 * values - char* res [] = {"+inf", "+inf", "nan", "nan", "-inf", "-inf", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "-1")) { - char* res [] = {"+inf", "1", "+0", "-0", "-1", "-inf", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "-0")) { - char* res [] = {"nan", "+0", "+0", "-0", "-0", "nan", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "+0")) { - char* res [] = {"nan", "-0", "-0", "+0", "+0", "nan", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "1")) { - char* res [] = {"-inf", "-1", "-0", "+0", "1", "+inf", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "+inf")) { - char* res [] = {"-inf", "-inf", "nan", "nan", "+inf", "+inf", ""}; - return res [index (values, valueslen, op2)]; - } - else - return "?"; -} - -char* div_fr_fr (char *op1, char *op2) { - // returns op1/op2 - char *r; -// printf (" %s %s", op1, op2); - if (equals (op1, "nan") || equals (op2, "nan")) - r = "nan"; - else if (equals (op2, "-inf")) { - char* res [] = {"nan", "+0", "+0", "-0", "-0", "nan", ""}; - r = res [index (values, valueslen, op1)]; - } - else if (equals (op2, "-2")) { - char* res [] = {"+inf", "0.5", "+0", "-0", "-0.5", "-inf", ""}; - if (equals (op1, "-2")) - r = "1"; - else if (equals (op1, "2")) - r = "-1"; - else if (equals (op1, "0")) - r = "0"; - else - r = res [index (values, valueslen, op1)]; - } - else if (equals (op2, "-1")) { - char* res [] = {"+inf", "1", "+0", "-0", "-1", "-inf", ""}; - r = res [index (values, valueslen, op1)]; - } - else if (equals (op2, "-0")) { - char* res [] = {"+inf", "+inf", "nan", "nan", "-inf", "-inf", ""}; - if (equals (op1, "0")) - r = "nan"; - else - r = res [index (values, valueslen, op1)]; - } - else if (equals (op2, "+0")) { - char* res [] = {"-inf", "-inf", "nan", "nan", "+inf", "+inf", ""}; - if (equals (op1, "0")) - r = "nan"; - else - r = res [index (values, valueslen, op1)]; - } - else if (equals (op2, "1")) { - char* res [] = {"-inf", "-1", "-0", "+0", "1", "+inf", ""}; - r = res [index (values, valueslen, op1)]; - } - else if (equals (op2, "2")) { - char* res [] = {"-inf", "-0.5", "-0", "+0", "0.5", "+inf", ""}; - if (equals (op1, "-2")) - r = "-1"; - else if (equals (op1, "2")) - r = "1"; - else if (equals (op1, "0")) - r = "0"; - else - r = res [index (values, valueslen, op1)]; - } - else if (equals (op2, "+inf")) { - char* res [] = {"nan", "-0", "-0", "+0", "+0", "nan", ""}; - r = res [index (values, valueslen, op1)]; - } - else - r = "?"; -// printf (" %s\n", r); - return r; -} - -char* add_fr_fr (char *op1, char *op2) { - // returns op1+op2 - if (equals (op1, "nan") || equals (op2, "nan")) - return "nan"; - else if (equals (op1, "-inf")) { - char* res [] = {"-inf", "-inf", "-inf", "-inf", "-inf", "nan", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "-1")) { - char* res [] = {"-inf", "-2", "-1", "-1", "0", "+inf", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "-0")) { - char* res [] = {"-inf", "-1", "-0", "0", "1", "+inf", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "+0")) { - char* res [] = {"-inf", "-1", "0", "+0", "1", "+inf", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "1")) { - char* res [] = {"-inf", "0", "1", "1", "2", "+inf", ""}; - return res [index (values, valueslen, op2)]; - } - else if (equals (op1, "+inf")) { - char* res [] = {"nan", "+inf", "+inf", "+inf", "+inf", "+inf", ""}; - return res [index (values, valueslen, op2)]; - } - else - return "?"; -} - -char* neg_fr (char *op) { - // returns -op - if (index (values, valueslen, op) != -1) { - char* res [] = {"+inf", "1", "+0", "-0", "-1", "-inf", "nan"}; - return res [index (values, valueslen, op)]; - } - else if (equals (op, "0")) - return "0"; - else - return "?"; -} - -char* sub_fr_fr (char *op1, char *op2) { - // returns op1-op2 - return add_fr_fr (op1, neg_fr (op2)); -} - -char* norm (char *opre, char *opim) { - // returns opre^2+opim^2 - if (equals (opre, "nan") || equals (opim, "nan")) - if ( (equals (opre, "-inf") || equals (opre, "+inf")) - || (equals (opim, "-inf") || equals (opim, "+inf"))) - return "+inf"; - else - return "nan"; - else - return add_fr_fr (mul_fr_fr (opre, opre), mul_fr_fr (opim, opim)); -} - -char* div_re (char *op1re, char *op1im, char *op2re, char *op2im) { - // returns real part of complex division - if ( equals (op1re, "nan") || equals (op1im, "nan") - || equals (op2re, "nan") || equals (op2im, "nan")) - return "nan"; - else if (equals (op2im, "-0") || equals (op2im, "+0")) - return div_fr_fr (op1re, op2re); - else if (equals (op2re, "-0") || equals (op2re, "+0")) - return div_fr_fr (op1im, op2im); - else - return div_fr_fr ( - add_fr_fr (mul_fr_fr (op1re, op2re), mul_fr_fr (op1im, op2im)), - norm (op2re, op2im)); -} - -char* div_im (char *op1re, char *op1im, char *op2re, char *op2im) { - // returns imaginary part of complex division - if ( equals (op1re, "nan") || equals (op1im, "nan") - || equals (op2re, "nan") || equals (op2im, "nan")) - return "nan"; - else if (equals (op2im, "-0") || equals (op2im, "+0")) - return div_fr_fr (op1im, op2re); - else if (equals (op2re, "-0") || equals (op2re, "+0")) - return neg_fr (div_fr_fr (op1re, op2im)); - else - return div_fr_fr ( - sub_fr_fr (mul_fr_fr (op1im, op2re), mul_fr_fr (op1re, op2im)), - norm (op2re, op2im)); -} - diff --git a/tools/testgen/write_test_div.c b/tools/testgen/write_test_div.c deleted file mode 100644 index c00f577..0000000 --- a/tools/testgen/write_test_div.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "write_test.h" - -char* header1 = -"# Data file for mpc_div.\n" -"#\n" -"# Copyright (C) 2008 Andreas Enge\n" -"#\n" -; -char* header2 = -"# For explanations on the file format, see add.dat.\n\n" -; - -int main () { - int op1rei, op1imi, op2rei, op2imi; - // index in values table - char *op1re, *op1im, *op2re, *op2im; - - printf ("%s%s%s", header1, licence, header2); - - printf ("# special values\n"); - for (op1rei = 0; op1rei < valueslen; op1rei++) - for (op1imi = 0; op1imi < valueslen; op1imi++) - for (op2rei = 0; op2rei < valueslen; op2rei++) - for (op2imi = 0; op2imi < valueslen; op2imi++) - { - op1re = values [op1rei]; - op1im = values [op1imi]; - op2re = values [op2rei]; - op2im = values [op2imi]; - if ( (index (infvalues, infvalueslen, op1re) != -1) - || (index (infvalues, infvalueslen, op1im) != -1) - || (index (infvalues, infvalueslen, op2re) != -1) - || (index (infvalues, infvalueslen, op2im) != -1)) - { - // at least one infinite value - printf ("7 %4s 7 %4s ", - div_re (op1re, op1im, op2re, op2im), - div_im (op1re, op1im, op2re, op2im)); - printf ("7 %4s 7 %4s 7 %4s 7 %4s N N\n", - op1re, op1im, op2re, op2im); - } - } - - printf ("\n# finite values\n"); - for (op1rei = 0; op1rei < valueslen; op1rei++) - for (op1imi = 0; op1imi < valueslen; op1imi++) - for (op2rei = 0; op2rei < valueslen; op2rei++) - for (op2imi = 0; op2imi < valueslen; op2imi++) - { - op1re = values [op1rei]; - op1im = values [op1imi]; - op2re = values [op2rei]; - op2im = values [op2imi]; - if ( (index (infvalues, infvalueslen, op1re) == -1) - && (index (infvalues, infvalueslen, op1im) == -1) - && (index (infvalues, infvalueslen, op2re) == -1) - && (index (infvalues, infvalueslen, op2im) == -1)) - { - printf ("7 %4s 7 %4s ", - div_re (op1re, op1im, op2re, op2im), - div_im (op1re, op1im, op2re, op2im)); - printf ("7 %4s 7 %4s 7 %4s 7 %4s N N\n", - op1re, op1im, op2re, op2im); - } - } - - return 1; -} diff --git a/tools/testgen/write_test_divfr.c b/tools/testgen/write_test_divfr.c deleted file mode 100644 index 60d182f..0000000 --- a/tools/testgen/write_test_divfr.c +++ /dev/null @@ -1,60 +0,0 @@ -#include "write_test.h" - -char* header1 = -"# Data file for mpc_div_fr.\n" -"#\n" -"# Copyright (C) 2008 Andreas Enge\n" -"#\n" -; -char* header2 = -"# For explanations on the file format, see add_fr.dat.\n\n" -; - -int main () { - int op1rei, op1imi, op2i; - // index in values table - char *op1re, *op1im, *op2; - - printf ("%s%s%s", header1, licence, header2); - - printf ("# special values\n"); - for (op1rei = 0; op1rei < valueslen; op1rei++) - for (op1imi = 0; op1imi < valueslen; op1imi++) - for (op2i = 0; op2i < valueslen; op2i++) - { - op1re = values [op1rei]; - op1im = values [op1imi]; - op2 = values [op2i]; - if ( (index (infvalues, infvalueslen, op1re) != -1) - || (index (infvalues, infvalueslen, op1im) != -1) - || (index (infvalues, infvalueslen, op2) != -1)) - { - // at least one infinite value - printf ("7 %4s 7 %4s ", - div_fr_fr (op1re, op2), div_fr_fr (op1im, op2)); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1re, op1im, op2); - } - } - - printf ("\n# values with only 1, -1, +0, -0\n"); - for (op1rei = 0; op1rei < valueslen; op1rei++) - for (op1imi = 0; op1imi < valueslen; op1imi++) - for (op2i = 0; op2i < valueslen; op2i++) - { - op1re = values [op1rei]; - op1im = values [op1imi]; - op2 = values [op2i]; - if ( (index (infvalues, infvalueslen, op1re) == -1) - && (index (infvalues, infvalueslen, op1im) == -1) - && (index (infvalues, infvalueslen, op2) == -1)) - { - printf ("7 %4s 7 %4s ", - div_fr_fr (op1re, op2), div_fr_fr (op1im, op2)); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1re, op1im, op2); - } - } - - return 1; -} diff --git a/tools/testgen/write_test_frdiv.c b/tools/testgen/write_test_frdiv.c deleted file mode 100644 index e7d9b38..0000000 --- a/tools/testgen/write_test_frdiv.c +++ /dev/null @@ -1,63 +0,0 @@ -#include "write_test.h" - -char* header1 = -"# Data file for mpc_fr_div.\n" -"#\n" -"# Copyright (C) 2008 Andreas Enge\n" -"#\n" -; -char* header2 = -"# For explanations on the file format, see add.dat, and take into\n" -"# account the necessary modifications for one real argument.\n\n" -; - -int main () { - int op1i, op2rei, op2imi; - // index in values table - char *op1, *op2re, *op2im; - - printf ("%s%s%s", header1, licence, header2); - - printf ("# special values\n"); - for (op1i = 0; op1i < valueslen; op1i++) - for (op2rei = 0; op2rei < valueslen; op2rei++) - for (op2imi = 0; op2imi < valueslen; op2imi++) - { - op1 = values [op1i]; - op2re = values [op2rei]; - op2im = values [op2imi]; - if ( (index (infvalues, infvalueslen, op1) != -1) - || (index (infvalues, infvalueslen, op2re) != -1) - || (index (infvalues, infvalueslen, op2im) != -1)) - { - // at least one infinite value - printf ("7 %4s 7 %4s ", - div_re (op1, "+0", op2re, op2im), - div_im (op1, "+0", op2re, op2im)); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1, op2re, op2im); - } - } - - printf ("\n# finite values\n"); - for (op1i = 0; op1i < valueslen; op1i++) - for (op2rei = 0; op2rei < valueslen; op2rei++) - for (op2imi = 0; op2imi < valueslen; op2imi++) - { - op1 = values [op1i]; - op2re = values [op2rei]; - op2im = values [op2imi]; - if ( (index (infvalues, infvalueslen, op1) == -1) - && (index (infvalues, infvalueslen, op2re) == -1) - && (index (infvalues, infvalueslen, op2im) == -1)) - { - printf ("7 %4s 7 %4s ", - div_re (op1, "+0", op2re, op2im), - div_im (op1, "+0", op2re, op2im)); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1, op2re, op2im); - } - } - - return 1; -} diff --git a/tools/testgen/write_test_frsub.c b/tools/testgen/write_test_frsub.c deleted file mode 100644 index e201ad6..0000000 --- a/tools/testgen/write_test_frsub.c +++ /dev/null @@ -1,60 +0,0 @@ -#include "write_test.h" - -char* header1 = -"# Data file for mpc_fr_sub.\n" -"#\n" -"# Copyright (C) 2008 Andreas Enge\n" -"#\n" -; -char* header2 = -"# For explanations on the file format, see add_fr.dat.\n\n" -; - -int main () { - int op1i, op2rei, op2imi; - // index in values table - char *op1, *op2re, *op2im; - - printf ("%s%s%s", header1, licence, header2); - - printf ("# special values\n"); - for (op1i = 0; op1i < valueslen; op1i++) - for (op2rei = 0; op2rei < valueslen; op2rei++) - for (op2imi = 0; op2imi < valueslen; op2imi++) - { - op1 = values [op1i]; - op2re = values [op2rei]; - op2im = values [op2imi]; - if ( (index (infvalues, infvalueslen, op1) != -1) - || (index (infvalues, infvalueslen, op2re) != -1) - || (index (infvalues, infvalueslen, op2im) != -1)) - { - // at least one infinite value - printf ("7 %4s 7 %4s ", - sub_fr_fr (op1, op2re), neg_fr (op2im)); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1, op2re, op2im); - } - } - - printf ("\n# values with only 1, -1, +0, -0\n"); - for (op1i = 0; op1i < valueslen; op1i++) - for (op2rei = 0; op2rei < valueslen; op2rei++) - for (op2imi = 0; op2imi < valueslen; op2imi++) - { - op1 = values [op1i]; - op2re = values [op2rei]; - op2im = values [op2imi]; - if ( (index (infvalues, infvalueslen, op1) == -1) - && (index (infvalues, infvalueslen, op2re) == -1) - && (index (infvalues, infvalueslen, op2im) == -1)) - { - printf ("7 %4s 7 %4s ", - sub_fr_fr (op1, op2re), neg_fr (op2im)); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1, op2re, op2im); - } - } - - return 1; -} diff --git a/tools/testgen/write_test_mulfr.c b/tools/testgen/write_test_mulfr.c deleted file mode 100644 index 1dfc577..0000000 --- a/tools/testgen/write_test_mulfr.c +++ /dev/null @@ -1,60 +0,0 @@ -#include "write_test.h" - -char* header1 = -"# Data file for mpc_mul_fr.\n" -"#\n" -"# Copyright (C) 2008 Andreas Enge\n" -"#\n" -; -char* header2 = -"# For explanations on the file format, see add_fr.dat.\n\n" -; - -int main () { - int op1rei, op1imi, op2i; - // index in values table - char *op1re, *op1im, *op2; - - printf ("%s%s%s", header1, licence, header2); - - printf ("# special values\n"); - for (op1rei = 0; op1rei < valueslen; op1rei++) - for (op1imi = 0; op1imi < valueslen; op1imi++) - for (op2i = 0; op2i < valueslen; op2i++) - { - op1re = values [op1rei]; - op1im = values [op1imi]; - op2 = values [op2i]; - if ( (index (infvalues, infvalueslen, op1re) != -1) - || (index (infvalues, infvalueslen, op1im) != -1) - || (index (infvalues, infvalueslen, op2) != -1)) - { - // at least one infinite value - printf ("7 %4s 7 %4s ", - mul_fr_fr (op1re, op2), mul_fr_fr (op1im, op2)); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1re, op1im, op2); - } - } - - printf ("\n# values with only 1, -1, +0, -0\n"); - for (op1rei = 0; op1rei < valueslen; op1rei++) - for (op1imi = 0; op1imi < valueslen; op1imi++) - for (op2i = 0; op2i < valueslen; op2i++) - { - op1re = values [op1rei]; - op1im = values [op1imi]; - op2 = values [op2i]; - if ( (index (infvalues, infvalueslen, op1re) == -1) - && (index (infvalues, infvalueslen, op1im) == -1) - && (index (infvalues, infvalueslen, op2) == -1)) - { - printf ("7 %4s 7 %4s ", - mul_fr_fr (op1re, op2), mul_fr_fr (op1im, op2)); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1re, op1im, op2); - } - } - - return 1; -} diff --git a/tools/testgen/write_test_norm.c b/tools/testgen/write_test_norm.c deleted file mode 100644 index 2532e8e..0000000 --- a/tools/testgen/write_test_norm.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "write_test.h" - -char* header1 = -"# Data file for mpc_norm.\n" -"#\n" -"# Copyright (C) 2008 Andreas Enge\n" -"#\n" -; -char* header2 = -"# For explanations on the file format, see abs.dat.\n\n" -; - -int main () { - int oprei, opimi; - // index in values table - char *opre, *opim; - - printf ("%s%s%s", header1, licence, header2); - - printf ("# special values\n"); - for (oprei = 0; oprei < valueslen; oprei++) - for (opimi = 0; opimi < valueslen; opimi++) - { - opre = values [oprei]; - opim = values [opimi]; - if ( (index (infvalues, infvalueslen, opre) != -1) - || (index (infvalues, infvalueslen, opim) != -1)) - { - printf ("7 %4s ", norm (opre, opim)); - printf ("7 %4s 7 %4s N\n", opre, opim); - } - } - - printf ("\n# values with only 1, -1, +0, -0\n"); - for (oprei = 0; oprei < valueslen; oprei++) - for (opimi = 0; opimi < valueslen; opimi++) - { - opre = values [oprei]; - opim = values [opimi]; - if ( (index (infvalues, infvalueslen, opre) == -1) - && (index (infvalues, infvalueslen, opim) == -1)) - { - printf ("7 %4s ", norm (opre, opim)); - printf ("7 %4s 7 %4s N\n", opre, opim); - } - } - - return 1; -} diff --git a/tools/testgen/write_test_subfr.c b/tools/testgen/write_test_subfr.c deleted file mode 100644 index 393355c..0000000 --- a/tools/testgen/write_test_subfr.c +++ /dev/null @@ -1,71 +0,0 @@ -#include "write_test.h" - -char* header1 = -"# Data file for mpc_sub_fr.\n" -"#\n" -"# Copyright (C) 2008 Paul Zimmermann, Andreas Enge\n" -"#\n" -; -char* header2 = -"# For explanations on the file format, see add_fr.dat.\n\n" -; - -int main () { - int op1rei, op1imi, op2i; - // index in values table - char *op1re, *op1im, *op2; - - printf ("%s%s%s", header1, licence, header2); - - printf ("# special values\n"); - for (op1rei = 0; op1rei < valueslen; op1rei++) - for (op1imi = 0; op1imi < valueslen; op1imi++) - for (op2i = 0; op2i < valueslen; op2i++) - { - op1re = values [op1rei]; - op1im = values [op1imi]; - op2 = values [op2i]; - if ( (index (infvalues, infvalueslen, op1re) != -1) - || (index (infvalues, infvalueslen, op1im) != -1) - || (index (infvalues, infvalueslen, op2) != -1)) - { - // at least one infinite value - printf ("7 %4s 7 %4s ", - sub_fr_fr (op1re, op2), op1im); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1re, op1im, op2); - } - } - - printf ("\n# values with only 1, -1, +0, -0\n"); - for (op1rei = 0; op1rei < valueslen; op1rei++) - for (op1imi = 0; op1imi < valueslen; op1imi++) - for (op2i = 0; op2i < valueslen; op2i++) - { - op1re = values [op1rei]; - op1im = values [op1imi]; - op2 = values [op2i]; - if ( (index (infvalues, infvalueslen, op1re) == -1) - && (index (infvalues, infvalueslen, op1im) == -1) - && (index (infvalues, infvalueslen, op2) == -1)) - { - printf ("7 %4s 7 %4s ", - sub_fr_fr (op1re, op2), op1im); - printf ("7 %4s 7 %4s 7 %4s N N\n", - op1re, op1im, op2); - } - } - - printf ( - "\n# also check the imaginary part is correctly rounded\n" - "2 nan 2 16 2 nan 5 17 2 nan N N\n" - "2 nan 2 24 2 nan 5 17 2 nan N U\n" - "2 nan 2 16 2 nan 5 17 2 nan N D\n" - "2 nan 2 16 2 nan 5 17 2 nan N Z\n" - "2 nan 2 -16 2 nan 5 -17 2 nan N N\n" - "2 nan 2 -16 2 nan 5 -17 2 nan N U\n" - "2 nan 2 -24 2 nan 5 -17 2 nan N D\n" - "2 nan 2 -16 2 nan 5 -17 2 nan N Z\n"); - - return 1; -} -- cgit v1.2.1