#!/bin/bash

##########################################################################
#
# Test script for the IeeeCC754 suite
#
# $Id: dotests.sh 68 2005-07-04 08:27:41Z sbecuwe $
#
##########################################################################


configure='./configure'
reportsummary='Report_summary'
ieeelogfile='ieee.log'

basicopcppsuffix=''
conversioncppsuffix='_cpp'
conversionforsuffix='_for'


# which compilers are available?
gccversion=`g++ -dumpversion 2>&1 | grep -v "command not found"`
CCversion=`CC -V 2>&1 | grep -v "command not found" | sed -e 's/.*C++ //' | cut -f1 -d' '`
fxxversion=`f95 -V 2>&1 | grep -v "command not found" | grep ^f95 | sed -e 's/.*Fortran 95 //' | cut -f1 -d' '`
iccversion=`icpc -V 2>&1 | grep -v "command not found" | grep Version | sed -e 's/.*Version *//' -e 's/ *Build.*//'`


if [ -z "${gccversion}" ] && [ -z "${gcc2version}" ] \
   && [ -z "${CCversion}" ] && [ -z "${iccversion}" ]
then
  echo "No gcc, icc or CC found on your system.  The tests cannot be run."
  echo
  exit 1
fi

if [ -z "${CXX}" ]
then
  CXX="g++"      # default
fi


if [ -z "${USER}" ]
then
  USER="unknown"
fi

today=`date`
if [ -z "${today}" ]
then
  today="unknown"
fi


# library specific directories
# example: MpIeee <http://www.win.ua.ac.be/~cant/arithmos/>
libdirMpIeee="${HOME}/projects/ArithmosRelease/Libraries/Arithmos/lib/"
incdirMpIeee="${HOME}/projects/ArithmosRelease/Libraries/Arithmos/include/"


displayheader() {
  echo "   *****************************************"
  echo "   *         IeeeCC754 testing tool        *"
  echo "   *****************************************"
  echo " "
}

displaytargetmenu() {
  #clear the screen
  clear
  displayheader

  echo "   a) Basicoperations "
  echo "   b) Conversions "
  echo " "
  echo -n "   select a target > "
}


displayplatformmenu() {
  #clear the screen
  clear
  displayheader

  echo "   a) SunSparc "
  echo "   b) IntelPentium "
  echo "   c) AMD "
  echo "   d) PowerMac "
  echo " "
  echo  -n "   select a Platform > "
}


displaysunsparcmenu() {
  #clear the screen
  clear
  displayheader

  if [ ! -z "${CCversion}" ]
  then
    echo "   a) CC_v${CCversion}"
  fi

  if [ ! -z "${gccversion}" ]
  then
    echo "   b) gcc_v${gccversion}"
  fi

  if [ ${TARGET} = "Conversion" ] && [ ! -z "${fxxversion}" ]
  then
    echo "   c) f95_v${fxxversion}"
  fi

  echo "   d) FMLib"

  if [ -d "${libdirMpIeee}" ] && [ -d "${incdirMpIeee}" ]
  then
    echo "   e) MpIeee"
  fi

  if [ ! -z "${gcc2version}" ]
  then
    echo "   f) gcc_v${gcc2version}"
  fi

  echo " "
  echo  -n "   select Software/Compiler > "
}


displayintelpentiummenu() {
  #clear the screen
  clear
  displayheader

  if [ ! -z "${gccversion}" ]
  then
    echo "   a) gcc_v${gccversion}"
  fi

  if [ -d "${libdirMpIeee}" ] && [ -d "${incdirMpIeee}" ]
  then
    echo "   b) MpIeee"
  fi

  if [ ! -z "${gcc2version}" ]
  then
    echo "   c) gcc_v${gcc2version}"
  fi

  if [ ! -z "${iccversion}" ]
  then
    echo "   d) FMLib"
  fi

  if [ ! -z "${iccversion}" ]
  then
    echo "   e) icc_v${iccversion}"
  fi

  echo " "
  echo  -n "   select Software/Compiler > "
}

displaypowermacmenu() {
  #clear the screen
  clear
  displayheader

  if [ -d "${libdirMpIeee}" ] && [ -d "${incdirMpIeee}" ]
  then
    echo "   b) MpIeee"
  fi

  echo " "
  echo  -n "   select Software/Compiler > "
}


detectieeecc754() {
  if [ ! -f IeeeCC754 ]
  then
    echo "Error: IeeeCC754 does not exist.  Please check ${LIBRARY_PATH}."
    exit 1;
  fi
}


reportSummary() {
  filenm=$1
  echo "---" >> ${reportsummary}
  grep "Testrun" ${ieeelogfile} >> ${reportsummary}
  tail -3 ${ieeelogfile} >> ${reportsummary}
  echo "---" >> ${reportsummary}
  echo " " >> ${reportsummary}
  mv ${ieeelogfile} ${filenm}
}

lineReportSummary() {
  filenm=$1
  echo "---" >> ${reportsummary}
  grep "Testrun" ${ieeelogfile} >> ${reportsummary}
  tail -3 ${ieeelogfile} >> ${reportsummary}
  grep "line" ${ieeelogfile} >> ${reportsummary}
  echo "---" >> ${reportsummary}
  echo " " >> ${reportsummary}
  mv ${ieeelogfile} ${filenm}
}

makeLogDirs() {
  LOGDIR=${LOGDIR}"/"${TARGET}
  mkdir -p ${LOGDIR}
  LOGDIR=${LOGDIR}"/"${PLATFORMx}
  mkdir -p ${LOGDIR}
  LOGDIR=${LOGDIR}"/"${SOFTWARE}
  mkdir -p ${LOGDIR}
}

badchoice() {
  echo
  echo "Illegal choice .. exiting!!"
  echo
  exit 1
}

