We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


SIMD.js has been taken out of active development in TC39 and removed from Stage 3. It is not being pursued by web browsers for implementation anymore. SIMD operations exposed to the web are under active development within WebAssembly, with operations based on the SIMD.js operations.

The static SIMD.%type%.addSaturate() method returns a new instance with the lane values added (a + b) and saturating behavior on overflow.

Note: This operation is not defined on Uint32x4 and Int32x4, because it is not accelerated by current hardware on those types.


SIMD.Int8x16.addSaturate(a, b)
SIMD.Int16x8.addSaturate(a, b)

SIMD.Uint8x16.addSaturate(a, b) 
SIMD.Uint16x8.addSaturate(a, b)


An instance of a SIMD type.
Another instance of a SIMD type.

Return value

A new corresponding SIMD data type with the lane values of a and b added (a + b).


The following example demonstrates the saturating behavior for Uint16 (maximum value 65535) and Int16 (maximum value 32767). If the addition overflows, the lanes will have the maximum possible value.

var a = SIMD.Uint16x8(65533, 65534, 65535, 65535, 1, 1, 1, 1); 
var b = SIMD.Uint16x8(1, 1, 1, 5000, 1, 1, 1, 1); 
SIMD.Uint16x8.addSaturate(a, b); 
// Uint16x8[65534, 65535, 65535, 65535, 2, 2, 2, 2]

var c = SIMD.Int16x8(32765, 32766, 32767, 32767, 1, 1, 1, 1);
var d = SIMD.Int16x8(1, 1, 1, 5000, 1, 1, 1, 1);
SIMD.Int16x8.addSaturate(c, d);
// Int16x8[32766, 32767, 32767, 32767, 2, 2, 2, 2]


Specification Status Comment
The definition of 'SIMDConstructor.addSaturate' in that specification.
Obsolete Initial definition.

Browser compatibility

Experimental SIMD.js has been removed from browsers. It's still available in Firefox Nightly, but will be removed in favor of a SIMD implementation in WebAssembly. See also bug 1416723.

See also

Document Tags and Contributors

 Contributors to this page: fscholz
 Last updated by: fscholz,