WebAssembly SIMD-specific bitwise instructions
WebAssembly SIMD-specific bitwise instructions.
WebAssembly SIMD-specific bitwise instructions.
## Bitwise logic
- [`all_true`](/docs/WebAssembly/Reference/SIMD/bitwise/all_true)
- : Tests whether all lanes of a `v128` input value are non-zero.
- [`andnot`](/docs/WebAssembly/Reference/SIMD/bitwise/andnot)
- : Takes two [`v128`](/docs/WebAssembly/Reference/Value_types/v128) input values. It performs a bitwise AND on the first value and a second value equal to the result of performing a bitwise NOT on each byte of the second original value. It returns a new `v128` value containing the result.
- [`any_true`](/docs/WebAssembly/Reference/SIMD/bitwise/any_true)
- : Tests whether a `v128` input value contains any non-zero bits.
- [`bitmask`](/docs/WebAssembly/Reference/SIMD/bitwise/bitmask)
- : Inspects the **most significant bit** (MSB) — bit 7 — of each byte of a [`v128`](/docs/WebAssembly/Reference/Value_types/v128) value interpretation. This is the sign bit if the value is treated as signed. The instruction's output value is equal to all of those bits collected into a single `i32`.
- [`bitselect`](/docs/WebAssembly/Reference/SIMD/bitwise/bitselect)
- : Takes three [`v128`](/docs/WebAssembly/Reference/Value_types/v128) values as inputs — two inputs and a mask value — and returns a new `v128` value with each byte calculated using the formula `output = (input1 AND mask) OR (input2 AND NOT mask)`.
- [`not`](/docs/WebAssembly/Reference/SIMD/bitwise/not)
- : Performs a bitwise NOT on each byte of a [`v128`](/docs/WebAssembly/Reference/Value_types/v128) value and returns a new `v128` value containing the result.
## See also
- [WebAssembly numeric instructions](/docs/WebAssembly/Reference/Numeric)
Cite this
"WebAssembly SIMD-specific bitwise instructions". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/SIMD/bitwise JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy