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

SIMD.not

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

静态SIMD.%type%.not()方法返回一个新的实例,其值为(~a)的按位逻辑NOT 。此操作仅在整型和布尔型SIMD类型上存在。

语法

代码语言:javascript
复制
SIMD.Int8x16.not(a)
SIMD.Int16x8.not(a)
SIMD.Int32x4.not(a)

SIMD.Uint8x16.not(a)
SIMD.Uint16x8.not(a)
SIMD.Uint32x4.not(a)

SIMD.Bool8x16.not(a)
SIMD.Bool16x8.not(a)
SIMD.Bool32x4.not(a)
SIMD.Bool64x2.not(a) 

参数

a SIMD类型的实例。

返回值

一个新的相应的SIMD数据类型,其中的值为(~a)的按位逻辑NOT 。

描述

按位NOT操作产生倒数值(补码)。NOT操作的真值表是:

a

~a

0

1

1

0

例如,十进制中的~5结果1010是十进制的NOT 。

代码语言:javascript
复制
5   0101
    ----
10  1010

例子

按位NOT Int32x4

代码语言:javascript
复制
var a = SIMD.Int32x4(1, 2, 4, 8);
SIMD.Int32x4.not(a);
// Int32x4[-2, -3, -5, -9]

规范

Specification

Status

Comment

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