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 SIMD.Bool16x8
data type is a 128-bit vector divided into 8 lanes storing boolean values.
SIMD.Bool16x8(s0, s1, s2, s3, s4, s5, s6, s7);
s[0-7]
Optional
false
.In addition to the simple creator function, the SIMD API provides the following constructor functions.
SIMD.Bool16x8.splat()
Note: SIMD types don't work with new
, as SIMD values are no "boxed" objects (comparable to String(s)
vs. new String(s)
, which creates a String object).
var v = new SIMD.Bool16x8(true, true, true, true, false, false, false, false); // TypeError: SIMD.Bool16x8 is not a constructor var w = new SIMD.Bool16x8.splat(true); // TypeError: SIMD.Bool16x8.splat is not a constructor
Instead, you just write:
var v = SIMD.Bool16x8(true, true, true, true, false, false, false, false); var w = SIMD.Bool16x8.splat(true);
To actually do something with SIMD types, SIMD operations are needed that work on SIMD data types.
SIMD.Bool16x8.check()
TypeError
otherwise.SIMD.Bool16x8.extractLane()
SIMD.Bool16x8.replaceLane()
SIMD.Bool16x8.allTrue()
true
value.SIMD.Bool16x8.anyTrue()
true
value.SIMD.Bool16x8.and()
a & b
).SIMD.Bool16x8.or()
a | b
).SIMD.Bool16x8.xor()
a ^ b
).SIMD.Bool16x8.not()
~a
).The following methods and properties are installed on the SIMD.Bool16x8.prototype
.
SIMD.Bool16x8.prototype.constructor
SIMD.Bool16x8.prototype.toLocaleString()
Object.prototype.toLocaleString()
method.SIMD.Bool16x8.prototype.toString()
Object.prototype.toString()
method.SIMD.Bool16x8.prototype.valueOf()
SIMD.Bool16x8.prototype.toSource()
Object.prototype.toSource()
method.SIMD.Bool16x8(true, true, true, true, false, false, false, false); // Bool16x8[true, true, true, true, false, false, false, false] SIMD.Bool16x8(true, false); // Bool16x8[true, false, false, false, false, false, false, false] SIMD.Bool16x8(); // Bool16x8[false, false, false false, false, false, false, false]
Specification | Status | Comment |
---|---|---|
SIMD The definition of 'Bool16x8' in that specification. | Obsolete | Initial definition. |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | No support | Nightly build | Nightly build | No support | No support | No support |
Feature | Android | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | No support | No support | Nightly build | Nightly build | No support | No support | No support |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Bool16x8