The experimental JavaScript SIMD API introduces vector objects that utilize SIMD/SSE instructions on supporting CPUs; SIMD is short for Single Instruction/Multiple Data. SIMD operations are methods that process multiple data with a single instruction. In contrary, scalar operations (SISD) process only one individual data with a single instruction.
The SIMD.Bool16x8 data type is a 128-bit vector divided into 8 lanes storing boolean values.
The SIMD.Bool32x4 data type is a 128-bit vector divided into 4 lanes storing boolean values.
The SIMD.Bool64x2 data type is a 128-bit vector divided into 2 lanes storing boolean values.
The SIMD.Bool8x16 data type is a 128-bit vector divided into 16 lanes storing boolean values.
The SIMD.Float32x4 data type is a 128-bit vector divided into 4 lanes storing single precision floating point values.
The SIMD.Float64x2 data type is a 128-bit vector divided into 2 lanes storing double precision floating point values.
The SIMD.Int16x8 data type is a 128-bit vector divided into 8 lanes storing 16-bit signed integer values.
The SIMD.Int32x4 data type is a 128-bit vector divided into 4 lanes storing 32-bit signed integer values.
The SIMD.Int8x16 data type is a 128-bit vector divided into 16 lanes storing 8-bit signed integer values.
SIMD (pronounced "sim-dee") is short for Single Instruction/Multiple Data which is one classification of computer architectures. SIMD operations perform the same computation 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.
The static SIMD.%type%.abs() method returns a new SIMD data type with absolute values. This operation exists only on floating point SIMD types.
The static SIMD.%type%.add() method returns a new instance with the lane values added (a + b).
The static SIMD.%type%.addSaturate() method returns a new instance with the lane values added (a + b) and saturating behavior on overflow.
The static SIMD.%BooleanType%.allTrue() method returns a Boolean indicating whether or not all lanes hold a true value.
The static SIMD.%type%.and() method returns a new instance with the logical AND of the lane values (a & b). This operation exists only on integer and boolean SIMD types.
The static SIMD.%BooleanType%.anyTrue() method returns a Boolean indicating whether or not any of the lanes hold a true value.
The static SIMD.%type%.check() method returns a SIMD data type if the parameter is a valid SIMD data type and the same as %type%. Otherwise, a TypeError is thrown.
The static SIMD.%type%.div() method returns a new instance with the lane values divided (a / b). This function is defined only on floating point SIMD types.
The static SIMD.%type%.equal() method returns a selection mask with values depending on a strict equality comparison (a === b) in each lane.