#TARGET MENU
displaytargetmenu
read answer
case ${answer} in
  a) TARGET="BasicOp";;
  b) TARGET="Conversion";; 
  *) badchoice;;
esac

#PLATFORM MENU
clear
displayplatformmenu
read answer
case ${answer} in

  a) PLATFORM="SunSparc"
     case "`uname -m`" in
       "sun4u") PLATFORMx="SunUltraSparc" ;;
       "sun4m") PLATFORMx="SunSuperSparc" ;;
       *)       PLATFORMx="SunSparc" ;;
     esac
     ;;	 

  b) PLATFORM="IntelPentium"
     PLATFORMx=$PLATFORM
     ;; 

  c) PLATFORM="AMD"
     PLATFORMx=$PLATFORM
     ;;

  d) PLATFORM="PowerMac"
     PLATFORMx=$PLATFORM
     ;;

  *) badchoice
     ;;

esac

#SunSparc MENU 
clear
if [ ${PLATFORM} = "SunSparc" ]
then
  displaysunsparcmenu
  read answer
  case ${answer} in

    a) if [ ! -z "${CCversion}" ]
       then
         SOFTWARE="CC_v${CCversion}"
         CXX="CC"
       else
         badchoice
       fi
       ;;

    b) if [ ! -z "${gccversion}" ]
       then
         SOFTWARE="gcc_v${gccversion}"
         CXX="g++"
       else
         badchoice
       fi
       ;;

    c) if [ ${TARGET} = "Conversion" ] && [ ! -z "${fxxversion}" ]
       then
         SOFTWARE="f95_v${fxxversion}"
         CXX="CC"
       else
         badchoice
       fi
       ;;

    d) SOFTWARE="FMLib"
       ;;

    e) if [ -d "${libdirMpIeee}" ] && [ -d "${incdirMpIeee}" ]
       then
         SOFTWARE="MpIeee"
       else
         badchoice
       fi
       ;;

    *) badchoice
       ;;

  esac
fi

#IntelPentium/AMD MENU
if [ ${PLATFORM} = "IntelPentium" ] || [ ${PLATFORM} = "AMD" ]
then
   displayintelpentiummenu
   read answer
   case ${answer} in

     a) if [ ! -z "${gccversion}" ]
        then
          SOFTWARE="gcc_v${gccversion}"
          CXX="g++"
        else
          badchoice
        fi
        ;;

     b) if [ -d "${libdirMpIeee}" ] && [ -d "${incdirMpIeee}" ]
        then
          SOFTWARE="MpIeee"
        else
          badchoice
        fi
        ;;

     d) if [ ! -z "${iccversion}" ]
        then
          SOFTWARE="FMLib"
        else
          badchoice
        fi
        ;;

     e) if [ ! -z "${iccversion}" ]
        then
          SOFTWARE="icc_v${iccversion}"
          CXX="icpc"
        else
          badchoice
        fi
        ;;

     *) badchoice
        ;;

   esac
fi

#PowerMac MENU
if [ ${PLATFORM} = "PowerMac" ]
then
   displaypowermacmenu
   read answer
   case ${answer} in

     b) if [ -d "${libdirMpIeee}" ] && [ -d "${incdirMpIeee}" ]
        then
          SOFTWARE="MpIeee"
        else
          badchoice
        fi
        ;;

     *) badchoice
        ;;

   esac
fi

LOGDIR="../IeeeCC754-Logfiles"

mkdir -p ${LOGDIR}

cat > ${reportsummary} <<EOF
################################ Report ###############################

Testresults for: ${TARGET} on ${PLATFORMx} with ${SOFTWARE}
Generated by ${USER} at ${today}
 
#######################################################################

EOF

clear

if [ ${PLATFORM} = "SunSparc" ] && [ ${TARGET} = "Conversion" ] && [ ${SOFTWARE} = "f95_v${fxxversion}" ]
then
  makeLogDirs

  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"

  ${configure} -platform ${PLATFORM}${conversionforsuffix} -target Conversions -cxx ${CXX}
  make clean
  make
  
  detectieeecc754

  # #########
  # The tests
  # ######### 

  ./IeeeCC754 -c -d -ds Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rd2s

  ./IeeeCC754 -c -q -ds Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rq2s

  ./IeeeCC754 -c -q -dd Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rq2d

  ./IeeeCC754 -c -s -dd Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cs2d

  ./IeeeCC754 -c -s -dq Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cs2q

  ./IeeeCC754 -c -d -dq Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cd2q

  ./IeeeCC754 -c -s Conversion/testsets/b2dconvs
  reportSummary  ${LOGDIR}"/"b2dconvs

  ./IeeeCC754 -c -d Conversion/testsets/b2dconvd
  reportSummary  ${LOGDIR}"/"b2dconvd

  ./IeeeCC754 -c -q Conversion/testsets/b2dconvq
  reportSummary  ${LOGDIR}"/"b2dconvq

  ./IeeeCC754 -c -s Conversion/testsets/d2bconvs
  reportSummary  ${LOGDIR}"/"d2bconvs

  ./IeeeCC754 -c -d Conversion/testsets/d2bconvd
  reportSummary  ${LOGDIR}"/"d2bconvd

  ./IeeeCC754 -c -q Conversion/testsets/d2bconvq
  reportSummary  ${LOGDIR}"/"d2bconvq

  ./IeeeCC754 -c -s Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegrals

  ./IeeeCC754 -c -d Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegrald

  ./IeeeCC754 -c -q -r nz Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegralq

  ./IeeeCC754 -c -s Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32s

  ./IeeeCC754 -c -d Conversion/testsets/rint32
  lineReportSummary  ${LOGDIR}"/"rint32d

  ./IeeeCC754 -c -q Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32q

  ./IeeeCC754 -c -s Conversion/testsets/rint64
  reportSummary  ${LOGDIR}"/"rint64s

  ./IeeeCC754 -c -d Conversion/testsets/rint64
  reportSummary  ${LOGDIR}"/"rint64d

  ./IeeeCC754 -c -q Conversion/testsets/rint64
  reportSummary  ${LOGDIR}"/"rint64q

  ./IeeeCC754 -c -s Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32s

  ./IeeeCC754 -c -d Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32d

  ./IeeeCC754 -c -q Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32q

  ./IeeeCC754 -c -s Conversion/testsets/cint64
  reportSummary  ${LOGDIR}"/"cint64s

  ./IeeeCC754 -c -d Conversion/testsets/cint64
  reportSummary  ${LOGDIR}"/"cint64d

  ./IeeeCC754 -c -q Conversion/testsets/cint64
  reportSummary  ${LOGDIR}"/"cint64q

  less ${reportsummary}  
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}

