WebAssembly Specification Release 1.1 (Draft 2021-12-18) - page 15

 

  Главная      Manuals     WebAssembly Specification Release 1.1 (Draft 2021-12-18)

 

Search            copyright infringement  

 

 

 

 

 

 

 

 

 

 

 

Content      ..     13      14      15     

 

 

 

 

WebAssembly Specification Release 1.1 (Draft 2021-12-18) - page 15

 

 

Table instructions

Added instructions to directly access and modify tables

?

.

Table types

allow any

reference type

as element type

• New

table instructions

:

table

.

get

,

table

.

set

,

table

.

size

,

table

.

grow

Multiple tables

Added the ability to use multiple tables per module

?

.

Modules

may

define

,

import

and

export

multiple tables

Table instructions

take a

table index

immediate:

table

.

get

,

table

.

set

,

table

.

size

,

table

.

grow

,

call

_

indirect

Element segments

take a

table index

Bulk memory and table instructions

Added instructions that modify ranges of memory or table entries

?

58

• New

memory instructions

:

memory

.

fill

,

memory

.

init

,

memory

.

copy

,

data

.

drop

• New

table instructions

:

table

.

fill

,

table

.

init

,

table

.

copy

,

elem

.

drop

• New

passive

form of

data segment

• New

passive

form of

element segment

• New

data count section

in binary format

• Active data and element segments boundaries are no longer checked at compile time but may trap instead

Vector instructions

Added vector type and instructions that manipulate multiple numeric values in parallel (also known as

SIMD

, single

instruction multiple data)

59

• New

value type

:

v128

• New

memory instructions

:

v128

.

load

,

v128

.

load

𝑁

x

𝑀

_

sx

,

v128

.

load

𝑁

_

zero

,

v128

.

load

𝑁

_

splat

,

v128

.

load

𝑁

_

lane

,

v128

.

store

,

v128

.

store

𝑁

_

lane

• New constant

vector instruction

:

v128

.

const

• New unary

vector instructions

:

v128

.

not

,

i

𝑁

x

𝑀.

abs

,

i

𝑁

x

𝑀.

neg

,

i8x16

.

popcnt

,

f

𝑁

x

𝑀.

abs

,

f

𝑁

x

𝑀.

neg

,

f

𝑁

x

𝑀.

sqrt

,

f

𝑁

x

𝑀.

ceil

,

f

𝑁

x

𝑀.

floor

,

f

𝑁

x

𝑀.

trunc

,

f

𝑁

x

𝑀.

nearest

• New binary

vector instructions

:

v128

.

and

,

v128

.

andnot

,

v128

.

or

,

v128

.

xor

,

i

𝑁

x

𝑀.

add

,

i

𝑁

x

𝑀.

sub

,

i

𝑁

x

𝑀.

mul

,

i

𝑁

x

𝑀.

add

_

sat

_

sx

,

i

𝑁

x

𝑀.

sub

_

sat

_

sx

,

i

𝑁

x

𝑀.

min

_

sx

,

i

𝑁

x

𝑀.

max

_

sx

,

i

𝑁

x

𝑀.

shl

,

i

𝑁

x

𝑀.

shr

_

sx

,

f

𝑁

x

𝑀.

add

,

i

𝑁

x

𝑀.

extmul

_

half

_

i

𝑁

x

𝑀

_

sx

,

i16x8

.

q15mulr

_

sat

_

s

,

i32x4

.

dot

_

i16x8

_

s

,

i16x8

.

extadd

_

pairwise

_

i8x16

_

sx

,

i32x4

.

extadd

_

pairwise

_

i16x8

_

sx

,

i8x16

.

avgr

_

u

,

i16x8

.

avgr

_

u

,

f

𝑁

x

𝑀.

sub

,

f

𝑁

x

𝑀.

mul

,

f

𝑁

x

𝑀.

div

,

f

𝑁

x

𝑀.

min

,

f

𝑁

x

𝑀.

max

,

f

𝑁

x

𝑀.

pmin

,

f

𝑁

x

𝑀.

pmax

• New ternary

vector instruction

:

v128

.

bitselect

• New test

vector instructions

:

v128

.

any

_

true

,

i

𝑁

x

𝑀.

all

_

true

• New relational

vector instructions

:

i

𝑁

x

𝑀.

eq

,

i

𝑁

x

𝑀.

ne

,

i

𝑁

x

𝑀.

lt

_

sx

,

i

𝑁

x

𝑀.

gt

_

sx

,

i

𝑁

x

𝑀.

le

_

sx

,

i

𝑁

x

𝑀.

ge

_

sx

,

f

𝑁

x

𝑀.

eq

,

f

𝑁

x

𝑀.

ne

,

f

𝑁

x

𝑀.

lt

,

f

𝑁

x

𝑀.

gt

,

f

𝑁

x

𝑀.

le

,

f

𝑁

x

𝑀.

ge

58

https://github.com/WebAssembly/spec/tree/main/proposals/bulk-memory-operations/

59

https://github.com/WebAssembly/spec/tree/main/proposals/simd/

• New conversion

vector instructions

:

i32x4

.

trunc

_

sat

_

f32x4

_

sx

,

i32x4

.

trunc

_

sat

_

f64x2

_

sx

_

zero

,

f32x4

.

convert

_

i32x4

_

sx

,

f32x4

.

demote

_

f64x2

_

zero

,

f64x2

.

convert

_

low

_

i32x4

_

sx

,

f64x2

.

promote

_

low

_

f32x4

• New lane access

vector instructions

:

i

𝑁

x

𝑀.

extract

_

lane

_

sx

?

,

i

𝑁

x

𝑀.

replace

_

lane

,

f

𝑁

x

𝑀.

extract

_

lane

,

f

𝑁

x

𝑀.

replace

_

lane

• New lane splitting/combining

vector instructions

:

i

𝑁

x

𝑀.

extend

_

half

_

i

𝑁

x

𝑀

_

sx

,

i8x16

.

narrow

_

i16x8

_

sx

,

i16x8

.

narrow

_

i32x4

_

sx

• New byte reordering

vector instructions

:

i8x16

.

shuffle

,

i8x16

.

swizzle

• New injection/projection

vector instructions

:

i

𝑁

x

𝑀.

splat

,

f

𝑁

x

𝑀.

splat

,

i

𝑁

x

𝑀.

bitmask

 

 

 

 

 

 

 

Content      ..     13      14      15