SIMD.fromFloat32x4Bits
SIMD.fromFloat32x4Bits
SIMD.js已经从TC39中取消了积极的开发,并从第三阶段中删除了。它不再被网页浏览器所追求。暴露在 web 上的SIMD 操作在 WebAssembly 中正处于积极的发展之中, 其操作基于 SIMD. js 操作。
静态SIMD.%type%.fromFloat32x4Bits()
方法使用Float32x4的按位副本创建新的SIMD数据类型。
语法
SIMD.Int32x4.fromFloat32x4Bits(t)
SIMD.Int16x8.fromFloat32x4Bits(t)
SIMD.Int8x16.fromFloat32x4Bits(t)
SIMD.Uint32x4.fromFloat32x4Bits(t)
SIMD.Uint16x8.fromFloat32x4Bits(t)
SIMD.Uint8x16.fromFloat32x4Bits(t)
参数
t
从(按位)转换的Float
32x4 SIMD类型。
返回值
一个新的SIMD数据类型,具有Float32x4的按位拷贝。
例子
SIMD.Int32x4.fromFloat32x4Bits
var t = SIMD.Float32x4(1.0, 2.0, 3.0, 4.0
SIMD.Int32x4.fromFloat32x4Bits(t
// Int32x4[1065353216, 1073741824, 1077936128, 1082130432]
SIMD.Int16x8.fromFloat32x4Bits
var t = SIMD.Float32x4(1.0, 2.0, 3.0, 4.0
SIMD.Int16x8.fromFloat32x4Bits(t
// Int16x8[0, 16256, 0, 16384, 0, 16448, 0, 16512]
SIMD.Int8x16.fromFloat32x4Bits
var t = SIMD.Float32x4(1.0, 2.0, 3.0, 4.0
SIMD.Int8x16.fromFloat32x4Bits(t
// Int8x16[0, 0, -128, 63, 0, 0, 0, 64, 0, 0, 64, 64, 0, 0, -128, 64]
规范
Specification | Status | Comment |
---|---|---|
SIMDThe definition of 'SIMDConstructor.fromTIMDBits' 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 |