fi  

if [ ${PLATFORM} = "SunSparc" ] && [ ${TARGET} = "Conversion" ] && ([ ${SOFTWARE} = "gcc_v${gccversion}" ] || [ ${SOFTWARE} = "gcc_v${gcc2version}" ] || [ ${SOFTWARE} = "CC_v${CCversion}" ] )
then
  makeLogDirs

  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"
  echo " "

  ${configure} -platform ${PLATFORM}${conversioncppsuffix} -target Conversions -cxx ${CXX}
  make clean
  make
  
  detectieeecc754
  clear
  echo "****************************************************"
  echo "Testing " ${TARGET} "on" ${PLATFORM} "with" ${SOFTWARE} 
  echo "****************************************************"
  echo " "

  # #########
  # The tests
  # ######### 

  ./IeeeCC754 -c -d -ds Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rd2s

  ./IeeeCC754 -c -q -ds Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rq2s

  ./IeeeCC754 -c -q -dd Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rq2d

  ./IeeeCC754 -c -s -dd Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cs2d

  ./IeeeCC754 -c -s -dq Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cs2q

  ./IeeeCC754 -c -d -dq Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cd2q

  ./IeeeCC754 -c -s Conversion/testsets/b2dconvs
  reportSummary  ${LOGDIR}"/"b2dconvs

  ./IeeeCC754 -c -d Conversion/testsets/b2dconvd
  reportSummary  ${LOGDIR}"/"b2dconvd

  ./IeeeCC754 -c -q Conversion/testsets/b2dconvq
  reportSummary  ${LOGDIR}"/"b2dconvq

  ./IeeeCC754 -c -s Conversion/testsets/d2bconvs
  reportSummary  ${LOGDIR}"/"d2bconvs

  ./IeeeCC754 -c -d Conversion/testsets/d2bconvd
  reportSummary  ${LOGDIR}"/"d2bconvd

  ./IeeeCC754 -c -q Conversion/testsets/d2bconvq
  reportSummary  ${LOGDIR}"/"d2bconvq

  ./IeeeCC754 -c -s Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegrals

  ./IeeeCC754 -c -d Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegrald

  ./IeeeCC754 -c -q Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegralq

  ./IeeeCC754 -c -s Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32s

  ./IeeeCC754 -c -d Conversion/testsets/rint32
  lineReportSummary  ${LOGDIR}"/"rint32d

  ./IeeeCC754 -c -q Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32q

  ./IeeeCC754 -c -s -r z Conversion/testsets/rint64
  reportSummary  ${LOGDIR}"/"rint64s

  ./IeeeCC754 -c -d -r z Conversion/testsets/rint64
  reportSummary  ${LOGDIR}"/"rint64d

  ./IeeeCC754 -c -q -r z Conversion/testsets/rint64
  reportSummary  ${LOGDIR}"/"rint64q

  ./IeeeCC754 -c -s -r z Conversion/testsets/ruint32
  reportSummary  ${LOGDIR}"/"ruint32s

  ./IeeeCC754 -c -d -r z Conversion/testsets/ruint32
  lineReportSummary  ${LOGDIR}"/"ruint32d

  ./IeeeCC754 -c -q -r z Conversion/testsets/ruint32
  reportSummary  ${LOGDIR}"/"ruint32q

  ./IeeeCC754 -c -s -r z Conversion/testsets/ruint64
  reportSummary  ${LOGDIR}"/"ruint64s

  ./IeeeCC754 -c -d -r z Conversion/testsets/ruint64
  reportSummary  ${LOGDIR}"/"ruint64d

  ./IeeeCC754 -c -q -r z Conversion/testsets/ruint64
  reportSummary  ${LOGDIR}"/"ruint64q

  ./IeeeCC754 -c -s Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32s

  ./IeeeCC754 -c -d Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32d

  ./IeeeCC754 -c -q Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32q

  ./IeeeCC754 -c -s Conversion/testsets/cint64
  reportSummary  ${LOGDIR}"/"cint64s

  ./IeeeCC754 -c -d Conversion/testsets/cint64
  reportSummary  ${LOGDIR}"/"cint64d

  ./IeeeCC754 -c -q Conversion/testsets/cint64
  reportSummary  ${LOGDIR}"/"cint64q

  ./IeeeCC754 -c -s Conversion/testsets/cuint32
  reportSummary  ${LOGDIR}"/"cuint32s

  ./IeeeCC754 -c -d Conversion/testsets/cuint32
  reportSummary  ${LOGDIR}"/"cuint32d

  ./IeeeCC754 -c -q Conversion/testsets/cuint32
  reportSummary  ${LOGDIR}"/"cuint32q

  ./IeeeCC754 -c -s Conversion/testsets/cuint64
  reportSummary  ${LOGDIR}"/"cuint64s

  ./IeeeCC754 -c -d Conversion/testsets/cuint64
  reportSummary  ${LOGDIR}"/"cuint64d

  ./IeeeCC754 -c -q Conversion/testsets/cuint64
  reportSummary  ${LOGDIR}"/"cuint64q

  less ${reportsummary}
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}

fi  


