-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperf-libm.sh
More file actions
executable file
·51 lines (46 loc) · 1.2 KB
/
perf-libm.sh
File metadata and controls
executable file
·51 lines (46 loc) · 1.2 KB
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
#!/bin/bash
declare -a func_list=(
"acosf" "acoshf" "asinf" "asinhf" "atan2" "atan2f" "atanf" "atanhf"
"cbrt" "cbrtf"
"cos" "cosf" "coshf" "cospif"
"erff" "exp" "exp10" "exp10f" "exp2" "exp2f" "exp2m1f"
"expf" "expm1" "expm1f"
"hypotf"
"log" "log10" "log10f" "log1p" "log1pf" "log2" "log2f" "logf"
"pow" "powf"
"sin" "sincos" "sincosf" "sinf" "sinhf" "sinpif"
"tan" "tanf" "tanhf"
)
if [ -z "${HOME_PATH}" ]; then
HOME_PATH=$HOME
fi
while [ -n "$1" ]; do
case "$1" in
--llvm )
LIBM="${HOME_PATH}/llvm-project/build/projects/libc/lib/libllvmlibc.a";
flag="--llvm --skip_system_libc --skip_core_math";
shift ;;
--musl )
LIBM="${HOME_PATH}/musl/lib/libc.a";
flag="--musl --skip_system_libc --skip_core_math";
shift ;;
--core_math )
LIBM="${HOME_PATH}/core_math/";
flag="--skip_system_libc";
shift ;;
--system )
LIBM="System libc";
flag="--skip_core_math";
shift ;;
--latency )
LATENCY="--latency";
shift ;;
* ) break ;;
esac
done
echo "LIBM location: ${LIBM}"
for func in "${func_list[@]}"
do
echo -n "$func "
CORE_MATH_QUIET=TRUE ./perf.sh $func --fast $flag
done