Advertisement
teknoraver

arch test

Jul 21st, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.82 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. archs='i386 i486 i586 pentium pentium-mmx pentiumpro i686 pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 nehalem westmere sandybridge ivybridge haswell broadwell bonnell silvermont knl k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3 athlon64-sse3 amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 btver1 btver2 winchip-c6 winchip2 c3 c3-2 geode'
  4.  
  5. dryes() {
  6.     local sum=0 res=0
  7.     for i in $(seq 1 $1); do
  8.         res=$(./dry 2>/dev/null |awk '/^Dhrystones/{print$4}')
  9.         sum=$((sum + res))
  10.     done
  11.     echo -n $((sum / $1))
  12. }
  13.  
  14. echo 'CPU,32 bit,64 bit'
  15. for a in $archs; do
  16.     echo -n "$a"
  17.     for b in 32 64; do
  18.         echo -n ,
  19.         make -s clean all CFLAGS="-m$b -O3 -march=$a" >/dev/null 2>/dev/null || continue
  20.         dryes 5
  21.     done
  22.     echo
  23. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement