-
Notifications
You must be signed in to change notification settings - Fork 1
/
anja
executable file
·49 lines (44 loc) · 693 Bytes
/
anja
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
#!/bin/bash
diff <(grep 'flags' /proc/cpuinfo | head -n1 | sed 's/^.*: \(.*\)/\1/' | tr ' ' '\n' | sort) <(sort << Core_ix
aes
avx
cx16
fsgsbase
fxsr
mmx
pclmulqdq
popcnt
lahf_lm
sse
pni
sse2
sse4_1
sse4_2
ssse3
xsave
xsaveopt
Core_ix
) | grep '^>' >/dev/null
if [ $? -eq 1 ]; then
arch="coreix"
else
arch="presc2m"
fi
options=()
debug=0
mode="rel"
for option in "$@"; do
if [ "$option" == "--debug" ]; then
debug=1
mode="dbg"
else
options+=("$option")
fi
done
current_dir=$(dirname "`readlink -f "${BASH_SOURCE[0]}"`")
binary="$current_dir"/__targets_"$mode"_"$arch"/anja
if [ $debug -eq 1 ]; then
gdb --args "$binary" "${options[@]}"
else
exec "$binary" "${options[@]}"
fi