if [ ${PLATFORM} = "SunSparc" ] && [ ${TARGET} = "BasicOp" ] && ( [ ${SOFTWARE} = "CC_v${CCversion}" ] || [ ${SOFTWARE} = "gcc_v${gccversion}" ]  || [ ${SOFTWARE} = "gcc_v${gcc2version}" ] )
then
  makeLogDirs

  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"
  echo " "

  ${configure} -platform ${PLATFORM}${basicopcppsuffix} -target BasicOperations -cxx ${CXX}
  make clean
  make

  echo "****************************************************"
  echo "Testing " ${TARGET} "on" ${PLATFORM} "with" ${SOFTWARE} 
  echo "****************************************************"
  echo " "

  # #########
  # The tests
  # ######### 

  ./IeeeCC754 -c -s BasicOp/testsets/add
  reportSummary    ${LOGDIR}"/"adds

  ./IeeeCC754 -c -d BasicOp/testsets/add
  reportSummary    ${LOGDIR}"/"addd

  ./IeeeCC754 -c -q BasicOp/testsets/add
  reportSummary    ${LOGDIR}"/"addq

  ./IeeeCC754 -c -s BasicOp/testsets/multiply
  reportSummary    ${LOGDIR}"/"mults

  ./IeeeCC754 -c -d BasicOp/testsets/multiply
  reportSummary    ${LOGDIR}"/"multd

  ./IeeeCC754 -c -q BasicOp/testsets/multiply
  reportSummary    ${LOGDIR}"/"multq

  ./IeeeCC754 -c -s BasicOp/testsets/divide
  reportSummary    ${LOGDIR}"/"divs

  ./IeeeCC754 -c -d BasicOp/testsets/divide
  reportSummary    ${LOGDIR}"/"divd

  ./IeeeCC754 -c -q BasicOp/testsets/divide
  reportSummary    ${LOGDIR}"/"divq

  ./IeeeCC754 -c -s BasicOp/testsets/remainder
  reportSummary    ${LOGDIR}"/"rems

  ./IeeeCC754 -c -d BasicOp/testsets/remainder
  reportSummary    ${LOGDIR}"/"remd

  ./IeeeCC754 -c -q BasicOp/testsets/remainder
  reportSummary    ${LOGDIR}"/"remq

  ./IeeeCC754 -c -s BasicOp/testsets/sqrt
  reportSummary    ${LOGDIR}"/"sqrts

  ./IeeeCC754 -c -d BasicOp/testsets/sqrt
  reportSummary    ${LOGDIR}"/"sqrtd

  ./IeeeCC754 -c -q BasicOp/testsets/sqrt
  reportSummary    ${LOGDIR}"/"sqrtq

  less ${reportsummary}
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}
fi


