SIMD.mul
SIMD.mul
SIMD.js已经从TC39中取消了积极的开发,并从第三阶段中删除了。它不再被网页浏览器所追求。暴露在 web 上的SIMD 操作在 WebAssembly 中正处于积极的发展之中, 其操作基于 SIMD. js 操作。
静态SIMD.%type%.mul()
方法返回一个新的实例,通道值乘以(a * b
)。
语法
SIMD.Float32x4.mul(a, b)
SIMD.Float64x2.mul(a, b)
SIMD.Int8x16.mul(a, b)
SIMD.Int16x8.mul(a, b)
SIMD.Int32x4.mul(a, b)
SIMD.Uint8x16.mul(a, b)
SIMD.Uint16x8.mul(a, b)
SIMD.Uint32x4.mul(a, b)
参数
a SIMD类型的实例。b
SIMD类型的另一个实例。
返回值
一个新的相应的SIMD数据类型的车道值a
和b
乘(a * b
)。
例子
var a = SIMD.Float32x4(-1, -2, 3, 4
var b = SIMD.Float32x4(3, 3, 3, 3
SIMD.Float32x4.mul(a, b
// Float32x4[-3, -6, 9, 12]
var c = SIMD.Int16x8(3, 3, 3, 3, 3, 3, 3, 3
SIMD.Int16x8.mul(c, c)
// Int16x8[9, 9, 9, 9, 9, 9, 9, 9]
规范
Specification | Status | Comment |
---|---|---|
SIMDThe definition of 'SIMDConstructor.mul' 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 |