Monkey Programming Forums/User Modules/Monkey-SIMD

FelipeA(Posted 2016) [#1]
Hi monkyes!

I want to share with you this little module/wrapper I created which exposes SIMD instructions to monkey. It's still work in progress but I was able to implement SSE, NEON and SIMD.js (experimental) instructions,

I've tested NEON on a raspberry pi 2 and it works correctly. I hope I can test it on iOS soon.

I've test compilation with MSVC, MinGW GCC and ARM GCC.

The HTML5 version requires Firefox Nightly Builds but a polyfill can be enabled using

Anyway, here is the repo with the code:


therevills(Posted 2016) [#2]
Cool! Whats SIMD? ;)

FelipeA(Posted 2016) [#3]

SIMD stands for Single Instruction Multiple Data. It's a way of parallelizing data and making use of cpu vector registers and instructions. In the case of this module we use 128 bit registers. This means, for example, you can do a vector arithmetic operation that is 4 times faster then a scalar one. Kind of like this:

Here I wrote I little blog post about it:

I also recommend watching this GDC talk which is really great because it focuses a lot on the use of simd on videogames.


FelipeA(Posted 2016) [#4]
Small update.

I've successfully tested the module on OS X and on iOS 9 (iPhone 5S). Here you can see a small vine showing off the module on PC using SSE, on Browser using SIMD.js and on iPhone using ARM's NEON.

therevills(Posted 2016) [#5]
Thanks for the explanation, sounds really cool!