Content deleted Content added
→SIMD on the web: Add {{Citation needed}} to unsourced and unclear claim |
m Dating maintenance tags: {{Citation needed}} |
||
Line 121:
Instances of these types are immutable and in optimized code are mapped directly to SIMD registers. Operations expressed in Dart typically are compiled into a single instruction without any overhead. This is similar to C and C++ intrinsics. Benchmarks for [[4×4 matrix|4×4]] [[matrix multiplication]], [[3D vertex transformation]], and [[Mandelbrot set]] visualization show near 400% speedup compared to scalar code written in Dart.
McCutchan's work on Dart, now called SIMD.js, has been adopted by [[ECMAScript]] and Intel announced at IDF 2013 that they are implementing McCutchan's specification for both [[V8 (JavaScript engine)|V8]] and [[SpiderMonkey (JavaScript engine)|SpiderMonkey]].<ref>{{cite web |title=SIMD in JavaScript |url=https://01.org/node/1495 |website=01.org |date=8 May 2014}}</ref> However, by 2017, SIMD.js has been taken out of the ECMAScript standard queue in favor of pursuing a similar interface in [[WebAssembly]].<ref>{{cite web |title=tc39/ecmascript_simd: SIMD numeric type for EcmaScript. |url=https://github.com/tc39/ecmascript_simd/ |website=GitHub |publisher=Ecma TC39 |access-date=8 September 2019 |date=22 August 2019}}</ref> As of August 2020, the WebAssembly interface remains unfinished, but its portable 128-bit SIMD feature has already seen some use in many engines.{{Citation needed|date=March 2025}}
Emscripten, Mozilla's C/C++-to-JavaScript compiler, with extensions can enable compilation of C++ programs that make use of SIMD intrinsics or GCC-style vector code to the SIMD API of JavaScript, resulting in equivalent speedups compared to scalar code.<ref>{{cite web |title=SIMD in JavaScript via C++ and Emscripten |first1=Peter |last1=Jensen |first2=Ivan |last2=Jibaja |first3=Ningxin |last3=Hu |first4=Dan |last4=Gohman |first5=John |last5=McCutchan |year=2015 |format=PDF |url=https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnx3cG12cDIwMTV8Z3g6NTkzYWE2OGNlNDAyMTRjOQ}}</ref> It also supports (and now prefers) the WebAssembly 128-bit SIMD proposal.<ref>{{cite web |title=Porting SIMD code targeting WebAssembly |url=https://emscripten.org/docs/porting/simd.html |website=Emscripten 1.40.1 documentation}}</ref>
|