if ([ ${PLATFORM} = "IntelPentium" ] || [ ${PLATFORM} = "AMD" ]) && [ ${TARGET} = "Conversion" ] && ([ ${SOFTWARE} = "gcc_v${gccversion}" ] || [ ${SOFTWARE} = "gcc_v${gcc2version}" ] || [ ${SOFTWARE} = "icc_v${iccversion}" ])
then
  makeLogDirs

  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"
  echo " "

  ${configure} -platform ${PLATFORM}${conversioncppsuffix} -target Conversions -cxx ${CXX}
  make clean
  make

  detectieeecc754

  clear
  echo "****************************************************"
  echo "Testing " ${TARGET} "on" ${PLATFORM} "with" ${SOFTWARE} 
  echo "****************************************************"
  echo " "

  # #########
  # The tests
  # ######### 

  ./IeeeCC754 -c -d -ds Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rd2s

  ./IeeeCC754 -c -l -ds Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rl2s

  ./IeeeCC754 -c -l -dd Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"rl2d

  ./IeeeCC754 -c -s -dd Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cs2d

  ./IeeeCC754 -c -s -dl Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cs2l

  ./IeeeCC754 -c -d -dl Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"cd2l

  ./IeeeCC754 -c -s -r n -n xiouz Conversion/testsets/b2dconvs
  reportSummary  ${LOGDIR}"/"b2dconvs.nearest

  ./IeeeCC754 -c -s -r z -n xiouz Conversion/testsets/b2dconvs
  reportSummary  ${LOGDIR}"/"b2dconvs.zero

  ./IeeeCC754 -c -s -r p -n xiouz Conversion/testsets/b2dconvs
  reportSummary  ${LOGDIR}"/"b2dconvs.up

  ./IeeeCC754 -c -s -r m -n xiouz Conversion/testsets/b2dconvs
  reportSummary  ${LOGDIR}"/"b2dconvs.down

  ./IeeeCC754 -c -d -r n -n xiouz Conversion/testsets/b2dconvd
  reportSummary  ${LOGDIR}"/"b2dconvd.nearest

  ./IeeeCC754 -c -d -r z -n xiouz Conversion/testsets/b2dconvd
  reportSummary  ${LOGDIR}"/"b2dconvd.zero

  ./IeeeCC754 -c -d -r p -n xiouz Conversion/testsets/b2dconvd
  reportSummary  ${LOGDIR}"/"b2dconvd.up

  ./IeeeCC754 -c -d -r m -n xiouz Conversion/testsets/b2dconvd
  reportSummary  ${LOGDIR}"/"b2dconvd.down

  ./IeeeCC754 -c -l -r n -n xiouz Conversion/testsets/b2dconvl
  reportSummary  ${LOGDIR}"/"b2dconvl.nearest

  ./IeeeCC754 -c -l -r z -n xiouz Conversion/testsets/b2dconvl
  reportSummary  ${LOGDIR}"/"b2dconvl.zero

  ./IeeeCC754 -c -l -r p -n xiouz Conversion/testsets/b2dconvl
  reportSummary  ${LOGDIR}"/"b2dconvl.up

  ./IeeeCC754 -c -l -r m -n xiouz Conversion/testsets/b2dconvl
  reportSummary  ${LOGDIR}"/"b2dconvl.down

  ./IeeeCC754 -c -s -r n -n xiouz Conversion/testsets/d2bconvs
  reportSummary  ${LOGDIR}"/"d2bconvs.nearest

  ./IeeeCC754 -c -s -r z -n xiouz Conversion/testsets/d2bconvs
  reportSummary  ${LOGDIR}"/"d2bconvs.zero

  ./IeeeCC754 -c -s -r p -n xiouz Conversion/testsets/d2bconvs
  reportSummary  ${LOGDIR}"/"d2bconvs.up

  ./IeeeCC754 -c -s -r m -n xiouz Conversion/testsets/d2bconvs
  reportSummary  ${LOGDIR}"/"d2bconvs.down


  ./IeeeCC754 -c -d -r n -n xiouz Conversion/testsets/d2bconvd
  reportSummary  ${LOGDIR}"/"d2bconvd.nearest

  ./IeeeCC754 -c -d -r z -n xiouz Conversion/testsets/d2bconvd
  reportSummary  ${LOGDIR}"/"d2bconvd.zero

  ./IeeeCC754 -c -d -r p -n xiouz Conversion/testsets/d2bconvd
  reportSummary  ${LOGDIR}"/"d2bconvd.up

  ./IeeeCC754 -c -d -r m -n xiouz Conversion/testsets/d2bconvd
  reportSummary  ${LOGDIR}"/"d2bconvd.down

  ./IeeeCC754 -c -l -r n -n xiouz Conversion/testsets/d2bconvl
  reportSummary  ${LOGDIR}"/"d2bconvl.nearest

  ./IeeeCC754 -c -l -r z -n xiouz Conversion/testsets/d2bconvl
  reportSummary  ${LOGDIR}"/"d2bconvl.zero

  ./IeeeCC754 -c -l -r p -n xiouz Conversion/testsets/d2bconvl
  reportSummary  ${LOGDIR}"/"d2bconvl.up

  ./IeeeCC754 -c -l -r m -n xiouz Conversion/testsets/d2bconvl
  reportSummary  ${LOGDIR}"/"d2bconvl.down

  ./IeeeCC754 -c -s Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegrals

  ./IeeeCC754 -c -d Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegrald

  ./IeeeCC754 -c -l Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegrall

  ./IeeeCC754 -c -s Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32s

  ./IeeeCC754 -c -d Conversion/testsets/rint32
  lineReportSummary  ${LOGDIR}"/"rint32d

  ./IeeeCC754 -c -l Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32l

  ./IeeeCC754 -c -s -r z Conversion/testsets/ruint32
  reportSummary  ${LOGDIR}"/"ruint32s

  ./IeeeCC754 -c -d -r z Conversion/testsets/ruint32
  lineReportSummary  ${LOGDIR}"/"ruint32d

  ./IeeeCC754 -c -l -r z Conversion/testsets/ruint32
  reportSummary  ${LOGDIR}"/"ruint32l


  ./IeeeCC754 -c -s Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32s

  ./IeeeCC754 -c -d Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32d

  ./IeeeCC754 -c -l Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32l

  ./IeeeCC754 -c -s Conversion/testsets/cuint32
  reportSummary  ${LOGDIR}"/"cuint32s

  ./IeeeCC754 -c -d Conversion/testsets/cuint32
  reportSummary  ${LOGDIR}"/"cuint32d

  ./IeeeCC754 -c -l Conversion/testsets/cuint32
  reportSummary  ${LOGDIR}"/"cuint32l  

  ./IeeeCC754 -c -s Conversion/testsets/remainder
  reportSummary  ${LOGDIR}"/"rems

  ./IeeeCC754 -c -d Conversion/testsets/remainder
  reportSummary  ${LOGDIR}"/"remd

  ./IeeeCC754 -c -l Conversion/testsets/remainder
  reportSummary  ${LOGDIR}"/"reml

  ./IeeeCC754 -c -s Conversion/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrts

  ./IeeeCC754 -c -d Conversion/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtd

  ./IeeeCC754 -c -l Conversion/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtl

  less ${reportsummary}
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}  
fi


if ([ ${PLATFORM} = "IntelPentium" ] || [ ${PLATFORM} = "AMD" ]) && [ ${TARGET} = "BasicOp" ] && ( [ ${SOFTWARE} = "gcc_v${gccversion}" ] || [ ${SOFTWARE} = "gcc_v${gcc2version}" ] || [ ${SOFTWARE} = "icc_v${iccversion}" ])
then
  makeLogDirs

  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"
  echo " "

  ${configure} -platform ${PLATFORM}${basicopcppsuffix} -target BasicOperations -cxx ${CXX}  
  make clean
  make
  
  detectieeecc754
  echo " "

  clear
  echo "****************************************************"
  echo "Testing " ${TARGET} "on" ${PLATFORM} "with" ${SOFTWARE} 
  echo "****************************************************"
  echo " "

  # #########
  # The tests
  # ######### 

  ./IeeeCC754 -c -s BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"adds

  ./IeeeCC754 -c -d BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"addd

  ./IeeeCC754 -c -l BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"addl

  ./IeeeCC754 -c -s BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"mults

  ./IeeeCC754 -c -d BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"multd

  ./IeeeCC754 -c -l BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"multl

  ./IeeeCC754 -c -s BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divs

  ./IeeeCC754 -c -d BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divd

  ./IeeeCC754 -c -l BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divl

  ./IeeeCC754 -c -s BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"rems

  ./IeeeCC754 -c -d BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"remd

  ./IeeeCC754 -c -l BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"reml

  ./IeeeCC754 -c -s BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrts

  ./IeeeCC754 -c -l BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtd

  ./IeeeCC754 -c -l BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtl

  less ${reportsummary}
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}

fi

