How to run wasm simd by V8 of arm64.debug?

18 views
Skip to first unread message

Yahan Lu

unread,
Jun 30, 2021, 3:47:04 AM6/30/21
to v8-dev
I build simd.cc :

#include <wasm_simd128.h>
int fun(v128_t a,v128_t b) {
  v128_t prod = wasm_i32x4_add(a, b);
  return prod[0];
}
int main() {
  v128_t a = {1,2,3,4};
  v128_t b = {5,4,6,8};
  return fun(a,b);
}

Build it:
emcc -msimd128 -O3 foo.c -o foo.js

And run 
./arm64.debug/d8 ./foo.js  --experimental-wasm-simd --print-code

But i don't find any Neon instr in code that be printed by v8?
I remeber it can work on January 2021.

Yahan Lu

unread,
Jun 30, 2021, 4:11:10 AM6/30/21
to v8-dev
Oh sorry . I can't build it by O3.

Zhi An Ng

unread,
Jun 30, 2021, 12:40:06 PM6/30/21
to v8-...@googlegroups.com
I guess you figured it out, everything is optimized away.
You can put a EMSCRIPTEN KEEPALIVE (https://emscripten.org/docs/api_reference/emscripten.h.html#c.EMSCRIPTEN_KEEPALIVE) on "fun" and it should prevent it from being optimized (don't even need to call it).

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/0e9e7d97-4b04-4d8e-80c1-88a1dd6f40b3n%40googlegroups.com.


--
Best,
Zhi An
Reply all
Reply to author
Forward
0 new messages