SIMD support in fastcomp

108 views
Skip to first unread message

Soeren Balko

unread,
Mar 29, 2014, 5:32:42 AM3/29/14
to emscripte...@googlegroups.com
I was wondering how SIMD is supported in fastcomp - is it the same as gcc's vector types with basic math operations? Or are specific platform-specific intrinsics (MMX, SSE, AVX, NEON and friends) supported too? The latter is probably not possible as it is inherently not portable. And are there any plans for an auto-vectorization feature?

Soeren

Alon Zakai

unread,
Mar 29, 2014, 1:19:19 PM3/29/14
to emscripte...@googlegroups.com
See system/include/emscripten/vector.h, emmintrin.h and xmmintrin.h

It implements the JS SIMD spec, which is a portable subset of SIMD stuff,

https://github.com/johnmccutchan/ecmascript_simd

JS engines don't optimize it yet, but hopefully soon.

- Alon



On Sat, Mar 29, 2014 at 2:32 AM, Soeren Balko <soe...@zfaas.com> wrote:
I was wondering how SIMD is supported in fastcomp - is it the same as gcc's vector types with basic math operations? Or are specific platform-specific intrinsics (MMX, SSE, AVX, NEON and friends) supported too? The latter is probably not possible as it is inherently not portable. And are there any plans for an auto-vectorization feature?

Soeren

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sören Balko

unread,
Mar 29, 2014, 5:27:00 PM3/29/14
to emscripte...@googlegroups.com
Looks good! And hasn't Firefox very recently gained SIMD support? In other words, wouldn't I benefit from SIMD hardware support when making use of the intrinsics you added? 

Other than that, do I need to use the intrinsics you introduced or can I also use plain math operators between vector types and emcc maps these to the intrinsics?

Btw, PNaCl will add SIMD support very soon (see here: https://groups.google.com/forum/m/#!topic/native-client-discuss/CgLtRlGIDIU). Any chance to co-ordinate the efforts, such that one can compile into asm.js and PNaCl from the same source? I know, that's asking a lot... ;-)

Soeren
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/YypFwcfL16A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.

Alon Zakai

unread,
Mar 31, 2014, 2:12:23 PM3/31/14
to emscripte...@googlegroups.com
I'm not sure on the landing status of SIMD in firefox, sorry. It might already be there, but it might also be behind a flag or such.

Add, subtract, etc. should work, see the simd tests for examples including that.

I don't follow PNaCl closely but do talk to the devs, I can raise the topic. But since emscripten follows the JS SIMD API, which was derived from the Dart one, it might or might not be a match to the PNaCl one (which I haven't seen).

- Alon

Reply all
Reply to author
Forward
0 new messages