PP
Size: a a a
PP
К
К
К
-DEMSCRIPTEN -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=10 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -msimd128
К
N
PP
PP
К
PP
К
PP
PP
P🍣
#include <emscripten/bind.h>и собрал:
using namespace emscripten;
int roll(int from, int to) {
int res = from;
for(int i = from; i < 1024*1024 && i < to; i ++) {
res *= i;
}
return res;
}
EMSCRIPTEN_BINDINGS(my_module) {
function("roll", &roll);
}
emcc test.cpp --bind -s WASM=1 -o test.ns.js -O3Получил 2 идентичных бинаря
emcc test.cpp --bind -s WASM=1 -o test.s.js -O3 -msimd128 -fno-vectorize
К
К
К
К
P🍣
К