首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SIMD.extractLane

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

静态SIMD.%type%.extractLane()方法返回给定通道的值。

语法

代码语言:javascript
复制
SIMD.Float32x4.extractLane(t, index)
SIMD.Float64x2.extractLane(t, index)

SIMD.Int8x16.extractLane(t, index)
SIMD.Int16x8.extractLane(t, index)
SIMD.Int32x4.extractLane(t, index)

SIMD.Uint8x16.extractLane(t, index) 
SIMD.Uint16x8.extractLane(t, index) 
SIMD.Uint32x4.extractLane(t, index)

SIMD.Bool8x16.extractLane(t, index)
SIMD.Bool16x8.extractLane(t, index)
SIMD.Bool32x4.extractLane(t, index)
SIMD.Bool64x2.extractLane(t, index)

参数

t一个相应SIMD类型的实例。索引一个索引号,表示要提取哪条通道。通道从0开始编号。

返回值

提取的通道的价。

Exceptions 异常

  • TypeError,如果t不是相应的SIMD类型。
  • RangeError,如果车道index超出范围。

例子

代码语言:javascript
复制
var t = SIMD.Float32x4(1, 2, 3, 4);
SIMD.Float32x4.extractLane(t, 2); 
// 3

规范

Specification

Status

Comment

SIMDThe definition of 'SIMDConstructor.extractLane' 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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com