Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relaxed SIMD #129

Merged
merged 159 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
48ed81a
initial setup and overview
ngzhian Mar 16, 2021
dd63aa2
Add a references section with useful links
ngzhian Mar 17, 2021
8815f41
Merge pull request #7 from ngzhian/add-references
ngzhian Mar 22, 2021
bf6a1bd
Add description of categories of instructions (#8)
ngzhian Mar 23, 2021
224627e
Update issue templates (#14)
ngzhian Mar 24, 2021
77e5f06
Add paragraph describing consistency using fpenv (#15)
ngzhian Mar 25, 2021
d87f9b2
Add placeholder sections for instructions and binary format (#16)
ngzhian Mar 29, 2021
023ce40
Add SIMD subgroup charter (#18)
dtig Apr 15, 2021
e71547e
Add relaxed swizzle to overview (#24)
ngzhian Jun 10, 2021
4fced21
Add relaxed float to int conversions (#25)
ngzhian Jun 24, 2021
9698769
Add fma and fms (#28)
ngzhian Jul 2, 2021
2295168
Add relaxed blend to overview (#29)
ngzhian Jul 21, 2021
d7489cd
Add binary opcodes for instructions in overview (#32)
ngzhian Aug 5, 2021
18c1b1d
Update issue templates
ngzhian Aug 9, 2021
ae132b3
Add relaxed min and max (#36)
ngzhian Sep 7, 2021
e53d41f
Rename to laneselect (#41)
ngzhian Oct 5, 2021
9854b86
Merge remote-tracking branch 'upstream/main'
ngzhian Oct 21, 2021
8f41b23
Add implementation status document (#45)
ngzhian Oct 28, 2021
407d3db
Merge remote-tracking branch 'upstream/main' into merge-upstream
ngzhian Oct 28, 2021
fdab682
Merge pull request #46 from ngzhian/merge-upstream
ngzhian Oct 29, 2021
383be57
Report status of SpiderMonkey implemention
yurydelendik Nov 1, 2021
847e8fc
Merge remote-tracking branch 'upstream/main'
ngzhian Nov 2, 2021
8f0a216
Merge pull request #48 from yurydelendik/sm-status
ngzhian Nov 5, 2021
a7f00a6
Remove fpenv from overview, add proposed spec text on Relaxed operations
ngzhian Mar 1, 2022
9d1a8a8
Merge pull request #58 from ngzhian/remove-fpenv
ngzhian Mar 1, 2022
7f65a2a
Add Relaxed Rounding Q-format Multiplication to overview
ngzhian Mar 1, 2022
1d90a25
Merge remote-tracking branch 'upstream/main' into merge-upstream
ngzhian Mar 1, 2022
fd1a19c
Merge pull request #60 from ngzhian/merge-upstream
ngzhian Mar 1, 2022
8f47f24
Restrict set of possible output values for relaxed rounding
ngzhian Mar 4, 2022
8a1eb2f
Update binary opcodes based on #51
ngzhian Mar 1, 2022
5c175d8
Fix reserved dot products instructions and add bfloat16
ngzhian Mar 4, 2022
fe473a7
Copy "either" result pattern from threads proposal
ngzhian Mar 1, 2022
8da2825
Update instruction names in opcode table based on #42
ngzhian Mar 14, 2022
dafba4f
Add tests for relaxed simd instructions
ngzhian Mar 9, 2022
3f95701
Fixes to test
ngzhian Mar 14, 2022
bfb6b0a
Fix relaxed trunc expected results
ngzhian Mar 14, 2022
9b8c69b
Restrict allowed return values
ngzhian Mar 10, 2022
fbfb92f
Fix typos
ngzhian Mar 10, 2022
c1a56b5
Fix trunc
ngzhian Mar 14, 2022
8413b42
Update trunc description
ngzhian Mar 14, 2022
2e66ec6
Update ImplementationStatus.md
ngzhian Mar 18, 2022
1f29e46
Add dot product to overview
ngzhian Mar 22, 2022
9369de7
Merge remote-tracking branch 'upstream/main' into merge-upstream
ngzhian Mar 28, 2022
1a303a5
Merge pull request #70 from ngzhian/merge-upstream
ngzhian Mar 28, 2022
2d63360
Remove unsigned dot product from overview (#73)
ngzhian May 13, 2022
f80420a
Merge remote-tracking branch 'upstream/main' into merge-upstream
ngzhian Jul 7, 2022
0d63afa
More fixes for merge commits
ngzhian Jul 7, 2022
a3f0037
More merge conflict fixes
ngzhian Jul 7, 2022
c2e53ec
Merge pull request #78 from ngzhian/merge-upstream
ngzhian Jul 7, 2022
1438c0e
Merge remote-tracking branch 'upstream/main' into merge-upstream
ngzhian Aug 4, 2022
d4f766c
Merge pull request #80 from ngzhian/merge-upstream
ngzhian Aug 4, 2022
aff5ae0
Fix ordering for FMA and change FMS to FNMA (fused negative multiply …
ngzhian Aug 4, 2022
e1759af
Merge from upstream spec
ngzhian Sep 12, 2022
26f1b78
Merge pull request #87 from ngzhian/merge-upstream
ngzhian Sep 12, 2022
b58bb2e
Add BFloat16 dot product
ngzhian Sep 12, 2022
0018aeb
Fix fnma instruction name and details
yurydelendik Sep 21, 2022
8cbfd34
Update implementation status with bf16 dot product and fnma
ngzhian Oct 24, 2022
6570724
Fix overview for integer dot products and implementation status
ngzhian Oct 24, 2022
8697e47
Add some relaxed dot product tests
ngzhian Oct 24, 2022
3935fe9
Fix number of lane literals
ngzhian Oct 24, 2022
e35df3a
Fix test results
ngzhian Oct 24, 2022
2dc7f2f
Fix fms -> fnma, add relaxed dot
ngzhian Oct 24, 2022
0f19aec
Rename fma test file
ngzhian Oct 24, 2022
c373433
Fix to instruction names in overview and implementation status
ngzhian Oct 24, 2022
fda767d
Update prototype opcodes
ngzhian Oct 24, 2022
5b727ca
Add link to phase 3 to overview
ngzhian Oct 24, 2022
484c78b
Rename relaxed_fma to relaxed_madd (fnma to nmadd)
ngzhian Oct 25, 2022
c199565
Remove bf16 from overview and implementation status
ngzhian Dec 6, 2022
9b886c0
Merge remote-tracking branch 'upstream/main' into merge-upstream
ngzhian Dec 8, 2022
95678a9
Merge pull request #112 from WebAssembly/merge-upstream
ngzhian Dec 8, 2022
22eb1c0
Remove bf16 dot
ngzhian Feb 14, 2023
91a76df
Merge pull request #118 from ngzhian/interp-fix
ngzhian Feb 14, 2023
5f39b1f
Fix names of dot instructions
ngzhian Feb 14, 2023
c7f2df1
Rename relaxed dot in tests
ngzhian Feb 14, 2023
50163d0
Merge pull request #119 from ngzhian/interp-dot-name
ngzhian Feb 14, 2023
d908cd4
Fix expected result type in relaxed dot product tests
ngzhian Feb 14, 2023
e7bb04d
Merge pull request #121 from ngzhian/fix-relaxed-dot-test
ngzhian Feb 14, 2023
961e0db
Check multiple calls to relaxed instructions return same results
ngzhian Feb 15, 2023
e8a9e54
Merge pull request #122 from ngzhian/tests-cmp
ngzhian Feb 15, 2023
e53cbc9
Add expected results for relaxed dot
ngzhian Feb 15, 2023
271b099
Merge pull request #123 from ngzhian/dot-tests
ngzhian Feb 15, 2023
d847308
Fix relaxed nmadd tests (#124)
ngzhian Feb 16, 2023
f443590
Fix relaxed trunc signed (#127)
ngzhian Feb 22, 2023
0bd0984
Merge remote-tracking branch 'upstream/main' into merging-upstream
ngzhian Feb 22, 2023
59f25ed
Merge pull request #128 from ngzhian/merging-upstream
ngzhian Feb 22, 2023
917bd5c
Update int dot tests to allow for saturation of intermediate 16-bit
ngzhian Feb 27, 2023
c423e63
Fix overview for int dot to allow saturation of 16-bit intermediates
ngzhian Feb 27, 2023
a9ad839
Fix typo in relaxed dot test
ngzhian Feb 27, 2023
ae8a9f9
Fix some tests in `i32x4_relaxed_trunc.wast`
alexcrichton Feb 27, 2023
f82b14f
Add a note about the integer value of INT_MAX
alexcrichton Feb 27, 2023
476802d
Implement relaxed instructions using the non-relaxed counterpart (#65)
ngzhian Feb 27, 2023
1bb54a7
Update overview spec of `laneselect` instructions
alexcrichton Feb 27, 2023
786f84d
Spec profiles
rossberg Dec 12, 2022
16f6d1f
Work around MathJax limitations
rossberg Dec 12, 2022
3c78e14
First pass at semantics
ngzhian Oct 12, 2021
70008ac
Changes atop profiles
ngzhian Jan 17, 2023
ab7d0be
Changes to execution and validation
ngzhian Jan 25, 2023
1cf8ca9
Fix to index instructions
ngzhian Jan 25, 2023
52668fa
Fix instruction generation script
ngzhian Jan 25, 2023
83b983d
Add macros
ngzhian Jan 25, 2023
8824d97
Update index of instructions, exec/numerics
ngzhian Jan 25, 2023
2a8208e
Fix binary and text
ngzhian Jan 25, 2023
f8cac7f
Update document/core/exec/numerics.rst
ngzhian Feb 14, 2023
5e08ffc
Update document/core/exec/numerics.rst
ngzhian Feb 14, 2023
c3f3239
Update document/core/exec/numerics.rst
ngzhian Feb 14, 2023
ddcc7ed
Update document/core/exec/numerics.rst
ngzhian Feb 14, 2023
b2fe562
Update document/core/exec/numerics.rst
ngzhian Feb 14, 2023
64bdd02
Update document/core/exec/numerics.rst
ngzhian Feb 14, 2023
caee906
Spell out instruction mnemonic
ngzhian Feb 14, 2023
a1a8a12
Fix text
ngzhian Feb 14, 2023
2c51978
Fix relaxed swizzle lane macro
ngzhian Feb 14, 2023
847b40f
Fix fma det
ngzhian Feb 14, 2023
ce1d31d
Fix mnemonics
ngzhian Feb 14, 2023
a7d4e96
Update changes
ngzhian Feb 14, 2023
824c9fd
Text for relaxed q15muls
ngzhian Feb 15, 2023
61fd687
Typo
ngzhian Feb 15, 2023
70bf915
Fix semantics for dot
ngzhian Feb 27, 2023
4073d27
Update document/core/appendix/changes.rst
ngzhian Mar 2, 2023
753c779
Update document/core/appendix/changes.rst
ngzhian Mar 2, 2023
f59b512
Move changes down
ngzhian Mar 2, 2023
8afc0d1
Add FMA definition
ngzhian Mar 2, 2023
46c9480
Reword fma
ngzhian Mar 2, 2023
a9ef2e4
Remove parens
ngzhian Mar 2, 2023
b00d451
Add entropy.md to discuss fingerprinting, and compat concerns (#83)
dtig Mar 7, 2023
4afd146
Rename entropy.md to Entropy.md
dtig Mar 7, 2023
c4c9dda
Add prose for exec numerics and fma
ngzhian Mar 3, 2023
b90afb8
Merge remote-tracking branch 'upstream/main' into merge-upstream
ngzhian Mar 22, 2023
ba2d5eb
Merge pull request #139 from ngzhian/merge-upstream
ngzhian Mar 22, 2023
70f8687
Add more allowed return values for relaxed trunc unsigned
ngzhian Jun 5, 2023
d879d67
Document that "either" comes from threads proposal
ngzhian Jun 30, 2023
f7e861c
Fix relaxed laneselect to allow looking at top bit of byte
ngzhian Jun 6, 2023
cd9c447
Add special test case for i16x8.relaxed_laneselect
ngzhian Jun 26, 2023
22257c5
Fix relaxed trunc pseudocode in Overview
thibaudmichaud Oct 3, 2023
95dc80e
Update ImplementationStatus.md
dtig May 10, 2024
e9c9a9b
Add a smoke test for consistent nondeterminism
fitzgen Jul 18, 2024
c3f9359
Merge pull request #156 from fitzgen/test-non-determinism-is-consistent
rossberg Jul 18, 2024
3f0bd84
Merge remote-tracking branch 'relaxed/main' into wasm-3.0+relaxed
rossberg Sep 3, 2024
9d740b0
Minor edits
rossberg Sep 4, 2024
acb599c
Refactor relaxed ops spec
rossberg Sep 4, 2024
bc87071
Implementation note
rossberg Sep 6, 2024
eb8f31c
Merge branch 'wasm-3.0' into wasm-3.0+relaxed
rossberg Sep 24, 2024
a315401
[test] Fix left-over use of kWasmStmt in wasm-module-builder (#1812)
backes Sep 24, 2024
09cc6c6
Adapt changes
rossberg Sep 26, 2024
8dadd74
Eps
rossberg Sep 26, 2024
95acd3e
Merge branch 'wasm-3.0+relaxed' into wasm-3.0
rossberg Sep 26, 2024
2b0896a
Merge remote-tracking branch 'upstream/wasm-3.0' into relaxed
rossberg Sep 26, 2024
b315265
Add relaxed swizzle, [n]madd, min/max
rossberg Sep 26, 2024
057b5e3
Add relaxed_q15mul
rossberg Oct 1, 2024
e9cbf1a
[spec] Fix typo in relaxed formula
rossberg Oct 1, 2024
00c56da
Fix merge bug
rossberg Oct 1, 2024
236f833
All but laneselect
rossberg Oct 2, 2024
efa5a82
Relaxed SIMD in SpecTec
rossberg Oct 2, 2024
8e5f4ee
[spec] Various fixes to SIMD stuff
rossberg Oct 3, 2024
75ea7be
Update and fix spec doc modulo numerics/exec
rossberg Oct 3, 2024
bb6a2cd
Merge remote-tracking branch 'upstream/wasm-3.0' into relaxed
rossberg Oct 3, 2024
02adbd2
Missing xref anchors
rossberg Oct 3, 2024
ff9ed64
Merge branch 'main' into relaxed
rossberg Oct 9, 2024
b191310
Merge branch 'main' into relaxed
rossberg Oct 9, 2024
379d081
Update test expect
rossberg Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-interpreter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 19.x
node-version: 20.x
- name: Build interpreter
run: cd interpreter && opam exec make
- name: Run tests
Expand Down
49 changes: 47 additions & 2 deletions document/core/appendix/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,48 @@ Added managed reference types. [#proposal-gc]_
- |EXTERNCONVERTANY|


.. index:: instruction, vector instruction, SIMD

Relaxed Vector Instructions
...........................

Added new *relaxed* vector instructions,
whose behaviour is non-deterministic and implementation-dependent. [#proposal-relaxed]_

* New binary :ref:`vector instruction <syntax-instr-vec-relaxed>`:

- :math:`\K{f}\!N\!\K{x}\!M\!\K{.relaxed\_min}`
- :math:`\K{f}\!N\!\K{x}\!M\!\K{.relaxed\_max}`
- :math:`\K{i16x8.relaxed\_q15mulr\_s}`
- :math:`\K{i16x8.relaxed\_dot\_i8x16\_i7x16\_s}`

* New ternary :ref:`vector instruction <syntax-instr-vec-relaxed>`:

- :math:`\K{f}\!N\!\K{x}\!M\!\K{.relaxed\_madd}`
- :math:`\K{f}\!N\!\K{x}\!M\!\K{.relaxed\_nmadd}`
- :math:`\K{i}\!N\!\K{x}\!M\!\K{.relaxed\_laneselect}`
- :math:`\K{i32x4.relaxed\_dot\_i8x16\_i7x16\_add\_s}`

* New conversion :ref:`vector instructions <syntax-instr-vec-relaxed>`:

- :math:`\K{i32x4.relaxed\_trunc\_f32x4\_}\sx`
- :math:`\K{i32x4.relaxed\_trunc\_f64x2\_}\sx\K{\_zero}`

* New byte reordering :ref:`vector instruction <syntax-instr-vec-relaxed>`:

- :math:`\K{i8x16.relaxed\_swizzle}`


.. index:: determinism, non-determinism, profiles

Profiles
........

Introduced the concept of :ref:`profile <profiles>` for specifying language subsets.

* A new profile defining a :ref:`deterministic <profile-deterministic>` mode of execution.


.. index:: text format, annotation, custom section, identifier, module, type, function, local, structure field

Custom Annotations
Expand All @@ -542,7 +584,7 @@ mirroring the role of custom sections in the binary format. [#proposal-annot]_


.. [#proposal-extconst]
https://github.com/WebAssembly/extended-const/blob/main/proposals/extended-const/
https://github.com/WebAssembly/spec/blob/main/proposals/extended-const/

.. [#proposal-tailcall]
https://github.com/WebAssembly/spec/tree/main/proposals/tail-call/
Expand All @@ -551,13 +593,16 @@ mirroring the role of custom sections in the binary format. [#proposal-annot]_
https://github.com/WebAssembly/spec/tree/main/proposals/exception-handling/

.. [#proposal-multimem]
https://github.com/WebAssembly/multi-memory/blob/main/proposals/multi-memory/
https://github.com/WebAssembly/spec/blob/main/proposals/multi-memory/

.. [#proposal-typedref]
https://github.com/WebAssembly/spec/tree/main/proposals/function-references/

.. [#proposal-gc]
https://github.com/WebAssembly/spec/tree/main/proposals/gc/

.. [#proposal-relaxed]
https://github.com/WebAssembly/spec/tree/main/proposals/relaxed-simd/

.. [#proposal-annot]
https://github.com/WebAssembly/annotations/tree/main/proposals/annotations/
1,140 changes: 580 additions & 560 deletions document/core/appendix/index-instructions.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions document/core/appendix/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Appendix
:maxdepth: 2

embedding
profiles
implementation
properties
algorithm
Expand Down
131 changes: 131 additions & 0 deletions document/core/appendix/profiles.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
.. index:: ! profile, abstract syntax, validation, execution, binary format, text format
.. _profiles:

Profiles
--------

To enable the use of WebAssembly in as many environments as possible, *profiles* specify coherent language subsets that fit constraints imposed by common classes of host environments.
A host platform can thereby decide to support the language only under a restricted profile, or even the intersection of multiple profiles.


Conventions
~~~~~~~~~~~

A profile modification is specified by decorating selected rules in the main body of this specification with a *profile annotation* that defines them as conditional on the choice of profile.

For that purpose, every profile defines a *profile marker*, an alphanumeric short-hand like :math:`\profilename{ABC}`.
A profile annotation of the form :math:`\exprofiles{\profile{ABC}~\profile{XYZ}}` on a rule indicates that this rule is *excluded* for either of the profiles whose marker is :math:`\profilename{ABC}` or :math:`\profilename{XYZ}`.

There are two ways of subsetting the language in a profile:

* *Syntactic*, by *omitting* a feature, in which case certain constructs are removed from the syntax altogether.

* *Semantic*, by *restricting* a feature, in which case certain constructs are still present but some behaviours are ruled out.


Syntax Annotations
..................

To omit a construct from a profile syntactically, respective productions in the grammar of the :ref:`abstract syntax <syntax>` are annotated with an associated profile marker.
This is defined to have the following implications:

1. Any production in the :ref:`binary <binary>` or :ref:`textual <text>` syntax that produces abstract syntax with a marked construct is omitted by extension.

2. Any :ref:`validation <valid>` or :ref:`execution <exec>` rule that handles a marked construct is omitted by extension.

The overall effect is that the respective construct is no longer part of the language under a respective profile.

.. note::
For example, a "busy" profile marked :math:`\profilename{BUSY}` could rule out the |NOP| instruction by marking the production for it in the abstract syntax as follows:

.. math::
\begin{array}{llcl}
\production{instruction} & \instr &::=&
\dots \\
& \exprofiles{\profile{BUSY}} &|& \NOP \\
& &|& \UNREACHABLE \\
\end{array}

A rule may be annotated by multiple markers, which could be the case if a construct is in the intersection of multiple features.


Semantics Annotations
.....................

To restrict certain behaviours in a profile, individual :ref:`validation <valid>` or :ref:`reduction <exec>` rules or auxiliary definitions are annotated with an associated marker.

This has the consequence that the respective rule is no longer applicable under the given profile.

.. note::
For example, an "infinite" profile marked :math:`\profilename{INF}` could define that growing memory never fails:

.. math::
\begin{array}{llcl@{\qquad}l}
& S; F; (\I32.\CONST~n)~\MEMORYGROW~x &\stepto& S'; F; (\I32.\CONST~\X{sz})
\\&&&
\begin{array}[t]{@{}r@{~}l@{}}
(\iff & F.\AMODULE.\MIMEMS[x] = a \\
\wedge & \X{sz} = |S.\SMEMS[a].\MIDATAS|/64\,\F{Ki} \\
\wedge & S' = S \with \SMEMS[a] = \growmem(S.\SMEMS[a], n)) \\[1ex]
\end{array}
\\[1ex]
\exprofiles{\profile{INF}} & S; F; (\I32.\CONST~n)~\MEMORYGROW~x &\stepto& S; F; (\I32.\CONST~\signed_{32}^{-1}(-1))
\end{array}


Properties
..........

All profiles are defined such that the following properties are preserved:

* All profiles represent syntactic and semantic subsets of the :ref:`full profile <profile-full>`, i.e., they do not *add* syntax or *alter* behaviour.

* All profiles are mutually compatible, i.e., no two profiles subset semantic behaviour in inconsistent or ambiguous ways, and any intersection of profiles preserves the properties described here.

* Profiles do not violate :ref:`soundness <soundness>`, i.e., all :ref:`configurations <syntax-config>` valid under that profile still have well-defined execution behaviour.

.. note::
Tools are generally expected to handle and produce code for the full profile by default.
In particular, producers should not generate code that *depends* on specific profiles. Instead, all code should preserve correctness when executed under the full profile.

Moreover, profiles should be considered static and fixed for a given platform or ecosystem. Runtime conditioning on the "current" profile is not intended and should be avoided.



Defined Profiles
~~~~~~~~~~~~~~~~

.. note::
The number of defined profiles is expected to remain small in the future. Profiles are intended for broad and permanent use cases only. In particular, profiles are not intended for language versioning.


.. index:: full profile
single: profile; full
.. _profile-full:

Full Profile (:math:`{\small{\mathrm{FUL}}}`)
.............................................

The *full* profile contains the complete language and all possible behaviours.
It imposes no restrictions, i.e., all rules and definitions are active.
All other profiles define sub-languages of this profile.


.. index:: determinism, non-determinism, deterministic profile
single: profile; deterministic
.. _profile-deterministic:

Deterministic Profile (:math:`{\small{\mathrm{DET}}}`)
......................................................

The *deterministic* profile excludes all rules marked :math:`\exprofiles{\PROFDET}`.
It defines a sub-language that does not exhibit any incidental non-deterministic behaviour:

* All :ref:`NaN <syntax-nan>` values :ref:`generated <aux-nans>` by :ref:`floating-point instructions <syntax-instr-numeric>` are canonical and positive.

* All :ref:`relaxed vector instructions <syntax-instr-vec-relaxed>` have a fixed behaviour that does not depend on the implementation.

Even under this profile, the |MEMORYGROW| and |TABLEGROW| instructions technically remain :ref:`non-deterministic <exec-memory.grow>`, in order to be able to indicate resource exhaustion.

.. note::
In future versions of WebAssembly, new non-deterministic behaviour may be added to the language, such that the deterministic profile will induce additional restrictions.
34 changes: 34 additions & 0 deletions document/core/binary/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ The ${:CONST} instruction for vectors is followed by 16 immediate bytes, which a

$${grammar: Binstr/vec-const}

.. _binary-vswizzlop:
.. _binary-vshuffle:

The ${:SHUFFLE} instruction is also followed by the encoding of 16 ${:laneidx} immediates.
Expand Down Expand Up @@ -309,6 +310,10 @@ $${grammar: {
.. _binary-vshiftop:
.. _binary-viunop:
.. _binary-vibinop:
.. _binary-viternop:
.. _binary-viextunop:
.. _binary-viextbinop:
.. _binary-viextternop:
.. _binary-viminmaxop:
.. _binary-vsatbinop:

Expand Down Expand Up @@ -342,6 +347,7 @@ $${grammar: {
Binstr/vec-shift-i32x4
Binstr/vec-bin-i32x4
Binstr/vec-extbin-i32x4
Binstr/vec-exttern-i32x4
}}

$${grammar: {
Expand All @@ -356,19 +362,47 @@ $${grammar: {

.. _binary-vfunop:
.. _binary-vfbinop:
.. _binary-vfternop:

$${grammar: {
Binstr/vec-un-f32x4
Binstr/vec-bin-f32x4
Binstr/vec-tern-f32x4
}}

$${grammar: {
Binstr/vec-un-f64x2
Binstr/vec-bin-f64x2
Binstr/vec-tern-f64x2
}}

$${grammar: {Binstr/vec-cvt}}

.. math::
\begin{array}{llclll}
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{vechaslongerinstructionnames} \\[-2ex] &&|&
\hex{FD}~~256{:}\Bu32 &\Rightarrow& \I16X8.\VRELAXEDSWIZZLE \\ &&|&
\hex{FD}~~257{:}\Bu32 &\Rightarrow& \I32X4.\VRELAXEDTRUNC\K{\_f32x4\_s} \\ &&|&
\hex{FD}~~258{:}\Bu32 &\Rightarrow& \I32X4.\VRELAXEDTRUNC\K{\_f32x4\_u} \\ &&|&
\hex{FD}~~259{:}\Bu32 &\Rightarrow& \I32X4.\VRELAXEDTRUNC\K{\_f32x4\_s\_zero} \\ &&|&
\hex{FD}~~260{:}\Bu32 &\Rightarrow& \I32X4.\VRELAXEDTRUNC\K{\_f32x4\_u\_zero} \\ &&|&
\hex{FD}~~261{:}\Bu32 &\Rightarrow& \F32X4.\VRELAXEDMADD \\ &&|&
\hex{FD}~~262{:}\Bu32 &\Rightarrow& \F32X4.\VRELAXEDNMADD \\ &&|&
\hex{FD}~~263{:}\Bu32 &\Rightarrow& \F64X2.\VRELAXEDMADD \\ &&|&
\hex{FD}~~264{:}\Bu32 &\Rightarrow& \F64X2.\VRELAXEDNMADD \\ &&|&
\hex{FD}~~265{:}\Bu32 &\Rightarrow& \I8X16.\VRELAXEDLANESELECT \\ &&|&
\hex{FD}~~266{:}\Bu32 &\Rightarrow& \I16X8.\VRELAXEDLANESELECT \\ &&|&
\hex{FD}~~267{:}\Bu32 &\Rightarrow& \I32X4.\VRELAXEDLANESELECT \\ &&|&
\hex{FD}~~268{:}\Bu32 &\Rightarrow& \I64X2.\VRELAXEDLANESELECT \\ &&|&
\hex{FD}~~269{:}\Bu32 &\Rightarrow& \F32X4.\VRELAXEDMIN \\ &&|&
\hex{FD}~~270{:}\Bu32 &\Rightarrow& \F32X4.\VRELAXEDMAX \\ &&|&
\hex{FD}~~271{:}\Bu32 &\Rightarrow& \F64X2.\VRELAXEDMIN \\ &&|&
\hex{FD}~~272{:}\Bu32 &\Rightarrow& \F64X2.\VRELAXEDMAX \\ &&|&
\hex{FD}~~273{:}\Bu32 &\Rightarrow& \I16X8.\VRELAXEDQ15MULR\K{\_s} \\ &&|&
\hex{FD}~~274{:}\Bu32 &\Rightarrow& \I16X8.\VRELAXEDDOT\K{\_i8x16\_i7x16\_s} \\ &&|&
\hex{FD}~~275{:}\Bu32 &\Rightarrow& \I16X8.\VRELAXEDDOT\K{\_i8x16\_i7x16\_add\_s} \\
\end{array}


.. index:: expression
pair: binary format; expression
Expand Down
Loading
Loading