Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit a3e4b05

Browse files
authored
Add Changelog (#522)
* Add Changelog * Comments * Split narrow * Regroup instructions
1 parent 32a461f commit a3e4b05

File tree

5 files changed

+55
-20
lines changed

5 files changed

+55
-20
lines changed

document/core/appendix/changes.rst

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,54 @@ Added instructions that modify ranges of memory or table entries [#proposal-reft
104104
* Active data and element segments boundaries are no longer checked at compile time but may trap instead
105105

106106

107+
.. index:: instructions, SIMD, value type, vector type
108+
109+
Vector instructions
110+
...................
111+
112+
Added vector type and instructions that manipulate multiple numeric values in parallel (also known as *SIMD*, single instruction multiple data) [#proposal-vectype]_
113+
114+
* New :ref:`value type <syntax-valtype>`: |V128|
115+
116+
* New :ref:`memory instructions <syntax-instr-memory>`: :math:`\K{v128.}\LOAD`, :math:`\K{v128.}\LOAD{}\!N\!\K{x}\!M\!\K{\_}\sx`, :math:`\K{v128.}\LOAD{}N\K{\_zero}`, :math:`\K{v128.}\LOAD{}N\K{\_splat}`, :math:`\K{v128.}\LOAD{}N\K{\_lane}`, :math:`\K{v128.}\STORE`, :math:`\K{v128.}\STORE{}N\K{\_lane}`
117+
118+
* New constant :ref:`vector instruction <syntax-instr-vec>`: :math:`\K{v128.}\VCONST`
119+
120+
* New unary :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{v128.not}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.abs}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.neg}`, :math:`\K{i8x16.popcnt}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.abs}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.neg}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.sqrt}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.ceil}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.floor}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.trunc}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.nearest}`
121+
122+
* New binary :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{v128.and}`, :math:`\K{v128.andnot}`, :math:`\K{v128.or}`, :math:`\K{v128.xor}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.add}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.sub}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.mul}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.add\_sat\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.sub\_sat\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.min\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.max\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.shl}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.shr\_}\sx`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.add}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.extmul\_}\half\K{\_i}\!N'\!\K{x}\!M'\!\K{\_}\sx`, :math:`\K{i16x8.q15mulr\_sat\_s}`, :math:`\K{i32x4.dot\_i16x8\_s}`, :math:`\K{i16x8.extadd\_pairwise\_i8x16\_}\sx`, :math:`\K{i32x4.extadd\_pairwise\_i16x8\_}\sx`, :math:`\K{i8x16.avgr\_u}`, :math:`\K{i16x8.avgr\_u}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.sub}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.mul}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.div}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.min}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.max}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.pmin}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.pmax}`
123+
124+
* New ternary :ref:`vector instruction <syntax-instr-vec>`: :math:`\K{v128.bitselect}`
125+
126+
* New test :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{v128.any\_true}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.all\_true}`
127+
128+
* New relational :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i}\!N\!\K{x}\!M\!\K{.eq}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.ne}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.lt\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.gt\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.le\_}\sx`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.ge\_}\sx`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.eq}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.ne}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.lt}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.gt}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.le}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.ge}`
129+
130+
* New conversion :ref:`vector instructions <syntax-instr-vec>`::math:`\K{i32x4.trunc\_sat\_f32x4\_}\sx`, :math:`\K{i32x4.trunc\_sat\_f64x2\_}\sx\K{\_zero}`, :math:`\K{f32x4.convert\_i32x4\_}\sx`, :math:`\K{f32x4.demote\_f64x2\_zero}`, :math:`\K{f64x2.convert\_low\_i32x4\_}\sx`, :math:`\K{f64x2.promote\_low\_f32x4}`
131+
132+
* New lane access :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i}\!N\!\K{x}\!M\!\K{.extract\_lane\_}\sx^?`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.replace\_lane}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.extract\_lane}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.replace\_lane}`
133+
134+
* New lane splitting/combining :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i}\!N\!\K{x}\!M\!\K{.extend\_}\half\K{\_i}\!N'\!\K{x}\!M'\!\K{\_}\sx`, :math:`\K{i8x16.narrow\_i16x8\_}\sx`, :math:`\K{i16x8.narrow\_i32x4\_}\sx`
135+
136+
* New byte reordering :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i8x16.shuffle}`, :math:`\K{i8x16.swizzle}`
137+
138+
* New injection/projection :ref:`vector instructions <syntax-instr-vec>`: :math:`\K{i}\!N\!\K{x}\!M\!\K{.splat}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.splat}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.bitmask}`
139+
140+
107141
.. [#proposal-signext]
108-
https://github.com/WebAssembly/spec/tree/master/proposals/sign-extension-ops/
142+
https://github.com/WebAssembly/spec/tree/main/proposals/sign-extension-ops/
109143
110144
.. [#proposal-cvtsat]
111-
https://github.com/WebAssembly/spec/tree/master/proposals/nontrapping-float-to-int-conversion/
145+
https://github.com/WebAssembly/spec/tree/main/proposals/nontrapping-float-to-int-conversion/
112146
113147
.. [#proposal-multivalue]
114-
https://github.com/WebAssembly/spec/tree/master/proposals/multi-value/
148+
https://github.com/WebAssembly/spec/tree/main/proposals/multi-value/
115149
116150
.. [#proposal-reftype]
117-
https://github.com/WebAssembly/spec/tree/master/proposals/reference-types/
151+
https://github.com/WebAssembly/spec/tree/main/proposals/reference-types/
118152
119153
.. [#proposal-bulk]
120-
https://github.com/WebAssembly/spec/tree/master/proposals/bulk-memory-operations/
154+
https://github.com/WebAssembly/spec/tree/main/proposals/bulk-memory-operations/
155+
156+
.. [#proposal-vectype]
157+
https://github.com/WebAssembly/spec/tree/main/proposals/simd/

document/core/appendix/gen-index-instructions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,8 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
569569
Instruction(r'\F64X2.\VPMAX', r'\hex{FD}~~\hex{F7}', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fpmax'),
570570
Instruction(r'\I32X4.\TRUNC\K{\_sat\_f32x4\_s}', r'\hex{FD}~~\hex{F8}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-trunc_sat_s'),
571571
Instruction(r'\I32X4.\TRUNC\K{\_sat\_f32x4\_u}', r'\hex{FD}~~\hex{F9}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-trunc_sat_u'),
572-
Instruction(r'\F32X4.\CONVERT\K{\_i32x4\_s}', r'\hex{FD}~~\hex{FA}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-convert_s'),
573-
Instruction(r'\F32X4.\CONVERT\K{\_i32x4\_u}', r'\hex{FD}~~\hex{FB}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-convert_u'),
572+
Instruction(r'\F32X4.\VCONVERT\K{\_i32x4\_s}', r'\hex{FD}~~\hex{FA}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-convert_s'),
573+
Instruction(r'\F32X4.\VCONVERT\K{\_i32x4\_u}', r'\hex{FD}~~\hex{FB}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-convert_u'),
574574
Instruction(r'\I32X4.\VTRUNC\K{\_sat\_f64x2\_s\_zero}', r'\hex{FD}~~\hex{FC}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-trunc_sat_s'),
575575
Instruction(r'\I32X4.\VTRUNC\K{\_sat\_f64x2\_u\_zero}', r'\hex{FD}~~\hex{FD}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-trunc_sat_u'),
576576
Instruction(r'\F64X2.\VCONVERT\K{\_low\_i32x4\_s}', r'\hex{FD}~~\hex{FE}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-convert_s'),

document/core/appendix/index-instructions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ Instruction Binary Opcode T
517517
:math:`\F64X2.\VPMAX` :math:`\hex{FD}~~\hex{F7}` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fpmax>`
518518
:math:`\I32X4.\TRUNC\K{\_sat\_f32x4\_s}` :math:`\hex{FD}~~\hex{F8}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-trunc_sat_s>`
519519
:math:`\I32X4.\TRUNC\K{\_sat\_f32x4\_u}` :math:`\hex{FD}~~\hex{F9}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-trunc_sat_u>`
520-
:math:`\F32X4.\CONVERT\K{\_i32x4\_s}` :math:`\hex{FD}~~\hex{FA}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-convert_s>`
521-
:math:`\F32X4.\CONVERT\K{\_i32x4\_u}` :math:`\hex{FD}~~\hex{FB}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-convert_u>`
520+
:math:`\F32X4.\VCONVERT\K{\_i32x4\_s}` :math:`\hex{FD}~~\hex{FA}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-convert_s>`
521+
:math:`\F32X4.\VCONVERT\K{\_i32x4\_u}` :math:`\hex{FD}~~\hex{FB}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-convert_u>`
522522
:math:`\I32X4.\VTRUNC\K{\_sat\_f64x2\_s\_zero}` :math:`\hex{FD}~~\hex{FC}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-trunc_sat_s>`
523523
:math:`\I32X4.\VTRUNC\K{\_sat\_f64x2\_u\_zero}` :math:`\hex{FD}~~\hex{FD}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-trunc_sat_u>`
524524
:math:`\F64X2.\VCONVERT\K{\_low\_i32x4\_s}` :math:`\hex{FD}~~\hex{FE}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-convert_s>`

