mpir/tune/benchmpn
2009-08-09 04:08:41 +00:00

24 lines
949 B
Bash
Executable File

#!/bin/bash
../config.guess | cut -d - -f 1
TMPFILE=$(tempfile)
for fn in mpn_add_n mpn_sub_n mpn_mul_1.333 mpn_addmul_1.333 mpn_submul_1.333 mpn_mul_2 mpn_addmul_2 mpn_submul_2 \
mpn_addadd_n mpn_addsub_n mpn_subadd_n mpn_lshift.3 mpn_rshift.3 mpn_lshift2 mpn_rshift2 mpn_lshift1 mpn_rshift1 \
mpn_addlsh1_n mpn_sublsh1_n mpn_rsh1add_n mpn_rsh1sub_n mpn_sumdiff_n mpn_store mpn_copyi mpn_copyd \
mpn_popcount mpn_hamdist mpn_com_n mpn_neg_n mpn_and_n mpn_xor_n mpn_ior_n mpn_nand_n mpn_nior_n mpn_xnor_n mpn_andn_n \
mpn_iorn_n mpn_lshift_com mpn_addlsh_n mpn_sublsh_n mpn_divexact_byff mpn_divexact_byc mpn_divexact_by2c
do
fnc=$(echo $fn | cut -d _ -f 2- | cut -d . -f 1)
while [ $(echo "$fnc" | wc -c) -le 10 ]
do
fnc=$(echo " $fnc")
done
echo -ne "$fnc\t"
./speed -c -s 1000 $fn > $TMPFILE 2>&1
if [ $? -eq 0 ] ; then
cat $TMPFILE | tail -n 1 | tr -s " " | cut -f 2 -d " " | cut -d . -f 1
else
echo
fi
done
rm -f $TMPFILE