-
Notifications
You must be signed in to change notification settings - Fork 1
/
tbs
75 lines (64 loc) · 1.81 KB
/
tbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
#set -x
set -e
h=$(readlink -f $(dirname $0))
r=$(readlink -f $h/../..)
t=$r/tbs
d=MD5
export OCAMLRUNPARAM=b
if test $h = $PWD; then
mkdir -p build
cd build
fi
if ! md5sum --status -c $d; then
md5sum $h/build.ml $h/tbs $t/tbs.cma >$d.tmp
ocamlc.opt -o build.cmo -c -g -I $t $h/build.ml
ocamlc.opt -g -thread -I $t unix.cma threads.cma tbs.cma build.cmo -o b
mv $d.tmp $d
fi
#altivec=false
case $(hostname) in
laptop)
cc="gcc-4.3.0"
ccopt="-Wall -Werror -Wextra -Wno-unused-function"
ccopt="$ccopt -O3 -march=athlon64 -mtune=athlon64 -fprefetch-loop-arrays"
# ccopt="$ccopt -mfpmath=sse"
ccopt="$ccopt -DTIMING"
;;
linmac)
cc="$HOME/x/dev/gcc-4.3.0/bin/gcc";
#cc=gcc-4.4.1
ccopt="-Wall -Werror -Wextra -O3 -Wno-unused-function"
ccopt="$ccopt -DTIMING"
if $altivec; then
ccopt="$ccopt -mcpu=G4 -fno-unit-at-a-time -mtune=power6"
ccopt="$ccopt -fprefetch-loop-arrays"
ccopt="$ccopt -DG4 -DUSE_ALTIVEC"
#ccopt="$ccopt -fprofile-generate"
#ccopt="$ccopt -fprofile-use"
# ccopt="$ccopt -O0 -g -Wno-unused"
else
ccopt="$ccopt -fprefetch-loop-arrays -mtune=power6 -mcpu=G4"
ccopt="$ccopt -ftree-loop-linear -ftree-vectorize"
ccopt="$ccopt --param l1-cache-line-size=32"
fi
;;
ps3)
cc="gcc-4.3.1 -m32";
ccopt="-Wall -Werror -Wextra -O3 -Wno-unused-function";
ccopt="$ccopt -fprefetch-loop-arrays -mtune=power6 -mcpu=cell"
ccopt="$ccopt --param l1-cache-line-size=128"
ccopt="$ccopt -DTIMING"
if $altivec; then
ccopt="$ccopt -DUSE_ALTIVEC"
else
ccopt="$ccopt -ftree-loop-linear -ftree-vectorize"
fi
;;
*)
cc=cc
ccopt=-O2
;;
esac
targets="dormin imgv"
./b -O src:$h -r -O ccopt:"$ccopt" -O cc:"$cc" $* $targets