if [ ${TARGET} = "BasicOp" ] && [ ${SOFTWARE} = "FMLib" ]
then
  makeLogDirs

  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"
  echo " "

  ${configure} -platform FMLib -target BasicOperations -cxx ${CXX}  
  make clean
  make
  
  detectieeecc754
  echo " "

  clear
  echo "****************************************************"
  echo "Testing " ${TARGET} "on" ${PLATFORM} "with" ${SOFTWARE} 
  echo "****************************************************"
  echo " "

  # #########
  # The tests
  # ######### 

  echo "********************" >> ${reportsummary}
  echo "Results for t=24 e=8" >> ${reportsummary}
  echo "********************" >> ${reportsummary}
  echo " "

  echo "Tests for round to zero and nearest"
  echo "-----------------------------------"
  echo " "

  echo "Tests for round to zero and nearest" >> ${reportsummary}
  echo "-----------------------------------" >> ${reportsummary}
  echo " " >> ${reportsummary}

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"addt24e8

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"multiplyt24e8


  ./IeeeCC754 -c -j ou -t 24 -e 8 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divt24e8

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"remt24e8

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r nz -n xiouz -n nan -n inf -n tiny -n snz BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtt24e8

  echo "*********************" >> ${reportsummary}
  echo "Results for t=53 e=11" >> ${reportsummary}
  echo "*********************" >> ${reportsummary}
  echo " "

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"addt53e11

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"multiplyt53e11


  ./IeeeCC754 -c -j ou -t 53 -e 11 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divt53e11

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"remt53e11

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r nz -n xiouz -n nan -n inf -n tiny -n snz BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtt53e11

  echo "********************" >> ${reportsummary}
  echo "Results for t=217 e=15" >> ${reportsummary}
  echo "********************" >> ${reportsummary}
  echo " "

  ./IeeeCC754 -c -j ou -t 217 -e 15 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"addt217e15

  ./IeeeCC754 -c -j ou -t 217 -e 15 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"multiplyt217e15


  ./IeeeCC754 -c -j ou -t 217 -e 15 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divt217e15

  ./IeeeCC754 -c -j ou -t 217 -e 15 -r nz -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"remt217e15

  ./IeeeCC754 -c -j ou -t 217 -e 15 -r nz -n xiouz -n nan -n inf -n tiny -n snz BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtt217e15

  echo "Tests for round up and down"
  echo "-----------------------------------"
  echo " "

  echo "Tests for round up and down" >> ${reportsummary}
  echo "---------------------------" >> ${reportsummary}
  echo " " >> ${reportsummary}

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"addt24e8_rpm

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"multiplyt24e8_rpm


  ./IeeeCC754 -c -j ou -t 24 -e 8 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divt24e8_rpm

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"remt24e8_rpm

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r pm -n xiouz -n nan -n inf -n tiny -n snz BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtt24e8_rpm

  echo "*********************" >> ${reportsummary}
  echo "Results for t=53 e=11" >> ${reportsummary}
  echo "*********************" >> ${reportsummary}
  echo " "

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"addt53e11_rpm

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"multiplyt53e11_rpm


  ./IeeeCC754 -c -j ou -t 53 -e 11 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divt53e11_rpm

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"remt53e11_rpm

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r pm -n xiouz -n nan -n inf -n tiny -n snz BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtt53e11_rpm

  echo "********************" >> ${reportsummary}
  echo "Results for t=217 e=15" >> ${reportsummary}
  echo "********************" >> ${reportsummary}
  echo " "

  ./IeeeCC754 -c -j ou -t 217 -e 15 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/add
  reportSummary  ${LOGDIR}"/"addt217e15_rpm

  ./IeeeCC754 -c -j ou -t 217 -e 15 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/multiply
  reportSummary  ${LOGDIR}"/"multiplyt217e15_rpm


  ./IeeeCC754 -c -j ou -t 217 -e 15 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/divide
  reportSummary  ${LOGDIR}"/"divt217e15_rpm

  ./IeeeCC754 -c -j ou -t 217 -e 15 -r pm -n xiuoz -n nan -n inf -n tiny -n snz BasicOp/testsets/remainder
  reportSummary  ${LOGDIR}"/"remt217e15_rpm

  ./IeeeCC754 -c -j ou -t 217 -e 15 -r pm -n xiouz -n nan -n inf -n tiny -n snz BasicOp/testsets/sqrt
  reportSummary  ${LOGDIR}"/"sqrtt217e15_rpm

  less ${reportsummary}
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}

fi

if [ ${TARGET} = "Conversion" ] && [ ${SOFTWARE} = "FMLib" ]
then
  makeLogDirs

  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"
  echo " "

  ${configure} -platform FMLib -target Conversions -cxx ${CXX}  
  make clean
  make
  
  detectieeecc754
  echo " "

  clear
  echo "****************************************************"
  echo "Testing " ${TARGET} "on" ${PLATFORM} "with" ${SOFTWARE} 
  echo "****************************************************"
  echo " "

  # #########
  # The tests
  # ######### 

  echo "Test for round to nearest and zero"
  echo "----------------------------------"
  echo " "

  echo "Test for round to nearest and zero" >> ${reportsummary}
  echo "----------------------------------" >> ${reportsummary}
  echo " " >> ${reportsummary}

  ./IeeeCC754 -c -j ou -t 53 -e 11 -dt 24 -de 8 -r nz -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"t53e11_roundto_t24e8

  ./IeeeCC754 -c -j ou -t 24 -e 8 -dt 53 -de 11 -r nz -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"t24e8_copyto_t53e11

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r nz -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32_t24e8

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r nz -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32_t53e11

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r nz -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32_t24e8

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r nz -n xiouz -n nan -n inf -n tiny -n snz Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32_t53e11

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r nz -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegral_t24e8

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r nz -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegral_t53e11

  echo "Test for round up and down"
  echo "----------------------------------"
  echo " "

  echo "Test for round up and down" >> ${reportsummary}
  echo "----------------------------------" >> ${reportsummary}
  echo " " >> ${reportsummary}

  ./IeeeCC754 -c -j ou -t 53 -e 11 -dt 24 -de 8 -r pm -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/roundto
  reportSummary  ${LOGDIR}"/"t53e11_roundto_t24e8_rpm

  ./IeeeCC754 -c -j ou -t 24 -e 8 -dt 53 -de 11 -r pm -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/copyto
  reportSummary  ${LOGDIR}"/"t24e8_copyto_t53e11_rpm

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r pm -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32_t24e8_rpm

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r pm -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/rint32
  reportSummary  ${LOGDIR}"/"rint32_t53e11_rpm

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r pm -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32_t24e8_rpm

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r pm -n xiouz -n nan -n inf -n tiny -n snz Conversion/testsets/cint32
  reportSummary  ${LOGDIR}"/"cint32_t53e11_rpm

  ./IeeeCC754 -c -j ou -t 24 -e 8 -r pm -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegral_t24e8_rpm

  ./IeeeCC754 -c -j ou -t 53 -e 11 -r pm -n xiuoz -n nan -n inf -n tiny -n snz Conversion/testsets/rintegral
  reportSummary  ${LOGDIR}"/"rintegral_t53e11_rpm

  less ${reportsummary}
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}

