SIMD.%type%.notEqual()

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%.notEqual() method returns a selection mask with values depending on an inequality comparison (a != b) in each lane.

Parameters

Return value

A selection mask (of type Bool64x2, Bool32x4, Bool16x8 or Bool8x16 depending on the size). The lane values of the mask are either true or false depending on the result of a != b.

Description

The SIMD.%type%.notEqual method is one of the SIMD comparison operations and does not give you back the values of the inequality comparison of two instances directly. Instead, a selection mask with Boolean values is returned.

Examples

Selecting unequal lanes from two vectors

In this example, two SIMD Float32x4 data types are compared against inequality of their lane values and a selection mask gets created based on the result. This selection mask is then used to select the unequal values into a new Float32x4. At the lane positions where the vectors a and b have equal values, the result vector uses the zero vector and fills the lanes with 0.