Note: The Bool64x2 type is currently not part of the SIMD specification draft.
The SIMD.Bool64x2
data type is a 128-bit vector divided into 2 lanes storing boolean values.
SIMD.Bool64x2(x, y);
x
Optional
false
.y
Optional
false
.In addition to the simple creator functions, the SIMD API provides the following constructor functions:
SIMD.Bool64x2.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.Bool64x2(true, false); // TypeError: SIMD.Bool64x2 is not a constructor var w = new SIMD.Bool64x2.splat(true); // TypeError: SIMD.Bool64x2.splat is not a constructor
Instead, you just write:
var v = SIMD.Bool64x2(true, false); var w = SIMD.Boolt64x2.splat(true);
To actually do something with SIMD types, SIMD operations are needed that work on SIMD data types.
SIMD.Bool64x2.check()
TypeError
otherwise.SIMD.Bool64x2.extractLane()
SIMD.Bool64x2.replaceLane()
SIMD.Bool64x2.allTrue()
true
value.SIMD.Bool64x2.anyTrue()
true
value.SIMD.Bool64x2.and()
a & b
).SIMD.Bool64x2.or()
a | b
).SIMD.Bool64x2.xor()
a ^ b
).SIMD.Bool64x2.not()
~a
).The following methods and properties are installed on the SIMD.Bool64x2.prototype
.
SIMD.Bool64x2.prototype.constructor
SIMD.Bool64x2.prototype.toLocaleString()
Object.prototype.toLocaleString()
method.SIMD.Bool64x2.prototype.toString()
Object.prototype.toString()
method.SIMD.Bool64x2.prototype.valueOf()
SIMD.Bool64x2.prototype.toSource()
Object.prototype.toSource()
method.SIMD.Bool64x2(true, false); // Bool64x2[true, false] SIMD.Bool64x2(1); // Bool64x2[true, false] SIMD.Bool64x2(); // Bool64x2[false, false]
The Bool64x2 type is currently not part of the SIMD specification draft.
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | No support | Nightly build | No support | No support | No support |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | No support | No support | Nightly build | No support | No support | No support |
© 2005–2017 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/Bool64x2