SIMD 单指令/多数据

标准移动到 WASM

SIMD (pronounced "seem-dee") is short for Single Instruction/Multiple Data which is one classification of computer architectures. SIMD allows one same operation to be performed on multiple data points resulting in data level parallelism and thus performance gains, for example for 3D graphics and video processing, physics simulations or cryptography, and other domains. 传统的数据串行操作叫做SISD.

JS 内置对象, 目前只有 firefox 支持
它的方法是静态方法,就像 Math 对象

var a = SIMD.Float32x4(1, 2, 3, 4);
var b = SIMD.Float32x4(5, 6, 7, 8);
var c = SIMD.Float32x4.add(a,b);
a, b, c 是一个InlineTransparentTypedObject, 不可变
目前有12种数据类型,构造函数SIMD.%type%.splat(n)
返回给定轨道值: SIMD.%type%.extractLane(t, index)