-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] webassembly simd as new dedicated target #5902
Comments
runtime simd and relaxed-simd discovery #include <stdio.h>
#include <emscripten.h>
EM_JS(int, check_simd_support, (), {
return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]));
});
EM_JS(int, check_relaxed_simd_support, (), {
return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11]));
});
int main()
{
printf("simd = %d\n", check_simd_support());
printf("relaxed-simd = %d\n", check_relaxed_simd_support());
return 0;
}
|
wasm code coverage # compile with --coverage -fprofile-arcs -ftest-coverage -g
emcc test.cpp -c -o test.o --coverage -fprofile-arcs -ftest-coverage -g
emcc simplegcov.cpp -c -o simplegcov.o --coverage -fprofile-arcs -ftest-coverage -g
# link with --coverage -g -s FORCE_FILESYSTEM=1 -sEXIT_RUNTIME=1
# link with -lnodefs.js -lnoderawfs.js
emcc test.o simplegcov.o -o test.js -s EXPORTED_FUNCTIONS='["_main"]' --coverage -g -s FORCE_FILESYSTEM=1 -sEXIT_RUNTIME=1 -lnodefs.js -lnoderawfs.js
# run wasm
node test.js
# collect gcda and generate output html
lcov -d ./ -c --gcov-tool `pwd`/llvm-gcov -o lcov.info --ignore-errors inconsistent
genhtml lcov.info -o ./output --ignore-errors inconsistent the llvm-gcov wrapper
|
This was referenced Feb 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pros
cons
to be investigated
resources
llvm wasm simd header
https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/wasm_simd128.h
simd
https://github.com/WebAssembly/simd/blob/main/proposals/simd/SIMD.md
relaxed-simd
https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md
half-precision
https://github.com/WebAssembly/half-precision/blob/main/proposals/half-precision/Overview.md
The text was updated successfully, but these errors were encountered: