This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
The SIMD.Uint32x4
data type is a 128-bit vector divided into 4 lanes storing 32-bit unsigned integer values.
SIMD.Uint32x4(x, y, z, w);
x
Optional
y
Optional
z
Optional
w
Optional
In addition to the simple creator function, the SIMD API provides the following constructor functions.
SIMD.Uint32x4.splat()
You can also convert from another SIMD data type to Uint32x4.
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.Uint32x4(1, 2, 3, 4); // TypeError: SIMD.Uint32x4 is not a constructor var w = new SIMD.Uint32x4.splat(3); // TypeError: SIMD.Uint32x4.splat is not a constructor
Instead, you just write:
var v = SIMD.Uint32x4(1, 2, 3, 4); var w = SIMD.Uint32x4.splat(3);
To actually do something with SIMD types, SIMD operations are needed that work on SIMD data types.
SIMD.Uint32x4.check()
TypeError
otherwise.SIMD.Uint32x4.extractLane()
SIMD.Uint32x4.replaceLane()
SIMD.Uint32x4.load()
SIMD.Uint32x4.load1()
SIMD.Uint32x4.load2()
SIMD.Uint32x4.load3()
SIMD.Uint32x4.store()
SIMD.Uint32x4.store1()
SIMD.Uint32x4.store2()
SIMD.Uint32x4.store3()
SIMD.Uint32x4.add()
a + b
).SIMD.Uint32x4.mul()
a * b
).SIMD.Uint32x4.neg()
SIMD.Uint32x4.sub()
a - b
).SIMD.Uint32x4.shuffle()
SIMD.Uint32x4.swizzle()
SIMD.Uint32x4.select()
SIMD.Uint32x4.equal()
a == b
.SIMD.Uint32x4.notEqual()
a != b
.SIMD.Uint32x4.lessThan()
a < b
.SIMD.Uint32x4.lessThanOrEqual()
a <= b
.SIMD.Uint32x4.greaterThan()
a > b
.SIMD.Uint32x4.greaterThanOrEqual()
a >= b
.SIMD.Uint32x4.and()
a & b
).SIMD.Uint32x4.or()
a | b
).SIMD.Uint32x4.xor()
a ^ b
).SIMD.Uint32x4.not()
~a
).SIMD.Uint32x4.shiftLeftByScalar()
a << bits
).SIMD.Uint32x4.shiftRightByScalar()
SIMD.Uint32x4.fromFloat32x4()
SIMD.Uint32x4.fromFloat32x4Bits()
SIMD.Uint32x4.fromFloat64x2Bits()
SIMD.Uint32x4.fromInt32x4Bits()
SIMD.Uint32x4.fromInt16x8Bits()
SIMD.Uint32x4.fromInt8x16Bits()
SIMD.Uint32x4.fromUint16x8Bits()
SIMD.Uint32x4.fromUint8x16Bits()
The following methods and properties are installed on the SIMD.Uint32x4.prototype
.
SIMD.Uint32x4.prototype.constructor
SIMD.Uint32x4.prototype.toLocaleString()
Object.prototype.toLocaleString()
method.SIMD.Uint32x4.prototype.toString()
Object.prototype.toString()
method.SIMD.Uint32x4.prototype.valueOf()
SIMD.Uint32x4.prototype.toSource()
Object.prototype.toSource()
method.SIMD.Uint32x4(1, 2, 3, 4); // Uint32x4[1, 2, 3, 4] SIMD.Uint32x4(1, 2); // Uint32x4[1, 2, 0, 0] SIMD.Uint32x4(); // Uint32x4[0, 0, 0, 0]
Specification | Status | Comment |
---|---|---|
SIMD The definition of 'Uint32x4' in that specification. | Draft | Initial definition. |
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/Uint32x4