I would like to experiment with SIMD (single instruction multiple data). From what I can glean from Google Group postings, people have been working to add this to Google Chrome, but when I try to call SIMD.Float32x4
in Chrome 46, I get that SIMD is undefined.
My googling suggests there might be some experimental versions of Chrome that have SIMD support. What is the newest version that includes it and what mand line flags need to be set in order to use it? Do I need to use strict mode?
When will SIMD be rolled into the stable Chrome build?
Also does it make a difference running SIMD instructions if I run a 32 bit version of Chrome or a 64 bit version?
I would like to experiment with SIMD (single instruction multiple data). From what I can glean from Google Group postings, people have been working to add this to Google Chrome, but when I try to call SIMD.Float32x4
in Chrome 46, I get that SIMD is undefined.
My googling suggests there might be some experimental versions of Chrome that have SIMD support. What is the newest version that includes it and what mand line flags need to be set in order to use it? Do I need to use strict mode?
When will SIMD be rolled into the stable Chrome build?
Also does it make a difference running SIMD instructions if I run a 32 bit version of Chrome or a 64 bit version?
Share Improve this question edited Nov 29, 2016 at 21:59 Yves M. 31k24 gold badges109 silver badges149 bronze badges asked Oct 28, 2015 at 21:48 brucecengbruceceng 2,1821 gold badge19 silver badges24 bronze badges 2- Maybe the Google developer forum would be a better place to ask this. – Barmar Commented Oct 28, 2015 at 22:09
- 2 Note to future visitors: Looks like chrome is dropping SIMD support in JS and only allowing it in WebAssembly :\ – user993683 Commented Jun 24, 2017 at 4:21
2 Answers
Reset to default 12Update (24/6/17): Chrome is dropping SIMD support in JS and only allowing it in WebAssembly.
Update: Now it's possible in the latest version of Chrome with a flag:
--js-flags="--harmony-simd"
In Chrome shortcut properties(i.e. on your desktop) "Target" field will look something like this
"C:\Users\Pav\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --js-flags="--harmony-simd"
Old answer:
You can try them out in Node before they will be added to Chrome (same JavaScript engine)
Install latest Node from https://nodejs/en/
Run your JavaScript as "node --harmony-simd index.js" (your code in index.js)
Print output from your script just like in Chrome console using console.log('BANG') or just log('TEST 2')
Option 2
Not Chrome solution but you can use SIMD in Firefox. Download Firefox Nightly which has SIMD already integrated. SIMD is almost identical between browsers.
https://nightly.mozilla/
If someone could explain how to build the latest Chromium with native SIMD(not polyfill as it's now) support that would be great.
It seems that the extent of SIMD in Chromium is an experimental contribution by Intel from 2013.
You can try it out in a special build of Chromium 37 (ia32). Source: IDF14 demo links.
To try it out download the build for your platform and start with the mand-line flag --js-flags=--simd-object
.
For example, on OSX:
./Chromium.app/Contents/MacOS/Chromium --js-flags=--simd-object
The SIMD
object is available in the JavaScript console:
var a = SIMD.float32x4(1, 2, 3, 4);
var b = SIMD.float32x4(5, 6, 7, 8);
var c = SIMD.float32x4.add(a,b);
console.log(c.toString())
// > float32x4(6,8,10,12)
I could find no information about intent to merge (but would love to hear something authoritative).