Monkey-SIMD

Monkey 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
#SIMD_JS_POLYFILL = True

Anyway, here is the repo with the code:

https://github.com/bitnenfer/monkey-simd

Cheers,
Felipe


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


FelipeA(Posted 2016) [#3]
Hi,

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:

http://voidptr.io/blog/2016/02/10/The-SIMD-Experience.html

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

http://gdcvault.com/play/1022248/SIMD-at-Insomniac-Games-How

Cheers,
Felipe


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.

https://vine.co/v/iHejKanptu0


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