SIMD.fromInt16x8Bits

SIMD.fromInt16x8Bits

SIMD.js已经从TC39中取消了积极的开发,并从第三阶段中删除了。它不再被网页浏览器所追求。暴露在 web 上的SIMD 操作在 WebAssembly 中正处于积极的发展之中, 其操作基于 SIMD. js 操作。

静态SIMD.%type%.fromInt16x8Bits()方法使用int16x8中的按位副本创建新的SIMD数据类型。

语法

SIMD.Float64x2.fromInt16x8Bits(t) SIMD.Float32x4.fromInt16x8Bits(t) SIMD.Int32x4.fromInt16x8Bits(t) SIMD.Int8x16.fromInt16x8Bits(t) SIMD.Uint32x4.fromInt16x8Bits(t) SIMD.Uint8x16.fromInt16x8Bits(t) SIMD.Uint16x8.fromInt16x8Bits(t)

参数

t一个Int16x8 SIMD类型从(按位)转换。

返回值

一个新的SIMD数据类型,来自Int16x8的按位拷贝。

例子

SIMD.Float64x2.fromInt16x8Bits

var t = SIMD.Int16x8(0, 0, 0, 16368, 0, 0, 0, 16384 SIMD.Float64x2.fromInt16x8Bits(t // Float64x2[1.0, 2.0]

SIMD.Float32x4.fromInt16x8Bits

var t = SIMD.Int16x8(0, 16256, 0, 16384, 0, 16448, 0, 16512 SIMD.Float32x4.fromInt16x8Bits(t // Float32x4[1.0, 2.0, 3.0, 4.0]

SIMD.Int32x4.fromInt16x8Bits

var t = SIMD.Int16x8(1, 2, 3, 4, 5, 6, 7, 8 SIMD.Int32x4.fromInt16x8Bits(t // Int32x4[131073, 262147, 393221, 524295]

SIMD.Int8x16.fromInt16x8Bits

var t = SIMD.Int16x8(1, 2, 3, 4, 5, 6, 7, 8 SIMD.Int8x16.fromInt16x8Bits(t // Int8x16[1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0]

规范

SpecificationStatusComment
SIMDThe definition of 'SIMDConstructor.fromTIMDBits' in that specification.DraftInitial definition.

浏览器兼容性

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic supportNo supportNightly buildNo supportNo supportNo support

FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic supportNo supportNo supportNightly buildNo supportNo supportNo support