Chrome To Support Simd.js
Wednesday, 13 May 2015

With Firefox support and Microsoft working on it in Chakra, the news that Chrome is to get Simd.js support completes the set - apart from Safari that is. 

chromiumicon

 

SIMD - or Single Instruction Multiple Data - is one of the simplest and easiest parallel processing mechanisms. Essentially what it comes down to is packing multiple values into a single register and then performing the operation as if it was a single value. Of course, there are some overheads - you have to pack and unpack the data - but in most cases these can be minimized. 

It isn't as good as using the GPU, but it is very much simpler. It is also something that a lot of C/C++ programs make use of to speed up things like codecs and game computations.

Given that JavaScript is the target of compilers like Emscripten, which have been used to convert games and other graphics programs to so that they run in the browser, not having SIMD support in JavaScript limits the range of programs that can be compiled without manual modification. There is an official polyfill that emulates SIMD using typed arrays, but it is slow. 

RealSIMD can produce a 3x or better speed up of programs that make heavy use of it. 

In the chart below you can see Mozilla's figures for running the polyfill v simd.js as part of Asm.js.

simdjs

 

The process of adding SIMD instructions to JavaScript is surprisingly easy. All you need are three new vector types: float32x4, float64x2, and int32x4, and some typed array views. Once the data is loaded into the new data types, the arithmetic operators work as parallel operations. That is, if you multiply two float32x4 variables, all four floats are multiplied in one operation. 

There is a small problem that different hardware supports different types of SIMD instructions. The good news is that there is a core of operations that are supported by SSE on Intel and AMD  x86 and by NEON on ARM. Hence there are no 256- and 512-bit vector operations. What this means is that the simd.js extensions will work on x86 and ARM platforms and Google is planning support on all Blink platforms. This will allow Android to run programs that use SIMD. 

 

chromedevs

Banner


Pico 2W Announced But There Is A Surprise!
25/11/2024

Raspberry Pi released the Pico 2 a few months ago and we have been waiting for the Pico 2W since then. But Pimoroni beat them to the draw with the Pico Plus 2W based on the RM2 radio module and hinted [ ... ]



GitHub Announces Free Copilot
19/12/2024

GitHub has launched GitHub Copilot Free, a free version of Copilot that provides limited access to selected features of Copilot and is automatically integrated into VS Code. The free tier is aimed at  [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Thursday, 14 October 2021 )