SIMD.shuffle

SIMD.shuffle

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

静态SIMD.%type%.shuffle()方法将创建一个新的SIMD数据类型实例,并对混合的泳道值进行混合。

语法

SIMD.Float32x4.shuffle(a, b, s0, s1, s2, s3) SIMD.Float64x2.shuffle(a, b, s0, s1) SIMD.Int8x16.shuffle(a,b,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15) SIMD.Int16x8.shuffle(a, b, s0, s1, s2, s3, s4, s5, s6, s7) SIMD.Int32x4.shuffle(a, b, s0, s1, s2, s3) SIMD.Uint8x16.shuffle(a,b,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15) SIMD.Uint16x8.shuffle(a, b, s0, s1, s2, s3, s4, s5, s6, s7) SIMD.Uint32x4.shuffle(a, b, s0, s1, s2, s3)

参数

a SIMD类型的实例将被混洗。b另一个SIMD类型的实例将被洗牌。s0-s15a和b的连接索引s0-s15

返回值

带有泳道值的新SIMD数据类型混洗。

描述

静态SIMD.%type%.shuffle()方法将两个SIMD数据类型混洗成一个新的SIMD数据类型。

例子

混乱 Float32x4

var a = SIMD.Float32x4(1, 2, 3, 4 var b = SIMD.Float32x4(5, 6, 7, 8 SIMD.Float32x4.shuffle(a, b, 1, 5, 7, 2 // Float32x4[2,6,8,3]

规范

SpecificationStatusComment
SIMDThe definition of 'SIMD.shuffle' 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