@@ -7,11 +7,11 @@ source /opt/emsdk/emsdk_env.sh
7
7
8
8
PLATFORM=$( uname -s | tr A-Z a-z)
9
9
10
+ WORK_DIR=$PWD
10
11
OUT_DIR=$PWD /out
11
12
WAMRC_CMD=$PWD /../../../wamr-compiler/build/wamrc
13
+ JETSTREAM_DIR=$PWD /perf-automation/benchmarks/JetStream2/wasm
12
14
13
- mkdir -p jetstream
14
- mkdir -p tsf-src
15
15
mkdir -p ${OUT_DIR}
16
16
17
17
if [[ $1 != " --no-simd" ]]; then
22
22
WASM_SIMD_FLAGS=" "
23
23
fi
24
24
25
- cd jetstream
26
-
27
- echo " Download source files .."
28
- wget -N https://browserbench.org/JetStream/wasm/gcc-loops.cpp
29
- wget -N https://browserbench.org/JetStream/wasm/quicksort.c
30
- wget -N https://browserbench.org/JetStream/wasm/HashSet.cpp
31
- wget -N https://browserbench.org/JetStream/simple/float-mm.c
32
-
33
- if [[ $? != 0 ]]; then
34
- exit
25
+ if [ ! -d perf-automation ]; then
26
+ git clone https://github.com/mozilla/perf-automation.git
27
+ echo " Patch source files .."
28
+ cd perf-automation
29
+ patch -p1 -N < ../jetstream.patch
35
30
fi
36
31
37
- echo " Patch source files .."
38
- patch -p1 -N < ../jetstream.patch
32
+ cd ${JETSTREAM_DIR}
33
+
34
+ # Build gcc-loops
39
35
40
36
echo " Build gcc-loops with g++ .."
41
37
g++ -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR} /gcc-loops_native gcc-loops.cpp
@@ -56,6 +52,8 @@ if [[ ${PLATFORM} == "linux" ]]; then
56
52
${WAMRC_CMD} --enable-segue -o ${OUT_DIR} /gcc-loops_segue.aot ${OUT_DIR} /gcc-loops.wasm
57
53
fi
58
54
55
+ # Build quicksort
56
+
59
57
echo " Build quicksort with gcc .."
60
58
gcc -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR} /quicksort_native quicksort.c
61
59
@@ -74,6 +72,8 @@ if [[ ${PLATFORM} == "linux" ]]; then
74
72
${WAMRC_CMD} --enable-segue -o ${OUT_DIR} /quicksort_segue.aot ${OUT_DIR} /quicksort.wasm
75
73
fi
76
74
75
+ # Build HashSet
76
+
77
77
echo " Build HashSet with g++ .."
78
78
g++ -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR} /HashSet_native HashSet.cpp \
79
79
-lstdc++
@@ -93,6 +93,10 @@ if [[ ${PLATFORM} == "linux" ]]; then
93
93
${WAMRC_CMD} --enable-segue -o ${OUT_DIR} /HashSet_segue.aot ${OUT_DIR} /HashSet.wasm
94
94
fi
95
95
96
+ # Build float-mm
97
+
98
+ cd ${JETSTREAM_DIR} /../simple
99
+
96
100
echo " Build float-mm with gcc .."
97
101
gcc -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR} /float-mm_native float-mm.c
98
102
@@ -111,7 +115,9 @@ if [[ ${PLATFORM} == "linux" ]]; then
111
115
${WAMRC_CMD} --enable-segue -o ${OUT_DIR} /float-mm_segue.aot ${OUT_DIR} /float-mm.wasm
112
116
fi
113
117
114
- cd ../tsf-src
118
+ # Build tsf
119
+
120
+ cd ${JETSTREAM_DIR} /TSF
115
121
116
122
tsf_srcs=" tsf_asprintf.c tsf_buffer.c tsf_error.c tsf_reflect.c tsf_st.c \
117
123
tsf_type.c tsf_io.c tsf_native.c tsf_generator.c tsf_st_typetable.c \
@@ -127,28 +133,6 @@ tsf_srcs="tsf_asprintf.c tsf_buffer.c tsf_error.c tsf_reflect.c tsf_st.c \
127
133
tsf_fsdb.c tsf_fsdb_protocol.c tsf_define_helpers.c tsf_ir.c \
128
134
tsf_ir_different.c tsf_ir_speed.c"
129
135
130
- tsf_files=" ${tsf_srcs} config.h gpc_worklist.h \
131
- tsf_config_stub.h tsf.h tsf_internal.h tsf_region.h tsf_types.h \
132
- gpc.h tsf_atomics.h tsf_define_helpers.h tsf_indent.h tsf_inttypes.h \
133
- tsf_serial_protocol.h tsf_util.h gpc_int_common.h tsf_build_defines.h \
134
- tsf_format.h tsf_internal_config.h tsf_ir_different.h tsf_sha1.h \
135
- tsf_zip_abstract.h gpc_internal.h tsf_config.h tsf_fsdb_protocol.h \
136
- tsf_internal_config_stub.h tsf_ir.h tsf_st.h \
137
- gpc_instruction_dispatch.gen gpc_instruction_stack_effects.gen \
138
- gpc_instruction_to_string.gen gpc_instruction_size.gen \
139
- gpc_instruction_static_size.gen gpc_interpreter.gen"
140
-
141
- echo " Download tsf source files .."
142
- for t in ${tsf_files}
143
- do
144
- wget -N " https://browserbench.org/JetStream/wasm/TSF/${t} "
145
- if [[ $? != 0 ]]; then
146
- exit
147
- fi
148
- done
149
-
150
- patch -p1 -N < ../tsf.patch
151
-
152
136
echo " Build tsf with gcc .."
153
137
gcc \
154
138
-o ${OUT_DIR} /tsf_native -O3 ${NATIVE_SIMD_FLAGS} \
0 commit comments