Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • opensrc/zipr
  • whh8b/zipr
2 results
Show changes
Commits on Source (6)
Subproject commit 4acb3099c386529a8da4fd42cb87484a486a60c3
Subproject commit a4b00a63158068efa2d9666d3254d1553bbf3be8
......@@ -3702,6 +3702,9 @@ int executeStep(IRDBObjects_t *const irdb_objects)
fill_in_indtargs(firp, elfiop.get(), do_unpin_opt);
if(split_eh_frame_opt)
split_eh_frame(firp);
if(firp->getArchitecture()->getMachineType() != admtAarch64)
assert(getenv("SELF_VALIDATE")==nullptr || ranges.size() > 1 );
}
if(getenv("FII_NOUPDATE")!=nullptr)
......@@ -3721,7 +3724,6 @@ int executeStep(IRDBObjects_t *const irdb_objects)
assert(getenv("SELF_VALIDATE")==nullptr || bounds.size() > 3 );
assert(getenv("SELF_VALIDATE")==nullptr || targets.size() > 100 );
assert(getenv("SELF_VALIDATE")==nullptr || ranges.size() > 1 );
assert(getenv("SELF_VALIDATE")==nullptr || preds.size() > 100 );
assert(getenv("SELF_VALIDATE")==nullptr || lookupInstructionMap.size() > 100 );
......
......@@ -1054,6 +1054,10 @@ int executeStep(IRDBObjects_t *const irdb_objects)
cout<<"Done!"<<endl;
if(firp->getArchitecture()->getMachineType() != admtAarch64)
assert(getenv("SELF_VALIDATE")==nullptr || (fixed_calls + other_fixes) > 5);
}
}
catch (DatabaseError_t pnide)
......@@ -1067,7 +1071,6 @@ int executeStep(IRDBObjects_t *const irdb_objects)
return -1;
}
assert(getenv("SELF_VALIDATE")==nullptr || (fixed_calls + other_fixes) > 5);
assert(getenv("SELF_VALIDATE")==nullptr || fix_all || not_fixed_calls > 5);
return 0;
......
#!/bin/bash
throws="THROW_INT THROW_CHAR THROW_FLOAT"
#---------------
compare()
{
rm -f good.txt xform.txt
env $1 ./a.out > good.txt 2>&1
exit1=$?
env $1 ./xxx > xform.txt 2>&1
exit2=$?
cmp good.txt xform.txt > /dev/null 2>&1
if [[ $? != 0 ]] || [[ $exit1 != $exit2 ]]; then
echo "Failed test: $1";
diff good.txt xform.txt
exit 2
fi
}
doit()
{
src=$1
options="$2"
psopts="$3"
echo "------------------------------------------------------"
echo "Trying $src with options: $options"
echo "And psflags=$psopts "
g++ -w $options $src
rm -Rf peasoup_executable_direc* xxx
(set -x ; $PSZ ./a.out ./xxx --step-option fill_in_indtargs:--split-eh-frame --step-option zipr:'--add-sections true' $psopts)
compare
for throw in $throws
do
compare $throw=1
done
echo "Passed test!"
echo "------------------------------------------------------"
}
doit_meta()
{
src=$1
option="$2"
psopts="$3"
doit $src "$option " "$psopts"
doit $src "$option -fPIC -fomit-frame-pointer -pie" "$psopts"
}
main()
{
local rida_flags="-c rida=on -s meds_static=off "
local ss_flags="-c stack_stamp=on"
local p1_flags="-c p1transform=on"
local src_files1=" derived3_throw.cpp derived4_throw.cpp "
local src_files2=" simple_throw.cpp throw.cpp derived_throw.cpp derived2_throw.cpp derived3_throw.cpp derived4_throw.cpp "
for src in $src_files1
do
for option in -O0 -O3
do
#rida
doit_meta $src "$option" "$rida_flags "
# doit_meta $src "$option" "$rida_flags $p1_flags"
# doit_meta $src "$option" "$rida_flags $ss_flags"
done
done
# for src in $src_files2
# do
# for option in -O3
# do
# #rida
## doit_meta $src "$option" "$rida_flags $p1_flags $ss_flags "
# done
# done
}
main
spec2006
spec2017
#!/bin/bash
# the bad boys
#benchmarks="
# 400.perlbench
# 403.gcc
# 445.gobmk
# 450.soplex
# 453.povray
# 458.sjeng
# 464.h264ref
# 465.tonto
# 471.omnetpp
# 481.wrf
# 482.sphinx3
# 483.xalancbmk
# "
# broken: 447.dealII
cint_benchmarks="400.perlbench 401.bzip2 403.gcc 429.mcf 445.gobmk 456.hmmer 458.sjeng 462.libquantum 464.h264ref 471.omnetpp 473.astar 483.xalancbmk"
c_cpp_benchmarks="$cint_benchmarks 433.milc 444.namd 450.soplex 453.povray 470.lbm 482.sphinx3"
fortran_benchmarks="410.bwaves 416.gamess 434.zeusmp 437.leslie3d 459.gemsFDTD 465.tonto"
mixed_c_fortran_benchnmarks="435.gromacs 436.cactusADM 454.calculix 481.wrf"
cfp_benchmarks="$fortran_benchmakrs $mixed_c_fortran_benchmarks 433.milc 444.namd 450.soplex 453.povray 470.lbm 482.sphinx3"
# all
#all_benchmarks="400.perlbench 401.bzip2 403.gcc 410.bwaves 416.gamess 429.mcf 433.milc 434.zeusmp 435.gromacs 436.cactusADM 437.leslie3d 444.namd 445.gobmk 450.soplex 453.povray 454.calculix 456.hmmer 458.sjeng 459.GemsFDTD 462.libquantum 464.h264ref 465.tonto 470.lbm 471.omnetpp 473.astar 481.wrf 482.sphinx3 483.xalancbmk"
#all_benchmarks=" 401.bzip2 "
all_benchmarks=" $c_cpp_benchmarks "
number=1
#input_size=test
input_size=ref
setup()
{
if [ ! -d spec2006 ]; then
#svn co ^/spec2006/trunk spec2006
git clone --depth 1 git@git.zephyr-software.com:allzp/spec2006.git spec2006
fi
if [[ ! -f /usr/bin/gfortran ]]; then
sudo apt-get install gfortran -y
fi
cd spec2006/
if [ ! -L bin ]; then
ln -s bin.power/ bin
fi
source shrc
bin/relocate
}
run_test()
{
config_name=$1
config=$2
benchmarks="$3"
global_config_list="$global_config_list $config_name"
cd $SPEC
if [ ! -d result.$config_name ]; then
dropdb $PGDATABASE
createdb $PGDATABASE
$PEASOUP_HOME/tools/db/pdb_setup.sh
rm -Rf result/*
runspec --action scrub --config $config $benchmarks
echo
echo "**************************************************************************"
echo "Starting test of $config_name"
echo "**************************************************************************"
echo
runspec --action validate --config $config -n $number $benchmarks -i $input_size
cp benchspec/CPU2006/*/exe/* result
mv result result.$config_name
for bench in $benchmarks
do
mv benchspec/CPU2006/$bench/run/build*/peasoup*/logs result.$config_name/$bench.log
done
fi
}
get_size_result()
{
bench=$1
if [ -e $bench ]; then
size=$(stat --printf="%s" $bench)
#echo -n "$size"
#LC_ALL= numfmt --grouping $size
#LC_ALL= printf "%'d" $size
#LC_NUMERIC=en_US printf "%'d" $size
#LC_NUMERIC=en_US printf "%'f" $size
#LC_NUMERIC=en_US printf "%'.f" $size
#LC_NUMERIC=en_US printf "%'10.10f" $size
#LC_NUMERIC=en_US /usr/bin/printf "%'d" $size
echo $size
else
echo -n "0"
fi
}
get_result()
{
bench=$1
config=$2
results=$(cat $SPEC/result.$config/CPU2006.002.log|grep Success|grep $bench|grep ratio=|sed 's/.*ratio=//'|sed 's/,.*//')
sum=0
count=0
for res in $results
do
sum=$(echo $sum + $res | bc)
count=$(echo $count + 1 | bc)
done
#echo sum=$sum
#echo count=$count
res=$(echo "scale=2; $sum / $count" | bc 2> /dev/null )
count=$(echo $res|wc -w)
if [ $count = 1 ]; then
echo -n $res
else
echo -n "0"
fi
}
get_raw_results()
{
local configs="$global_config_list"
get_raw_perf_results $configs
get_raw_size_results $configs
#get_raw_fde_results $configs
}
get_raw_perf_results()
{
configs=$*
first_config=$1
echo "--------------------------------------------------------------"
echo "Performance results are:"
echo "--------------------------------------------------------------"
echo benchmark $configs
for bench in $benchmarks
do
echo -n "$bench "
for config in $*
do
get_result $bench $config
echo -n " "
done
echo
done
}
get_raw_size_results()
{
echo "--------------------------------------------------------------"
echo "Size results are:"
echo "--------------------------------------------------------------"
configs=$*
first_config=$1
echo benchmark $configs
for bench in $SPEC/result.$first_config/*_base.amd64-m64-gcc42-nn
do
echo -n "$(basename $bench _base.amd64-m64-gcc42-nn) "
for config in $*
do
if [[ $config == "baseline" ]]; then
file="$SPEC/result.$config/$(basename $bench)"
cp $file /tmp/foo.exe
strip /tmp/foo.exe 2> /dev/null
file="/tmp/foo.exe"
else
file="$SPEC/result.$config/$(basename $bench)"
fi
res=$(get_size_result $file)
#printf "%15s" $res
echo -n " $res"
done
echo
done
}
get_raw_fde_results()
{
echo "--------------------------------------------------------------"
echo "FDE results are:"
echo "--------------------------------------------------------------"
configs=$*
first_config=$1
echo benchmark $configs
for bench in $SPEC/result.$first_config/*_base.amd64-m64-gcc42-nn
do
#printf "%-20s" $(basename $bench _base.amd64-m64-gcc42-nn)
echo -n $(basename $bench _base.amd64-m64-gcc42-nn)
for config in $*
do
file="$SPEC/result.$config/$(basename $bench)"
res=$(readelf -w $file |grep FDE|wc -l )
#if [[ $config == "baseline" ]]; then
#else
#fi
#printf "%15s" $res
echo -n " $res"
done
echo
done
}
main()
{
zipr_flags=" --backend zipr --step-option zipr:--add-sections --step-option zipr:true"
rida_flags=" $zipr_flags -c rida=on -s meds_static=off "
trace_flags=" --step-option zipr:--traceplacement:on --step-option zipr:true"
relax_flags=" --step-option zipr:--relax:on --step-option zipr:true --step-option zipr:--unpin:on --step-option zipr:false"
nounpin_flags=" --step-option zipr:--unpin:on --step-option zipr:false"
split_flags=" --step-option fill_in_indtargs:--split-eh-frame "
icall_flags=" --step-option fix_calls:--no-fix-icalls "
p1flags=" -c p1transform=on "
siflags=" $p1flags -s initialize_stack=on "
ssflags=" -c stack_stamp=on "
mga_flags=" -c move_globals=on -o move_globals:--aggressive "
mgc_flags=" -c move_globals=on -o move_globals:--conservative "
nosflags=" -c non_overlapping_stack=on "
start_dir=$(pwd)
setup
# baseline
run_test baseline $SPEC/config/ubuntu14.04lts-64bit.cfg "$all_benchmarks"
PSOPTS="$zipr_flags " run_test zipr $SPEC/config/ubuntu14.04lts-64bit-withps.cfg "$all_benchmarks"
get_raw_results
}
main "$@"
#!/bin/bash
# the bad boys
run_size="test"
all_benchmarks="
600.perlbench_s 602.gcc_s 603.bwaves_s 605.mcf_s 607.cactuBSSN_s 619.lbm_s 620.omnetpp_s 621.wrf_s 623.xalancbmk_s 625.x264_s 627.cam4_s 628.pop2_s 631.deepsjeng_s 638.imagick_s 641.leela_s 644.nab_s 648.exchange2_s 649.fotonik3d_s 654.roms_s 657.xz_s 996.specrand_fs 998.specrand_is
"
all_benchmarks="
620.omnetpp_s 623.xalancbmk_s 631.deepsjeng_s 641.leela_s 607.cactuBSSN_s
"
number=1
setup()
{
if [ ! -d spec2017 ]; then
#svn co ^/spec2017/trunk spec2017
git clone --depth 1 git@git.zephyr-software.com:allzp/spec2017.git spec2017
fi
if [[ ! -f /usr/bin/gfortran ]]; then
sudo apt-get install gfortran gcc g++ -y
fi
cd spec2017/
source shrc
}
run_test()
{
local config_name="$1"
local config="$2"
local benchmarks="$3"
tests_that_ran="$tests_that_ran $config_name"
cd $SPEC
if [ ! -d result.$config_name ]; then
bash -x $PEASOUP_UMBRELLA_DIR/postgres_reset.sh
rm -Rf result/*
runcpu --action scrub --config $config $benchmarks
echo
echo "**************************************************************************"
echo "Starting test of $config_name"
echo "**************************************************************************"
echo
#runspec --action validate --config $config -n $number $benchmarks
runcpu --config $config --iterations $number --size $run_size --copies=8 --parallel_test_workload $run_size --noreportable $benchmarks
cp benchspec/CPU/*/exe/* result
mv result result.$config_name
for bench in $benchmarks
do
mv benchspec/CPU/$bench/build/build*/peasoup*/logs result.$config_name/$bench.log
done
fi
}
get_size_result()
{
bench=$1
if [ -e $bench ]; then
size=$(stat --printf="%s" $bench)
#echo -n "$size"
#LC_ALL= numfmt --grouping $size
#LC_ALL= printf "%'d" $size
#LC_NUMERIC=en_US printf "%'d" $size
#LC_NUMERIC=en_US printf "%'f" $size
#LC_NUMERIC=en_US printf "%'.f" $size
#LC_NUMERIC=en_US printf "%'10.10f" $size
#LC_NUMERIC=en_US /usr/bin/printf "%'d" $size
echo $size
else
echo -n "0"
fi
}
get_result()
{
bench=$1
config=$2
results=$(cat $SPEC/result.$config/CPU2017.002.log|grep Success|grep $bench|grep ratio=|sed 's/.*ratio=//'|sed 's/,.*//')
sum=0
count=0
for res in $results
do
sum=$(echo $sum + $res | bc)
count=$(echo $count + 1 | bc)
done
#echo sum=$sum
#echo count=$count
res=$(echo "scale=2; $sum / $count" | bc 2> /dev/null )
count=$(echo $res|wc -w)
if [ $count = 1 ]; then
echo -n $res
else
echo -n "0"
fi
}
get_raw_results()
{
get_raw_perf_results $tests_that_ran
get_raw_size_results $tests_that_ran
#get_raw_fde_results $tests_that_ran
}
get_raw_perf_results()
{
configs="$*"
first_config=$1
echo "--------------------------------------------------------------"
echo "Performance results are:"
echo "--------------------------------------------------------------"
echo benchmark $configs
for bench in $all_benchmarks
do
echo -n "$bench "
for config in $*
do
get_result $bench $config
echo -n " "
done
echo
done
}
get_raw_size_results()
{
echo "--------------------------------------------------------------"
echo "Size results are:"
echo "--------------------------------------------------------------"
configs=$*
echo benchmark $configs
for bench in $SPEC/result.$first_config/*mytest-m64
do
echo -n "$(basename $bench _base.mytest-m64) "
for config in $*
do
if [[ $config == "baseline" ]]; then
file="$SPEC/result.$config/$(basename $bench)"
cp $file /tmp/foo.exe
strip /tmp/foo.exe
file="/tmp/foo.exe"
else
file="$SPEC/result.$config/$(basename $bench)"
fi
res=$(get_size_result $file)
#printf "%15s" $res
echo -n " $res"
done
echo
done
}
get_raw_fde_results()
{
echo "--------------------------------------------------------------"
echo "FDE results are:"
echo "--------------------------------------------------------------"
configs=$*
echo benchmark $configs
for bench in $SPEC/result.$first_config/*mytest-m64
do
#printf "%-20s" $(basename $bench _base.amd64-m64-gcc42-nn)
echo -n $(basename $bench _base.amd64-m64-gcc42-nn)
for config in $*
do
file="$SPEC/result.$config/$(basename $bench)"
res=$(readelf -w $file |grep FDE|wc -l )
#if [[ $config == "baseline" ]]; then
#else
#fi
#printf "%15s" $res
echo -n " $res"
done
echo
done
}
main()
{
local zipr_flags=" --backend zipr --step-option zipr:--add-sections --step-option zipr:true"
local trace_flags=" --step-option zipr:--traceplacement:on --step-option zipr:true"
local relax_flags=" --step-option zipr:--relax:on --step-option zipr:true --step-option zipr:--unpin:on --step-option zipr:false"
local nounpin_flags=" --step-option zipr:--unpin:on --step-option zipr:false"
local split_flags=" --step-option fill_in_indtargs:--split-eh-frame "
local icall_flags=" --step-option fix_calls:--no-fix-icalls "
local p1flags=" -c p1transform=on "
# sets $SPEC
setup
local nops_config=$SPEC/config/gcc-linux-aarch64.cfg
local withps_config=$SPEC/config/gcc-linux-aarch64.withps.cfg
# baseline
run_test baseline $nops_config "$all_benchmarks"
PSOPTS="$zipr_flags " run_test zipr $withps_config "$all_benchmarks"
get_raw_results
}
main "$@"
......@@ -4,7 +4,7 @@ infile=$1
addr=$2
outfile=$3
gcc $infile -nostdlib -Wl,--section-start -Wl,eh_frame_hdr=$addr -Wl,-e -Wl,0x1000 -Wl,--build-id=none -Wl,-T -Wl,${PEASOUP_HOME}/tools/eh_frame_tools/eh_frame.ls -o $outfile -Wl,-Map,$outfile.map || exit
gcc $infile -nostdlib -Wl,--section-start -Wl,eh_frame_hdr=$addr -Wl,-e -Wl,0x1000 -Wl,--build-id=none -Wl,-T -Wl,${PEASOUP_HOME}/tools/eh_frame_tools/eh_frame.ls -o $outfile -Wl,-Map,$outfile.map -static -no-pie -fno-PIC || exit
#eu-readelf -S ./a.out
objcopy --rename-section eh_frame_hdr=.eh_frame_hdr --rename-section eh_frame=.eh_frame --rename-section gcc_except_table=.gcc_except_table $outfile
#eu-readelf -S -w ./b.out
......
Subproject commit 08b54f284e1baf726b28e11520aec25d6da9f322
Subproject commit b9545797fdfbfc6b184e2d4c8a49bd87cd88b54a