-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (49 loc) · 1.69 KB
/
Makefile
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
.PHONY: all test clean build
C_ERRS += -Wall -Wextra -Wpedantic \
-Wformat=2 -Wno-unused-parameter -Wshadow \
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition \
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs \
-Wno-unused -fms-extensions
run: test test_clang check
# Should run something like
# `source ~/Projects/spikes/emsdk/emsdk_env.sh`
# first to setup environment
test_wasm: clean
mkdir -p bin
CC=emcc OUT=./bin/run_tests.html \
CFLAGS='-std=c99 -Wall -Werror -Wno-unused -v -Os -funroll-loops -fopenmp' \
./test.sh
test: clean
mkdir -p bin
CC=gcc OUT=./bin/run_tests \
CFLAGS='-std=c99 $(C_ERRS) -g3 -v -O3 -funroll-loops -msse3 -fopenmp' \
./test.sh
# objdump -S --disassemble ./bin/run_tests > ./bin/run_tests.asm
./bin/run_tests
test_clang: clean
mkdir -p bin
CC=clang OUT=./bin/run_tests \
CFLAGS='-std=c99 $(C_ERRS) -g3 -v -O3 -funroll-loops -msse3' \
./test.sh
# objdump -S --disassemble ./bin/run_tests > ./bin/run_tests.asm
./bin/run_tests
perf:
#####################################
# build as user, but run this sudo
#####################################
# The output also estimates the instructions per processor
# clock cycle (IPC). The higher IPC the more efficiently the
# processor is executing instruction on the system.
#
# The ratio of cache-misses to instructions will give an indication
# how well the cache is working; the lower the ratio the better.
# ratio = (cache-misses / instructions) ---- 0.000247968
perf stat -e task-clock,cycles,instructions,cache-references,cache-misses ./bin/run_tests
# perf record -e cache-misses ./bin/run_tests
# perf report
# perf annotate
# perf stat ./bin/run_tests
check:
./check.sh
clean:
rm -rf bin