├── .github └── workflows │ └── github-actions-travis.yml ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── COPYING ├── Interlibmath ├── Makefile ├── README.md ├── interlibmath.cxx ├── runExemple.sh ├── stacktrace.cxx ├── testCos.cxx └── testCos.py ├── Makefile.am ├── README.md ├── bash_completion ├── Makefile ├── bash_completion_post_verrou_dd ├── bash_completion_valgrind ├── bash_completion_verrou_dd_clean ├── bash_completion_verrou_dd_line ├── bash_completion_verrou_dd_stdout ├── bash_completion_verrou_dd_sym ├── bash_completion_verrou_dd_task └── bash_completion_verrou_plot_stat ├── check_perf_tools ├── .gitignore ├── buildConfig.sh ├── buildTag.sh ├── exclude.all.ex ├── gen_build.py ├── gen_perf.py ├── gen_stat.py └── tabular.py ├── configure.ac ├── docker ├── Dockerfile └── check_build_loop.sh ├── docs ├── fix-encoding ├── update-docs ├── update-vr-clo ├── valgrind-manpage.xml ├── verrou_dd-manpage.xml ├── verrou_dd_clean-manpage.xml ├── verrou_plotstat-manpage.xml ├── verrou_postdd-manpage.xml ├── vr-localization.xml ├── vr-manual.xml ├── vr-overview.xml ├── vr-scope.xml └── vr-std.xml ├── env.sh.in ├── extendStdoutPrecision.cxx ├── generateBackendInterOperator.py ├── generateInstrumentOp_impl.py ├── interflop_backends ├── backend_check_float_max │ ├── COPYING │ ├── interflop_check_float_max.cxx │ ├── interflop_check_float_max.h │ └── test_main.cxx ├── backend_checkcancellation │ ├── .dirstamp │ ├── COPYING │ ├── interflop_checkcancellation.cxx │ ├── interflop_checkcancellation.h │ ├── test_main.cxx │ └── vr_fpRepr.hxx ├── backend_checkdenorm │ ├── COPYING │ ├── interflop_checkdenorm.cxx │ ├── interflop_checkdenorm.h │ └── test_main.cxx ├── backend_mcaquad │ ├── common │ │ ├── fmaqApprox.c │ │ ├── fmaqApprox.h │ │ ├── mca_const.h │ │ ├── quadmath-imp.h │ │ ├── tinymt64.c │ │ └── tinymt64.h │ ├── interflop_mcaquad.c │ ├── interflop_mcaquad.h │ ├── libmca-quad.h │ ├── mcalib.c │ └── test_main.cxx ├── interflop.h ├── interflop_verrou │ ├── COPYING │ ├── Makefile │ ├── dietzfelbingerHash.hxx │ ├── examples │ │ ├── stagnation │ │ │ ├── makefile │ │ │ ├── postTreatment.py │ │ │ ├── stagnation.cxx │ │ │ ├── stagnationErrorLog.gp │ │ │ ├── stagnationErrorLogSt.gp │ │ │ ├── stagnationLog.gp │ │ │ └── stagnationLogSt.gp │ │ ├── stencil │ │ │ ├── Makefile │ │ │ ├── stencil_interflop_verrou.cpp │ │ │ └── timing.h │ │ ├── testProdDenorm │ │ │ ├── makefile │ │ │ └── testProdDenorm.cxx │ │ ├── testSqrt │ │ │ ├── makefile │ │ │ └── testSqrt.cxx │ │ └── testadiva │ │ │ ├── makefile │ │ │ └── testadiva.cxx │ ├── gen_interflop_verrou_flop_impl.py │ ├── interflop_verrou.cxx │ ├── interflop_verrou.h │ ├── interflop_verrou_flop_impl.hxx │ ├── interflop_verrou_rounding.h │ ├── mersenneHash.hxx │ ├── multiplyShiftHash.hxx │ ├── prng │ │ ├── genXoshiro.py │ │ ├── org │ │ │ ├── splitmix64.c │ │ │ ├── xoroshiro128plus.c │ │ │ ├── xoroshiro128plusplus.c │ │ │ ├── xoroshiro128starstar.c │ │ │ ├── xoshiro128plus.c │ │ │ ├── xoshiro128plusplus.c │ │ │ ├── xoshiro128starstar.c │ │ │ ├── xoshiro256plus.c │ │ │ ├── xoshiro256plusplus.c │ │ │ └── xoshiro256starstar.c │ │ ├── test.cxx │ │ └── xoshiro.cxx │ ├── tableHash.hxx │ ├── test_main.cxx │ ├── vr_fma.hxx │ ├── vr_isNan.hxx │ ├── vr_nextUlp.hxx │ ├── vr_op.hxx │ ├── vr_rand.h │ ├── vr_rand_implem.h │ ├── vr_roundingOp.hxx │ ├── vr_sqrt.hxx │ ├── xxHash.hxx │ ├── xxHashOrg │ │ ├── LICENSE │ │ └── xxhash.h │ ├── xxh3.h │ └── xxhashct │ │ └── xxh64.hpp └── statically_integrated_backends.h ├── libVerrouTask ├── .dirstamp ├── libverrouTask.cxx ├── libverrouTask.h ├── trace.py.org └── trace_verrou_task.py ├── newbackend.md ├── pyTools ├── COPYING ├── DD.py ├── DD_exec_stat.py ├── DD_stoch.py ├── convNumLineTool.py ├── dd_config.py ├── genCovBB ├── gen_config.py ├── paraview_script.py ├── post_config.py ├── post_verrou_dd ├── rounding_tool.py ├── verrou_dd_clean ├── verrou_dd_line ├── verrou_dd_stdout ├── verrou_dd_sym ├── verrou_dd_task └── verrou_plot_stat ├── pyWrapper ├── verrouCBinding.c ├── verrouCBinding.h └── verrouPyBinding.py ├── release.md ├── tests ├── .gitignore ├── Iomatch.script ├── Makefile.am ├── accuClreq.c ├── accuClreq1.stderr.exp ├── accuClreq1.stdout.exp ├── accuClreq1.vgtest ├── accuClreq2.stderr.exp ├── accuClreq2.stdout.exp ├── accuClreq2.vgtest ├── accuClreq3.stderr.exp ├── accuClreq3.stdout.exp ├── accuClreq3.vgtest ├── accuClreq4.stderr.exp ├── accuClreq4.stdout.exp ├── accuClreq4.vgtest ├── accuClreq5.stderr.exp ├── accuClreq5.stdout.exp ├── accuClreq5.vgtest ├── clreq.c ├── clreq.stderr.exp ├── clreq.stdout.exp ├── clreq.vgtest ├── clreq_both.stderr.exp ├── clreq_both.stdout.exp ├── clreq_both.vgtest ├── clreq_soft.stderr.exp ├── clreq_soft.stdout.exp ├── clreq_soft.vgtest ├── denorm.cxx ├── denorm1.stderr.exp ├── denorm1.stderr.exp.aarch64 ├── denorm1.stdout.exp ├── denorm1.vgtest ├── denorm2.stderr.exp ├── denorm2.stdout.exp ├── denorm2.vgtest ├── denorm3.stderr.exp ├── denorm3.stdout.exp ├── denorm3.vgtest ├── denorm4.post.exp ├── denorm4.post.exp.arm64 ├── denorm4.stderr.exp ├── denorm4.stdout.exp ├── denorm4.vgtest ├── filter_stderr ├── filter_stdout ├── fma_common.hxx ├── hardSoftClreq.c ├── hardSoftClreq1.stderr.exp ├── hardSoftClreq1.stdout.exp ├── hardSoftClreq1.vgtest ├── hardSoftClreq2.stderr.exp ├── hardSoftClreq2.stdout.exp ├── hardSoftClreq2.vgtest ├── hardSoftClreq3.stderr.exp ├── hardSoftClreq3.stdout.exp ├── hardSoftClreq3.vgtest ├── hardSoftClreqDouble.c ├── hardSoftClreqDouble1.stderr.exp ├── hardSoftClreqDouble1.stdout.exp ├── hardSoftClreqDouble1.vgtest ├── hardSoftClreqDouble2.stderr.exp ├── hardSoftClreqDouble2.stdout.exp ├── hardSoftClreqDouble2.vgtest ├── hardSoftClreqDouble3.stderr.exp ├── hardSoftClreqDouble3.stdout.exp ├── hardSoftClreqDouble3.vgtest ├── iomatch.script ├── libmtest-withlibm.stderr.exp ├── libmtest-withlibm.stderr.exp.aarch64 ├── libmtest-withlibm.stdout.exp ├── libmtest-withlibm.vgtest ├── libmtest-withoutlibm.stderr.exp ├── libmtest-withoutlibm.stdout.exp ├── libmtest-withoutlibm.vgtest ├── libmtest.c ├── libmtest_float_conv.c ├── libmtest_float_conv1.stderr.exp ├── libmtest_float_conv1.stderr.exp.aarch64 ├── libmtest_float_conv1.stdout.exp ├── libmtest_float_conv1.vgtest ├── libmtest_float_conv2.stderr.exp ├── libmtest_float_conv2.stderr.exp.aarch64 ├── libmtest_float_conv2.stdout.exp ├── libmtest_float_conv2.vgtest ├── naninf-rnd.stderr.exp ├── naninf-rnd.stdout.exp ├── naninf-rnd.stdout.exp.aarch64 ├── naninf-rnd.vgtest ├── naninf.cxx ├── post_diff.sh ├── post_verrou_diff.sh ├── seed.stderr.exp ├── seed.stdout.exp ├── seed.vgtest ├── seed_random_det.aarch64.stderr.exp ├── seed_random_det.aarch64.stdout.exp ├── seed_random_det.aarch64.vgtest ├── seed_random_det.x86_64.stderr.exp ├── seed_random_det.x86_64.stdout.exp ├── seed_random_det.x86_64.vgtest ├── sum.c ├── sum1.stderr.exp ├── sum1.stdout.exp ├── sum1.vgtest ├── sum2.stderr.exp ├── sum2.stdout.exp ├── sum2.vgtest ├── sum3.stderr.exp ├── sum3.stdout.exp ├── sum3.vgtest ├── test_det.cxx ├── test_det_average_comdet.stderr.exp ├── test_det_average_comdet.stdout.exp ├── test_det_average_comdet.vgtest ├── test_det_average_det.stderr.exp ├── test_det_average_det.stdout.exp ├── test_det_average_det.vgtest ├── test_det_average_scomdet.stderr.exp ├── test_det_average_scomdet.stdout.exp ├── test_det_average_scomdet.vgtest ├── test_det_random_comdet.stderr.exp ├── test_det_random_comdet.stdout.exp ├── test_det_random_comdet.vgtest ├── test_det_random_det.stderr.exp ├── test_det_random_det.stdout.exp ├── test_det_random_det.vgtest ├── test_det_random_scomdet.stderr.exp ├── test_det_random_scomdet.stdout.exp ├── test_det_random_scomdet.vgtest ├── test_det_sr_monotonic.stderr.exp ├── test_det_sr_monotonic.stdout.exp ├── test_det_sr_monotonic.vgtest ├── test_det_sr_smonotonic.stderr.exp ├── test_det_sr_smonotonic.stdout.exp ├── test_det_sr_smonotonic.vgtest ├── test_libm.cxx ├── test_libm_random.stderr.exp ├── test_libm_random.stderr.exp.aarch64 ├── test_libm_random.stdout.exp ├── test_libm_random.vgtest ├── test_libm_random_det.stderr.exp ├── test_libm_random_det.stderr.exp.aarch64 ├── test_libm_random_det.stdout.exp ├── test_libm_random_det.stdout.exp.aarch64 ├── test_libm_random_det.vgtest ├── test_libm_random_scomdet.stderr.exp ├── test_libm_random_scomdet.stderr.exp.aarch64 ├── test_libm_random_scomdet.stdout.exp ├── test_libm_random_scomdet.vgtest ├── test_unfusedfma.cxx ├── test_unfusedfma1.stderr.exp ├── test_unfusedfma1.stdout.exp ├── test_unfusedfma1.vgtest ├── test_unfusedfma2.stderr.exp ├── test_unfusedfma2.stdout.exp ├── test_unfusedfma2.vgtest ├── test_unfusedfma3.stderr.exp ├── test_unfusedfma3.stdout.exp ├── test_unfusedfma3.vgtest ├── test_unfusedfma4.stderr.exp ├── test_unfusedfma4.stdout.exp └── test_unfusedfma4.vgtest ├── travis.mk ├── unbufferPrintf.c ├── unitTest ├── check-libM │ ├── .gitignore │ ├── Makefile │ ├── genTab.py │ ├── hist.sh │ ├── latex │ │ └── article.tex │ ├── testAster.cxx │ └── testRegRef ├── check-verrou-dd-task │ ├── .gitignore │ ├── Makefile │ ├── cmp.py │ ├── mainTime.cxx │ ├── refNonReg │ └── run.sh ├── checkRounding │ ├── .gitignore │ ├── checkRounding.cxx │ ├── extract.sh │ ├── makefile │ ├── run.sh │ └── runCheck.py ├── checkStatRounding │ ├── .gitignore │ ├── checkStatRounding.cxx │ ├── extract.py │ ├── makefile │ └── run.sh ├── checkUCB-vecto │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── inputData │ │ ├── addd.input │ │ ├── adds.input │ │ ├── divd.input │ │ ├── divs.input │ │ ├── muld.input │ │ ├── muls.input │ │ ├── sqrtd.input │ │ ├── sqrts.input │ │ ├── subd.input │ │ └── subs.input │ ├── sse2neon.h │ └── testFloat.cxx ├── ddCover │ ├── .gitignore │ ├── Makefile │ ├── assertCover.py │ ├── ddCmp.py │ ├── ddRun.sh │ ├── ddRunMatch.sh │ ├── integrate.hxx │ ├── matchLast.script │ └── unitTest.cxx ├── ddLibm │ ├── .gitignore │ ├── Makefile │ ├── assert.py │ ├── cmp.sh │ ├── ddRun.sh │ └── main_libm.cpp ├── ddStdOut │ ├── .gitignore │ ├── Makefile │ ├── assertDDFusion.py │ ├── assertDDMuller.py │ ├── assertSqrt.py │ ├── assertTask.py │ ├── ddRun.sh │ ├── ddRunBis.sh │ ├── ddRunSqrt.sh │ ├── extractOrCmp.py │ ├── extractOrCmpSqrt.py │ ├── extractTime.py │ ├── genExcludePython.sh │ ├── iomatch.custom │ ├── iomatch.custom.listing │ ├── iomatch.header │ ├── muller.cpp │ ├── muller.py │ ├── pythonFilter.py │ └── sqrt.cxx ├── ddTest │ ├── .gitignore │ ├── Makefile │ ├── ddCheck.py │ ├── ddCmp.py │ ├── ddCmpFalse.py │ ├── ddCmpTrue.py │ └── ddRun.py ├── exempleDet │ ├── dotConditionNumber.cxx │ ├── extract.sh │ ├── runPlotStat.sh │ ├── runUntilFailure.sh │ └── runVerrou.sh ├── flag.mk.in ├── installpath ├── makefile ├── nocheckExemples │ ├── addSqrtVecDoubleSSE.cxx │ ├── addVecDoubleAVX.cxx │ ├── addVecDoubleSSE.cxx │ ├── addVecFloatAVX.cxx │ ├── addVecFloatSSE.cxx │ ├── cast.cxx │ ├── checkCosSin.cxx │ ├── fma.cxx │ └── testQuadMath.cxx ├── testPerf │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── run.sh │ ├── stencil.cpp │ ├── study.sh │ └── timing.h ├── testPlotStat │ ├── dot.py │ ├── extract.py │ └── run.sh └── verrouDDPython │ ├── .gitignore │ ├── Makefile │ ├── Muller.py │ ├── ddRun.sh │ ├── extractOrCmp.py │ └── genExcludePython.sh ├── valgrind.diff ├── valgrind.fma_arm64.diff ├── valgrind.vgregtest.diff ├── verrou.bib ├── verrou.h ├── vr_IOMatch_clr.c ├── vr_IOMatch_clr.h ├── vr_clo.c ├── vr_clo.h ├── vr_clo.txt ├── vr_clreq.c ├── vr_clreq.h ├── vr_error.c ├── vr_error.h ├── vr_exclude.c ├── vr_exclude.h ├── vr_generated_from_templates.h ├── vr_include_trace.c ├── vr_include_trace.h ├── vr_instrumentOp_impl.h ├── vr_instrumentOp_impl_generated_all_backends.h ├── vr_instrumentOp_impl_generated_verrou_specific.h ├── vr_interp_operator_impl.h ├── vr_interp_operator_template_1args.h ├── vr_interp_operator_template_2args.h ├── vr_interp_operator_template_3args.h ├── vr_interp_operator_template_cast.h ├── vr_main.c ├── vr_main.h └── vr_traceBB_impl.h /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | *amd64-linux* 4 | *arm64-linux* 5 | *.o 6 | *.so 7 | *~ 8 | .deps 9 | .idea/ 10 | env.sh 11 | unitTest/flag.mk 12 | */.dirstamp 13 | */*/.dirstamp 14 | */*/*/.dirstamp -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | dist: xenial 3 | sudo: required 4 | env: 5 | - VALGRIND_VERSION=VALGRIND_3_25_0 6 | - VALGRIND_VERSION=master 7 | matrix: 8 | allow_failures: 9 | - env: VALGRIND_VERSION=master 10 | before_install: 11 | - sudo apt-get -qq update 12 | - sudo apt-get install -y libc-dbg 13 | install: 14 | - make -f travis.mk download-valgrind 15 | - make -f travis.mk patch-valgrind || make -f travis.mk patch-error 16 | - make -f travis.mk configure 17 | - make -f travis.mk build 18 | script: 19 | - make -f travis.mk check-install 20 | - make -f travis.mk check || make -f travis.mk check-error 21 | - make -f travis.mk unit-test 22 | -------------------------------------------------------------------------------- /Interlibmath/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | SRC=interlibmath.cxx ../interflop_backends/backend_mcaquad/common/tinymt64.c 4 | FLAGS= -std=c++11 -DLIBMATHINTERP -DINTERLIBM_STAND_ALONE -I../backend_verrou -Wall -O2 -DVERROU_NUM_AVG=1 -DVERROU_DET_HASH=vr_xxhash_hash -DUSE_VERROU_SQRT -DUSE_VERROU_FMA -fno-builtin -Wno-strict-aliasing 5 | 6 | CXX=g++ 7 | 8 | FLAGQUADMATH= 9 | LDFLAGQUADMATH= 10 | 11 | PLATFORM = $(shell uname -m) 12 | ifeq ($(PLATFORM),aarch64) 13 | FLAGQUADMATH= 14 | LDFLAGQUADMATH= 15 | endif 16 | ifeq ($(PLATFORM),x86_64) 17 | LDFLAGQUADMATH=-lquadmath 18 | FLAGQUADMATH=-DUSE_VERROU_QUADMATH 19 | endif 20 | 21 | 22 | interlibmath.so: $(SRC) stacktrace.cxx 23 | $(CXX) $(FLAGS) $(SRC) $(FLAGQUADMATH) -lm $(LDFLAGQUADMATH) -ldl -shared -fPIC -o interlibmath.so 24 | 25 | 26 | testCos: testCos.cxx 27 | $(CXX) -g -Wall -lm testCos.cxx -o testCos 28 | 29 | clean: 30 | rm -f testCos interlibmath.so 31 | -------------------------------------------------------------------------------- /Interlibmath/runExemple.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "random python " 3 | VERROU_LIBM_ROUNDING_MODE=random LD_PRELOAD="./interlibmath.so" ./testCos.py 1.1 4 | 5 | echo "average python" 6 | VERROU_ROUNDING_MODE=average LD_PRELOAD="./interlibmath.so" ./testCos.py 1.1 7 | 8 | echo "random testCos binary" 9 | 10 | VERROU_LIBM_ROUNDING_MODE=random LD_PRELOAD="./interlibmath.so" ./testCos 1.1 11 | 12 | echo "native testCos binary" 13 | VERROU_LIBM_ROUNDING_MODE=native LD_PRELOAD="./interlibmath.so" ./testCos 1.1 14 | -------------------------------------------------------------------------------- /Interlibmath/testCos.cxx: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int main(int argc, char** argv){ 6 | 7 | double a(0.1); 8 | float af(a); 9 | long double al= 1./10.; 10 | 11 | for(int i=0; i<4; i++){ 12 | std::cout << "diff cos: " << cos(a) -cos(a) << std::endl; 13 | std::cout << "diff cosf: " << cosf(af) -cosf(af) << std::endl; 14 | } 15 | 16 | for(int i=0; i<4; i++){ 17 | std::cout << "diff sin: " << sin(a) -sin(a) << std::endl; 18 | std::cout << "diff sinf: " << sinf(af) -sinf(af) << std::endl; 19 | } 20 | 21 | for(int i=0; i<4; i++){ 22 | std::cout << "diff erf: " << erf(a) -erf(a) << std::endl; 23 | std::cout << "diff erff: " << erff(af) -erff(af) << std::endl; 24 | } 25 | 26 | std::cout << "sqrt: "<1: 55 | lineTab+=["\multicolumn{%s}{c}{%s}"%(str(nb), value.replace("_","\_")) ] 56 | if nb==1: 57 | lineTab+=[value.replace("_","\_")] 58 | lineStr+= ("\t&\t".join(lineTab)) 59 | self.currentStr+=lineStr 60 | -------------------------------------------------------------------------------- /docker/check_build_loop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | LISTOFIMAGE_ORG="ubuntu:20.04 ubuntu:latest debian:buster debian:bullseye debian:testing" 4 | 5 | # fail : debian:stretch problem with matplotlib 6 | 7 | VERROU_BRANCH=master 8 | 9 | for IMAGE in $LISTOFIMAGE_ORG 10 | do 11 | echo "Test build image:" $IMAGE 12 | VERROU_IMAGE=$(echo $IMAGE |sed -s "s/:/-/")-verrou 13 | docker build . -t ${VERROU_IMAGE} --build-arg IMAGE_BASE=$IMAGE --build-arg VERROU_BRANCH=$VERROU_BRANCH || exit 42 14 | done 15 | -------------------------------------------------------------------------------- /docs/fix-encoding: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TMP=$(mktemp) 4 | trap "{ echo 'cleaning up'; rm -f ${TMP};}" EXIT 5 | 6 | while [ ! -z "$1" ]; do 7 | FILE="$1" 8 | echo "Fixing encoding of file ${FILE}" 9 | iconv -f iso-8859-1 -t utf-8 -o ${TMP} ${FILE} 10 | sed 's/iso-8859-1/utf-8/i' ${TMP} >${FILE} 11 | shift 12 | done 13 | -------------------------------------------------------------------------------- /docs/update-docs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | SRCDIR=$( 6 | cd "$(dirname "${BASH_SOURCE[0]}")"/../.. 7 | pwd) 8 | echo "SRCDIR=${SRCDIR}" 9 | 10 | BUILDDIR="${PWD}" 11 | echo "BUILDDIR=${BUILDDIR}" 12 | 13 | 14 | INSTALLDIR=$(./config.status --config | sed -r "s/.*'--prefix=(.*)'.*/\1/") 15 | echo "INSTALLDIR=${INSTALLDIR}" 16 | 17 | [ -r "${INSTALLDIR}/env.sh" ] || ( 18 | echo "Could not find ${INSTALLDIR}/env.sh" 19 | false 20 | ) 21 | 22 | ( 23 | cd ${SRCDIR}/verrou; 24 | git diff --no-ext-diff --ignore-submodules --quiet --exit-code 25 | ) || ( 26 | echo "Please commit your local changes" 27 | false 28 | ) 29 | 30 | HASH=$(cd ${SRCDIR}/verrou; 31 | git rev-parse --short=14 HEAD) 32 | echo "HASH=${HASH}" 33 | 34 | echo "Press a key to continue (Ctrl+C to abort)" 35 | read 36 | 37 | # Build and install documentation 38 | make -C docs html-docs man-pages 39 | make install 40 | #${SRCDIR}/verrou/docs/fix-encoding ${INSTALLDIR}/share/doc/valgrind/html/*.html 41 | 42 | 43 | # Update usage string in source files 44 | ${SRCDIR}/verrou/docs/update-vr-clo 45 | 46 | # Upload HTML documentation to github 47 | TMPDIR=$(mktemp -d) 48 | trap "echo -e '\n\nCleaning up...'; rm -rf ${TMPDIR}" EXIT 49 | ( 50 | cd ${TMPDIR} 51 | git clone --branch gh-pages --single-branch https://github.com/edf-hpc/verrou.git html 52 | cd html 53 | ) 54 | rsync -av --delete --exclude .git ${INSTALLDIR}/share/doc/valgrind/html/ ${TMPDIR}/html/ 55 | ( 56 | cd ${TMPDIR}/html 57 | git add . 58 | git status 59 | ( 60 | echo "Updated documentation to ${HASH}" 61 | echo "" 62 | echo "REMOVE THIS LINE TO COMMIT THESE CHANGES AND UPLOAD THEM" 63 | ) >../commit.msg 64 | ( 65 | echo "echo 'Staged changes'" 66 | echo "git status --porcelain | grep '^??'" 67 | echo "git diff --staged --stat" 68 | ) >../bashrc 69 | git config user.name "Bruno Lathuilière" 70 | git config user.email "bruno.lathuiliere@edf.fr" 71 | x-terminal-emulator -e "bash --init-file ../bashrc" & 72 | firefox --new-window "vr-manual.html" & 73 | git commit -t ../commit.msg 74 | git push origin gh-pages 75 | ) 76 | -------------------------------------------------------------------------------- /docs/update-vr-clo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import subprocess 5 | import re 6 | import os.path 7 | import sys 8 | 9 | env = os.environ 10 | env["COLUMNS"] = "81" 11 | 12 | installConfig= subprocess.Popen(["./config.status", "--config"], 13 | env = env, 14 | stdout = subprocess.PIPE) 15 | 16 | line = (installConfig.stdout.readline()).decode("utf8").replace("'","") 17 | spline=(line.strip()).split() 18 | pathInstall="./install" 19 | for conf in spline: 20 | if conf.startswith("--prefix"): 21 | pathInstall=(conf.partition('='))[2] 22 | 23 | manPath=os.path.join(pathInstall, "share/man/man1/valgrind.1") 24 | if not os.path.exists(manPath): 25 | print("unable to find valgrind man file : "+ manPath) 26 | sys.exit(42) 27 | 28 | man = subprocess.Popen(["man", manPath], 29 | env = env, 30 | stdout = subprocess.PIPE) 31 | 32 | 33 | verrouFound=False 34 | for line in man.stdout: 35 | line=line.decode("utf8") 36 | if line.startswith("VERROU"): 37 | verrouFound=True 38 | break 39 | 40 | if not verrouFound: 41 | print("valgrind man file does not contain VERROU options : "+ manPath) 42 | sys.exit(42) 43 | 44 | title = re.compile("^[A-Z]") 45 | subtitle = re.compile("^\s{3}[A-Z]") 46 | 47 | linesRes=[] 48 | for line in man.stdout: 49 | line=line.decode("utf8") 50 | if title.search(line): 51 | break 52 | if subtitle.search(line): 53 | line = " " + line 54 | else: 55 | line = line[1:] 56 | 57 | line=line.replace('","','\\",\\"') 58 | line=line.replace("","yes|no") 59 | linesRes+=[line.rstrip()] 60 | 61 | #with open("verrou/vr_clo_gen.c", "w") as f: 62 | # for line in linesRes: 63 | # f.write ('VG_(printf)( "'+line+'\\n"'+" );\n") 64 | 65 | with open("verrou/vr_clo.txt", "w") as f: 66 | f.write('"') 67 | for line in linesRes[0:-1]: 68 | f.write (line+'\\n\\'+"\n") 69 | f.write(linesRes[-1]+'"\n') 70 | 71 | 72 | -------------------------------------------------------------------------------- /docs/valgrind-manpage.xml: -------------------------------------------------------------------------------- 1 | 2 | Verrou Options 3 | 4 | 5 | General options 6 | 9 | 10 | 11 | 12 | Perturbation of floating-point operations 13 | 16 | 17 | 18 | 19 | Instrumentation scope 20 | 23 | 24 | 25 | 26 | Coverage generation 27 | 30 | 31 | 32 | 33 | Detection options 34 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/verrou_dd_clean-manpage.xml: -------------------------------------------------------------------------------- 1 | 2 | %vg-entities; ]> 5 | 6 | 7 | 8 | 9 | 10 | Verrou Delta-Debug Cleaning Tool 11 | 1 12 | Release &rel-version; 13 | 14 | 15 | 16 | verrou_dd_clean 17 | Clean the verrou_dd_* cache 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | Description 28 | 30 | 31 | 32 | 33 | Options 34 | 36 | 37 | 38 | 39 | See Also 40 | 41 | verrou_dd(1), 42 | &vg-docs-path;. 43 | 44 | 45 | 46 | 47 | Authors 48 | Bruno Lathuilière. 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/verrou_plotstat-manpage.xml: -------------------------------------------------------------------------------- 1 | 2 | %vg-entities; ]> 5 | 6 | 7 | 8 | 9 | 10 | Verrou Plot Stat 11 | 1 12 | Release &rel-version; 13 | 14 | 15 | 16 | verrou_plot_stat 17 | Run verrou computations, compute estimators, and plot histograms 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | Description 28 | 30 | 31 | 32 | 33 | Options and Environment Variables 34 | 36 | 37 | 38 | 39 | See Also 40 | 41 | valgrind(1), 42 | verrou_dd(1), 43 | post_verrou_dd(1), 44 | &vg-docs-path; or 45 | &vg-docs-url;. 46 | 47 | 48 | 49 | 50 | Authors 51 | Bruno Lathuilière. 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /docs/verrou_postdd-manpage.xml: -------------------------------------------------------------------------------- 1 | 2 | %vg-entities; ]> 5 | 6 | 7 | 8 | 9 | 10 | Verrou Delta-Debug Post-Treatment 11 | 1 12 | Release &rel-version; 13 | 14 | 15 | 16 | post_verrou_dd 17 | Post-treat the results of verrou_dd_line 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | Description 28 | 30 | 31 | 32 | 33 | Options and Environment Variables 34 | 36 | 37 | 38 | 39 | See Also 40 | 41 | valgrind(1), 42 | verrou_dd(1), 43 | verrou_plot_stat(1), 44 | &vg-docs-path;. 45 | 46 | 47 | 48 | 49 | Authors 50 | Bruno Lathuilière. 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /env.sh.in: -------------------------------------------------------------------------------- 1 | # @configure_input@ 2 | 3 | export PATH=@prefix@/bin:${PATH} 4 | export PYTHONPATH=$(prefix=@prefix@; PYTHON_PREFIX=@prefix@; echo @pythondir@):$(prefix=@prefix@; PYTHON_PREFIX=@prefix@; echo @pythondir@)/valgrind:${PYTHONPATH} 5 | export MANPATH=@prefix@/share/man:${MANPATH} 6 | export CPATH=@prefix@/include:${CPATH} 7 | export LD_LIBRARY_PATH=@prefix@/lib/valgrind:${LD_LIBRARY_PATH} 8 | export LIBRARY_PATH=@prefix@/lib/valgrind:${LIBRARY_PATH} 9 | 10 | export VERROU_COMPILED_WITH_FMA=@vg_cv_verrou_fma@ 11 | export VERROU_COMPILED_WITH_QUADMATH=@vg_cv_verrou_quadmath@ 12 | 13 | 14 | if [ "x${BASH_VERSION-}" != x ]; then 15 | for bash_completion_file in @prefix@/usr/share/completions/bash_completion* ; do 16 | [ -f "${bash_completion_file}" ] && . ${bash_completion_file} 17 | done 18 | fi 19 | -------------------------------------------------------------------------------- /extendStdoutPrecision.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | extern "C" { 9 | int __libc_start_main( 10 | int (*main)(int, char **, char **), 11 | int argc, char **argv, 12 | int (*init)(int, char **, char **), 13 | void (*fini)(void), 14 | void (*rtld_fini)(void), 15 | void (*stack_end)){ 16 | std::cout << std::setprecision(17); 17 | typeof(&__libc_start_main) startMainPtr = (typeof(&__libc_start_main))dlsym(RTLD_NEXT, "__libc_start_main"); 18 | return startMainPtr(main, argc, argv, init, fini, rtld_fini, stack_end); 19 | } 20 | } 21 | 22 | /* 23 | extern "C" { 24 | typedef void(*VoidFuncPtr)(); 25 | void _ZNSt8ios_base4InitC1Ev(void){ 26 | VoidFuncPtr startIOBasePtr = (VoidFuncPtr)dlsym(RTLD_NEXT, "_ZNSt8ios_base4InitC1Ev"); 27 | if(startIOBasePtr!=NULL){ 28 | startIOBasePtr(); 29 | std::cout << std::setprecision(17); 30 | } 31 | } 32 | }*/ 33 | -------------------------------------------------------------------------------- /interflop_backends/backend_check_float_max/test_main.cxx: -------------------------------------------------------------------------------- 1 | #include "interflop_check_float_max.h" 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | 9 | void printFltMax(){ 10 | std::cout << "FLT_MAX detected " << std::endl; 11 | } 12 | 13 | 14 | int main(int argc, char** argv){ 15 | #ifndef NATIF 16 | void* context; 17 | struct interflop_backend_interface_t ifcheck_float_max=interflop_check_float_max_init(&context); 18 | ifmax_set_max_handler(&printFltMax); 19 | #endif 20 | 21 | double a=DBL_MAX; 22 | double b=1; 23 | double c; 24 | 25 | float af=FLT_MAX; 26 | float bf=0.10; 27 | float cf=af-bf; 28 | 29 | std::cout << "check max"<< std::endl; 30 | #ifdef NATIF 31 | std::cout << "double" << std::endl; 32 | c=a-b; 33 | std::cout << "float" << std::endl; 34 | cf=af-bf; 35 | #else 36 | std::cout << "double" << std::endl; 37 | interflop_check_float_max_sub_double(a,b,&c,context); 38 | std::cout << "float" << std::endl; 39 | interflop_check_float_max_sub_float(af,bf,&cf,context); 40 | #endif 41 | 42 | std::cout << "check without max"<< std::endl; 43 | 44 | 45 | #ifdef NATIF 46 | std::cout << "double" << std::endl; 47 | c=b-b; 48 | std::cout << "float" << std::endl; 49 | cf=bf-bf; 50 | #else 51 | std::cout << "double" << std::endl; 52 | interflop_check_float_max_sub_double(b,b,&c,context); 53 | std::cout << "float" << std::endl; 54 | interflop_check_float_max_sub_float(bf,bf,&cf,context); 55 | #endif 56 | 57 | // std::cout << std::setprecision(16); 58 | // std::cout << "c: "< 3 | #include 4 | #include 5 | 6 | 7 | 8 | void printCancellation(int range){ 9 | std::cout << "Cancellation deteted : "< 3 | #include 4 | #include 5 | 6 | #include "interflop_checkdenorm.h" 7 | 8 | void printDenormOutput(){ 9 | std::cout << "Denorm output detected " << std::endl; 10 | } 11 | void printDenormInput(int nb){ 12 | std::cout << "Denorm input detected :" << nb<. * 21 | * * 22 | ********************************************************************************/ 23 | 24 | struct mca_interface_t; 25 | extern struct mca_interface_t quad_mca_interface; 26 | -------------------------------------------------------------------------------- /interflop_backends/backend_mcaquad/test_main.cxx: -------------------------------------------------------------------------------- 1 | 2 | #define DEBUG_PRINT_OP 3 | 4 | #include "interflop_mcaquad.h" 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | void print_debug(int nbArg, const char * op,const double* a, const double* res){ 13 | 14 | if(nbArg==1){ 15 | std::cout << op << " : "<< a[0] << "->"<<&res << std::endl; 16 | } 17 | 18 | if(nbArg==2){ 19 | std::cout << op << " : "<< a[0] << "," << a[1]<< "->"<<&res << std::endl; 20 | } 21 | 22 | if(nbArg==3){ 23 | std::cout << op << " : "<< a[0] << "," << a[1]<< "," << a[2]<< "->"<<&res << std::endl; 24 | } 25 | 26 | } ; 27 | 28 | 29 | int main(int argc, char** argv){ 30 | 31 | void* context; 32 | 33 | struct interflop_backend_interface_t ifmcaquad=interflop_mcaquad_init(&context); 34 | 35 | // interflop_verrou_configure(VR_NEAREST, context); 36 | mcaquad_conf_t conf; 37 | conf.precision_float=32; 38 | conf.precision_double=53; 39 | conf.precision_double=20; 40 | conf.mode=MCAMODE_MCA; 41 | //MCAMODE_PB; 42 | //MCAMODE_RR; 43 | interflop_mcaquad_configure(conf, context); 44 | 45 | struct timeval now; 46 | gettimeofday(&now, NULL); 47 | unsigned int pid = getpid(); 48 | unsigned int firstSeed = now.tv_usec + pid; 49 | 50 | firstSeed=3; 51 | mcaquad_set_seed(firstSeed); 52 | 53 | //verrou_set_debug_print_op(&print_debug); 54 | 55 | 56 | double a=0.1; 57 | double b=0.1; 58 | double c1; 59 | double c2; 60 | 61 | interflop_mcaquad_add_double(a,b,&c1,context); 62 | ifmcaquad.interflop_add_double(a,b,&c2,context); 63 | 64 | std::cout << std::setprecision(16); 65 | std::cout << "c1: "<. */ 8 | 9 | #include 10 | 11 | /* This is a fixed-increment version of Java 8's SplittableRandom generator 12 | See http://dx.doi.org/10.1145/2714064.2660195 and 13 | http://docs.oracle.com/javase/8/docs/api/java/util/SplittableRandom.html 14 | 15 | It is a very fast generator passing BigCrush, and it can be useful if 16 | for some reason you absolutely want 64 bits of state. */ 17 | 18 | static uint64_t x; /* The state can be seeded with any value. */ 19 | 20 | uint64_t next() { 21 | uint64_t z = (x += 0x9e3779b97f4a7c15); 22 | z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9; 23 | z = (z ^ (z >> 27)) * 0x94d049bb133111eb; 24 | return z ^ (z >> 31); 25 | } 26 | -------------------------------------------------------------------------------- /interflop_backends/interflop_verrou/xxHashOrg/LICENSE: -------------------------------------------------------------------------------- 1 | xxHash Library 2 | Copyright (c) 2012-2021 Yann Collet 3 | All rights reserved. 4 | 5 | BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php) 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, this 14 | list of conditions and the following disclaimer in the documentation and/or 15 | other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /interflop_backends/statically_integrated_backends.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef INTERFLOP_STATIC_INTERFACE_ENABLED 4 | #error "INTERFLOP_STATIC_INTERFACE_ENABLED should be defined" 5 | #endif 6 | #include "interflop_verrou/interflop_verrou.h" 7 | #ifdef USE_VERROU_QUADMATH 8 | #include "backend_mcaquad/interflop_mcaquad.h" 9 | #else 10 | #define MCAMODE_IEEE 0 11 | #define MCAMODE_MCA 1 12 | #define MCAMODE_PB 2 13 | #define MCAMODE_RR 3 14 | #endif 15 | #include "backend_checkcancellation/interflop_checkcancellation.h" 16 | #include "backend_checkdenorm/interflop_checkdenorm.h" 17 | #include "backend_check_float_max/interflop_check_float_max.h" 18 | -------------------------------------------------------------------------------- /libVerrouTask/.dirstamp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edf-hpc/verrou/5c502f72d19143917be2dffc6231b5bd8fe07187/libVerrouTask/.dirstamp -------------------------------------------------------------------------------- /libVerrouTask/libverrouTask.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | This file is part of Verrou, a FPU instrumentation tool. 4 | 5 | Copyright (C) 2014-2021 EDF 6 | B. Lathuilière 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public License as 10 | published by the Free Software Foundation; either version 2.1 of the 11 | License, or (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, but 14 | WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 21 | 02111-1307, USA. 22 | 23 | The GNU Lesser General Public License is contained in the file COPYING. 24 | */ 25 | #pragma once 26 | 27 | /* 28 | List of env variable : 29 | DEBUG_PRINT_TASK 30 | TASK_LIST 31 | GENERATE_TASK_LIST 32 | GENERATE_TASK_FP_LIST 33 | */ 34 | 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | void verrou_task_init(); 40 | void verrou_task(char const*const key, int index); 41 | void verrou_task_finalyze(); 42 | #ifdef __cplusplus 43 | }; 44 | #endif 45 | 46 | 47 | #define VERROU_TASK_INIT verrou_task_init(); 48 | #define VERROU_TASK(a,b) verrou_task(a,b); 49 | #define VERROU_TASK_FINALIZE verrou_task_finalyze(); 50 | -------------------------------------------------------------------------------- /pyWrapper/verrouCBinding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //C functions to call verrou client request 4 | 5 | // start/stop instrumentation 6 | void c_verrou_start_instrumentation(void); 7 | void c_verrou_stop_instrumentation(void); 8 | 9 | void c_verrou_start_soft_instrumentation(void); 10 | void c_verrou_stop_soft_instrumentation(void); 11 | 12 | // define derteministic section 13 | void c_verrou_start_determinitic(int level); 14 | void c_verrou_stop_determinitic(int level); 15 | 16 | //dump cover 17 | unsigned int c_verrou_dump_cover(void); 18 | 19 | 20 | //counters 21 | void c_verrou_display_counters(void); 22 | unsigned int c_verrou_count_fp_instrumented(void); 23 | unsigned int c_verrou_count_fp_not_instrumented(void); 24 | 25 | void c_verrou_print_denorm_counter(void); 26 | void c_verrou_reset_denorm_counter(void); 27 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.std*.out 2 | *.std*.diff 3 | *.vgtest.log 4 | *.vgtest.trs 5 | test-suite.log 6 | iomatch.script.log-* 7 | accuClreq 8 | denorm 9 | hardSoftClreq 10 | hardSoftClreqDouble 11 | libmtest 12 | naninf 13 | test_det 14 | test_libm 15 | clreq 16 | sum 17 | libmtest_float_conv 18 | test_unfusedfma 19 | cdi.out 20 | cdo.out -------------------------------------------------------------------------------- /tests/Iomatch.script: -------------------------------------------------------------------------------- 1 | default: print_denorm_counter 2 | default: reset_denorm_counter 3 | bmatch: after afxbf 4 | apply: default 5 | cmatch: mul: * 6 | apply: default -------------------------------------------------------------------------------- /tests/accuClreq.c: -------------------------------------------------------------------------------- 1 | #include "../verrou.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | float compute () { 9 | float res=0; 10 | int i; 11 | for(i=0; i< 1000; i++){ 12 | res+=(float)0.1; 13 | } 14 | return res-100 ; 15 | } 16 | 17 | int main (int argc, char** argv) { 18 | double x=cos(42.); if(x!=x) printf ("FAILURE\n");// line to force libm use 19 | 20 | bool hard=false; 21 | bool soft=false; 22 | 23 | if(argc!=2){ 24 | return RUNNING_ON_VALGRIND; 25 | }else{ 26 | if(strcmp("hard",argv[1])==0){ 27 | hard=true; 28 | } 29 | if(strcmp("soft",argv[1])==0){ 30 | soft=true; 31 | } 32 | if(strcmp("both",argv[1])==0){ 33 | soft=true; hard=true; 34 | } 35 | } 36 | if(soft==false && hard==false){ 37 | printf ("error invalid data\n"); 38 | } 39 | 40 | float res_init=compute(); 41 | 42 | // Uninstrumented part 43 | if(hard && !soft){ VERROU_STOP_INSTRUMENTATION;} 44 | if(!hard && soft){ VERROU_STOP_SOFT_INSTRUMENTATION;} 45 | if(hard && soft){ 46 | VERROU_START_INSTRUMENTATION; 47 | VERROU_STOP_SOFT_INSTRUMENTATION; 48 | } 49 | 50 | float res_uninst=compute(); 51 | 52 | //Instrumented part 53 | if(hard){ VERROU_START_INSTRUMENTATION;} 54 | if(soft){ VERROU_START_SOFT_INSTRUMENTATION;} 55 | 56 | float res_end=compute(); 57 | 58 | printf ("%f %f %f\n", res_init, res_uninst, res_end); 59 | 60 | if (res_init == res_uninst){ 61 | printf ("NO INSTR AT START\n"); 62 | }else{ 63 | printf ("INSTR AT START\n"); 64 | } 65 | 66 | if (res_init == res_end){ 67 | printf ("DET\n"); 68 | }else{ 69 | printf( "NO_DET\n"); 70 | } 71 | 72 | if (res_end == res_uninst){ 73 | printf ("START FAIL\n"); 74 | }else{ 75 | printf ("START SUCCEED\n"); 76 | } 77 | 78 | return RUNNING_ON_VALGRIND; 79 | } 80 | -------------------------------------------------------------------------------- /tests/accuClreq1.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating UPWARD rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 3000 2000 ( 67%) 41 | `- flt 3000 2000 ( 67%) 42 | `- llo 3000 2000 ( 67%) 43 | --------------------------------------------------------------------- 44 | sub 3 2 ( 67%) 45 | `- flt 3 2 ( 67%) 46 | `- llo 3 2 ( 67%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/accuClreq1.stdout.exp: -------------------------------------------------------------------------------- 1 | 0.003044 -0.000954 0.003044 2 | INSTR AT START 3 | DET 4 | START SUCCEED 5 | -------------------------------------------------------------------------------- /tests/accuClreq1.vgtest: -------------------------------------------------------------------------------- 1 | prog: accuClreq 2 | args: hard 3 | vgopts: --rounding-mode=upward 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/accuClreq2.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating UPWARD rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 3000 1000 ( 33%) 41 | `- flt 3000 1000 ( 33%) 42 | `- llo 3000 1000 ( 33%) 43 | --------------------------------------------------------------------- 44 | sub 3 1 ( 33%) 45 | `- flt 3 1 ( 33%) 46 | `- llo 3 1 ( 33%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/accuClreq2.stdout.exp: -------------------------------------------------------------------------------- 1 | -0.000954 -0.000954 0.003044 2 | NO INSTR AT START 3 | NO_DET 4 | START SUCCEED 5 | -------------------------------------------------------------------------------- /tests/accuClreq2.vgtest: -------------------------------------------------------------------------------- 1 | prog: accuClreq 2 | args: hard 3 | vgopts: --rounding-mode=upward --instr-atstart=no 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/accuClreq3.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating UPWARD rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 3000 2000 ( 67%) 41 | `- flt 3000 2000 ( 67%) 42 | `- llo 3000 2000 ( 67%) 43 | --------------------------------------------------------------------- 44 | sub 3 2 ( 67%) 45 | `- flt 3 2 ( 67%) 46 | `- llo 3 2 ( 67%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/accuClreq3.stdout.exp: -------------------------------------------------------------------------------- 1 | 0.003044 -0.000954 0.003044 2 | INSTR AT START 3 | DET 4 | START SUCCEED 5 | -------------------------------------------------------------------------------- /tests/accuClreq3.vgtest: -------------------------------------------------------------------------------- 1 | prog: accuClreq 2 | args: soft 3 | vgopts: --rounding-mode=upward 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/accuClreq4.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating UPWARD rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 3000 1000 ( 33%) 41 | `- flt 3000 1000 ( 33%) 42 | `- llo 3000 1000 ( 33%) 43 | --------------------------------------------------------------------- 44 | sub 3 1 ( 33%) 45 | `- flt 3 1 ( 33%) 46 | `- llo 3 1 ( 33%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/accuClreq4.stdout.exp: -------------------------------------------------------------------------------- 1 | -0.000954 -0.000954 0.003044 2 | NO INSTR AT START 3 | NO_DET 4 | START SUCCEED 5 | -------------------------------------------------------------------------------- /tests/accuClreq4.vgtest: -------------------------------------------------------------------------------- 1 | prog: accuClreq 2 | args: soft 3 | vgopts: --rounding-mode=upward --instr-atstart-soft=no 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/accuClreq5.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating UPWARD rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 3000 2000 ( 67%) 41 | `- flt 3000 2000 ( 67%) 42 | `- llo 3000 2000 ( 67%) 43 | --------------------------------------------------------------------- 44 | sub 3 2 ( 67%) 45 | `- flt 3 2 ( 67%) 46 | `- llo 3 2 ( 67%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/accuClreq5.stdout.exp: -------------------------------------------------------------------------------- 1 | 0.003044 -0.000954 0.003044 2 | INSTR AT START 3 | DET 4 | START SUCCEED 5 | -------------------------------------------------------------------------------- /tests/accuClreq5.vgtest: -------------------------------------------------------------------------------- 1 | prog: accuClreq 2 | args: both 3 | vgopts: --rounding-mode=upward 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/clreq.c: -------------------------------------------------------------------------------- 1 | #include "../verrou.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | float compute () { 8 | int i; 9 | float sum = 0; 10 | for (i = 0 ; i<100 ; ++i) { 11 | sum += (float)i; 12 | } 13 | return sum; 14 | } 15 | 16 | int main (int argc, char** argv) { 17 | double x=cos(42.); if(x!=x) printf ("FAILURE\n");// line to force libm use 18 | 19 | bool hard=false; 20 | bool soft=false; 21 | 22 | if(argc!=2){ 23 | return RUNNING_ON_VALGRIND; 24 | }else{ 25 | if(strcmp("hard",argv[1])==0){ 26 | hard=true; 27 | } 28 | if(strcmp("soft",argv[1])==0){ 29 | soft=true; 30 | } 31 | if(strcmp("both",argv[1])==0){ 32 | soft=true; hard=true; 33 | } 34 | } 35 | if(soft==false && hard==false){ 36 | printf ("error invalid data\n"); 37 | } 38 | 39 | if (compute() == (float)4950.) 40 | printf ("OK\n"); 41 | 42 | // Uninstrumented part 43 | if(hard && !soft){ VERROU_STOP_INSTRUMENTATION;} 44 | if(!hard && soft){ VERROU_STOP_SOFT_INSTRUMENTATION;} 45 | if(hard && soft){ 46 | VERROU_START_INSTRUMENTATION; 47 | VERROU_STOP_SOFT_INSTRUMENTATION; 48 | } 49 | 50 | if (compute() == (float)4950.) 51 | printf ("OK\n"); 52 | 53 | //Instrumented part 54 | if(hard){ VERROU_START_INSTRUMENTATION;} 55 | if(soft){ VERROU_START_SOFT_INSTRUMENTATION;} 56 | 57 | if (compute() == (float)4950.) 58 | printf ("OK\n"); 59 | 60 | return RUNNING_ON_VALGRIND; 61 | } 62 | -------------------------------------------------------------------------------- /tests/clreq.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating NEAREST rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 300 200 ( 67%) 41 | `- flt 300 200 ( 67%) 42 | `- llo 300 200 ( 67%) 43 | --------------------------------------------------------------------- 44 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 45 | -------------------------------------------------------------------------------- /tests/clreq.stdout.exp: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | OK 4 | -------------------------------------------------------------------------------- /tests/clreq.vgtest: -------------------------------------------------------------------------------- 1 | prog: clreq 2 | args: hard 3 | vgopts: 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo -------------------------------------------------------------------------------- /tests/clreq_both.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating NEAREST rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 300 200 ( 67%) 41 | `- flt 300 200 ( 67%) 42 | `- llo 300 200 ( 67%) 43 | --------------------------------------------------------------------- 44 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 45 | -------------------------------------------------------------------------------- /tests/clreq_both.stdout.exp: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | OK 4 | -------------------------------------------------------------------------------- /tests/clreq_both.vgtest: -------------------------------------------------------------------------------- 1 | prog: clreq 2 | args: both 3 | vgopts: 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo -------------------------------------------------------------------------------- /tests/clreq_soft.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating NEAREST rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 300 200 ( 67%) 41 | `- flt 300 200 ( 67%) 42 | `- llo 300 200 ( 67%) 43 | --------------------------------------------------------------------- 44 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 45 | -------------------------------------------------------------------------------- /tests/clreq_soft.stdout.exp: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | OK 4 | -------------------------------------------------------------------------------- /tests/clreq_soft.vgtest: -------------------------------------------------------------------------------- 1 | prog: clreq 2 | args: soft 3 | vgopts: 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo -------------------------------------------------------------------------------- /tests/denorm.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | #include "../interflop_backends/interflop_verrou/vr_fma.hxx" 8 | 9 | int main (int argc, char **argv) { 10 | double x=cos(42.); if(x!=x) printf ("FAILURE\n");// line to force libm use 11 | 12 | double a=1.e-160; 13 | double b=1.e-160; 14 | 15 | float af=1.e-20; 16 | float bf=-1.e-20; 17 | 18 | double a1=1.e-320; 19 | double a2=-1.; 20 | double a3=-1.1e-320; 21 | 22 | std::cout << "init" << std::endl; 23 | double c=a*b; 24 | std::cout << "after axb" << std::endl; 25 | double cf=af*bf; 26 | std::cout << "after afxbf" << std::endl; 27 | #ifdef USE_VERROU_FMA 28 | double cfma=vr_fma(a1,a2,a3); 29 | #else 30 | double cfma=fma(a1,a2,a3); 31 | #endif 32 | printf("c: %e\n", c); 33 | printf("cf: %e\n", cf); 34 | printf("cfma: %e\n",cfma ); 35 | 36 | { 37 | double am1=1.e-320; 38 | double am2=1.e100; 39 | double resm=am1*am2; 40 | double resp=am1+am2; 41 | printf("mul: %e\n",resm ); 42 | printf("add: %e\n",resp ); 43 | } 44 | 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /tests/denorm1.stdout.exp: -------------------------------------------------------------------------------- 1 | init 2 | after axb 3 | after afxbf 4 | c: 9.999889e-321 5 | cf: -9.999946e-41 6 | cfma: -2.099779e-320 7 | mul: 9.999889e-221 8 | add: 1.000000e+100 9 | -------------------------------------------------------------------------------- /tests/denorm1.vgtest: -------------------------------------------------------------------------------- 1 | prog: denorm 2 | vgopts: --check-denorm=yes 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -addr-error -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/denorm2.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | EXCLUDE DETECTED: XXXXX 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | Using exclusion rule: * XXXXX 35 | 36 | --------------------------------------------------------------------- 37 | Operation Instruction count 38 | `- Precision 39 | `- Vectorization Total Instrumented 40 | --------------------------------------------------------------------- 41 | add 1 1 (100%) 42 | `- dbl 1 1 (100%) 43 | `- llo 1 1 (100%) 44 | --------------------------------------------------------------------- 45 | mul 3 3 (100%) 46 | `- flt 1 1 (100%) 47 | `- llo 1 1 (100%) 48 | `- dbl 2 2 (100%) 49 | `- llo 2 2 (100%) 50 | --------------------------------------------------------------------- 51 | mAdd 1 1 (100%) 52 | `- dbl 1 1 (100%) 53 | --------------------------------------------------------------------- 54 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 55 | -------------------------------------------------------------------------------- /tests/denorm2.stdout.exp: -------------------------------------------------------------------------------- 1 | init 2 | after axb 3 | after afxbf 4 | c: 0.000000e+00 5 | cf: 0.000000e+00 6 | cfma: 0.000000e+00 7 | mul: 9.999889e-221 8 | add: 1.000000e+100 9 | -------------------------------------------------------------------------------- /tests/denorm2.vgtest: -------------------------------------------------------------------------------- 1 | prog: denorm 2 | vgopts: --rounding-mode=ftz 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/denorm3.stdout.exp: -------------------------------------------------------------------------------- 1 | init 2 | after axb 3 | after afxbf 4 | c: 9.999889e-321 5 | cf: -9.999946e-41 6 | cfma: -2.099779e-320 7 | mul: 9.999889e-221 8 | add: 1.000000e+100 9 | -------------------------------------------------------------------------------- /tests/denorm3.vgtest: -------------------------------------------------------------------------------- 1 | prog: denorm 2 | vgopts: --count-denorm=yes --IOmatch-clr=./Iomatch.script 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo -iomatch 4 | cleanup: rm Iomatch.script.log-* -------------------------------------------------------------------------------- /tests/denorm4.post.exp: -------------------------------------------------------------------------------- 1 | denorm.cxx 37 main 2 | fmaintrin.h 73 _Z6vr_fmaIdET_RKS0_S2_S2_ 3 | fmaintrin.h 73 _Z6vr_fmaIdET_RKS0_S2_S2_ 4 | denorm.cxx 25 main 5 | denorm.cxx 23 main 6 | -------------------------------------------------------------------------------- /tests/denorm4.post.exp.arm64: -------------------------------------------------------------------------------- 1 | denorm.cxx 37 main 2 | denorm.cxx 28 main 3 | denorm.cxx 28 main 4 | denorm.cxx 25 main 5 | denorm.cxx 23 main 6 | -------------------------------------------------------------------------------- /tests/denorm4.stdout.exp: -------------------------------------------------------------------------------- 1 | init 2 | after axb 3 | after afxbf 4 | c: 9.999889e-321 5 | cf: -9.999946e-41 6 | cfma: -2.099779e-320 7 | mul: 9.999889e-221 8 | add: 1.000000e+100 9 | -------------------------------------------------------------------------------- /tests/denorm4.vgtest: -------------------------------------------------------------------------------- 1 | prog: denorm 2 | vgopts: --cdi-gen-file=cdi.out --cdo-gen-file=cdo.out 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo -dump-list 4 | post: cat cdi.out cdo.out 5 | -------------------------------------------------------------------------------- /tests/filter_stdout: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | dir=`dirname $0` 4 | 5 | cmd="perl -pne ''" 6 | while [ ! -z "$1" ]; do 7 | case "$1" in 8 | "-nan-commut") 9 | cmd="${cmd} | perl -pne 's/^nan1 \+ nan2 = nan \(7ff800000000babe\)/nan1 + nan2 = nan (7ff800000000dead)/;'" 10 | cmd="${cmd} | perl -pne 's/^nan2 \+ nan1 = nan \(7ff800000000dead\)/nan2 + nan1 = nan (7ff800000000babe)/;'" 11 | ;; 12 | esac 13 | shift 14 | done 15 | eval ${cmd} 16 | -------------------------------------------------------------------------------- /tests/fma_common.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #if defined(VGA_amd64) || defined(__x86_64__) 3 | #include 4 | #endif 5 | 6 | #if defined(VGA_arm64) || defined(__aarch64__) 7 | #include "arm_neon.h" 8 | #endif 9 | 10 | 11 | template 12 | inline REALTYPE intrin_fma(const REALTYPE&, const REALTYPE&, const REALTYPE&); 13 | 14 | #if defined(__x86_64__) 15 | template<> 16 | inline double intrin_fma(const double& a, const double& b, const double& c){ 17 | double d; 18 | __m128d ai, bi,ci,di; 19 | ai = _mm_load_sd(&a); 20 | bi = _mm_load_sd(&b); 21 | ci = _mm_load_sd(&c); 22 | di=_mm_fmadd_sd(ai,bi,ci); 23 | d=_mm_cvtsd_f64(di); 24 | return d; 25 | } 26 | #endif 27 | 28 | #if defined(__aarch64__) 29 | template<> 30 | inline double intrin_fma(const double& a, const double& b, const double& c){ 31 | double d; 32 | const float64x1_t ai=vld1_f64(&a); 33 | const float64x1_t bi=vld1_f64(&b); 34 | const float64x1_t ci=vld1_f64(&c); 35 | 36 | const float64x1_t di=vfma_f64(ci,ai,bi);// warning strange argument order 37 | // cf doc : https://developer.arm.com/architectures/instruction-set/intrinsics/#q=vfma 38 | vst1_f64(&d, di); 39 | return d; 40 | } 41 | #endif 42 | 43 | 44 | 45 | #if defined(__x86_64__) 46 | template<> 47 | inline float intrin_fma(const float& a, const float& b, const float& c){ 48 | float d; 49 | __m128 ai, bi,ci,di; 50 | ai = _mm_load_ss(&a); 51 | bi = _mm_load_ss(&b); 52 | ci = _mm_load_ss(&c); 53 | di=_mm_fmadd_ss(ai,bi,ci); 54 | d=_mm_cvtss_f32(di); 55 | return d; 56 | } 57 | #endif 58 | 59 | 60 | #if defined(__aarch64__) 61 | template<> 62 | inline float intrin_fma(const float& a, const float& b, const float& c){ 63 | float res; 64 | __asm__( 65 | "fmadd %s0, %s1, %s2, %s3": 66 | "=x"(res): "x"(a),"x"(b),"x"(c) 67 | ); 68 | return res; 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /tests/hardSoftClreq.c: -------------------------------------------------------------------------------- 1 | #include "../verrou.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | float compute () { 9 | float res=0; 10 | int i; 11 | for(i=0; i< 1000; i++){ 12 | res+=(float)0.1; 13 | } 14 | return res-100 ; 15 | } 16 | 17 | void detect(int index, float* res, float res_init){ 18 | printf("res[%d] ",index); 19 | if((res[index] - res_init) ==0){ 20 | printf("==\n"); //fflush(stdout); 21 | }else{ 22 | printf("!=\n"); //fflush(stdout); 23 | } 24 | } 25 | 26 | int main (int argc, char** argv) { 27 | double x=cos(42.); if(x!=x) printf ("FAILURE\n");// line to force libm use 28 | 29 | float res[10]; 30 | float res_init=compute(); 31 | 32 | VERROU_STOP_SOFT_INSTRUMENTATION; 33 | VERROU_START_INSTRUMENTATION; 34 | res[0]=compute(); //non inst 35 | detect(0, res, res_init); 36 | VERROU_STOP_INSTRUMENTATION; 37 | VERROU_START_SOFT_INSTRUMENTATION; 38 | res[1]=compute(); //non inst 39 | detect(1, res, res_init); 40 | VERROU_START_INSTRUMENTATION; 41 | res[2]=compute(); // inst 42 | detect(2, res, res_init); 43 | VERROU_STOP_SOFT_INSTRUMENTATION; 44 | res[3]=compute(); // non inst 45 | detect(3, res, res_init); 46 | VERROU_START_SOFT_INSTRUMENTATION; 47 | res[4]=compute(); // inst 48 | detect(4, res, res_init); 49 | VERROU_STOP_SOFT_INSTRUMENTATION; 50 | res[5]=compute(); //no inst 51 | detect(5, res, res_init); 52 | VERROU_STOP_INSTRUMENTATION; 53 | res[6]=compute(); //no inst 54 | detect(6, res, res_init); 55 | VERROU_START_INSTRUMENTATION; 56 | res[7]=compute(); //no inst 57 | detect(7, res, res_init); 58 | VERROU_START_SOFT_INSTRUMENTATION; 59 | res[8]=compute(); //inst 60 | detect(8, res, res_init); 61 | VERROU_START_SOFT_INSTRUMENTATION; 62 | res[9]=compute(); //inst 63 | detect(9, res, res_init); 64 | return RUNNING_ON_VALGRIND; 65 | } 66 | -------------------------------------------------------------------------------- /tests/hardSoftClreq1.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating RANDOM_DET rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 11000 4000 ( 36%) 41 | `- flt 11000 4000 ( 36%) 42 | `- llo 11000 4000 ( 36%) 43 | --------------------------------------------------------------------- 44 | sub 21 8 ( 38%) 45 | `- flt 21 8 ( 38%) 46 | `- llo 21 8 ( 38%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/hardSoftClreq1.stdout.exp: -------------------------------------------------------------------------------- 1 | res[0] == 2 | res[1] == 3 | res[2] != 4 | res[3] == 5 | res[4] != 6 | res[5] == 7 | res[6] == 8 | res[7] == 9 | res[8] != 10 | res[9] != 11 | -------------------------------------------------------------------------------- /tests/hardSoftClreq1.vgtest: -------------------------------------------------------------------------------- 1 | prog: hardSoftClreq 2 | vgopts: --rounding-mode=random_det --instr-atstart=no --vr-seed=42 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/hardSoftClreq2.stdout.exp: -------------------------------------------------------------------------------- 1 | res[0] == 2 | res[1] == 3 | res[2] == 4 | res[3] == 5 | res[4] == 6 | res[5] == 7 | res[6] == 8 | res[7] == 9 | res[8] == 10 | res[9] == 11 | -------------------------------------------------------------------------------- /tests/hardSoftClreq2.vgtest: -------------------------------------------------------------------------------- 1 | prog: hardSoftClreq 2 | vgopts: --check-cancellation=yes --cc-threshold-float=10 --instr-atstart=yes --instr-atstart-soft=no --vr-seed=42 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo -addr-error 4 | -------------------------------------------------------------------------------- /tests/hardSoftClreq3.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | Open IOMatchClr file : PATH 5 | Open IOMatchClr output file : PATH 6 | First seed : XXX 7 | Backend verrou : test-version 8 | Backend checkcancellation : test-version 9 | Backend check_float_max : test-version 10 | Backend checkdenorm : test-version 11 | Instrumented operations : 12 | add : yes 13 | sub : yes 14 | mul : yes 15 | div : yes 16 | mAdd : yes 17 | mSub : yes 18 | sqrt : yes 19 | cmp : no 20 | conv : yes 21 | max : no 22 | min : no 23 | Instrumented vectorized operations : 24 | scal : no 25 | llo : yes 26 | vec2 : yes 27 | vec4 : yes 28 | vec8 : yes 29 | unk : yes 30 | Instrumented type : 31 | flt : yes 32 | dbl : yes 33 | Backend mcaquad simulating mode MCA with precision 53 for double and 10 for float 34 | EXCLUDE DETECTED: XXXXX 35 | Using exclusion rule: * XXXXX 36 | match [0]: |res[5] ==| 37 | match [1]: |res[8] !=| 38 | 39 | match pattern count 40 | 1 : res[5] == 41 | 1 : res[8] != 42 | --------------------------------------------------------------------- 43 | Operation Instruction count 44 | `- Precision 45 | `- Vectorization Total Instrumented 46 | --------------------------------------------------------------------- 47 | add 11000 4000 ( 36%) 48 | `- flt 11000 4000 ( 36%) 49 | `- llo 11000 4000 ( 36%) 50 | --------------------------------------------------------------------- 51 | sub 21 8 ( 38%) 52 | `- flt 21 8 ( 38%) 53 | `- llo 21 8 ( 38%) 54 | --------------------------------------------------------------------- 55 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 56 | -------------------------------------------------------------------------------- /tests/hardSoftClreq3.stdout.exp: -------------------------------------------------------------------------------- 1 | res[0] == 2 | res[1] == 3 | res[2] != 4 | res[3] == 5 | res[4] != 6 | res[5] == 7 | res[6] == 8 | res[7] != 9 | res[8] != 10 | res[9] == 11 | -------------------------------------------------------------------------------- /tests/hardSoftClreq3.vgtest: -------------------------------------------------------------------------------- 1 | prereq: test `uname -m` = x86_64 2 | prog: hardSoftClreq 3 | vgopts: --backend=mcaquad --instr-atstart=no --vr-seed=42 --IOmatch-clr=iomatch.script --mca-precision-float=10 4 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo -iomatch 5 | env: LD_PRELOAD=verrouUnbuffered.so:$LD_PRELOAD LD_LIBRARY_PATH=../:$LD_LIBRARY_PATH 6 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble1.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating FLOAT rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 12000 4000 ( 33%) 41 | `- flt 1000 0 ( 0%) 42 | `- llo 1000 0 ( 0%) 43 | `- dbl 11000 4000 ( 36%) 44 | `- llo 11000 4000 ( 36%) 45 | --------------------------------------------------------------------- 46 | sub 32 12 ( 37%) 47 | `- flt 1 0 ( 0%) 48 | `- llo 1 0 ( 0%) 49 | `- dbl 31 12 ( 39%) 50 | `- llo 31 12 ( 39%) 51 | --------------------------------------------------------------------- 52 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 53 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble1.stdout.exp: -------------------------------------------------------------------------------- 1 | res[0] =-0.00000000000140687 2 | == 3 | double 4 | 5 | res[1] =-0.00000000000140687 6 | == 7 | double 8 | 9 | res[2] =-0.00095367431640625 10 | != 11 | float 12 | 13 | res[3] =-0.00000000000140687 14 | == 15 | double 16 | 17 | res[4] =-0.00095367431640625 18 | != 19 | float 20 | 21 | res[5] =-0.00000000000140687 22 | == 23 | double 24 | 25 | res[6] =-0.00000000000140687 26 | == 27 | double 28 | 29 | res[7] =-0.00000000000140687 30 | == 31 | double 32 | 33 | res[8] =-0.00095367431640625 34 | != 35 | float 36 | 37 | res[9] =-0.00095367431640625 38 | != 39 | float 40 | 41 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble1.vgtest: -------------------------------------------------------------------------------- 1 | prog: hardSoftClreqDouble 2 | vgopts: --rounding-mode=float --instr-atstart=no 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble2.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Frontend: double -> float 32 | Backend verrou simulating NEAREST rounding mode 33 | EXCLUDE DETECTED: XXXXX 34 | Using exclusion rule: * XXXXX 35 | 36 | --------------------------------------------------------------------- 37 | Operation Instruction count 38 | `- Precision 39 | `- Vectorization Total Instrumented 40 | --------------------------------------------------------------------- 41 | add 12000 4000 ( 33%) 42 | `- flt 1000 0 ( 0%) 43 | `- llo 1000 0 ( 0%) 44 | `- dbl 11000 4000 ( 36%) 45 | `- llo 11000 4000 ( 36%) 46 | --------------------------------------------------------------------- 47 | sub 32 12 ( 37%) 48 | `- flt 1 0 ( 0%) 49 | `- llo 1 0 ( 0%) 50 | `- dbl 31 12 ( 39%) 51 | `- llo 31 12 ( 39%) 52 | --------------------------------------------------------------------- 53 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 54 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble2.stdout.exp: -------------------------------------------------------------------------------- 1 | res[0] =-0.00000000000140687 2 | == 3 | double 4 | 5 | res[1] =-0.00000000000140687 6 | == 7 | double 8 | 9 | res[2] =-0.00095367431640625 10 | != 11 | float 12 | 13 | res[3] =-0.00000000000140687 14 | == 15 | double 16 | 17 | res[4] =-0.00095367431640625 18 | != 19 | float 20 | 21 | res[5] =-0.00000000000140687 22 | == 23 | double 24 | 25 | res[6] =-0.00000000000140687 26 | == 27 | double 28 | 29 | res[7] =-0.00000000000140687 30 | == 31 | double 32 | 33 | res[8] =-0.00095367431640625 34 | != 35 | float 36 | 37 | res[9] =-0.00095367431640625 38 | != 39 | float 40 | 41 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble2.vgtest: -------------------------------------------------------------------------------- 1 | prog: hardSoftClreqDouble 2 | vgopts: --rounding-mode=nearest --float=yes --instr-atstart=no 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble3.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Frontend: double -> float 32 | Backend verrou simulating UPWARD rounding mode 33 | EXCLUDE DETECTED: XXXXX 34 | Using exclusion rule: * XXXXX 35 | 36 | --------------------------------------------------------------------- 37 | Operation Instruction count 38 | `- Precision 39 | `- Vectorization Total Instrumented 40 | --------------------------------------------------------------------- 41 | add 12000 6000 ( 50%) 42 | `- flt 1000 1000 (100%) 43 | `- llo 1000 1000 (100%) 44 | `- dbl 11000 5000 ( 45%) 45 | `- llo 11000 5000 ( 45%) 46 | --------------------------------------------------------------------- 47 | sub 32 14 ( 44%) 48 | `- flt 1 1 (100%) 49 | `- llo 1 1 (100%) 50 | `- dbl 31 13 ( 42%) 51 | `- llo 31 13 ( 42%) 52 | --------------------------------------------------------------------- 53 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 54 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble3.stdout.exp: -------------------------------------------------------------------------------- 1 | res_init == res_float 2 | res[0] =-0.00000000000140687 3 | != 4 | double 5 | 6 | res[1] =-0.00000000000140687 7 | != 8 | double 9 | 10 | res[2] =0.00304412841796875 11 | == 12 | float 13 | 14 | res[3] =-0.00000000000140687 15 | != 16 | double 17 | 18 | res[4] =0.00304412841796875 19 | == 20 | float 21 | 22 | res[5] =-0.00000000000140687 23 | != 24 | double 25 | 26 | res[6] =-0.00000000000140687 27 | != 28 | double 29 | 30 | res[7] =-0.00000000000140687 31 | != 32 | double 33 | 34 | res[8] =0.00304412841796875 35 | == 36 | float 37 | 38 | res[9] =0.00304412841796875 39 | == 40 | float 41 | 42 | -------------------------------------------------------------------------------- /tests/hardSoftClreqDouble3.vgtest: -------------------------------------------------------------------------------- 1 | prog: hardSoftClreqDouble 2 | vgopts: --rounding-mode=upward --float=yes --instr-atstart=yes 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/iomatch.script: -------------------------------------------------------------------------------- 1 | cmatch: res[5] == 2 | apply: start_soft 3 | bmatch: res[8] != 4 | apply: stop 5 | -------------------------------------------------------------------------------- /tests/libmtest-withlibm.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | ldbl : no 32 | Backend verrou simulating RANDOM rounding mode 33 | EXCLUDE DETECTED: XXXXX 34 | EXCLUDE DETECTED: XXXXX 35 | EXCLUDE DETECTED: XXXXX 36 | EXCLUDE DETECTED: XXXXX 37 | Using exclusion rule: * XXXXX 38 | Using exclusion rule: * XXXXX 39 | Using exclusion rule: * XXXXX 40 | Using exclusion rule: * XXXXX 41 | Interlibm counter ( ROUNDINGMODE=RANDOM ) 42 | Total Instrumented 43 | --------------------------------------------------- 44 | cos 240 160 45 | `- flt 120 80 46 | `- dbl 120 80 47 | --------------------------------------------------- 48 | atan2 240 160 49 | `- flt 120 80 50 | `- dbl 120 80 51 | 52 | --------------------------------------------------------------------- 53 | Operation Instruction count 54 | `- Precision 55 | `- Vectorization Total Instrumented 56 | --------------------------------------------------------------------- 57 | sub 240 160 ( 67%) 58 | `- flt 120 80 ( 67%) 59 | `- llo 120 80 ( 67%) 60 | `- dbl 120 80 ( 67%) 61 | `- llo 120 80 ( 67%) 62 | --------------------------------------------------------------------- 63 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 64 | -------------------------------------------------------------------------------- /tests/libmtest-withlibm.stderr.exp.aarch64: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | ldbl : no 32 | Backend verrou simulating RANDOM rounding mode 33 | EXCLUDE DETECTED: XXXXX 34 | EXCLUDE DETECTED: XXXXX 35 | EXCLUDE DETECTED: XXXXX 36 | Using exclusion rule: * XXXXX 37 | Using exclusion rule: * XXXXX 38 | Using exclusion rule: * XXXXX 39 | Interlibm counter ( ROUNDINGMODE=RANDOM ) 40 | Total Instrumented 41 | --------------------------------------------------- 42 | cos 240 160 43 | `- flt 120 80 44 | `- dbl 120 80 45 | --------------------------------------------------- 46 | atan2 240 160 47 | `- flt 120 80 48 | `- dbl 120 80 49 | 50 | --------------------------------------------------------------------- 51 | Operation Instruction count 52 | `- Precision 53 | `- Vectorization Total Instrumented 54 | --------------------------------------------------------------------- 55 | sub 240 160 ( 67%) 56 | `- flt 120 80 ( 67%) 57 | `- llo 120 80 ( 67%) 58 | `- dbl 120 80 ( 67%) 59 | `- llo 120 80 ( 67%) 60 | --------------------------------------------------------------------- 61 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 62 | -------------------------------------------------------------------------------- /tests/libmtest-withlibm.stdout.exp: -------------------------------------------------------------------------------- 1 | cosf un/re-inst : OK 2 | atan2f un/re-inst : OK 3 | cos un/re-inst : OK 4 | atan2 un/re-inst : OK 5 | cosf un/re-inst : OK 6 | atan2f un/re-inst : OK 7 | cos un/re-inst : OK 8 | atan2 un/re-inst : OK 9 | -------------------------------------------------------------------------------- /tests/libmtest-withlibm.vgtest: -------------------------------------------------------------------------------- 1 | prog: libmtest 2 | vgopts: --rounding-mode=random --libm=instrumented 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/libmtest-withoutlibm.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating RANDOM rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | sub 240 160 ( 67%) 41 | `- flt 120 80 ( 67%) 42 | `- llo 120 80 ( 67%) 43 | `- dbl 120 80 ( 67%) 44 | `- llo 120 80 ( 67%) 45 | --------------------------------------------------------------------- 46 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 47 | -------------------------------------------------------------------------------- /tests/libmtest-withoutlibm.stdout.exp: -------------------------------------------------------------------------------- 1 | cosf un/re-inst : KO 2 | atan2f un/re-inst : KO 3 | cos un/re-inst : KO 4 | atan2 un/re-inst : KO 5 | cosf un/re-inst : KO 6 | atan2f un/re-inst : KO 7 | cos un/re-inst : KO 8 | atan2 un/re-inst : KO 9 | -------------------------------------------------------------------------------- /tests/libmtest-withoutlibm.vgtest: -------------------------------------------------------------------------------- 1 | prog: libmtest 2 | vgopts: --rounding-mode=random --libm=auto_exclude 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv.c: -------------------------------------------------------------------------------- 1 | #include "../verrou.h" 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | int main (int argc, char** argv) { 8 | volatile float af=0.111; 9 | volatile double a=0.111; 10 | 11 | if(argc==2){ 12 | a=atof(argv[1]); 13 | af=(float) a; 14 | } 15 | 16 | // Uninstrumented part 17 | VERROU_STOP_INSTRUMENTATION; 18 | float cosf_uninst= cosf(af); 19 | double cos_uninst= cos(a); 20 | VERROU_START_INSTRUMENTATION; 21 | float cosf_inst= cosf(af); 22 | double cos_inst= cos(a); 23 | VERROU_STOP_INSTRUMENTATION; 24 | 25 | printf("a: %.17f\n",a); 26 | printf("af: %.17f\n",af); 27 | printf("cosf uninst: %.17f\n",cosf_uninst); 28 | printf("cos uninst: %.17f\n",cos_uninst); 29 | printf("cosf inst: %.17f\n",cosf_inst); 30 | printf("cos inst: %.17f\n",cos_inst); 31 | 32 | if( cosf_inst!=cosf_uninst){ 33 | printf("cosf impacted by instrumentation\n"); 34 | } 35 | 36 | if( cos_inst!=cos_uninst){ 37 | printf("cos impacted by instrumentation\n"); 38 | } 39 | 40 | if(cosf_uninst==cos_uninst){ 41 | printf("native cos and cosf are equal : strange\n"); 42 | } 43 | 44 | if(cosf_inst==cos_inst){ 45 | printf("instrumented cos and cosf are equal\n"); 46 | }else{ 47 | printf("instrumented cos and cosf are different\n"); 48 | }; 49 | 50 | return RUNNING_ON_VALGRIND; 51 | } 52 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv1.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | ldbl : no 32 | Backend verrou simulating UPWARD rounding mode 33 | EXCLUDE DETECTED: XXXXX 34 | EXCLUDE DETECTED: XXXXX 35 | EXCLUDE DETECTED: XXXXX 36 | EXCLUDE DETECTED: XXXXX 37 | Using exclusion rule: * XXXXX 38 | Using exclusion rule: * XXXXX 39 | Using exclusion rule: * XXXXX 40 | Using exclusion rule: * XXXXX 41 | Interlibm counter ( ROUNDINGMODE=UPWARD ) 42 | Total Instrumented 43 | --------------------------------------------------- 44 | cos 4 2 45 | `- flt 2 1 46 | `- dbl 2 1 47 | 48 | --------------------------------------------------------------------- 49 | Operation Instruction count 50 | `- Precision 51 | `- Vectorization Total Instrumented 52 | --------------------------------------------------------------------- 53 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 54 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv1.stderr.exp.aarch64: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | ldbl : no 32 | Backend verrou simulating UPWARD rounding mode 33 | EXCLUDE DETECTED: XXXXX 34 | EXCLUDE DETECTED: XXXXX 35 | EXCLUDE DETECTED: XXXXX 36 | Using exclusion rule: * XXXXX 37 | Using exclusion rule: * XXXXX 38 | Using exclusion rule: * XXXXX 39 | Interlibm counter ( ROUNDINGMODE=UPWARD ) 40 | Total Instrumented 41 | --------------------------------------------------- 42 | cos 4 2 43 | `- flt 2 1 44 | `- dbl 2 1 45 | 46 | --------------------------------------------------------------------- 47 | Operation Instruction count 48 | `- Precision 49 | `- Vectorization Total Instrumented 50 | --------------------------------------------------------------------- 51 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 52 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv1.stdout.exp: -------------------------------------------------------------------------------- 1 | a: 0.11100000000000000 2 | af: 0.11100000143051147 3 | cosf uninst: 0.99384582042694092 4 | cos uninst: 0.99384582269614852 5 | cosf inst: 0.99384588003158569 6 | cos inst: 0.99384582269614852 7 | cosf impacted by instrumentation 8 | instrumented cos and cosf are different 9 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv1.vgtest: -------------------------------------------------------------------------------- 1 | prog: libmtest_float_conv 2 | vgopts: --rounding-mode=upward --libm=instrumented 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv2.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | ldbl : no 32 | Frontend: double -> float 33 | Backend verrou simulating UPWARD rounding mode 34 | EXCLUDE DETECTED: XXXXX 35 | EXCLUDE DETECTED: XXXXX 36 | EXCLUDE DETECTED: XXXXX 37 | EXCLUDE DETECTED: XXXXX 38 | Using exclusion rule: * XXXXX 39 | Using exclusion rule: * XXXXX 40 | Using exclusion rule: * XXXXX 41 | Using exclusion rule: * XXXXX 42 | Interlibm counter ( ROUNDINGMODE=UPWARD double=>float ) 43 | Total Instrumented 44 | --------------------------------------------------- 45 | cos 4 2 46 | `- flt 2 1 47 | `- dbl 2 1 48 | 49 | --------------------------------------------------------------------- 50 | Operation Instruction count 51 | `- Precision 52 | `- Vectorization Total Instrumented 53 | --------------------------------------------------------------------- 54 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 55 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv2.stderr.exp.aarch64: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | ldbl : no 32 | Frontend: double -> float 33 | Backend verrou simulating UPWARD rounding mode 34 | EXCLUDE DETECTED: XXXXX 35 | EXCLUDE DETECTED: XXXXX 36 | EXCLUDE DETECTED: XXXXX 37 | Using exclusion rule: * XXXXX 38 | Using exclusion rule: * XXXXX 39 | Using exclusion rule: * XXXXX 40 | Interlibm counter ( ROUNDINGMODE=UPWARD double=>float ) 41 | Total Instrumented 42 | --------------------------------------------------- 43 | cos 4 2 44 | `- flt 2 1 45 | `- dbl 2 1 46 | 47 | --------------------------------------------------------------------- 48 | Operation Instruction count 49 | `- Precision 50 | `- Vectorization Total Instrumented 51 | --------------------------------------------------------------------- 52 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 53 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv2.stdout.exp: -------------------------------------------------------------------------------- 1 | a: 0.11100000000000000 2 | af: 0.11100000143051147 3 | cosf uninst: 0.99384582042694092 4 | cos uninst: 0.99384582269614852 5 | cosf inst: 0.99384588003158569 6 | cos inst: 0.99384588003158569 7 | cosf impacted by instrumentation 8 | cos impacted by instrumentation 9 | instrumented cos and cosf are equal 10 | -------------------------------------------------------------------------------- /tests/libmtest_float_conv2.vgtest: -------------------------------------------------------------------------------- 1 | prog: libmtest_float_conv 2 | vgopts: --rounding-mode=upward --libm=instrumented --float=yes 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 4 | -------------------------------------------------------------------------------- /tests/naninf-rnd.stdout.exp: -------------------------------------------------------------------------------- 1 | d = 42 2 | infP = inf 3 | infN = -inf 4 | 5 | d / 0 = inf 6 | -d / 0 = -inf 7 | infP + d = inf 8 | infN + d = -inf 9 | 10 | 0 / 0 = -nan (fff8000000000000) 11 | infP + infN = -nan (fff8000000000000) 12 | infN + infP = -nan (fff8000000000000) 13 | infP - infP = -nan (fff8000000000000) 14 | infN - infN = -nan (fff8000000000000) 15 | 16 | nan1 = nan (7ff800000000dead) 17 | nan2 = nan (7ff800000000babe) 18 | 19 | nan1 + d = nan (7ff800000000dead) 20 | d + nan1 = nan (7ff800000000dead) 21 | nan1 + nan2 = nan (7ff800000000dead) 22 | nan2 + nan1 = nan (7ff800000000babe) 23 | -------------------------------------------------------------------------------- /tests/naninf-rnd.stdout.exp.aarch64: -------------------------------------------------------------------------------- 1 | d = 42 2 | infP = inf 3 | infN = -inf 4 | 5 | d / 0 = inf 6 | -d / 0 = -inf 7 | infP + d = inf 8 | infN + d = -inf 9 | 10 | 0 / 0 = nan (7ff8000000000000) 11 | infP + infN = nan (7ff8000000000000) 12 | infN + infP = nan (7ff8000000000000) 13 | infP - infP = nan (7ff8000000000000) 14 | infN - infN = nan (7ff8000000000000) 15 | 16 | nan1 = nan (7ff800000000dead) 17 | nan2 = nan (7ff800000000babe) 18 | 19 | nan1 + d = nan (7ff800000000dead) 20 | d + nan1 = nan (7ff800000000dead) 21 | nan1 + nan2 = nan (7ff800000000dead) 22 | nan2 + nan1 = nan (7ff800000000babe) 23 | -------------------------------------------------------------------------------- /tests/naninf-rnd.vgtest: -------------------------------------------------------------------------------- 1 | prog: naninf 2 | vgopts: --rounding-mode=random 3 | stderr_filter_args: -seed -cnt-cmp-conv -backend-version -addr-error -copyright -exclude -scal-llo 4 | stdout_filter: filter_stdout 5 | stdout_filter_args: -nan-commut -------------------------------------------------------------------------------- /tests/naninf.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | void printNaN(double n) { 8 | std::uint64_t hex; 9 | std::memcpy(&hex, &n, sizeof n); 10 | std::cout << n 11 | << " (" << std::hex << hex << ")" 12 | << std::endl; 13 | } 14 | 15 | int main() 16 | { double x=cos(42.); if(x!=x) printf ("FAILURE\n");// line to force libm use 17 | double d = 42.; 18 | std::cout << "d = " << d << std::endl; 19 | 20 | double infP = std::numeric_limits::infinity(); 21 | std::cout << "infP = " << infP << std::endl; 22 | 23 | double infN = -std::numeric_limits::infinity(); 24 | std::cout << "infN = " << infN << std::endl; 25 | std::cout << std::endl; 26 | 27 | std::cout << "d / 0 = " << (d / 0.) << std::endl; 28 | std::cout << "-d / 0 = " << (-d / 0.) << std::endl; 29 | std::cout << "infP + d = " << (infP + d) << std::endl; 30 | std::cout << "infN + d = " << (infN + d) << std::endl; 31 | std::cout << std::endl; 32 | 33 | 34 | std::cout << "0 / 0 = "; printNaN (0./0.); 35 | std::cout << "infP + infN = "; printNaN (infP + infN); 36 | std::cout << "infN + infP = "; printNaN (infN + infP); 37 | std::cout << "infP - infP = "; printNaN (infP - infP); 38 | std::cout << "infN - infN = "; printNaN (infN - infN); 39 | std::cout << std::endl; 40 | 41 | double nan1 = std::nan("0xdead"); 42 | std::cout << "nan1 = "; printNaN (nan1); 43 | 44 | double nan2 = std::nan("0xbabe"); 45 | std::cout << "nan2 = "; printNaN (nan2); 46 | std::cout << std::endl; 47 | 48 | std::cout << "nan1 + d = "; printNaN (nan1 + d); 49 | std::cout << "d + nan1 = "; printNaN (d + nan1); 50 | std::cout << "nan1 + nan2 = "; printNaN (nan1 + nan2); 51 | std::cout << "nan2 + nan1 = "; printNaN (nan2 + nan1); 52 | } 53 | -------------------------------------------------------------------------------- /tests/post_diff.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | if [ "$#" -eq 0 ]; then 4 | echo "A directory argument is required" 5 | fi 6 | 7 | cd $1 8 | diffList=$(find . -name "*stdout.diff") 9 | 10 | for diff in $diffList 11 | do 12 | stdout=${diff/stdout.diff/stdout.out} 13 | stderr=${diff/stdout.diff/stderr.out} 14 | 15 | echo $diff 16 | cat $diff 17 | echo "" 18 | echo $stdout 19 | cat $stdout 20 | echo "" 21 | echo $stderr 22 | cat $stderr 23 | 24 | echo "" 25 | done 26 | -------------------------------------------------------------------------------- /tests/post_verrou_diff.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | if [ "$#" -eq 0 ]; then 4 | echo "A directory argument is required" 5 | fi 6 | 7 | cd $1 8 | diffList=$(find . -name "*std*.diff" -o -name "*post.diff") 9 | 10 | testCasList=${diffList//.stdout.diff/} 11 | testCasList=${testCasList//.stderr.diff/} 12 | testCasList=${testCasList//.post.diff/} 13 | testCasList=$(echo $testCasList |uniq) 14 | 15 | echo "testCasList:" 16 | echo $testCasList 17 | echo "" 18 | 19 | for testCas in $testCasList 20 | do 21 | echo "" 22 | echo "TEST CAS: " $testCas 23 | 24 | testCasOutDiff=$testCas".stdout.diff" 25 | 26 | if [ -f $testCasOutDiff ] 27 | then 28 | echo $testCasOutDiff 29 | cat $testCasOutDiff 30 | echo "" 31 | 32 | testCasOut=$testCas".stdout.out" 33 | echo $testCasOut 34 | cat $testCasOut 35 | echo "" 36 | fi 37 | 38 | testCasErrDiff=$testCas".stderr.diff" 39 | if [ -f $testCasErrDiff ] 40 | then 41 | echo $testCasErrDiff 42 | cat $testCasErrDiff 43 | echo "" 44 | 45 | testCasErr=$testCas".stderr.out" 46 | echo $testCasErr 47 | cat $testCasErr 48 | echo "" 49 | fi 50 | 51 | testCasPostDiff=$testCas".post.diff" 52 | if [ -f $testCasPostDiff ] 53 | then 54 | echo $testCasPostDiff 55 | cat $testCasPostDiff 56 | echo "" 57 | 58 | testCasPost=$testCas".post.out" 59 | echo $testCasPost 60 | cat $testCasPost 61 | echo "" 62 | fi 63 | echo "" 64 | done 65 | -------------------------------------------------------------------------------- /tests/seed.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : 42 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating RANDOM rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 100001 100000 (100%) 41 | `- flt 100001 100000 (100%) 42 | `- llo 100001 100000 (100%) 43 | --------------------------------------------------------------------- 44 | mul 1 0 ( 0%) 45 | `- flt 1 0 ( 0%) 46 | `- llo 1 0 ( 0%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/seed.stdout.exp: -------------------------------------------------------------------------------- 1 | 1.0059436560 2 | -------------------------------------------------------------------------------- /tests/seed.vgtest: -------------------------------------------------------------------------------- 1 | prog: sum 2 | args: 0 3 | vgopts: --instr-atstart=no --rounding-mode=random --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/seed_random_det.aarch64.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : 42 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating RANDOM_DET rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 100001 100000 (100%) 41 | `- flt 100001 100000 (100%) 42 | `- llo 100001 100000 (100%) 43 | --------------------------------------------------------------------- 44 | mul 1 0 ( 0%) 45 | `- flt 1 0 ( 0%) 46 | `- llo 1 0 ( 0%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/seed_random_det.aarch64.stdout.exp: -------------------------------------------------------------------------------- 1 | 1.0000002384 2 | -------------------------------------------------------------------------------- /tests/seed_random_det.aarch64.vgtest: -------------------------------------------------------------------------------- 1 | prereq: test `uname -m` = aarch64 2 | prog: sum 3 | args: 0 4 | vgopts: --instr-atstart=no --rounding-mode=random_det --vr-seed=42 5 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 6 | #compare to x86 we change the seed to avoid stagnation (not the same hash function) 7 | #to recover this result with x86 you can comment the line #define USE_XXH3 in the file xxHash.hxx -------------------------------------------------------------------------------- /tests/seed_random_det.x86_64.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : 422 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating RANDOM_DET rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 100001 100000 (100%) 41 | `- flt 100001 100000 (100%) 42 | `- llo 100001 100000 (100%) 43 | --------------------------------------------------------------------- 44 | mul 1 0 ( 0%) 45 | `- flt 1 0 ( 0%) 46 | `- llo 1 0 ( 0%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/seed_random_det.x86_64.stdout.exp: -------------------------------------------------------------------------------- 1 | 1.0000003576 2 | -------------------------------------------------------------------------------- /tests/seed_random_det.x86_64.vgtest: -------------------------------------------------------------------------------- 1 | prereq: test `uname -m` = x86_64 2 | prog: sum 3 | args: 0 4 | vgopts: --instr-atstart=no --rounding-mode=random_det --vr-seed=422 5 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 6 | -------------------------------------------------------------------------------- /tests/sum.c: -------------------------------------------------------------------------------- 1 | #include "../verrou.h" 2 | #include 3 | #include 4 | #include 5 | 6 | int N = 100000; 7 | float epsilon = 1e-9; 8 | 9 | float compute () { 10 | float sum = 1; 11 | int i; 12 | VERROU_START_INSTRUMENTATION; 13 | for (i = 0 ; i < N ; ++i) { 14 | sum += epsilon; 15 | } 16 | VERROU_STOP_INSTRUMENTATION; 17 | 18 | return sum; 19 | } 20 | 21 | int main (int argc, char **argv) { 22 | double x=cos(42.); if(x!=x) printf ("FAILURE\n");// line to force libm use 23 | float res = compute(); 24 | float ref = 1 + N*epsilon; 25 | 26 | if (!strcmp (argv[1], "0")) { 27 | // Just print the result 28 | printf ("%.10f\n", res); 29 | } 30 | else if (!strcmp (argv[1], "1")) { 31 | // sum1.vgtest 32 | // CL switches: 33 | // --instr-atstart=no 34 | // 35 | // res should be 1 36 | if (res == 1) { 37 | printf ("OK\n"); 38 | } else { 39 | printf ("%.10f\n", res); 40 | } 41 | } 42 | else if (!strcmp (argv[1], "2")) { 43 | // sum2.vgtest 44 | // CL switches: 45 | // --instr-atstart=no 46 | // --rounding-mode=random 47 | // 48 | // res should be significantly different from 1, 49 | // since there are floating point errors 50 | float threshold = 20*N*epsilon; 51 | if (fabs(res - 1) > threshold) { 52 | printf ("OK\n"); 53 | } else { 54 | printf ("error: |%.10e| < %.10e\n", res-1, threshold); 55 | } 56 | } 57 | else if (!strcmp (argv[1], "3")) { 58 | // sum3.vgtest 59 | // CL switches: 60 | // --instr-atstart=no 61 | // --rounding-mode=average 62 | // 63 | // res should be close to ref 64 | float threshold = 0.2f * (float)N * epsilon; 65 | if (fabs(res-ref) < threshold) { 66 | printf ("OK\n"); 67 | } else { 68 | printf ("|%.10e| > %.10e \n", res-ref, threshold); 69 | } 70 | } 71 | 72 | return RUNNING_ON_VALGRIND; 73 | } 74 | -------------------------------------------------------------------------------- /tests/sum1.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating NEAREST rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 100001 100000 (100%) 41 | `- flt 100001 100000 (100%) 42 | `- llo 100001 100000 (100%) 43 | --------------------------------------------------------------------- 44 | mul 1 0 ( 0%) 45 | `- flt 1 0 ( 0%) 46 | `- llo 1 0 ( 0%) 47 | --------------------------------------------------------------------- 48 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 49 | -------------------------------------------------------------------------------- /tests/sum1.stdout.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/sum1.vgtest: -------------------------------------------------------------------------------- 1 | prog: sum 2 | args: 1 3 | vgopts: --instr-atstart=no 4 | stderr_filter_args: -seed -backend-version -copyright -exclude -cnt-cmp-conv -scal-llo 5 | -------------------------------------------------------------------------------- /tests/sum2.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating RANDOM rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 100001 100000 (100%) 41 | `- flt 100001 100000 (100%) 42 | `- llo 100001 100000 (100%) 43 | --------------------------------------------------------------------- 44 | sub 1 0 ( 0%) 45 | `- flt 1 0 ( 0%) 46 | `- llo 1 0 ( 0%) 47 | --------------------------------------------------------------------- 48 | mul 2 0 ( 0%) 49 | `- flt 2 0 ( 0%) 50 | `- llo 2 0 ( 0%) 51 | --------------------------------------------------------------------- 52 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 53 | -------------------------------------------------------------------------------- /tests/sum2.stdout.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/sum2.vgtest: -------------------------------------------------------------------------------- 1 | prog: sum 2 | args: 2 3 | vgopts: --instr-atstart=no --rounding-mode=random 4 | stderr_filter_args: -seed -backend-version -copyright -exclude -cnt-cmp-conv -scal-llo 5 | -------------------------------------------------------------------------------- /tests/sum3.stderr.exp: -------------------------------------------------------------------------------- 1 | Verrou, Check floating-point rounding errors 2 | Copyright (C) XXXXX 3 | 4 | First seed : XXX 5 | Backend verrou : test-version 6 | Backend checkcancellation : test-version 7 | Backend check_float_max : test-version 8 | Backend checkdenorm : test-version 9 | Instrumented operations : 10 | add : yes 11 | sub : yes 12 | mul : yes 13 | div : yes 14 | mAdd : yes 15 | mSub : yes 16 | sqrt : yes 17 | cmp : no 18 | conv : yes 19 | max : no 20 | min : no 21 | Instrumented vectorized operations : 22 | scal : no 23 | llo : yes 24 | vec2 : yes 25 | vec4 : yes 26 | vec8 : yes 27 | unk : yes 28 | Instrumented type : 29 | flt : yes 30 | dbl : yes 31 | Backend verrou simulating AVERAGE rounding mode 32 | EXCLUDE DETECTED: XXXXX 33 | Using exclusion rule: * XXXXX 34 | 35 | --------------------------------------------------------------------- 36 | Operation Instruction count 37 | `- Precision 38 | `- Vectorization Total Instrumented 39 | --------------------------------------------------------------------- 40 | add 100001 100000 (100%) 41 | `- flt 100001 100000 (100%) 42 | `- llo 100001 100000 (100%) 43 | --------------------------------------------------------------------- 44 | sub 1 0 ( 0%) 45 | `- flt 1 0 ( 0%) 46 | `- llo 1 0 ( 0%) 47 | --------------------------------------------------------------------- 48 | mul 3 0 ( 0%) 49 | `- flt 3 0 ( 0%) 50 | `- llo 3 0 ( 0%) 51 | --------------------------------------------------------------------- 52 | ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 53 | -------------------------------------------------------------------------------- /tests/sum3.stdout.exp: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/sum3.vgtest: -------------------------------------------------------------------------------- 1 | prog: sum 2 | args: 3 3 | vgopts: --instr-atstart=no --rounding-mode=average 4 | stderr_filter_args: -seed -backend-version -copyright -exclude -cnt-cmp-conv -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_det_average_comdet.stdout.exp: -------------------------------------------------------------------------------- 1 | FLOAT 2 | DET 3 | COMDET 4 | NO SCOMDET 5 | NO MONOTONIC 6 | 7 | DOUBLE 8 | DET 9 | COMDET 10 | NO SCOMDET 11 | NO MONOTONIC 12 | -------------------------------------------------------------------------------- /tests/test_det_average_comdet.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_det 2 | args: 3 | vgopts: --rounding-mode=average_comdet --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_det_average_det.stdout.exp: -------------------------------------------------------------------------------- 1 | FLOAT 2 | DET 3 | NO COMDET 4 | NO SCOMDET 5 | NO MONOTONIC 6 | 7 | DOUBLE 8 | DET 9 | NO COMDET 10 | NO SCOMDET 11 | NO MONOTONIC 12 | -------------------------------------------------------------------------------- /tests/test_det_average_det.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_det 2 | args: 3 | vgopts: --rounding-mode=average_det --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_det_average_scomdet.stdout.exp: -------------------------------------------------------------------------------- 1 | FLOAT 2 | DET 3 | COMDET 4 | NO SCOMDET 5 | NO MONOTONIC 6 | 7 | DOUBLE 8 | DET 9 | COMDET 10 | NO SCOMDET 11 | NO MONOTONIC 12 | -------------------------------------------------------------------------------- /tests/test_det_average_scomdet.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_det 2 | args: 3 | vgopts: --rounding-mode=average_comdet --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_det_random_comdet.stdout.exp: -------------------------------------------------------------------------------- 1 | FLOAT 2 | DET 3 | COMDET 4 | NO SCOMDET 5 | NO MONOTONIC 6 | 7 | DOUBLE 8 | DET 9 | COMDET 10 | NO SCOMDET 11 | NO MONOTONIC 12 | -------------------------------------------------------------------------------- /tests/test_det_random_comdet.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_det 2 | args: 3 | vgopts: --rounding-mode=random_comdet --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_det_random_det.stdout.exp: -------------------------------------------------------------------------------- 1 | FLOAT 2 | DET 3 | NO COMDET 4 | NO SCOMDET 5 | NO MONOTONIC 6 | 7 | DOUBLE 8 | DET 9 | NO COMDET 10 | NO SCOMDET 11 | NO MONOTONIC 12 | -------------------------------------------------------------------------------- /tests/test_det_random_det.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_det 2 | args: 3 | vgopts: --rounding-mode=random_det --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_det_random_scomdet.stdout.exp: -------------------------------------------------------------------------------- 1 | FLOAT 2 | DET 3 | COMDET 4 | SCOMDET 5 | NO MONOTONIC 6 | 7 | DOUBLE 8 | DET 9 | COMDET 10 | SCOMDET 11 | NO MONOTONIC 12 | -------------------------------------------------------------------------------- /tests/test_det_random_scomdet.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_det 2 | args: 3 | vgopts: --rounding-mode=random_scomdet --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_det_sr_monotonic.stdout.exp: -------------------------------------------------------------------------------- 1 | FLOAT 2 | DET 3 | COMDET 4 | NO SCOMDET 5 | MONOTONIC 6 | 7 | DOUBLE 8 | DET 9 | COMDET 10 | NO SCOMDET 11 | MONOTONIC 12 | -------------------------------------------------------------------------------- /tests/test_det_sr_monotonic.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_det 2 | args: 3 | vgopts: --rounding-mode=sr_monotonic --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_det_sr_smonotonic.stdout.exp: -------------------------------------------------------------------------------- 1 | FLOAT 2 | DET 3 | COMDET 4 | SCOMDET 5 | MONOTONIC 6 | 7 | DOUBLE 8 | DET 9 | COMDET 10 | SCOMDET 11 | MONOTONIC 12 | -------------------------------------------------------------------------------- /tests/test_det_sr_smonotonic.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_det 2 | args: 3 | vgopts: --rounding-mode=sr_smonotonic --vr-seed=42 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_libm_random.stdout.exp: -------------------------------------------------------------------------------- 1 | float 2 | cos: max diff=5.9903911164838064e-08 3 | sin: max sum=7.4630122526286868e-08 4 | j0: max diff=5.975393690960118e-08 5 | j1: max sum=7.4599014965315291e-08 6 | pow: max diff=9.291163394209434e-08 7 | atan2: max diff=8.5735635479977645e-08 8 | atan2: max diff (nada)=70.302139282226562 9 | fma: max diff =7.4505805969238281e-09 10 | double 11 | cos: max diff=1.1157973638381061e-16 12 | sin: max sum=1.3900944467230525e-16 13 | j0: max diff=1.1130037955285464e-16 14 | j1: max sum=1.3895149509151393e-16 15 | pow: max diff=1.7306141892541719e-16 16 | atan2: max diff=1.5969507282604147e-16 17 | atan2: max diff (nada)=70.302138431930487 18 | fma: max diff =1.3877787807814457e-17 19 | -------------------------------------------------------------------------------- /tests/test_libm_random.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_libm 2 | args: 3 | vgopts: --rounding-mode=random --libm=instrumented --vr-instr=mAdd,mSub 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -seed -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_libm_random_det.stdout.exp: -------------------------------------------------------------------------------- 1 | float 2 | cos: max diff=5.9903911164838064e-08 3 | sin: max sum=7.4630129631714226e-08 4 | j0: max diff=5.975393690960118e-08 5 | j1: max sum=7.4599022070742649e-08 6 | pow: max diff=0 7 | atan2: max diff=8.5735628374550288e-08 8 | atan2: max diff (nada)=70.302139282226562 9 | fma: max diff =7.4505805969238281e-09 10 | double 11 | cos: max diff=1.1157973638381063e-16 12 | sin: max sum=1.3900944467230522e-16 13 | j0: max diff=1.1130037955285464e-16 14 | j1: max sum=1.3895149509151393e-16 15 | pow: max diff=0 16 | atan2: max diff=1.5969507282604147e-16 17 | atan2: max diff (nada)=70.302138431930487 18 | fma: max diff =1.3877787807814457e-17 19 | -------------------------------------------------------------------------------- /tests/test_libm_random_det.stdout.exp.aarch64: -------------------------------------------------------------------------------- 1 | float 2 | cos: max diff=5.9903918270265422e-08 3 | sin: max sum=7.4630129631714226e-08 4 | j0: max diff=5.975393690960118e-08 5 | j1: max sum=7.4599014965315291e-08 6 | pow: max diff=0 7 | atan2: max diff=8.5735635479977645e-08 8 | atan2: max diff (nada)=70.302139282226562 9 | fma: max diff =7.4505805969238281e-09 10 | double 11 | cos: max diff=1.1157973638381063e-16 12 | sin: max sum=1.3900944467230525e-16 13 | j0: max diff=1.1130037955285464e-16 14 | j1: max sum=1.389514950915139e-16 15 | pow: max diff=0 16 | atan2: max diff=1.5969507282604147e-16 17 | atan2: max diff (nada)=70.302138431930487 18 | fma: max diff =1.3877787807814457e-17 19 | -------------------------------------------------------------------------------- /tests/test_libm_random_det.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_libm 2 | args: 3 | vgopts: --rounding-mode=random_det --libm=instrumented --vr-instr=mAdd,mSub 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -seed -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_libm_random_scomdet.stdout.exp: -------------------------------------------------------------------------------- 1 | float 2 | cos: max diff=0 3 | sin: max sum=0 4 | j0: max diff=0 5 | j1: max sum=0 6 | pow: max diff=0 7 | atan2: max diff=0 8 | atan2: max diff (nada)=70.302139282226562 9 | fma: max diff =0 10 | double 11 | cos: max diff=0 12 | sin: max sum=0 13 | j0: max diff=0 14 | j1: max sum=0 15 | pow: max diff=0 16 | atan2: max diff=0 17 | atan2: max diff (nada)=70.302138431930487 18 | fma: max diff =0 19 | -------------------------------------------------------------------------------- /tests/test_libm_random_scomdet.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_libm 2 | args: 3 | vgopts: --rounding-mode=random_scomdet --libm=instrumented --vr-instr=mAdd,mSub 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -seed -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_unfusedfma1.stdout.exp: -------------------------------------------------------------------------------- 1 | fused!=unfused 2 | fused_f!=unfused_f 3 | fused!=fused_f 4 | unfused!=unfused_f 5 | 6 | non inst 7 | fused!=unfused 8 | fused_f!=unfused_f 9 | fused!=fused_f 10 | unfused!=unfused_f 11 | 12 | non inst 13 | fused!=unfused 14 | fused_f!=unfused_f 15 | fused!=fused_f 16 | unfused!=unfused_f 17 | 18 | inst 19 | fused==unfused 20 | fused_f==unfused_f 21 | fused!=fused_f 22 | unfused!=unfused_f 23 | 24 | non inst 25 | fused!=unfused 26 | fused_f!=unfused_f 27 | fused!=fused_f 28 | unfused!=unfused_f 29 | 30 | inst 31 | fused==unfused 32 | fused_f==unfused_f 33 | fused!=fused_f 34 | unfused!=unfused_f 35 | 36 | non inst 37 | fused!=unfused 38 | fused_f!=unfused_f 39 | fused!=fused_f 40 | unfused!=unfused_f 41 | 42 | non inst 43 | fused!=unfused 44 | fused_f!=unfused_f 45 | fused!=fused_f 46 | unfused!=unfused_f 47 | 48 | non inst 49 | fused!=unfused 50 | fused_f!=unfused_f 51 | fused!=fused_f 52 | unfused!=unfused_f 53 | 54 | inst 55 | fused==unfused 56 | fused_f==unfused_f 57 | fused!=fused_f 58 | unfused!=unfused_f 59 | 60 | inst 61 | fused==unfused 62 | fused_f==unfused_f 63 | fused!=fused_f 64 | unfused!=unfused_f 65 | 66 | -------------------------------------------------------------------------------- /tests/test_unfusedfma1.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_unfusedfma 2 | args: 3 | vgopts: --instr-atstart=no --unfused=yes 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -seed -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_unfusedfma2.stdout.exp: -------------------------------------------------------------------------------- 1 | fused!=unfused 2 | fused_f!=unfused_f 3 | fused!=fused_f 4 | unfused!=unfused_f 5 | 6 | non inst 7 | fused!=unfused 8 | fused_f!=unfused_f 9 | fused!=fused_f 10 | unfused!=unfused_f 11 | 12 | non inst 13 | fused!=unfused 14 | fused_f!=unfused_f 15 | fused!=fused_f 16 | unfused!=unfused_f 17 | 18 | inst 19 | fused==unfused 20 | fused_f==unfused_f 21 | fused==fused_f 22 | unfused==unfused_f 23 | 24 | non inst 25 | fused!=unfused 26 | fused_f!=unfused_f 27 | fused!=fused_f 28 | unfused!=unfused_f 29 | 30 | inst 31 | fused==unfused 32 | fused_f==unfused_f 33 | fused==fused_f 34 | unfused==unfused_f 35 | 36 | non inst 37 | fused!=unfused 38 | fused_f!=unfused_f 39 | fused!=fused_f 40 | unfused!=unfused_f 41 | 42 | non inst 43 | fused!=unfused 44 | fused_f!=unfused_f 45 | fused!=fused_f 46 | unfused!=unfused_f 47 | 48 | non inst 49 | fused!=unfused 50 | fused_f!=unfused_f 51 | fused!=fused_f 52 | unfused!=unfused_f 53 | 54 | inst 55 | fused==unfused 56 | fused_f==unfused_f 57 | fused==fused_f 58 | unfused==unfused_f 59 | 60 | inst 61 | fused==unfused 62 | fused_f==unfused_f 63 | fused==fused_f 64 | unfused==unfused_f 65 | 66 | -------------------------------------------------------------------------------- /tests/test_unfusedfma2.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_unfusedfma 2 | args: 3 | vgopts: --instr-atstart-soft=no --unfused=yes --float=yes 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -seed -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_unfusedfma3.stdout.exp: -------------------------------------------------------------------------------- 1 | fused!=unfused 2 | fused_f!=unfused_f 3 | fused==fused_f 4 | unfused==unfused_f 5 | 6 | non inst 7 | fused!=unfused 8 | fused_f!=unfused_f 9 | fused!=fused_f 10 | unfused!=unfused_f 11 | 12 | non inst 13 | fused!=unfused 14 | fused_f!=unfused_f 15 | fused!=fused_f 16 | unfused!=unfused_f 17 | 18 | inst 19 | fused!=unfused 20 | fused_f!=unfused_f 21 | fused==fused_f 22 | unfused==unfused_f 23 | 24 | non inst 25 | fused!=unfused 26 | fused_f!=unfused_f 27 | fused!=fused_f 28 | unfused!=unfused_f 29 | 30 | inst 31 | fused!=unfused 32 | fused_f!=unfused_f 33 | fused==fused_f 34 | unfused==unfused_f 35 | 36 | non inst 37 | fused!=unfused 38 | fused_f!=unfused_f 39 | fused!=fused_f 40 | unfused!=unfused_f 41 | 42 | non inst 43 | fused!=unfused 44 | fused_f!=unfused_f 45 | fused!=fused_f 46 | unfused!=unfused_f 47 | 48 | non inst 49 | fused!=unfused 50 | fused_f!=unfused_f 51 | fused!=fused_f 52 | unfused!=unfused_f 53 | 54 | inst 55 | fused!=unfused 56 | fused_f!=unfused_f 57 | fused==fused_f 58 | unfused==unfused_f 59 | 60 | inst 61 | fused!=unfused 62 | fused_f!=unfused_f 63 | fused==fused_f 64 | unfused==unfused_f 65 | 66 | -------------------------------------------------------------------------------- /tests/test_unfusedfma3.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_unfusedfma 2 | args: 3 | vgopts: --float=yes 4 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -seed -scal-llo 5 | -------------------------------------------------------------------------------- /tests/test_unfusedfma4.stdout.exp: -------------------------------------------------------------------------------- 1 | fused==unfused 2 | fused_f==unfused_f 3 | fused==fused_f 4 | unfused==unfused_f 5 | 6 | non inst 7 | fused!=unfused 8 | fused_f!=unfused_f 9 | fused!=fused_f 10 | unfused!=unfused_f 11 | 12 | non inst 13 | fused!=unfused 14 | fused_f!=unfused_f 15 | fused!=fused_f 16 | unfused!=unfused_f 17 | 18 | inst 19 | fused==unfused 20 | fused_f==unfused_f 21 | fused==fused_f 22 | unfused==unfused_f 23 | 24 | non inst 25 | fused!=unfused 26 | fused_f!=unfused_f 27 | fused!=fused_f 28 | unfused!=unfused_f 29 | 30 | inst 31 | fused==unfused 32 | fused_f==unfused_f 33 | fused==fused_f 34 | unfused==unfused_f 35 | 36 | non inst 37 | fused!=unfused 38 | fused_f!=unfused_f 39 | fused!=fused_f 40 | unfused!=unfused_f 41 | 42 | non inst 43 | fused!=unfused 44 | fused_f!=unfused_f 45 | fused!=fused_f 46 | unfused!=unfused_f 47 | 48 | non inst 49 | fused!=unfused 50 | fused_f!=unfused_f 51 | fused!=fused_f 52 | unfused!=unfused_f 53 | 54 | inst 55 | fused==unfused 56 | fused_f==unfused_f 57 | fused==fused_f 58 | unfused==unfused_f 59 | 60 | inst 61 | fused==unfused 62 | fused_f==unfused_f 63 | fused==fused_f 64 | unfused==unfused_f 65 | 66 | -------------------------------------------------------------------------------- /tests/test_unfusedfma4.vgtest: -------------------------------------------------------------------------------- 1 | prog: test_unfusedfma 2 | args: 3 | vgopts: --float=yes --unfused=yes --rounding-mode=random_det --vr-seed=42 --vr-instr=add,sub,mul,mAdd,mSub,sqrt,div 4 | #vr-instr is there to avoid randomness in cast used to defined a_f 5 | stderr_filter_args: -cnt-cmp-conv -backend-version -copyright -exclude -seed -scal-llo 6 | -------------------------------------------------------------------------------- /travis.mk: -------------------------------------------------------------------------------- 1 | SHELL = /bin/bash 2 | 3 | download-valgrind: 4 | cd .. && git clone --branch=$(VALGRIND_VERSION) --single-branch git://sourceware.org/git/valgrind.git valgrind+verrou >/dev/null 5 | 6 | patch-valgrind: 7 | cd ../valgrind+verrou && cp -a $(PWD) verrou 8 | cd ../valgrind+verrou && cat verrou/valgrind.*diff | patch -p1 9 | 10 | patch-error: 11 | cd ../valgrind+verrou && find . -name '*.rej' | xargs tail -n+1 12 | # try to build verrou anyway if we check the development version of Valgrind 13 | test "$(VALGRIND_VERSION)" = "master" 14 | 15 | configure: 16 | @echo "*** AUTOGEN ***" 17 | cd ../valgrind+verrou && ./autogen.sh 18 | 19 | @echo "*** CONFIGURE ***" 20 | cd ../valgrind+verrou && ./configure --enable-only64bit --prefix=$${PWD}/../install 21 | 22 | build: 23 | @echo "*** MAKE ***" 24 | cd ../valgrind+verrou && make 25 | 26 | @echo "*** MAKE INSTALL ***" 27 | cd ../valgrind+verrou && make install 28 | 29 | check-install: 30 | @echo "*** CHECK VERSION ***" 31 | source ../install/env.sh && valgrind --version 32 | 33 | @echo "*** CHECK HELP ***" 34 | source ../install/env.sh && valgrind --tool=verrou --help 35 | 36 | check: 37 | @echo "*** BUILD TESTS ***" 38 | make -C ../valgrind+verrou/verrou/unitTest/ valgrind-test 39 | 40 | check-error: 41 | ../valgrind+verrou/verrou/tests/post_diff.sh ../valgrind+verrou/none/tests/ 42 | ../valgrind+verrou/verrou/tests/post_diff.sh ../valgrind+verrou/callgrind/tests/ 43 | ../valgrind+verrou/verrou/tests/post_verrou_diff.sh ../valgrind+verrou/verrou/tests/ 44 | @false 45 | 46 | unit-test: 47 | @echo "*** VERROU UNIT TESTS ***" 48 | cd ../valgrind+verrou/verrou/unitTest && make 49 | 50 | valgrind-test: 51 | @echo "*** VALGRIND UNIT TESTS ***" 52 | cd ../valgrind+verrou/verrou/unitTest && make valgrind-test 53 | 54 | post-regtest-checks: 55 | @echo "*** POST_REGTEST_CHECKS ***" 56 | cd ../valgrind+verrou/ && make post-regtest-checks 57 | 58 | gitignore-checks: 59 | @echo "*** GITIGNORE_CHECKS ***" 60 | cd ../valgrind+verrou/verrou && git status --porcelain | grep '^??' | cut -c4- |tee /tmp/tracked_file.tmp 61 | cat /tmp/tracked_file.tmp | wc -l |xargs test 0 -eq 62 | -------------------------------------------------------------------------------- /unbufferPrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void __attribute__((constructor)) init_unbufferPrintf(void); 4 | void __attribute__((constructor)) init_unbufferPrintf(void){ 5 | setbuf(stdout,NULL); 6 | }; 7 | 8 | void __attribute__((destructor)) finalyze_unbufferPrintf(void); 9 | void __attribute__((destructor)) finalyze_unbufferPrintf(void){ 10 | }; 11 | -------------------------------------------------------------------------------- /unitTest/check-libM/.gitignore: -------------------------------------------------------------------------------- 1 | bin.ex 2 | reference.dat 3 | resNative.dat 4 | resRandominterlibm.dat 5 | resRandomverrou+interlibm.dat 6 | resRandomverrou.dat 7 | tabAster.tex 8 | testAster 9 | testReg -------------------------------------------------------------------------------- /unitTest/check-libM/hist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FILE=$1 4 | NUM=$2 5 | 6 | index=$(cat $FILE | cut -f $NUM |head -n 1) 7 | echo $index 8 | 9 | values=$(cat $FILE | cut -f $NUM | sort -u |grep -v $index) 10 | allvalues=$(cat $FILE | cut -f $NUM | grep -v $index) 11 | 12 | 13 | for value in $values ; 14 | do 15 | count=$(cat $FILE | cut -f $NUM | grep -v $index |grep $value |wc -l) 16 | echo $value , $count 17 | done; 18 | 19 | 20 | -------------------------------------------------------------------------------- /unitTest/check-libM/latex/article.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{booktabs} 3 | \begin{document} 4 | 5 | \input{../tabAster.tex} 6 | \end{document} 7 | -------------------------------------------------------------------------------- /unitTest/check-libM/testRegRef: -------------------------------------------------------------------------------- 1 | Randominterlibm 2 | AfterCorrection_Double 52.463495428908004 3 | AfterCorrection_Float 23.475670480078016 4 | BeforeCorrection_Double 14.121371625961734 5 | BeforeCorrection_Float 13.109299288388522 6 | Randomverrou 7 | AfterCorrection_Double 51.463495428908004 8 | AfterCorrection_Float 22.475670480078016 9 | BeforeCorrection_Double 52.46350992680084 10 | BeforeCorrection_Float 23.47562150263434 11 | Randomverrou+interlibm 12 | AfterCorrection_Double 50.87853292818685 13 | AfterCorrection_Float 22.475670480078016 14 | BeforeCorrection_Double 14.121371625957593 15 | BeforeCorrection_Float 13.108206751387511 16 | -------------------------------------------------------------------------------- /unitTest/check-verrou-dd-task/.gitignore: -------------------------------------------------------------------------------- 1 | dd.task 2 | mainTime 3 | resDDtask -------------------------------------------------------------------------------- /unitTest/check-verrou-dd-task/Makefile: -------------------------------------------------------------------------------- 1 | 2 | export INSTALLPATH = $(shell bash ../installpath) 3 | export BASH_ENV=$(INSTALLPATH)/env.sh 4 | export SHELL=bash 5 | 6 | FLAGS=-O0 -g -Wall -std=c++11 -DUSE_VERROU_TASK 7 | VERROU_TASK_SO=-lverrouTask 8 | CPP=g++ 9 | 10 | .PHONY:run 11 | 12 | all:check 13 | mainTime: mainTime.o 14 | g++ $^ $(VERROU_TASK_SO) -o $@ 15 | 16 | 17 | %.o : %.cxx 18 | $(CPP) $(FLAGS) -c $< -o $@ 19 | 20 | 21 | run: mainTime run.sh cmp.py 22 | $(INSTALLPATH)/bin/verrou_dd_task run.sh cmp.py 23 | 24 | 25 | clean: 26 | rm -rf dd.task mainTime.o mainTime resDDtask 27 | 28 | check: run 29 | cat dd.task/ddmin*/dd.task.include > resDDtask 30 | diff refNonReg resDDtask 31 | -------------------------------------------------------------------------------- /unitTest/check-verrou-dd-task/cmp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | import os 4 | 5 | def extract(rep): 6 | fileName=os.path.join(rep,"res.out") 7 | value=float(open(fileName).readline().split(":")[1]) 8 | return value 9 | 10 | def cmpRep(repRef,rep): 11 | valueRef=extract(repRef) 12 | value=extract(rep) 13 | print("valueRef: ",valueRef) 14 | print("value: ",value) 15 | 16 | return abs(value -valueRef) < 0.05*abs(valueRef) 17 | 18 | 19 | 20 | if __name__=="__main__": 21 | 22 | if len(sys.argv)==3: 23 | ok=cmpRep(sys.argv[1],sys.argv[2]) 24 | if ok: 25 | sys.exit(0) 26 | else: 27 | sys.exit(1) 28 | 29 | if len(sys.argv)==2: 30 | print(extract(sys.argv[1])) 31 | sys.exit(0) 32 | print("Use one or two args") 33 | sys.exit(1) 34 | -------------------------------------------------------------------------------- /unitTest/check-verrou-dd-task/mainTime.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef USE_VERROU_TASK 4 | #include "valgrind/libverrouTask.h" 5 | #else 6 | #define VERROU_TASK_INIT 7 | #define VERROU_TASK(a,b) 8 | #define VERROU_TASK_FINALIZE 9 | #endif 10 | 11 | 12 | 13 | 14 | 15 | //exemple suite de muller 16 | int main(int argc, char** argv){ 17 | VERROU_TASK_INIT; 18 | 19 | int nt=12; 20 | 21 | VERROU_TASK("Init", 0); 22 | double x0 = 11./2.; 23 | double x1 = 61./11.; 24 | 25 | 26 | for(int it =0; it $1/res.out 5 | 6 | -------------------------------------------------------------------------------- /unitTest/checkRounding/.gitignore: -------------------------------------------------------------------------------- 1 | checkRounding 2 | checkRoundingNative -------------------------------------------------------------------------------- /unitTest/checkRounding/extract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | cat $1/out.std | grep "testFma" |cut -f 4 | cut -d " " -f 2 5 | -------------------------------------------------------------------------------- /unitTest/checkRounding/makefile: -------------------------------------------------------------------------------- 1 | SOURCE=checkRounding.cxx 2 | EXEC1=checkRounding 3 | EXEC2=checkRoundingNative 4 | 5 | export INSTALLPATH = $(shell bash ../installpath) 6 | FLAGS += -I$(INSTALLPATH)/include/valgrind 7 | FLAGS += -Wall -Wno-unused 8 | 9 | FLAGS += -O1 #required to get hardware sqrt with builtin_sqrt 10 | 11 | FMA_FLAG= 12 | HAS_FMA = $(shell grep VERROU_COMPILED_WITH_FMA= $(INSTALLPATH)/env.sh) 13 | ifeq ($(HAS_FMA), export VERROU_COMPILED_WITH_FMA=yes) 14 | FMA_FLAG=-DTEST_FMA -DTEST_AVX 15 | endif 16 | ifeq ($(HAS_FMA), export VERROU_COMPILED_WITH_FMA=no) 17 | FMA_FLAG=-DTEST_NOFMA 18 | endif 19 | 20 | include ../flag.mk 21 | 22 | FLAGS1 = $(FLAGS) $(DEBUGFLAGS) -DTEST_SSE 23 | FLAGS2 = $(FLAGS) $(NATIVEFLAGS) -DTEST_SSE $(FMA_FLAG) 24 | 25 | .PHONY: run run1 run2 26 | 27 | 28 | run: run1 run2 29 | run1: $(EXEC1) 30 | python3 runCheck.py $(EXEC1) 31 | 32 | run2: $(EXEC2) 33 | python3 runCheck.py $(EXEC2) 34 | 35 | 36 | $(EXEC1): $(SOURCE) 37 | $(CXX) $(FLAGS1) -o $(EXEC1) $(SOURCE) 38 | 39 | $(EXEC2): $(SOURCE) 40 | $(CXX) $(FLAGS2) -o $(EXEC2) $(SOURCE) 41 | 42 | clean: 43 | rm $(EXEC1) $(EXEC2) 44 | -------------------------------------------------------------------------------- /unitTest/checkRounding/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | valgrind --tool=verrou ./checkRoundingNative valgrind > $1/out.std 4 | -------------------------------------------------------------------------------- /unitTest/checkStatRounding/.gitignore: -------------------------------------------------------------------------------- 1 | verrou.stat 2 | verrou.stat.2 3 | verrou.stat.3 4 | verrou.stat.4 5 | res3 6 | res4 7 | floatSeq.png 8 | checkStatRounding -------------------------------------------------------------------------------- /unitTest/checkStatRounding/extract.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import os 4 | import sys 5 | 6 | defaultType="double" 7 | defaultAlgo="Seq" 8 | 9 | def extract(fileName,typeFloat, algo): 10 | if not typeFloat in ["double","float"]: 11 | print("invalid ALGO_TYPE") 12 | sys.exit(42) 13 | if not algo in ["Seq","Rec","SeqRatio","RecRatio"]: 14 | print("invalid ALGO") 15 | sys.exit(42) 16 | 17 | for line in open(fileName): 18 | if line.startswith("<%s>"%(typeFloat)): 19 | resLine=line.split("\t")[1:] 20 | for algoRes in resLine: 21 | algoStr, res= algoRes.split(":") 22 | if algoStr=="res"+algo: 23 | return res.strip() 24 | print("invalid file :", fileName) 25 | return None 26 | 27 | if __name__=="__main__": 28 | if "ALGO_TYPE" in os.environ: 29 | algo_type=os.environ["ALGO_TYPE"] 30 | else: 31 | algo_type=defaultType 32 | if "ALGO" in os.environ: 33 | algo=os.environ["ALGO"] 34 | else: 35 | algo=defaultAlgo 36 | if len(sys.argv)==2: 37 | print(extract(sys.argv[1]+"/res.out", algo_type, algo)) 38 | else: 39 | v1=float(extract(sys.argv[1]+"/res.out", algo_type, algo)) 40 | v2=float(extract(sys.argv[2]+"/res.out", algo_type, algo)) 41 | 42 | if abs(v2 - v1)/abs(v1) < 1e-17: 43 | sys.exit(0) 44 | else: 45 | sys.exit(42) 46 | -------------------------------------------------------------------------------- /unitTest/checkStatRounding/makefile: -------------------------------------------------------------------------------- 1 | 2 | SOURCE=checkStatRounding.cxx 3 | EXEC=checkStatRounding 4 | 5 | export INSTALLPATH = $(shell bash ../installpath) 6 | export BASH_ENV=$(INSTALLPATH)/env.sh 7 | export SHELL=bash 8 | 9 | #FLAGS += -I$(INSTALLPATH)/include/valgrind 10 | FLAGS += -Wall -Wno-unused -O2 -g 11 | 12 | FMA_FLAG= 13 | HAS_FMA = $(shell grep VERROU_COMPILED_WITH_FMA= $(INSTALLPATH)/env.sh) 14 | ifeq ($(HAS_FMA), export VERROU_COMPILED_WITH_FMA=yes) 15 | FMA_FLAG=-DTEST_FMA 16 | endif 17 | ifeq ($(HAS_FMA), export VERROU_COMPILED_WITH_FMA=no) 18 | FMA_FLAG=-DTEST_NOFMA 19 | endif 20 | 21 | include ../flag.mk 22 | 23 | FLAGS1 = $(FLAGS) $(DEBUGFLAGS) 24 | 25 | 26 | .PHONY: run cleanStat 27 | 28 | 29 | test:$(EXEC) cleanStat run.sh extract.py 30 | ALGO_TYPE=float ALGO=Seq verrou_plot_stat --sample=2 --num-threads=2 --rounding=det,random,random_det,average,average_det --ref=upward --relative=104857.6 --png=floatSeq.png run.sh extract.py 31 | ALGO_TYPE=double ALGO=Seq verrou_plot_stat --rep=verrou.stat.2 --sample=2 --rounding=random --no-plot run.sh extract.py 32 | ALGO_TYPE=double ALGO=Seq verrou_plot_stat --rep=verrou.stat.3 --seed=42 --sample=2 --rounding=random --no-plot run.sh extract.py |grep -v verrou.stat.3 > res3 33 | ALGO_TYPE=double ALGO=Seq verrou_plot_stat --rep=verrou.stat.4 --seed=42 --sample=2 --rounding=random --no-plot run.sh extract.py |grep -v verrou.stat.4 > res4 34 | diff res3 res4 35 | 36 | $(EXEC): $(SOURCE) 37 | $(CXX) $(FLAGS1) -o $(EXEC) $(SOURCE) 38 | 39 | 40 | clean: cleanStat 41 | rm -rf $(EXEC) 42 | 43 | cleanStat: 44 | rm -rf verrou.stat verrou.stat.2 verrou.stat.3 verrou.stat.4 45 | -------------------------------------------------------------------------------- /unitTest/checkStatRounding/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEC_PATH=$(dirname $0) 4 | 5 | valgrind --tool=verrou --vr-verbose=no --rounding-mode=random ${EXEC_PATH}/checkStatRounding > $1/res.out 6 | -------------------------------------------------------------------------------- /unitTest/checkUCB-vecto/.gitignore: -------------------------------------------------------------------------------- 1 | testFloat -------------------------------------------------------------------------------- /unitTest/checkUCB-vecto/Makefile: -------------------------------------------------------------------------------- 1 | export INSTALLPATH = $(shell bash ../installpath) 2 | export VALGRIND=$(INSTALLPATH)/bin/valgrind --tool=verrou --check-nan=no --check-inf=no 3 | 4 | include ../flag.mk 5 | 6 | 7 | FLAGS=-Wall -O0 -g $(NATIVEFLAGS) -fabi-version=0 -std=c++11 #-mavx 8 | 9 | SOURCE=testFloat.cxx 10 | EXEC=./testFloat 11 | 12 | .PHONY: clean run runValgrind runFenv 13 | 14 | run: runFenv runValgrind 15 | 16 | $(EXEC): $(SOURCE) Makefile 17 | $(CXX) $(FLAGS) $(LDFLAGS) $(SOURCE) -o $(EXEC) 18 | 19 | 20 | runFenv:$(EXEC) 21 | $(EXEC) fenv --rounding-mode=nearest 22 | $(EXEC) fenv --rounding-mode=upward 23 | $(EXEC) fenv --rounding-mode=downward 24 | $(EXEC) fenv --rounding-mode=toward_zero 25 | 26 | runValgrind:$(EXEC) 27 | $(VALGRIND) --rounding-mode=nearest $(EXEC) valgrind --rounding-mode=nearest 28 | $(VALGRIND) --rounding-mode=upward $(EXEC) valgrind --rounding-mode=upward 29 | $(VALGRIND) --rounding-mode=downward $(EXEC) valgrind --rounding-mode=downward 30 | $(VALGRIND) --rounding-mode=toward_zero $(EXEC) valgrind --rounding-mode=toward_zero 31 | 32 | clean: 33 | rm $(EXEC) 34 | -------------------------------------------------------------------------------- /unitTest/checkUCB-vecto/README: -------------------------------------------------------------------------------- 1 | 2 | The input data come from ucb : http://www.netlib.org/fp/ucbtest.tgz 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitTest/ddCover/.gitignore: -------------------------------------------------------------------------------- 1 | matchLast.script.log-* 2 | dd.line* 3 | unitTest 4 | -------------------------------------------------------------------------------- /unitTest/ddCover/Makefile: -------------------------------------------------------------------------------- 1 | 2 | export INSTALLPATH = $(shell bash ../installpath) 3 | export BASH_ENV=$(INSTALLPATH)/env.sh 4 | export SHELL=bash 5 | 6 | 7 | 8 | .PHONY: 9 | 10 | FLAGS=-Wall -g -O2 11 | 12 | 13 | all: dd.line.post.assert dd.line.postmatch.assert 14 | 15 | unitTest: unitTest.cxx integrate.hxx 16 | g++ $(FLAGS) -o $@ $< 17 | 18 | 19 | dd.line: unitTest ddRun.sh ddCmp.py 20 | verrou_dd_line --nruns=8 --num-threads=4 --seed=42 --res-with-all-samples ./ddRun.sh ./ddCmp.py 21 | touch dd.line #to ensure dependency 22 | 23 | dd.line.post: dd.line 24 | cp -r dd.line dd.line.post 25 | post_verrou_dd --rep=dd.line.post --trace-bin --seed=42 --nrun=3 --rounding=average,nearest --count-denorm ./ddRun.sh ./ddCmp.py 26 | 27 | dd.line.post.assert: dd.line.post 28 | ./assertCover.py dd.line.post 2 8 3 0 average 29 | 30 | dd.line.postmatch: dd.line 31 | cp -r dd.line dd.line.postmatch 32 | post_verrou_dd --nruns=4 --num-thread=4 --rep=dd.line.postmatch --trace-bin --seed=42 ./ddRunMatch.sh ./ddCmp.py 33 | 34 | dd.line.postmatch.assert: dd.line.postmatch 35 | ./assertCover.py dd.line.postmatch 2 8 4 2 default 36 | 37 | 38 | clean: 39 | rm -rf unitTest dd.line dd.line.post dd.line.postmatch matchLast.script.log-* *~ 40 | -------------------------------------------------------------------------------- /unitTest/ddCover/ddCmp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | import os.path 4 | import re 5 | 6 | def extract(rep): 7 | lines=(open(os.path.join(rep, "res.dat"))).readlines() 8 | return re.split(" ",lines[-1].strip())[1] 9 | 10 | if __name__=="__main__": 11 | if len(sys.argv)==2: #extract for verrou_plot_stat 12 | print(extract(sys.argv[1])) 13 | if len(sys.argv)==3: #cmp for verrou_dd_* 14 | refValue=float(extract(sys.argv[1])) 15 | value=float(extract(sys.argv[2])) 16 | relDist= abs((value -refValue)/refValue) 17 | if relDist < 1e-6: sys.exit(0) 18 | else:sys.exit(1) 19 | -------------------------------------------------------------------------------- /unitTest/ddCover/ddRun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | OUTDIR=$1 3 | 4 | #workaround to deactivate instrumented libm option when VERROU_COUNT_DENORM is active 5 | #if [[ -z "${VERROU_COUNT_DENORM}" ]]; then 6 | LIBMOPTION=instrumented 7 | #else 8 | # LIBMOPTION=manual_exclude 9 | #fi 10 | 11 | valgrind --tool=verrou --rounding-mode=random --libm=$LIBMOPTION\ 12 | ./unitTest >${OUTDIR}/res.dat 13 | -------------------------------------------------------------------------------- /unitTest/ddCover/ddRunMatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | OUTDIR=$1 3 | valgrind --tool=verrou --rounding-mode=random --libm=instrumented --IOmatch-clr=matchLast.script\ 4 | ./unitTest >${OUTDIR}/res.dat 5 | -------------------------------------------------------------------------------- /unitTest/ddCover/integrate.hxx: -------------------------------------------------------------------------------- 1 | 2 | /** calculating the integral of a function between two bounds using the rectangles method. 3 | @param f the function 4 | @param x0 left bound 5 | @param x1 right bound 6 | @param n number of rectangles 7 | */ 8 | template 9 | REALTYPE integrate (const T& f, REALTYPE a, REALTYPE b, unsigned int n) { 10 | // Integration step 11 | const REALTYPE dx = (b - a) / n; 12 | // Naive integration Loop 13 | REALTYPE sum = 0.; 14 | for (REALTYPE x = a + (REALTYPE)0.5 * dx ; 15 | x < b ; 16 | x += dx) { 17 | sum += dx * f(x); 18 | } 19 | return sum; 20 | } 21 | -------------------------------------------------------------------------------- /unitTest/ddCover/matchLast.script: -------------------------------------------------------------------------------- 1 | cmatch: 10000 * * 2 | apply: dump_cover 3 | cmatch: 1000 * * 4 | apply: dump_cover -------------------------------------------------------------------------------- /unitTest/ddCover/unitTest.cxx: -------------------------------------------------------------------------------- 1 | #include "integrate.hxx" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | typedef float RealType; 9 | 10 | /** 11 | Tests the convergence of the integral calculation with the number of rectangles. 12 | 13 | The test case is the calculation of the integral of cos between 0 and pi/2, 14 | whose exact value is 1. 15 | 16 | The same calculation is performed for an increasing (~geometric) sequence of 17 | number of rectangles. Each calculation result is displayed as output. 18 | 19 | @param step factor between two numbers of rectangles tested 20 | */ 21 | 22 | void testConvergence (const RealType & step) { 23 | std::cout << std::scientific << std::setprecision(17); 24 | const unsigned int maxN= 10000;//0; 25 | for (unsigned int n = 1 ; n <= maxN ; 26 | n = std::max (std::min(maxN, (unsigned int)(step*n)), n+1)) { 27 | 28 | RealType res = integrate ((RealType(*)(RealType)) std::cos, 29 | (RealType)0, (RealType)M_PI_2, n); 30 | 31 | RealType err = std::abs(1 - res); 32 | 33 | // 3 columns output: Nrectangles Result Error 34 | std::cout << std::setw(10) << n << " " << res << " " << err << std::endl; 35 | } 36 | } 37 | 38 | 39 | 40 | /** Tools: from string convertion 41 | @param str string input 42 | @param TO type of data to read 43 | */ 44 | template 45 | TO strTo (const std::string & str) { 46 | std::istringstream iss(str); 47 | TO x; 48 | iss >> x; 49 | return x; 50 | } 51 | 52 | 53 | /* 54 | Main function: the step factor of the number of rectangles 55 | tested is read as the first argument on the command line. 56 | The default value is 10 if no argument is supplied. 57 | */ 58 | int main (int argc, char **argv) { 59 | RealType step = 10; 60 | if (argc > 1) 61 | step = strTo (argv[1]); 62 | 63 | testConvergence (step); 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /unitTest/ddLibm/.gitignore: -------------------------------------------------------------------------------- 1 | main_libm 2 | dd.sym.random 3 | dd.sym.nearest 4 | dd.sym.native 5 | dd.line.random 6 | dd.line.nearest 7 | dd.line.native 8 | -------------------------------------------------------------------------------- /unitTest/ddLibm/Makefile: -------------------------------------------------------------------------------- 1 | export INSTALLPATH = $(shell bash ../installpath) 2 | export BASH_ENV=$(INSTALLPATH)/env.sh 3 | export SHELL=bash 4 | 5 | 6 | PYTHON=/usr/bin/python3 7 | 8 | REP_LIST=dd.sym.random dd.sym.nearest dd.sym.native dd.line.random dd.line.nearest dd.line.native 9 | 10 | NBRUN=10 11 | 12 | .PHONY: $(REP_LIST) 13 | all: $(REP_LIST) 14 | 15 | LIST_UNSTABLE=cos sinf erf atan2 jn 16 | LIST_NATIVE_UNSTABLE=erf jn 17 | LIST_NEAREST_UNSTABLE=erf jn 18 | 19 | main_libm: main_libm.cpp 20 | g++ -O2 -g -fno-builtin main_libm.cpp -o main_libm 21 | 22 | dd.sym.random: ./main_libm 23 | verrou_dd_sym --cache=clean --rep=$@ --num-threads=5 --nruns=$(NBRUN) --seed=42 ddRun.sh cmp.sh 24 | ./assert.py $@ ${LIST_UNSTABLE} 25 | 26 | dd.sym.nearest: ./main_libm 27 | CMD_ROUNDING="nearest" verrou_dd_sym --cache=clean --rep=$@ --num-threads=4 --nruns=1 ddRun.sh cmp.sh 28 | ./assert.py $@ ${LIST_NEAREST_UNSTABLE} 29 | 30 | dd.sym.native: ./main_libm 31 | CMD_ROUNDING="native" verrou_dd_sym --cache=clean --reference-rounding=nearest --rep=$@ --num-threads=4 --nruns=1 ddRun.sh cmp.sh 32 | ./assert.py $@ ${LIST_NATIVE_UNSTABLE} 33 | 34 | dd.line.random: ./main_libm 35 | verrou_dd_line --cache=clean --rep=$@ --num-threads=5 --nruns=$(NBRUN) --seed=42 ddRun.sh cmp.sh 36 | ./assert.py $@ ${LIST_UNSTABLE} 37 | 38 | dd.line.nearest: ./main_libm 39 | CMD_ROUNDING="nearest" verrou_dd_line --cache=clean --rep=$@ --num-threads=4 --nruns=1 ddRun.sh cmp.sh 40 | ./assert.py $@ ${LIST_NEAREST_UNSTABLE} 41 | 42 | dd.line.native: ./main_libm 43 | CMD_ROUNDING="native" verrou_dd_line --cache=clean --reference-rounding=nearest --rep=$@ --num-threads=4 --nruns=1 ddRun.sh cmp.sh 44 | ./assert.py $@ ${LIST_NATIVE_UNSTABLE} 45 | 46 | clean: 47 | rm -rf exclude.ex $(REP_LIST) main_libm 48 | -------------------------------------------------------------------------------- /unitTest/ddLibm/cmp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | diff $1/res.dat $2/res.dat 4 | -------------------------------------------------------------------------------- /unitTest/ddLibm/ddRun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR=$1 3 | 4 | if test "x$CMD_ROUNDING" = "x" 5 | then 6 | CMD_ROUNDING="random" 7 | fi 8 | valgrind --tool=verrou --rounding-mode=${CMD_ROUNDING} --libm=instrumented ./main_libm > $DIR/res.dat 9 | 10 | -------------------------------------------------------------------------------- /unitTest/ddLibm/main_libm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | 7 | int main(int argc, char** argv){ 8 | 9 | std::cout << std::setprecision(17); 10 | 11 | std::cout << "cos(0.1): "< $DIR/res.dat 9 | 10 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/ddRunBis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR=$1 3 | 4 | valgrind --tool=verrou --exclude=exclude.ex --rounding-mode=random /usr/bin/python3 ./muller.py> $DIR/res.dat 5 | 6 | valgrind --tool=verrou --exclude=exclude.ex --rounding-mode=random ./muller > $DIR/res2.dat 7 | 8 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/ddRunSqrt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR=$1 3 | 4 | if [ "x" = "x$PARAM" ] ; then 5 | echo "sans PARAM" 6 | valgrind --tool=verrou --exclude=exclude.ex --rounding-mode=random ./sqrt > $DIR/res.dat 7 | else 8 | echo "avec PARAM" 9 | valgrind --tool=verrou --exclude=exclude.ex --rounding-mode=random ./sqrt $DIR/$PARAM 10 | fi 11 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/extractOrCmp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | import os 4 | 5 | 6 | def extractValue(rep): 7 | lines=(open(os.path.join(rep,"res.dat")).readlines()) 8 | for line in lines: 9 | if line.startswith("x[12]="): 10 | return float(line.partition("=")[2]) 11 | return None 12 | 13 | 14 | if __name__=="__main__": 15 | if len(sys.argv)==2: 16 | print(extractValue(sys.argv[1])) 17 | if len(sys.argv)==3: 18 | valueRef=extractValue(sys.argv[1]) 19 | value=extractValue(sys.argv[2]) 20 | 21 | relDiff=abs((value-valueRef)/valueRef) 22 | if relDiff < 1.e-2: 23 | sys.exit(0) 24 | else: 25 | sys.exit(1) 26 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/extractOrCmpSqrt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | import os 4 | 5 | 6 | def extractValue(rep): 7 | fileName=os.path.join(rep,"res.dat") 8 | if "PARAM" in os.environ: 9 | fileName=os.path.join(rep,os.environ["PARAM"]) 10 | lines=(open(fileName).readlines()) 11 | for line in lines: 12 | if line.startswith("res="): 13 | return float(line.partition("=")[2]) 14 | return None 15 | 16 | 17 | if __name__=="__main__": 18 | if len(sys.argv)==2: 19 | print(extractValue(sys.argv[1])) 20 | if len(sys.argv)==3: 21 | valueRef=extractValue(sys.argv[1]) 22 | value=extractValue(sys.argv[2]) 23 | 24 | relDiff=abs((value-valueRef)/valueRef) 25 | if relDiff ==0: 26 | sys.exit(0) 27 | else: 28 | sys.exit(1) 29 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/extractTime.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | import os 4 | import re 5 | 6 | pattern=re.compile(r"it:\s+(\d+)\s+x2:\s*([\w.]*)[\w\s]*") 7 | 8 | def extractTime(rep): 9 | res="" 10 | lines=(open(os.path.join(rep,"res.dat")).readlines()) 11 | for line in lines: 12 | regexp=pattern.match(line) 13 | if regexp!=None: 14 | res+=(" ".join(regexp.groups()))+"\n" 15 | return res[0:-1] 16 | 17 | if __name__=="__main__": 18 | if len(sys.argv)==2: 19 | print(extractTime(sys.argv[1])) 20 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/genExcludePython.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PYTHON_BIN=`readlink -f $1` 4 | OUT_FILE=$2 5 | echo "$PYTHON_BIN" 6 | 7 | echo "∗" `ldd ${PYTHON_BIN} | grep libm | cut -f 3 -d " " | xargs readlink -f ` > ${OUT_FILE} 8 | 9 | echo "_Py_HashDouble $PYTHON_BIN" >> ${OUT_FILE} 10 | echo "_Py_dg_strtod $PYTHON_BIN" >> ${OUT_FILE} 11 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/iomatch.custom: -------------------------------------------------------------------------------- 1 | __verrou__stdout__init__ 2 | xn[1]=* delta=* 3 | xn[2]=* delta=* 4 | xn[3]=* delta=* 5 | xn[4]=* delta=* 6 | xn[5]=* delta=* 7 | xn[6]=* delta=* 8 | xn[7]=* delta=* 9 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/iomatch.custom.listing: -------------------------------------------------------------------------------- 1 | expect open filename: /home/E52654/srcVerrou/valgrind**+verrou-dev/verrou/unitTest/ddStdOut/dd.stdout.sqrt/*/listing 2 | xn[2]=* delta=* 3 | xn[3]=* delta=* 4 | xn[4]=* delta=* 5 | xn[5]=* delta=* 6 | xn[6]=* delta=* 7 | xn[7]=* delta=* 8 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/iomatch.header: -------------------------------------------------------------------------------- 1 | bmatch: xn[10]=* 2 | apply: exit 3 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/muller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | 4 | 5 | def muller(nt,verbose=False): 6 | x0 = 11./2.; 7 | x1 = 61./11.; 8 | 9 | 10 | for it in range(nt): 11 | temp0 = 3000./x0; 12 | temp1 = 1130. - temp0; 13 | temp2 = temp1 /x1 ; 14 | 15 | x2 = 111. - temp2; 16 | 17 | if verbose: 18 | print("it: %i\tx2: %f\ttemp0: %f\ttemp1: %f\ttemp2: %f"%(it,x2,temp0,temp1,temp2)) 19 | 20 | 21 | x0 = x1; 22 | x1 = x2; 23 | print("x[%i]=%f"%(nt,x1)) 24 | print("Function object at 0x49996a00>") 25 | a=10.*4. 26 | print("a=",a) 27 | 28 | 29 | if __name__=="__main__": 30 | muller(12, True) 31 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/pythonFilter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 -u 2 | import sys 3 | 4 | def applyFilter(strLine,filterList): 5 | res=strLine 6 | for filterFnc in filterList: 7 | res=filterFnc(res) 8 | return res 9 | 10 | def deleteDebug(strLine): 11 | if "debug" in strLine: 12 | return "" 13 | else: 14 | return strLine 15 | 16 | fusionParam=1 17 | def fusionFilter(strLine): 18 | if strLine.startswith("it:"): 19 | it=int((strLine.split("\t")[0]).split(":")[1]) 20 | if it%fusionParam==0: 21 | return strLine 22 | else: 23 | return "" 24 | else: 25 | return strLine 26 | 27 | 28 | 29 | def getLineCharByChar(): 30 | line="" 31 | while True: 32 | c=sys.stdin.read(1) 33 | if line== "\x00": #EOF detected 34 | return None 35 | if c=='\n': 36 | return line 37 | line+=c 38 | 39 | if __name__=="__main__": 40 | fusion=False 41 | if len(sys.argv)>1: 42 | for arg in sys.argv: 43 | if arg.startswith("--loop-fusion="): 44 | fusion=True 45 | fusionParam=int(arg.partition("=")[2]) 46 | while True: 47 | line=getLineCharByChar() 48 | if line==None: 49 | sys.exit(0) 50 | if fusion: 51 | print(applyFilter(line, [deleteDebug, fusionFilter])) 52 | else: 53 | print(applyFilter(line, [deleteDebug])) 54 | 55 | -------------------------------------------------------------------------------- /unitTest/ddStdOut/sqrt.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | typedef double Realtype; 7 | 8 | template 9 | Realtype sqrtNewton(Realtype a, size_t nbMax, FLUX& flux){ 10 | Realtype xp=0; 11 | Realtype xn=a; 12 | size_t i=0; 13 | bool first=true; 14 | while(true){ 15 | xp=xn; 16 | xn=1/2.*(xp+a/xp); 17 | i+=1; 18 | flux << "xn["<1){ 37 | std::ofstream flux; 38 | flux.open(argv[1], std::ios::out); 39 | flux << std::setprecision(17); 40 | Realtype res=sqrtNewton(0.1, 100,flux); 41 | flux << "res=" << res<$1/out 4 | -------------------------------------------------------------------------------- /unitTest/flag.mk.in: -------------------------------------------------------------------------------- 1 | # @configure_input@ 2 | 3 | AVX512FLAG=@vg_test_no_avx512f_flag@ 4 | MFPMATHFLAG=@vg_test_mfpmath_sse_flag@ 5 | FMAFLAG=@vg_test_mfma_flag@ 6 | AVX_CONFIG=@ac_have_as_avx@ 7 | 8 | FLAG_TEST_AVX= 9 | ifeq ($(AVX_CONFIG) , yes) 10 | FLAG_TEST_AVX=-DHAVE_AVX 11 | endif 12 | 13 | DEBUGFLAGS = $(MFPMATHFLAG) -g $(AVX512FLAG) $(FLAG_TEST_AVX) 14 | NATIVEFLAGS= $(MFPMATHFLAG) -march=native $(FMAFLAG) $(AVX512FLAG) $(FLAG_TEST_AVX) 15 | -------------------------------------------------------------------------------- /unitTest/installpath: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ../../env.sh; readlink -f $(dirname $(which valgrind))/.. 4 | -------------------------------------------------------------------------------- /unitTest/makefile: -------------------------------------------------------------------------------- 1 | SUBREPLIST=checkRounding checkStatRounding checkUCB-vecto check-libM ddTest check-verrou-dd-task ddStdOut ddLibm verrouDDPython ddCover 2 | 3 | SUBREPLISTPYTHON=checkStatRounding ddTest check-verrou-dd-task ddStdOut ddLibm verrouDDPython ddCover 4 | 5 | .PHONY: valgrind-test none-test callgrind-test verrou-test 6 | 7 | all: 8 | for i in $(SUBREPLIST) ; do \ 9 | make -C "./$$i" || exit 42; \ 10 | done 11 | 12 | python: 13 | for i in $(SUBREPLISTPYTHON) ; do \ 14 | make -C "./$$i" || exit 42; \ 15 | done 16 | 17 | 18 | #to be able to do valgrind test from this directory 19 | valgrind-test: verrou-test none-test callgrind-test #helgrind-test 20 | 21 | valgrind-check: 22 | make -C ../.. check 23 | make -C ../../tests check 24 | make -C ../../verrou check 25 | make -C ../../none check 26 | make -C ../../perf check 27 | make -C ../../callgrind check 28 | 29 | verrou-test: valgrind-check 30 | cd ../..; perl ./tests/vg_regtest verrou/tests 31 | 32 | none-test: valgrind-check 33 | cd ../..; perl ./tests/vg_regtest none/tests --force-tool=verrou --stderr-ignore 34 | 35 | callgrind-test: valgrind-check 36 | cd ../..; perl ./tests/vg_regtest callgrind/tests --force-tool=verrou --stderr-ignore --toolopt-ignore --cleanup-ignore --post-ignore 37 | 38 | helgrind-test: valgrind-check 39 | make -C ../../helgrind check 40 | cd ../..; perl ./tests/vg_regtest helgrind/tests --force-tool=verrou --stderr-ignore --toolopt-ignore 41 | 42 | clean: 43 | for i in $(SUBREPLIST) ; do \ 44 | make -C "./$$i" clean ; \ 45 | done 46 | -------------------------------------------------------------------------------- /unitTest/nocheckExemples/addSqrtVecDoubleSSE.cxx: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | #include 8 | //#include 9 | int main(int argc, char** argv){ 10 | double a[2] ,b[2] ; 11 | double r[2]; 12 | 13 | if(argc==5){ 14 | a[0]=atof(argv[1]); 15 | a[1]=atof(argv[2]); 16 | b[0]=atof(argv[3]); 17 | b[1]=atof(argv[4]); 18 | }else{ 19 | std::cerr << "demande 4 argument"< 3 | #include 4 | #include 5 | 6 | 7 | #include 8 | #include 9 | 10 | int main(int argc, char** argv){ 11 | double a[4] __attribute__ ((aligned(32))); 12 | double b[4] __attribute__ ((aligned(32))); 13 | double r[4] __attribute__ ((aligned(32))); 14 | 15 | if(argc==9){ 16 | a[0]=atof(argv[1]); 17 | a[1]=atof(argv[2]); 18 | a[2]=atof(argv[3]); 19 | a[3]=atof(argv[4]); 20 | b[0]=atof(argv[5]); 21 | b[1]=atof(argv[6]); 22 | b[2]=atof(argv[7]); 23 | b[3]=atof(argv[8]); 24 | }else{ 25 | std::cerr << "demande 8 arguments"< 3 | #include 4 | #include 5 | 6 | 7 | #include 8 | //#include 9 | int main(int argc, char** argv){ 10 | double a[2] ,b[2] ; 11 | double r[2]; 12 | 13 | if(argc==5){ 14 | a[0]=atof(argv[1]); 15 | a[1]=atof(argv[2]); 16 | b[0]=atof(argv[3]); 17 | b[1]=atof(argv[4]); 18 | }else{ 19 | std::cerr << "demande 4 argument"< 3 | #include 4 | #include 5 | 6 | 7 | #include 8 | #include 9 | 10 | int main(int argc, char** argv){ 11 | float a[8] __attribute__ ((aligned(32))); 12 | float b[8] __attribute__ ((aligned(32))); 13 | float r[8] __attribute__ ((aligned(32))); 14 | 15 | if(argc==17){ 16 | a[0]=atof(argv[1]); 17 | a[1]=atof(argv[2]); 18 | a[2]=atof(argv[3]); 19 | a[3]=atof(argv[4]); 20 | a[4]=atof(argv[5]); 21 | a[5]=atof(argv[6]); 22 | a[6]=atof(argv[7]); 23 | a[7]=atof(argv[8]); 24 | 25 | 26 | b[0]=atof(argv[9]); 27 | b[1]=atof(argv[10]); 28 | b[2]=atof(argv[11]); 29 | b[3]=atof(argv[12]); 30 | b[4]=atof(argv[13]); 31 | b[5]=atof(argv[14]); 32 | b[6]=atof(argv[15]); 33 | b[7]=atof(argv[16]); 34 | 35 | }else{ 36 | std::cerr << "demande 16 arguments : "<< argc-1 < 3 | #include 4 | #include 5 | 6 | 7 | #include 8 | //#include 9 | int main(int argc, char** argv){ 10 | float a[4] ,b[4] ; 11 | float r[4]; 12 | 13 | if(argc==9){ 14 | a[0]=atof(argv[1]); 15 | a[1]=atof(argv[2]); 16 | a[2]=atof(argv[3]); 17 | a[3]=atof(argv[4]); 18 | b[0]=atof(argv[5]); 19 | b[1]=atof(argv[6]); 20 | b[2]=atof(argv[7]); 21 | b[3]=atof(argv[8]); 22 | 23 | 24 | }else{ 25 | std::cerr << "demande 8 arguments"< 2 | #include 3 | #include 4 | 5 | 6 | //#include 7 | //#include 8 | int main(int argc, char** argv){ 9 | double a; 10 | if(argc==2){ 11 | a=atof(argv[1]); 12 | }else{ 13 | std::cerr << "demande 1 argument"< 3 | #include 4 | #include 5 | #ifdef __x86_64__ 6 | #include 7 | #endif 8 | 9 | #ifdef __aarch64__ 10 | #include 11 | #endif 12 | 13 | 14 | //#include 15 | int main(int argc, char** argv){ 16 | double a,b,c,d,e ; 17 | float af,bf,cf,df,ef ; 18 | if(argc==4){ 19 | a=atof(argv[1]);af=a; 20 | b=atof(argv[2]);bf=b; 21 | c=atof(argv[3]);cf=c; 22 | }else{ 23 | std::cerr << "requiere 3 arguments"< 3 | #include 4 | #include 5 | #include 6 | #ifdef __x86_64__ 7 | #include 8 | #endif 9 | 10 | #ifdef __aarch64__ 11 | #endif 12 | 13 | 14 | //#include 15 | int main(int argc, char** argv){ 16 | double remain; 17 | 18 | #ifdef __x86_64__ 19 | __float128 a=1.; 20 | __float128 quarterPi= atanq(a); 21 | __float128 pi= quarterPi * __float128(4.); 22 | __float128 factor=0.1; 23 | remain= (double)( (pi - (__float128)M_PI)*factor); 24 | #endif 25 | 26 | #ifdef __aarch64__ 27 | using myReal128=long double ; 28 | myReal128 a=1.; 29 | myReal128 quarterPi= atanl(a); 30 | myReal128 pi= quarterPi * myReal128(4.); 31 | myReal128 factor=0.1; 32 | remain= (double)( (pi - (myReal128)M_PI) *factor); 33 | 34 | #endif 35 | std::cout << std::setprecision(17); 36 | std::cout << "remain: "<< remain</dev/null 7 | 8 | #to get improved perf (warning unsafe) 9 | PREFIX="valgrind --tool=verrou --rounding-mode=random --vr-unsafe-llo-optim=yes " ./run.sh 2>/dev/null 10 | -------------------------------------------------------------------------------- /unitTest/testPerf/run.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | BIN=stencil 4 | 5 | FMA="-FMA" 6 | 7 | BINO3DOUBLE=$BIN-O3-DOUBLE${FMA} 8 | BINO0DOUBLE=$BIN-O0-DOUBLE${FMA} 9 | BINO3FLOAT=$BIN-O3-FLOAT${FMA} 10 | BINO0FLOAT=$BIN-O0-FLOAT${FMA} 11 | 12 | BINS="./$BINO3DOUBLE ./$BINO0DOUBLE ./$BINO3FLOAT ./$BINO0FLOAT" 13 | 14 | OPT="--scale=1 1" 15 | 16 | 17 | 18 | for i in $BINS 19 | do 20 | echo $i 21 | $PREFIX $i $OPT 22 | 23 | done; 24 | -------------------------------------------------------------------------------- /unitTest/testPerf/study.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | PREFIX=" " ./run.sh 2>/dev/null > resNative 4 | PREFIX="valgrind --tool=verrou " ./run.sh 2>/dev/null >resNearest 5 | PREFIX="valgrind --tool=verrou --rounding-mode=random " ./run.sh 2>/dev/null >resRandom 6 | PREFIX="valgrind --tool=verrou --rounding-mode=average " ./run.sh 2>/dev/null >resAverage 7 | 8 | PREFIX="valgrind --tool=verrou --rounding-mode=float " ./run.sh 2>/dev/null >resFloat 9 | 10 | 11 | -------------------------------------------------------------------------------- /unitTest/testPlotStat/dot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | 4 | def computeDot(v1,v2, blockSize): 5 | totalSize=len(v1) 6 | if totalSize!=len(v2): 7 | print("incoherent size") 8 | sys.exit(42) 9 | if totalSize % blockSize !=0: 10 | print("block size should divide total size") 11 | sys.exit(42) 12 | 13 | 14 | res=0. 15 | for iExtern in range(int(totalSize / blockSize)): 16 | resLocal=0. 17 | for iIntern in range(blockSize): 18 | i=iExtern *blockSize + iIntern 19 | resLocal+=v1[i]*v2[i] 20 | res+=resLocal 21 | return res 22 | 23 | if __name__=="__main__": 24 | v1=[0.1 for i in range(128)] 25 | v2=[0.1 for i in range(128)] 26 | 27 | for b in [1,2,4,8,16,32]: 28 | dot1=computeDot(v1,v2, b) 29 | dot2=computeDot(v1,v2, b) 30 | print("1-dot("+str(b)+") %.17g %.17g"%(dot1, dot1-1.28)) 31 | print("2-dot("+str(b)+") %.17g %.17g"%(dot2, dot2-1.28)) 32 | -------------------------------------------------------------------------------- /unitTest/testPlotStat/extract.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | blockSize=32 4 | 5 | for line in open(sys.argv[1]+"/out"): 6 | if line.startswith("1-dot("+str(blockSize)+")"): 7 | print(line.split()[2]) 8 | sys.exit(0) 9 | sys.exit(42) 10 | 11 | -------------------------------------------------------------------------------- /unitTest/testPlotStat/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | valgrind --trace-children=yes --tool=verrou ./dot.py > $1/out 2>&1 4 | -------------------------------------------------------------------------------- /unitTest/verrouDDPython/.gitignore: -------------------------------------------------------------------------------- 1 | dd.task -------------------------------------------------------------------------------- /unitTest/verrouDDPython/Makefile: -------------------------------------------------------------------------------- 1 | export INSTALLPATH = $(shell bash ../installpath) 2 | export BASH_ENV=$(INSTALLPATH)/env.sh 3 | export SHELL=bash 4 | 5 | all: dd.synchro 6 | 7 | dd.synchro: clean 8 | verrou_dd_task --num-threads=4 --nrun=1 ddRun.sh extractOrCmp.py 9 | 10 | clean: 11 | rm -rf dd.task 12 | -------------------------------------------------------------------------------- /unitTest/verrouDDPython/Muller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | 4 | 5 | def muller(nt,verbose=False): 6 | x0 = 11./2.; 7 | x1 = 61./11.; 8 | 9 | 10 | for it in range(nt): 11 | temp0 = 3000./x0; 12 | temp1 = 1130. - temp0; 13 | temp2 = temp1 /x1 ; 14 | 15 | x2 = 111. - temp2; 16 | 17 | if verbose: 18 | print("it: %i\tx2: %f\ttemp0: %f\ttemp1: %f\ttemp2: %f"%(it,x2,temp0,temp1,temp2)) 19 | 20 | 21 | x0 = x1; 22 | x1 = x2; 23 | print("x[%i]=%f"%(nt,x1)) 24 | print("Function object at 0x49996a00>") 25 | a=10.*4. 26 | print("a=",a) 27 | 28 | 29 | if __name__=="__main__": 30 | muller(12, True) 31 | -------------------------------------------------------------------------------- /unitTest/verrouDDPython/ddRun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR=$1 3 | valgrind --tool=verrou --rounding-mode=downward trace_verrou_task.py ./Muller.py > $DIR/res.dat 4 | 5 | -------------------------------------------------------------------------------- /unitTest/verrouDDPython/extractOrCmp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | import os 4 | 5 | 6 | def extractValue(rep): 7 | lines=(open(os.path.join(rep,"res.dat")).readlines()) 8 | for line in lines: 9 | if line.startswith("x[12]="): 10 | return float(line.partition("=")[2]) 11 | return None 12 | 13 | 14 | if __name__=="__main__": 15 | if len(sys.argv)==2: 16 | print(extractValue(sys.argv[1])) 17 | if len(sys.argv)==3: 18 | valueRef=extractValue(sys.argv[1]) 19 | value=extractValue(sys.argv[2]) 20 | 21 | relDiff=abs((value-valueRef)/valueRef) 22 | if relDiff < 1.e-2: 23 | sys.exit(0) 24 | else: 25 | sys.exit(1) 26 | -------------------------------------------------------------------------------- /unitTest/verrouDDPython/genExcludePython.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PYTHON_BIN=`readlink -f $1` 4 | OUT_FILE=$2 5 | echo "$PYTHON_BIN" 6 | 7 | echo "∗" `ldd ${PYTHON_BIN} | grep libm | cut -f 3 -d " " | xargs readlink -f ` > ${OUT_FILE} 8 | 9 | echo "_Py_HashDouble $PYTHON_BIN" >> ${OUT_FILE} 10 | echo "_Py_dg_strtod $PYTHON_BIN" >> ${OUT_FILE} 11 | -------------------------------------------------------------------------------- /verrou.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{fevotte2019, 2 | author = {François Févotte and Bruno Lathuilière}, 3 | title = {Debugging and Optimization of {HPC} Programs with the {Verrou} Tool}, 4 | booktitle = {International Workshop on Software Correctness for HPC Applications (Correctness)}, 5 | year = {2019}, 6 | month = nov, 7 | address = {Denver, CO, USA}, 8 | doi = {10.1109/Correctness49594.2019.00006} 9 | } 10 | 11 | @article{grasland2019, 12 | author = {Grasland, Hadrien and F\'evotte, Fran\c{c}ois and Lathuili\`ere, Bruno and Chamont, David}, 13 | title = {Floating-point profiling of {ACTS} using {V}errou}, 14 | doi = {10.1051/epjconf/201921405025}, 15 | journal = {EPJ Web Conf.}, 16 | year = 2019, 17 | volume = 214 18 | } 19 | 20 | @inproceedings{fevotte2017a, 21 | author = {F{\'e}votte, Fran{\c{c}}ois and Lathuili{\`e}re, Bruno}, 22 | title = {Studying the Numerical Quality of an Industrial Computing Code: A Case 23 | Study on code{\_}aster}, 24 | booktitle = {10th International Workshop on Numerical Software Verification (NSV)}, 25 | year = 2017, 26 | pages = {61--80}, 27 | address = {Heidelberg, Germany}, 28 | month = jul, 29 | isbn = {978-3-319-63501-9}, 30 | doi = {10.1007/978-3-319-63501-9_5}, 31 | } 32 | 33 | @inproceedings{fevotte2016, 34 | author = {François Févotte and Bruno Lathuilière}, 35 | title = { {VERROU}: a {CESTAC} evaluation without recompilation}, 36 | booktitle = {International Symposium on Scientific Computing, Computer 37 | Arithmetics and Verified Numerics~(SCAN)}, 38 | year = 2016, 39 | month = sep, 40 | address = {Uppsala, Sweden} 41 | } 42 | -------------------------------------------------------------------------------- /vr_IOMatch_clr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void vr_IOmatch_clr_init (const HChar * fileName); 4 | void vr_IOmatch_clr_checkmatch(const HChar* writeLine, SizeT size); 5 | void vr_IOmatch_clr_finalize (void); 6 | -------------------------------------------------------------------------------- /vr_clo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vr_main.h" 4 | 5 | void vr_env_clo_one_option (const HChar* env, const HChar *clo); 6 | void vr_env_clo (void); 7 | void vr_clo_defaults (void); 8 | Bool vr_process_clo (const HChar *arg); 9 | void vr_print_usage (void); 10 | void vr_print_debug_usage (void); 11 | -------------------------------------------------------------------------------- /vr_clreq.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vr_main.h" 4 | 5 | Bool vr_handle_client_request (ThreadId tid, UWord *args, UWord *ret); 6 | void vr_set_instrument_state (const HChar* reason, Vr_Instr state, Bool isHard); 7 | 8 | void vr_print_denorm_counter(void); 9 | void vr_reset_denorm_counter(void); 10 | -------------------------------------------------------------------------------- /vr_error.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef enum { 4 | VR_ERROR_UNCOUNTED, 5 | VR_ERROR_SCALAR, 6 | VR_ERROR_NAN, 7 | VR_ERROR_INF, 8 | VR_ERROR_CC, 9 | VR_ERROR_CDI, 10 | VR_ERROR_CDO, 11 | VR_ERROR_FLT_MAX, 12 | VR_ERROR_UNKNOWN_FLT_IOP, 13 | VR_ERROR 14 | } Vr_ErrorKind; 15 | 16 | 17 | const HChar* vr_get_error_name (const Error* err); 18 | Bool vr_recognised_suppression (const HChar* name, Supp* su); 19 | void vr_before_pp_Error (const Error* err) ; 20 | void vr_pp_Error (const Error* err); 21 | Bool vr_eq_Error (VgRes res, const Error* e1, const Error* e2); 22 | UInt vr_update_extra (const Error* err); 23 | Bool vr_error_matches_suppression (const Error* err, const Supp* su); 24 | Bool vr_read_extra_suppression_info (Int fd, HChar** bufpp, SizeT* nBuf, 25 | Int* lineno, Supp* su); 26 | SizeT vr_print_extra_suppression_info (const Error* er, 27 | /*OUT*/HChar* buf, Int nBuf); 28 | SizeT vr_print_extra_suppression_use (const Supp* s, 29 | /*OUT*/HChar* buf, Int nBuf); 30 | void vr_update_extra_suppression_use (const Error* err, const Supp* su); 31 | 32 | 33 | void vr_maybe_record_ErrorOp (Vr_ErrorKind kind, IROp op); 34 | void vr_maybe_record_ErrorRt (Vr_ErrorKind kind); 35 | 36 | 37 | 38 | void vr_handle_NaN (void); 39 | void vr_handle_Inf (void); 40 | void vr_handle_CC (int); 41 | void vr_handle_CD_input (check_subnormal_op_t, check_subnormal_type_t, UInt); 42 | void vr_handle_CD_output (check_subnormal_op_t, check_subnormal_type_t); 43 | void vr_handle_FLT_MAX (void); 44 | 45 | -------------------------------------------------------------------------------- /vr_exclude.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef struct Vr_Exclude_ Vr_Exclude; 4 | struct Vr_Exclude_ { 5 | HChar* fnname; 6 | HChar* objname; 7 | Bool used; 8 | Bool counted; 9 | Vr_Exclude* next; 10 | }; 11 | 12 | typedef struct Vr_IncludeSource_ Vr_IncludeSource; 13 | struct Vr_IncludeSource_ { 14 | HChar* fnname; 15 | HChar* filename; 16 | UInt linenum; 17 | Vr_IncludeSource* next; 18 | }; 19 | 20 | 21 | void vr_freeExcludeList (Vr_Exclude* list); 22 | void vr_dumpExcludeList (Vr_Exclude* list, const HChar* filename); 23 | Vr_Exclude* vr_loadExcludeList (Vr_Exclude * list, const HChar * filename); 24 | Vr_Exclude* vr_addObjectIfMatchPattern(Vr_Exclude * list, const HChar* objName); 25 | Vr_Exclude* vr_addPythonSymbols(Vr_Exclude * list); 26 | Bool vr_excludeIRSB(const HChar** fnname, const HChar** objname, Bool* counted); 27 | 28 | 29 | void vr_excludeIRSB_generate(const HChar** fnname, const HChar** objname); 30 | 31 | void vr_freeIncludeSourceList (Vr_IncludeSource* list); 32 | void vr_dumpIncludeSourceList (Vr_IncludeSource* list, const HChar* fname); 33 | Vr_IncludeSource * vr_loadIncludeSourceList (Vr_IncludeSource * list, const HChar * fname); 34 | Bool vr_includeSource (Vr_IncludeSource** list, 35 | const HChar* fnname, const HChar* filename, UInt linenum); 36 | void vr_includeSource_generate (Vr_IncludeSource** list, 37 | const HChar* fnname, const HChar* filename, UInt linenum); 38 | 39 | Vr_IncludeSource * vr_addIncludeSource (Vr_IncludeSource* list, const HChar* fnname, 40 | const HChar * filename, UInt linenum); 41 | Bool vr_includeSourceMutuallyExclusive( Vr_IncludeSource* listInclude, Vr_IncludeSource* listExclude); 42 | 43 | void vr_generate_exclude_source(const char* functionName, int line, const char* fileName, const char* object ); 44 | Bool vr_clrIsInstrumented(const char* functionName, int line, const char* fileName, const char* object); 45 | -------------------------------------------------------------------------------- /vr_include_trace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | typedef struct Vr_Include_Trace_ Vr_Include_Trace; 5 | struct Vr_Include_Trace_ { 6 | HChar* fnname; 7 | HChar* objname; 8 | Vr_Include_Trace* next; 9 | }; 10 | 11 | 12 | void vr_freeIncludeTraceList (Vr_Include_Trace* list) ; 13 | Vr_Include_Trace * vr_loadIncludeTraceList (Vr_Include_Trace * list, const HChar * fname); 14 | Bool vr_includeTraceIRSB (const HChar** fnname, const HChar **objname); 15 | -------------------------------------------------------------------------------- /vr_interp_operator_impl.h: -------------------------------------------------------------------------------- 1 | 2 | static double arg1CopyDouble[4] __attribute__((aligned(32))); 3 | static double arg2CopyDouble[4] __attribute__((aligned(32))); 4 | static float arg1CopyFloat[8] __attribute__((aligned(32))); 5 | static float arg2CopyFloat[8] __attribute__((aligned(32))); 6 | -------------------------------------------------------------------------------- /vr_interp_operator_template_cast.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | static VG_REGPARM(3) Int FCTNAME(64FTo32F,) (Long a) { 4 | double *arg1 = (double*)(&a); 5 | float res; 6 | PREBACKEND; 7 | BACKENDFUNC(double_to_float)(*arg1, &res,CONTEXT); 8 | POSTBACKEND; 9 | Int *d = (Int*)(&res); 10 | return *d; 11 | } 12 | --------------------------------------------------------------------------------