News for hackers. Stuff that matters.
Re:Intel Bringing SIMD to JavaScript by mantrax5 on Wednesday June 11, 2014 @07:44AM (#7877448)
"There is encouraging evidence that SIMD will enable a whole new class of application domains and high-performance libraries in JavaScript."

Anyone take a guess what those might be (honest question)?

In the past SIMD has been the primary way to accelerate audio and graphics related compute tasks, but with WebGL and shaders, JS users already have a very powerful vector processing unit at their fingertips.

Re:Intel Bringing SIMD to JavaScript by ahoge on Wednesday June 11, 2014 @08:43AM (#7877674)
Check "Bringing SIMD to the Web via Dart" by John McCutchan:

https://www.youtube.com/watch?v=CKh7UOELpPo

He's also the guy wrote the proposal for ECMAScript:

https://github.com/johnmccutchan/ecmascript_simd

Also, using SIMD is way easier than using shaders. You just write something like this:

  double average (Float32x4List list) {
    var n = list.length;
    var sum = new Float32x4.zero();
    for (int i = 0; i < n; i++) {
      sum += list[i];
    }
    var total = sum.x + sum.y + sum.z + sum.w;
    return total / (n * 4);
  }
Instead of:

  double average (Float32List list) {
    var n = list.length;
    var sum = 0.0;
    for (int i = 0; i < n; i++) {
      sum += list[i];
    }
    return sum / n;
  }
Re:Intel Bringing SIMD to JavaScript by general_failure on Wednesday June 11, 2014 @11:54AM (#7878647)
I am still looking for practical examples. Unless there is a usecase for averaging gazillion numbers on the client (I would like to know what the use case for that is)
Re:Intel Bringing SIMD to JavaScript by ahoge on Wednesday June 11, 2014 @03:02PM (#7879800)
> Unless there is a usecase for averaging gazillion numbers on the client

Adding 2 numbers (x4) is just the simplest thing you can do.

There are a bunch of other operators and methods:

https://api.dartlang.org/apidocs/channels/stable/dartdoc-vie...

Good intro:

https://www.dartlang.org/articles/simd/

GMMs in speech recognition:

http://dartogreniyorum.blogspot.com/2013/05/performance-opti...

(Be sure to check the follow up article for the updated numbers.)

Re:Intel Bringing SIMD to JavaScript by figglesonrails on Wednesday June 11, 2014 @12:25PM (#7878848)
OK- Look at people trying to make 3D games for the web. GPU performance is a concern, but if you can't even run the physics simulation or cull your object database fast enough to push triangles to the GPU, your performance will be hurt and the GPU will be idle. People want games based on WebGL to have comparable performance to native apps -- well, you're going to need to take all of the libraries that games use and convert them too. This is a good solution to allow such SIMD optimization that have been present in native libs for years to have a chance to surface in JS libraries.
Re:Intel Bringing SIMD to JavaScript by spankalee on Wednesday June 11, 2014 @03:52PM (#7880064)
There's a skeletal animation demo that was made to show off Dart SIMD support. The bottleneck was the animation, not the 3D rendering, and using SIMD allowed almost 4x the number of characters to be drawn.
Re:Intel Bringing SIMD to JavaScript by yoklov on Thursday June 12, 2014 @12:27AM (#7881817)
This is exactly what people should use WebGL for. Software skinning sucks, esp. if you can avoid it (e.g. with a vertex shader).

(That said, there are plenty of other areas for using SIMD in JS)

Re:Intel Bringing SIMD to JavaScript by baq on Wednesday June 11, 2014 @07:50AM (#7877474)
complex physics engines, games, etc. come to mind. not everything parallel is doable in shaders/opencl.
Re:Intel Bringing SIMD to JavaScript by fulafel on Wednesday June 11, 2014 @04:25PM (#7880220)
It is somewhat hyperbolic, given nothing prevents jit compilers using SIMD on standard JS typed array loops. And SIMD rarely givers more than 2x speedup for on app level even in native games and such.
Re:Intel Bringing SIMD to JavaScript by moron4hire on Wednesday June 11, 2014 @07:54AM (#7877489)
Except on systems without good GPUs.
Re:Intel Bringing SIMD to JavaScript by pjmlp on Wednesday June 11, 2014 @11:09AM (#7878380)
SIMD is CPU related not GPU.
Re:Intel Bringing SIMD to JavaScript by moron4hire on Wednesday June 11, 2014 @11:49AM (#7878610)
Yes, I know. The person I was replying to was questioning why someone would want SIMD when shaders on a GPU were available. Well, if you don't have a GPU, shaders aren't available (or at least emulated at a huge performance hit).
Re:Intel Bringing SIMD to JavaScript by pjmlp on Wednesday June 11, 2014 @12:12PM (#7878756)
Ah, sorry I missed that.