document/core/syntax/instructions.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Vector instructions (also known as *SIMD* instructions, single data multiple val
268268
\K{i32x4.}\VTRUNC\K{\_sat\_f64x2\_}\sx\K{\_zero} \\&&|&
269269
\K{f32x4.}\VCONVERT\K{\_i32x4\_}\sx ~|~
270270
\K{f32x4.}\VDEMOTE\K{\_f64x2\_zero} \\&&|&
271-
\K{f64x2.}\VCONVERT\K{\_low\_i32x4\_}sx ~|~
271+
\K{f64x2.}\VCONVERT\K{\_low\_i32x4\_}\sx ~|~
272272
\K{f64x2.}\VPROMOTE\K{\_low\_f32x4} \\&&|&
273273
\dots \\
274274
\production{vector bitwise unary operator} & \vvunop &::=&
@@ -312,8 +312,7 @@ Vector instructions (also known as *SIMD* instructions, single data multiple val
312312
\K{sub\_sat\_}\sx \\
313313
\production{vector integer shift operator} & \vishiftop &::=&
314314
\K{shl} ~|~
315-
\K{shr\_s} ~|~
316-
\K{shr\_u} \\
315+
\K{shr\_}\sx \\
317316
\production{vector floating-point unary operator} & \vfunop &::=&
318317
\K{abs} ~|~
319318
\K{neg} ~|~
@@ -542,7 +541,7 @@ Instructions in this group are concerned with linear :ref:`memory <syntax-mem>`.
542541
\begin{array}{llcl}
543542
\production{memory immediate} & \memarg &::=&
544543
\{ \OFFSET~\u32, \ALIGN~\u32 \} \\
545-
\production{lane width} & \lanewidth &::=&
544+
\production{lane width} & \X{ww} &::=&
546545
8 ~|~ 16 ~|~ 32 ~|~ 64 \\
547546
\production{instruction} & \instr &::=&
548547
\dots \\&&|&
@@ -558,14 +557,14 @@ Instructions in this group are concerned with linear :ref:`memory <syntax-mem>`.
558557
\K{i}\X{nn}\K{.}\STORE\K{8}~\memarg ~|~
559558
\K{i}\X{nn}\K{.}\STORE\K{16}~\memarg ~|~
560559
\K{i64.}\STORE\K{32}~\memarg \\&&|&
561-
\K{v128.}\LOAD\K{8x8}\_\sx~\memarg ~|~
562-
\K{v128.}\LOAD\K{16x4}\_\sx~\memarg ~|~
563-
\K{v128.}\LOAD\K{32x2}\_\sx~\memarg \\&&|&
564-
\K{v128.}\LOAD\lanewidth\K{\_splat}~\memarg \\&&|&
560+
\K{v128.}\LOAD\K{8x8\_}\sx~\memarg ~|~
561+
\K{v128.}\LOAD\K{16x4\_}\sx~\memarg ~|~
562+
\K{v128.}\LOAD\K{32x2\_}\sx~\memarg \\&&|&
565563
\K{v128.}\LOAD\K{32\_zero}~\memarg ~|~
566564
\K{v128.}\LOAD\K{64\_zero}~\memarg \\&&|&
567-
\K{v128.}\LOAD\lanewidth\K{\_lane}~\memarg~\laneidx ~|~
568-
\K{v128.}\STORE\lanewidth\K{\_lane}~\memarg~\laneidx \\&&|&
565+
\K{v128.}\LOAD\X{ww}\K{\_splat}~\memarg \\&&|&
566+
\K{v128.}\LOAD\X{ww}\K{\_lane}~\memarg~\laneidx ~|~
567+
\K{v128.}\STORE\X{ww}\K{\_lane}~\memarg~\laneidx \\&&|&
569568
\MEMORYSIZE \\&&|&
570569
\MEMORYGROW \\&&|&
571570
\MEMORYFILL \\&&|&

document/core/util/macros.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@
535535
.. |sx| mathdef:: \xref{syntax/instructions}{syntax-sx}{\X{sx}}
536536
.. |half| mathdef:: \xref{syntax/instructions}{syntax-half}{\X{half}}
537537
.. |memarg| mathdef:: \xref{syntax/instructions}{syntax-memarg}{\X{memarg}}
538-
.. |lanewidth| mathdef:: \xref{syntax/instructions}{syntax-lanewidth}{\X{lanewidth}}
539538

540539
.. |blocktype| mathdef:: \xref{syntax/instructions}{syntax-blocktype}{\X{blocktype}}
541540

0 commit comments

Comments
 (0)