diff --git a/etc/makefile b/etc/makefile index df4628bf..b30d5090 100644 --- a/etc/makefile +++ b/etc/makefile @@ -49,7 +49,7 @@ graphs: tune get_limbsize clean: rm -f *.log *.o *.obj *.exe pprime tune mersenne drprime mont 2kprime pprime.dat \ - tuning_list multiplying squaring readradix writeradix get_limbsize *png *.da *.dyn *.dpi *~ + tuning_list get_limbsize *.da *.dyn *.dpi *~ rm -rf .libs .PHONY: tune diff --git a/etc/plot_graphs.gp b/etc/plot_graphs.gp index 954ce598..f5ad31dc 100644 --- a/etc/plot_graphs.gp +++ b/etc/plot_graphs.gp @@ -7,22 +7,22 @@ set key top left; set ylabel "Time" set xlabel "Operand size (limbs)" -set output "multiplying.png"; +set output "multiplying".ARG1.".png"; set title "Comparing fast and slow multiplying [".ARG1." bits limbsize]"; -plot "multiplying" using 1:2 w lines t "slow", "multiplying" using 1:3 w lines t "fast" +plot "multiplying".ARG1."" using 1:2 w lines t "slow", "multiplying".ARG1."" using 1:3 w lines t "fast" -set output "squaring.png"; +set output "squaring".ARG1.".png"; set title "Comparing fast and slow squaring [".ARG1." bits limbsize]"; -plot "squaring" using 1:2 w lines t "slow", "squaring" using 1:3 w lines t "fast" +plot "squaring".ARG1."" using 1:2 w lines t "slow", "squaring".ARG1."" using 1:3 w lines t "fast" set xlabel "Operand size (bits)" -set output "readradix.png"; +set output "readradix".ARG1.".png"; set title "Comparing fast and slow radix conversion (reading) [".ARG1." bits limbsize]"; -plot "readradix" using 1:2 w lines t "slow", "readradix" using 1:3 w lines t "fast" +plot "readradix".ARG1."" using 1:2 w lines t "slow", "readradix".ARG1."" using 1:3 w lines t "fast" -set output "writeradix.png"; +set output "writeradix".ARG1.".png"; set title "Comparing fast and slow radix conversion (writing) [".ARG1." bits limbsize]"; -plot "writeradix" using 1:2 w lines t "slow", "writeradix" using 1:3 w lines t "fast" +plot "writeradix".ARG1."" using 1:2 w lines t "slow", "writeradix".ARG1."" using 1:3 w lines t "fast" diff --git a/etc/tune_it.sh b/etc/tune_it.sh index ee1e5824..d42f44c4 100755 --- a/etc/tune_it.sh +++ b/etc/tune_it.sh @@ -119,7 +119,7 @@ if [ $# -eq 1 ]; then if [ $OPTION0 -lt 500 ]; then OPTION0=500 fi - "$MPWD"/tune -p -r $RLOOPS -L $LAG -S "$RNUM" -o $OFFSET -M $1 -s $TMP0,$TMP1,$TMP2,$TMP3,$TMP4,$TMP5 + "$MPWD"/tune -p -r $RLOOPS -L $LAG -S "$RNUM" -o $OFFSET -M $1 -G $(./get_limbsize) -s $TMP0,$TMP1,$TMP2,$TMP3,$TMP4,$TMP5 fi diff --git a/makefile.shared b/makefile.shared index 368953ca..e48e2cd8 100644 --- a/makefile.shared +++ b/makefile.shared @@ -99,6 +99,9 @@ tuneold: $(LIBNAME) cd etc/; /bin/sh tune_it.sh; cd .. $(MAKE) -f makefile.shared +# etc/tune.c uses hidden symbols, so we assume that only difference between the shared and static +# libraries is just that: they are shared or static and simply build a static library to run +# etc/tune tune: $(MAKE) -f makefile tune $(MAKE) -f makefile clean @@ -116,32 +119,9 @@ graphsold: $(LIBNAME) cd .. $(MAKE) -f makefile.shared - -# Most of the substitution tricks do not work in Posix make and/or shell -# so we do it by hand. (Yes, it has to be in one line) graphs: $(MAKE) -f makefile graphs - cd etc/;\ - /bin/mv multiplying.png multiplying.png_backup;\ - /bin/mv squaring.png squaring.png_backup;\ - /bin/mv readradix.png readradix.png_backup;\ - /bin/mv writeradix.png writeradix.png_backup;\ - /bin/mv multiplying multiplying_backup;\ - /bin/mv squaring squaring_backup;\ - /bin/mv readradix readradix_backup;\ - /bin/mv writeradix writeradix_backup;\ - cd .. $(MAKE) -f makefile clean - cd etc/;\ - /bin/mv multiplying.png_backup multiplying.png;\ - /bin/mv squaring.png_backup squaring.png;\ - /bin/mv readradix.png_backup readradix.png;\ - /bin/mv writeradix.png_backup writeradix.png;\ - /bin/mv multiplying_backup multiplying;\ - /bin/mv squaring_backup squaring;\ - /bin/mv readradix_backup readradix;\ - /bin/mv writeradix_backup writeradix;\ - cd .. $(MAKE) -f makefile.shared