fi

if [ ${SOFTWARE} = "MpIeee" ] && [ ${TARGET} = "BasicOp" ] 
then 
  makeLogDirs
  
  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"
  echo " "

  ${configure} -platform MpIeee -target BasicOperations -cxx ${CXX} -libdir ${libdirMpIeee} -incdir ${incdirMpIeee}
  make clean
  make
  
  detectieeecc754
  clear
  echo "****************************************************"
  echo "Testing " ${TARGET} "on" ${PLATFORM} "with" ${SOFTWARE} 
  echo "****************************************************"
  echo " "
  

  # #########
  # The tests
  # ######### 
  
  ./IeeeCC754 -c -t 24 -e 8 BasicOp/testsets/add
  reportSummary    ${LOGDIR}"/"adds
  
  ./IeeeCC754 -c -t 53 -e 11 BasicOp/testsets/add
  reportSummary    ${LOGDIR}"/"addd
  
  ./IeeeCC754 -c -t 117 -e 10 BasicOp/testsets/add
  reportSummary    ${LOGDIR}"/"add_t117e10

  ./IeeeCC754 -c -t 496 -e 15 BasicOp/testsets/add
  reportSummary    ${LOGDIR}"/"add_t496e15
  
  ./IeeeCC754 -c -t 24 -e 8 BasicOp/testsets/multiply
  reportSummary    ${LOGDIR}"/"mults
  
  ./IeeeCC754 -c -t 53 -e 11 BasicOp/testsets/multiply
  reportSummary    ${LOGDIR}"/"multd
  
  ./IeeeCC754 -c -t 117 -e 10 BasicOp/testsets/multiply
  reportSummary    ${LOGDIR}"/"mult_t117e10
 
  ./IeeeCC754 -c -t 496 -e 15 BasicOp/testsets/multiply
  reportSummary    ${LOGDIR}"/"mult_t496e15
 
  ./IeeeCC754 -c -t 24 -e 8 BasicOp/testsets/divide
  reportSummary    ${LOGDIR}"/"divs
  
  ./IeeeCC754 -c -t 53 -e 11 BasicOp/testsets/divide
  reportSummary    ${LOGDIR}"/"divd
  
  ./IeeeCC754 -c -t 117 -e 10 BasicOp/testsets/divide
  reportSummary    ${LOGDIR}"/"div_t117e10

  ./IeeeCC754 -c -t 496 -e 15 BasicOp/testsets/divide
  reportSummary    ${LOGDIR}"/"div_t496e15
  
  ./IeeeCC754 -c -t 24 -e 8 BasicOp/testsets/remainder
  reportSummary    ${LOGDIR}"/"rems
  
  ./IeeeCC754 -c -t 53 -e 11 BasicOp/testsets/remainder
  reportSummary    ${LOGDIR}"/"remd
  
  ./IeeeCC754 -c -t 117 -e 10 BasicOp/testsets/remainder
  reportSummary    ${LOGDIR}"/"rem_t117e10

  ./IeeeCC754 -c -t 496 -e 15 BasicOp/testsets/remainder
  reportSummary    ${LOGDIR}"/"rem_t496e15
  
  ./IeeeCC754 -c -t 24 -e 8 BasicOp/testsets/sqrt
  reportSummary    ${LOGDIR}"/"sqrts
  
  ./IeeeCC754 -c -t 53 -e 11 BasicOp/testsets/sqrt
  reportSummary    ${LOGDIR}"/"sqrtd
  
  ./IeeeCC754 -c -t 117 -e 10 BasicOp/testsets/sqrt
  reportSummary    ${LOGDIR}"/"sqrt_t117e10
      
  less ${reportsummary}
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}
fi

