diff --git a/.gitattributes b/.gitattributes index bf6fba63af167e27a6f87348e4c3b5eab4f73269..9387aed829eafbe0dea63dd634eb07e11a91b861 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,33 +1,34 @@ * text=auto !eol /LICENSE.txt -text /Makefile -text -c++_examples/Makefile -text -c++_examples/derived2_throw.cpp -text -c++_examples/derived3_throw.cpp -text -c++_examples/derived4_throw.cpp -text -c++_examples/derived_throw.cpp -text -c++_examples/hanoi++.cpp -text -c++_examples/newdel.cpp -text -c++_examples/newdel_broke1.cpp -text -c++_examples/newdel_broke2.cpp -text -c++_examples/newdel_broke3.cpp -text -c++_examples/newdel_broke4.cpp -text -c++_examples/newdel_broke5.cpp -text -c++_examples/newdel_broke6.cpp -text -c++_examples/newdel_broke7.cpp -text -c++_examples/newdelete1.cpp -text -c++_examples/newdelete2.cpp -text -c++_examples/newdelete3.cpp -text -c++_examples/newdelete4.cpp -text -c++_examples/newdelete5.cpp -text -c++_examples/newdelete6.cpp -text -c++_examples/simple_throw.cpp -text -c++_examples/testit.sh -text -c++_examples/throw.cpp -text cgc_spri/Makefile -text cgc_spri/spawn_with_spri_open.c -text chopzero_src/Makefile -text chopzero_src/chopzero.c -text +cpp-examples/Makefile -text +cpp-examples/derived2_throw.cpp -text +cpp-examples/derived3_throw.cpp -text +cpp-examples/derived4_throw.cpp -text +cpp-examples/derived_throw.cpp -text +cpp-examples/hanoi++.cpp -text +cpp-examples/newdel.cpp -text +cpp-examples/newdel_broke1.cpp -text +cpp-examples/newdel_broke2.cpp -text +cpp-examples/newdel_broke3.cpp -text +cpp-examples/newdel_broke4.cpp -text +cpp-examples/newdel_broke5.cpp -text +cpp-examples/newdel_broke6.cpp -text +cpp-examples/newdel_broke7.cpp -text +cpp-examples/newdelete1.cpp -text +cpp-examples/newdelete2.cpp -text +cpp-examples/newdelete3.cpp -text +cpp-examples/newdelete4.cpp -text +cpp-examples/newdelete5.cpp -text +cpp-examples/newdelete6.cpp -text +cpp-examples/simple_throw.cpp -text +cpp-examples/test_spec.sh -text +cpp-examples/testit.sh -text +cpp-examples/throw.cpp -text demos/Makefile -text demos/demo.aug_9_2011/Makefile -text demos/demo.aug_9_2011/demo_heaprand.sh -text diff --git a/c++_examples/Makefile b/cpp-examples/Makefile similarity index 100% rename from c++_examples/Makefile rename to cpp-examples/Makefile diff --git a/c++_examples/derived2_throw.cpp b/cpp-examples/derived2_throw.cpp similarity index 100% rename from c++_examples/derived2_throw.cpp rename to cpp-examples/derived2_throw.cpp diff --git a/c++_examples/derived3_throw.cpp b/cpp-examples/derived3_throw.cpp similarity index 100% rename from c++_examples/derived3_throw.cpp rename to cpp-examples/derived3_throw.cpp diff --git a/c++_examples/derived4_throw.cpp b/cpp-examples/derived4_throw.cpp similarity index 100% rename from c++_examples/derived4_throw.cpp rename to cpp-examples/derived4_throw.cpp diff --git a/c++_examples/derived_throw.cpp b/cpp-examples/derived_throw.cpp similarity index 100% rename from c++_examples/derived_throw.cpp rename to cpp-examples/derived_throw.cpp diff --git a/c++_examples/hanoi++.cpp b/cpp-examples/hanoi++.cpp similarity index 100% rename from c++_examples/hanoi++.cpp rename to cpp-examples/hanoi++.cpp diff --git a/c++_examples/newdel.cpp b/cpp-examples/newdel.cpp similarity index 100% rename from c++_examples/newdel.cpp rename to cpp-examples/newdel.cpp diff --git a/c++_examples/newdel_broke1.cpp b/cpp-examples/newdel_broke1.cpp similarity index 100% rename from c++_examples/newdel_broke1.cpp rename to cpp-examples/newdel_broke1.cpp diff --git a/c++_examples/newdel_broke2.cpp b/cpp-examples/newdel_broke2.cpp similarity index 100% rename from c++_examples/newdel_broke2.cpp rename to cpp-examples/newdel_broke2.cpp diff --git a/c++_examples/newdel_broke3.cpp b/cpp-examples/newdel_broke3.cpp similarity index 100% rename from c++_examples/newdel_broke3.cpp rename to cpp-examples/newdel_broke3.cpp diff --git a/c++_examples/newdel_broke4.cpp b/cpp-examples/newdel_broke4.cpp similarity index 100% rename from c++_examples/newdel_broke4.cpp rename to cpp-examples/newdel_broke4.cpp diff --git a/c++_examples/newdel_broke5.cpp b/cpp-examples/newdel_broke5.cpp similarity index 100% rename from c++_examples/newdel_broke5.cpp rename to cpp-examples/newdel_broke5.cpp diff --git a/c++_examples/newdel_broke6.cpp b/cpp-examples/newdel_broke6.cpp similarity index 100% rename from c++_examples/newdel_broke6.cpp rename to cpp-examples/newdel_broke6.cpp diff --git a/c++_examples/newdel_broke7.cpp b/cpp-examples/newdel_broke7.cpp similarity index 100% rename from c++_examples/newdel_broke7.cpp rename to cpp-examples/newdel_broke7.cpp diff --git a/c++_examples/newdelete1.cpp b/cpp-examples/newdelete1.cpp similarity index 100% rename from c++_examples/newdelete1.cpp rename to cpp-examples/newdelete1.cpp diff --git a/c++_examples/newdelete2.cpp b/cpp-examples/newdelete2.cpp similarity index 100% rename from c++_examples/newdelete2.cpp rename to cpp-examples/newdelete2.cpp diff --git a/c++_examples/newdelete3.cpp b/cpp-examples/newdelete3.cpp similarity index 100% rename from c++_examples/newdelete3.cpp rename to cpp-examples/newdelete3.cpp diff --git a/c++_examples/newdelete4.cpp b/cpp-examples/newdelete4.cpp similarity index 100% rename from c++_examples/newdelete4.cpp rename to cpp-examples/newdelete4.cpp diff --git a/c++_examples/newdelete5.cpp b/cpp-examples/newdelete5.cpp similarity index 100% rename from c++_examples/newdelete5.cpp rename to cpp-examples/newdelete5.cpp diff --git a/c++_examples/newdelete6.cpp b/cpp-examples/newdelete6.cpp similarity index 100% rename from c++_examples/newdelete6.cpp rename to cpp-examples/newdelete6.cpp diff --git a/c++_examples/simple_throw.cpp b/cpp-examples/simple_throw.cpp similarity index 100% rename from c++_examples/simple_throw.cpp rename to cpp-examples/simple_throw.cpp diff --git a/cpp-examples/test_spec.sh b/cpp-examples/test_spec.sh new file mode 100755 index 0000000000000000000000000000000000000000..24e73bfbdef08104b1035d7cba95b571e7531228 --- /dev/null +++ b/cpp-examples/test_spec.sh @@ -0,0 +1,140 @@ +#!/bin/bash + +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 + " +number=1 + +setup() +{ + + if [ ! -d spec2006 ]; then + svn co ^/spec2006/trunk spec2006 + fi + + + cd spec2006/ + if [ ! -L bin ]; then + ln -s bin.power/ bin + fi + source shrc + bin/relocate +} + + +run_test() +{ + config_name=$1 + config=$2 + cd $SPEC + if [ ! -d result.$config_name ]; then + rm -Rf result/* + runspec --action scrub --config $config $benchmarks + runspec --action validate --config $config -n $number $benchmarks + cp benchspec/CPU2006/*/exe/* result + mv result result.$config_name + fi + +} + +get_size_result() +{ + bench=$1 + size=$(stat --printf="%s" $bench) + echo -n $size +} + +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 "N/A" + fi + +} + +get_raw_results() +{ + echo "--------------------------------------------------------------" + echo "Performance results are:" + echo "--------------------------------------------------------------" + configs=$* + echo benchmark $configs + for bench in $benchmarks + do + echo -n "$bench " + for config in $* + do + get_result $bench $config + echo -n " " + done + echo + done + + echo "--------------------------------------------------------------" + echo "Size results are:" + echo "--------------------------------------------------------------" + configs=$* + echo benchmark $configs + for bench in $SPEC/result.$config/*_base.amd64-m64-gcc42-nn + do + echo -n "$(basename $bench _base.amd64-m64-gcc42-nn) " + for config in $* + do + file="$SPEC/result.$config/$(basename $bench)" + get_size_result $file + echo -n " " + done + echo + done + +} + + +main() +{ + start_dir=$(pwd) + setup + #run_test baseline $SPEC/config/ubuntu14.04lts-64bit.cfg + #PSOPTS="--backend zipr" run_test zipr $SPEC/config/ubuntu14.04lts-64bit-withps.cfg + PSOPTS="--backend zipr --step-option fill_in_indtargs:--split-eh-frame " run_test split $SPEC/config/ubuntu14.04lts-64bit-withps.cfg + #PSOPTS="--backend zipr --step-option fill_in_indtargs:--split-eh-frame --step-option fix_calls:--no-fix-icalls " run_test split_no-fix-icalls $SPEC/config/ubuntu14.04lts-64bit-withps.cfg + + get_raw_results baseline + +} + +main "$@" + + + diff --git a/c++_examples/testit.sh b/cpp-examples/testit.sh similarity index 88% rename from c++_examples/testit.sh rename to cpp-examples/testit.sh index 309dd230fcea3cd8a9bd2c589ee66240c5d1d4c7..25c5c6917acd870e03d07766d50d161713df1ff6 100755 --- a/c++_examples/testit.sh +++ b/cpp-examples/testit.sh @@ -47,8 +47,9 @@ doit_meta() doit $src $option doit $src $option -fPIC - doit $src $option -fPIC -fPIE - doit $src $option -fPIC -fPIE -fomit-frame-pointer + doit $src $option -fPIC -fomit-frame-pointer + doit $src $option -fPIC -pie + doit $src $option -fPIC -fomit-frame-pointer -pie } main() diff --git a/c++_examples/throw.cpp b/cpp-examples/throw.cpp similarity index 100% rename from c++_examples/throw.cpp rename to cpp-examples/throw.cpp