这篇翻译不完整。请帮忙从英语翻译这篇文章

SIMD.js has been taken out of active development in TC39 and removed from Stage 3. It is not being pursued by web browsers for implementation anymore. SIMD operations exposed to the web are under active development within WebAssembly, with operations based on the SIMD.js operations.

该静态方法SIMD.%type%.and() 将输入的参数进行二进制与操作结果以SIMD实例的形式返回,参数仅接受整数型或布尔型SIMD。

语法

SIMD.Int8x16.and(a, b)
SIMD.Int16x8.and(a, b)
SIMD.Int32x4.and(a, b)

SIMD.Uint8x16.and(a, b)
SIMD.Uint16x8.and(a, b) 
SIMD.Uint32x4.and(a, b)

SIMD.Bool8x16.and(a, b) 
SIMD.Bool16x8.and(a, b) 
SIMD.Bool32x4.and(a, b)
SIMD.Bool64x2.and(a, b)

参数

a
SIMD类型的实例。
b
另一个SIMD类型实例。

返回结果

以 (a & b)为结果的SIMD新实例。

描述

逻辑与操作仅在a 和 b 都为1的情况下yield。 以下是AND操作的演示表:

a b a & b
0 0 0
0 1 0
1 0 0
1 1 1

比如,5 & 1 的逻辑与结果为0001 .

5  0101
1  0001
   ----
1  0001

示例

两个 Int32x4的逻辑与操作

var a = SIMD.Int32x4(1, 2, 4, 8);
var b = SIMD.Int32x4(5, 5, 5, 5);
SIMD.Int32x4.and(a, b);
// Int32x4[1, 0, 4, 0]

Specifications

Specification Status Comment
SIMD
SIMDConstructor.and
Obsolete Initial definition.

浏览器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 未实现 Nightly build 未实现 未实现 未实现
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 未实现 未实现 Nightly build 未实现 未实现 未实现

See also

文档标签和贡献者

 此页面的贡献者: jasonOramo
 最后编辑者: jasonOramo,