if  [ ${SOFTWARE} = "MpIeee" ] && [ ${TARGET} = "Conversion" ] 
then
  makeLogDirs

  # MAKE TESTTOOL
  echo "***************"
  echo "MAKING TESTTOOL"
  echo "***************"
  echo " "

  ${configure} -platform MpIeee -target Conversions -cxx ${CXX} -libdir ${libdirMpIeee} -incdir ${incdirMpIeee}
  make clean
  make

  detectieeecc754  
  clear
  echo "****************************************************"
  echo "Testing " ${TARGET} "on" ${PLATFORM} "with" ${SOFTWARE} 
  echo "****************************************************"
  echo " "
  
  # #########
  # The tests
  # ######### 
    

  ./IeeeCC754 -c -t 53 -e 11 -dt 24 -de 8 Conversion/testsets/roundto
  reportSummary    ${LOGDIR}"/"t53e11_roundto_t24e8
  
   ./IeeeCC754 -c -t 240 -e 15 -dt 53 -de 11 Conversion/testsets/roundto
  reportSummary    ${LOGDIR}"/"t240e15_roundto_t53e11

  ./IeeeCC754 -c -t 24 -e 8 -dt 53 -de 11 Conversion/testsets/copyto
  reportSummary    ${LOGDIR}"/"t24e8_copyto_t53e11
  
  ./IeeeCC754 -c -t 24 -e 8 -dt 240 -de 15 Conversion/testsets/copyto
  reportSummary    ${LOGDIR}"/"t24e8_copyto_t240e15

  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/rint32
  reportSummary    ${LOGDIR}"/"rint32_t24e8
  
  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/rint32
  reportSummary    ${LOGDIR}"/"rint32_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/rint32
  reportSummary    ${LOGDIR}"/"rint32_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/rint32
  reportSummary    ${LOGDIR}"/"rint32_t240e15
  
  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/ruint32
  reportSummary    ${LOGDIR}"/"ruint32_t24e8
  
  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/ruint32
  reportSummary    ${LOGDIR}"/"ruint32_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/ruint32
  reportSummary    ${LOGDIR}"/"ruint32_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/ruint32
  reportSummary    ${LOGDIR}"/"ruint32_t240e15

  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/rint64
  reportSummary    ${LOGDIR}"/"rint64_t24e8
  
  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/rint64
  reportSummary    ${LOGDIR}"/"rint64_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/rint64
  reportSummary    ${LOGDIR}"/"rint64_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/rint64
  reportSummary    ${LOGDIR}"/"rint64_t240e15

  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/ruint64
  reportSummary    ${LOGDIR}"/"ruint64_t24e8
  
  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/ruint64
  reportSummary    ${LOGDIR}"/"ruint64_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/ruint64
  reportSummary    ${LOGDIR}"/"ruint64_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/ruint64
  reportSummary    ${LOGDIR}"/"ruint64_t240e15

  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/cint32
  reportSummary    ${LOGDIR}"/"cint32_t24e8
  
  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/cint32
  reportSummary    ${LOGDIR}"/"cint32_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/cint32
  reportSummary    ${LOGDIR}"/"cint32_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/cint32
  reportSummary    ${LOGDIR}"/"cint32_t240e15

  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/cuint32
  reportSummary    ${LOGDIR}"/"cuint32_t24e8

  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/cuint32
  reportSummary    ${LOGDIR}"/"cuint32_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/cuint32
  reportSummary    ${LOGDIR}"/"cuint32_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/cuint32
  reportSummary    ${LOGDIR}"/"cuint32_t240e15

  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/cint64
  reportSummary    ${LOGDIR}"/"cint64_t24e8
  
  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/cint64
  reportSummary    ${LOGDIR}"/"cint64_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/cint64
  reportSummary    ${LOGDIR}"/"cint64_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/cint64
  reportSummary    ${LOGDIR}"/"cint64_t240e15
  
  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/cuint64
  reportSummary    ${LOGDIR}"/"cuint64_t24e8
  
  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/cuint64
  reportSummary    ${LOGDIR}"/"cuint64_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/cuint64
  reportSummary    ${LOGDIR}"/"cuint64_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/cuint64
  reportSummary    ${LOGDIR}"/"cuint64_t240e15

  ./IeeeCC754 -c -t 24 -e 8 Conversion/testsets/rintegral
  reportSummary    ${LOGDIR}"/"rintegral_t24e8
  
  ./IeeeCC754 -c -t 53 -e 11 Conversion/testsets/rintegral
  reportSummary    ${LOGDIR}"/"rintegral_t53e11

  ./IeeeCC754 -c -t 117 -e 10 Conversion/testsets/rintegral
  reportSummary    ${LOGDIR}"/"rintegral_t117e10

  ./IeeeCC754 -c -t 240 -e 15 Conversion/testsets/rintegral
  reportSummary    ${LOGDIR}"/"rintegral_t240e15

  ./IeeeCC754 -c -t 24 -e 8 -n xiouz Conversion/testsets/b2dconvs
  reportSummary    ${LOGDIR}"/"b2d_t24e8

  ./IeeeCC754 -c -t 53 -e 11 -n xiouz Conversion/testsets/b2dconvd
  reportSummary    ${LOGDIR}"/"b2d_t53e11

  ./IeeeCC754 -c -t 64 -e 15 -n xiouz Conversion/testsets/b2dconvl
  reportSummary    ${LOGDIR}"/"b2d_t64e15

  ./IeeeCC754 -c -t 113 -e 15 -n xiouz Conversion/testsets/b2dconvq
  reportSummary    ${LOGDIR}"/"b2d_t113e15

  ./IeeeCC754 -c -t 240 -e 15 -n xiouz Conversion/testsets/b2dconvm
  reportSummary    ${LOGDIR}"/"b2d_t240e15

  ./IeeeCC754 -c -t 24 -e 8 -n xiouz Conversion/testsets/d2bconvs
  reportSummary    ${LOGDIR}"/"d2b_t24e8

  ./IeeeCC754 -c -t 53 -e 11 -n xiouz Conversion/testsets/d2bconvd
  reportSummary    ${LOGDIR}"/"d2b_t53e11

  ./IeeeCC754 -c -t 64 -e 15 -n xiouz Conversion/testsets/d2bconvl
  reportSummary    ${LOGDIR}"/"d2b_t64e15

  ./IeeeCC754 -c -t 113 -e 15 -n xiouz Conversion/testsets/d2bconvq
  reportSummary    ${LOGDIR}"/"d2b_t113e15

#  ./IeeeCC754 -c -t 240 -e 15 -n xiouz Conversion/testsets/d2bconvm
#  reportSummary    ${LOGDIR}"/"d2b_t240e15

  less ${reportsummary}
  mv ${reportsummary} ${LOGDIR}"/"${reportsummary}

fi


