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

Commit 77b3177

Browse files
committed
[spectext] Add {f32x4,f64x2}.{pmin,pmax}
We added these instructions to the syntax in #353, this adds them to the other sections, numerics, text, binary.
1 parent 4c8378f commit 77b3177

File tree

6 files changed

+56
-4
lines changed

6 files changed

+56
-4
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
519519
Instruction(r'\F32X4.\VDIV', r'\hex{FD}~~231', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fdiv'),
520520
Instruction(r'\F32X4.\VMIN', r'\hex{FD}~~232', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fmin'),
521521
Instruction(r'\F32X4.\VMAX', r'\hex{FD}~~233', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fmax'),
522+
Instruction(r'\F32X4.\VPMIN', r'\hex{FD}~~234', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fpmin'),
523+
Instruction(r'\F32X4.\VPMAX', r'\hex{FD}~~235', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fpmax'),
522524
Instruction(r'\F64X2.\VABS', r'\hex{FD}~~236', r'[\V128] \to [\V128]', r'valid-vunop', r'exec-vunop', r'op-fabs'),
523525
Instruction(r'\F64X2.\VNEG', r'\hex{FD}~~237', r'[\V128] \to [\V128]', r'valid-vunop', r'exec-vunop', r'op-fneg'),
524526
Instruction(r'\F64X2.\VSQRT', r'\hex{FD}~~239', r'[\V128] \to [\I32]', r'valid-vunop', r'exec-vunop', r'op-fsqrt'),
@@ -527,6 +529,8 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
527529
Instruction(r'\F64X2.\VMUL', r'\hex{FD}~~242', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fmul'),
528530
Instruction(r'\F64X2.\VDIV', r'\hex{FD}~~243', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fdiv'),
529531
Instruction(r'\F64X2.\VMIN', r'\hex{FD}~~244', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fmin'),
532+
Instruction(r'\F64X2.\VPMIN', r'\hex{FD}~~245', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fpmin'),
533+
Instruction(r'\F64X2.\VPMAX', r'\hex{FD}~~246', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fpmax'),
530534
Instruction(r'\F64X2.\VMAX', r'\hex{FD}~~245', r'[\V128~\V128] \to [\V128]', r'valid-vbinop', r'exec-vbinop', r'op-fmax'),
531535
Instruction(r'\I32X4.\TRUNC\K{\_sat\_f32x4\_s}', r'\hex{FD}~~248', r'[\V128] \to [\V128]', r'valid-vunop', r'exec-vunop', r'op-trunc_sat_s'),
532536
Instruction(r'\I32X4.\TRUNC\K{\_sat\_f32x4\_u}', r'\hex{FD}~~249', r'[\V128] \to [\V128]', r'valid-vunop', r'exec-vunop', r'op-trunc_sat_u'),

document/core/appendix/index-instructions.rst

+4
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ Instruction Binary Opcode Type
467467
:math:`\F32X4.\VDIV` :math:`\hex{FD}~~231` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fdiv>`
468468
:math:`\F32X4.\VMIN` :math:`\hex{FD}~~232` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fmin>`
469469
:math:`\F32X4.\VMAX` :math:`\hex{FD}~~233` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fmax>`
470+
:math:`\F32X4.\VPMIN` :math:`\hex{FD}~~234` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fpmin>`
471+
:math:`\F32X4.\VPMAX` :math:`\hex{FD}~~235` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fpmax>`
470472
:math:`\F64X2.\VABS` :math:`\hex{FD}~~236` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vunop>` :ref:`execution <exec-vunop>`, :ref:`operator <op-fabs>`
471473
:math:`\F64X2.\VNEG` :math:`\hex{FD}~~237` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vunop>` :ref:`execution <exec-vunop>`, :ref:`operator <op-fneg>`
472474
:math:`\F64X2.\VSQRT` :math:`\hex{FD}~~239` :math:`[\V128] \to [\I32]` :ref:`validation <valid-vunop>` :ref:`execution <exec-vunop>`, :ref:`operator <op-fsqrt>`
@@ -475,6 +477,8 @@ Instruction Binary Opcode Type
475477
:math:`\F64X2.\VMUL` :math:`\hex{FD}~~242` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fmul>`
476478
:math:`\F64X2.\VDIV` :math:`\hex{FD}~~243` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fdiv>`
477479
:math:`\F64X2.\VMIN` :math:`\hex{FD}~~244` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fmin>`
480+
:math:`\F64X2.\VPMIN` :math:`\hex{FD}~~245` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fpmin>`
481+
:math:`\F64X2.\VPMAX` :math:`\hex{FD}~~246` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fpmax>`
478482
:math:`\F64X2.\VMAX` :math:`\hex{FD}~~245` :math:`[\V128~\V128] \to [\V128]` :ref:`validation <valid-vbinop>` :ref:`execution <exec-vbinop>`, :ref:`operator <op-fmax>`
479483
:math:`\I32X4.\TRUNC\K{\_sat\_f32x4\_s}` :math:`\hex{FD}~~248` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vunop>` :ref:`execution <exec-vunop>`, :ref:`operator <op-trunc_sat_s>`
480484
:math:`\I32X4.\TRUNC\K{\_sat\_f32x4\_u}` :math:`\hex{FD}~~249` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vunop>` :ref:`execution <exec-vunop>`, :ref:`operator <op-trunc_sat_u>`

document/core/binary/instructions.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,9 @@ All other SIMD instructions are plain opcodes without any immediates.
730730
\hex{FD}~~230{:}\Bu32 &\Rightarrow& \F32X4.\VMUL \\ &&|&
731731
\hex{FD}~~231{:}\Bu32 &\Rightarrow& \F32X4.\VDIV \\ &&|&
732732
\hex{FD}~~232{:}\Bu32 &\Rightarrow& \F32X4.\VMIN \\ &&|&
733-
\hex{FD}~~233{:}\Bu32 &\Rightarrow& \F32X4.\VMAX \\
733+
\hex{FD}~~233{:}\Bu32 &\Rightarrow& \F32X4.\VMAX \\ &&|&
734+
\hex{FD}~~234{:}\Bu32 &\Rightarrow& \F32X4.\VPMIN \\ &&|&
735+
\hex{FD}~~235{:}\Bu32 &\Rightarrow& \F32X4.\VPMAX \\
734736
\end{array}
735737
736738
.. math::
@@ -744,7 +746,9 @@ All other SIMD instructions are plain opcodes without any immediates.
744746
\hex{FD}~~242{:}\Bu32 &\Rightarrow& \F64X2.\VMUL \\ &&|&
745747
\hex{FD}~~243{:}\Bu32 &\Rightarrow& \F64X2.\VDIV \\ &&|&
746748
\hex{FD}~~244{:}\Bu32 &\Rightarrow& \F64X2.\VMIN \\ &&|&
747-
\hex{FD}~~245{:}\Bu32 &\Rightarrow& \F64X2.\VMAX \\
749+
\hex{FD}~~245{:}\Bu32 &\Rightarrow& \F64X2.\VMAX \\ &&|&
750+
\hex{FD}~~245{:}\Bu32 &\Rightarrow& \F64X2.\VPMIN \\ &&|&
751+
\hex{FD}~~246{:}\Bu32 &\Rightarrow& \F64X2.\VPMAX \\
748752
\end{array}
749753
750754
.. math::

document/core/exec/numerics.rst

+32
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,38 @@ This non-deterministic result is expressed by the following auxiliary function p
16751675
\end{array}
16761676
16771677
1678+
.. _op-fpmin:
1679+
1680+
:math:`\fpmin_N(z_1, z_2)`
1681+
..........................
1682+
1683+
* If :math:`z_2` is less than :math:`z_1` then return :math:`z_2`.
1684+
1685+
* Else return :math:`z_1`.
1686+
1687+
.. math::
1688+
\begin{array}{@{}lcll}
1689+
\fpmin_N(z_1, z_2) &=& z_2 & (\iff \flt_N(z_2, z_1) = 1) \\
1690+
\fpmin_N(z_1, z_2) &=& z_1 & (\otherwise)
1691+
\end{array}
1692+
1693+
1694+
.. _op-fpmax:
1695+
1696+
:math:`\fpmax_N(z_1, z_2)`
1697+
..........................
1698+
1699+
* If :math:`z_1` is less than :math:`z_2` then return :math:`z_2`.
1700+
1701+
* Else return :math:`z_1`.
1702+
1703+
.. math::
1704+
\begin{array}{@{}lcll}
1705+
\fpmax_N(z_1, z_2) &=& z_2 & (\iff \flt_N(z_1, z_2) = 1) \\
1706+
\fpmax_N(z_1, z_2) &=& z_1 & (\otherwise)
1707+
\end{array}
1708+
1709+
16781710
.. _convert-ops:
16791711

16801712
Conversions

document/core/text/instructions.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,9 @@ SIMD const instructions have a mandatory :ref:`shape <syntax-simd-shape>` descri
763763
\text{f32x4.mul} &\Rightarrow& \F32X4.\VMUL\\ &&|&
764764
\text{f32x4.div} &\Rightarrow& \F32X4.\VDIV\\ &&|&
765765
\text{f32x4.min} &\Rightarrow& \F32X4.\VMIN\\ &&|&
766-
\text{f32x4.max} &\Rightarrow& \F32X4.\VMAX\\
766+
\text{f32x4.max} &\Rightarrow& \F32X4.\VMAX\\ &&|&
767+
\text{f32x4.pmin} &\Rightarrow& \F32X4.\VPMIN\\ &&|&
768+
\text{f32x4.pmax} &\Rightarrow& \F32X4.\VPMAX\\
767769
\end{array}
768770
769771
.. math::
@@ -777,7 +779,9 @@ SIMD const instructions have a mandatory :ref:`shape <syntax-simd-shape>` descri
777779
\text{f64x2.mul} &\Rightarrow& \F64X2.\VMUL\\ &&|&
778780
\text{f64x2.div} &\Rightarrow& \F64X2.\VDIV\\ &&|&
779781
\text{f64x2.min} &\Rightarrow& \F64X2.\VMIN\\ &&|&
780-
\text{f64x2.max} &\Rightarrow& \F64X2.\VMAX\\
782+
\text{f64x2.max} &\Rightarrow& \F64X2.\VMAX\\ &&|&
783+
\text{f64x2.pmin} &\Rightarrow& \F64X2.\VPMIN\\ &&|&
784+
\text{f64x2.pmax} &\Rightarrow& \F64X2.\VPMAX\\
781785
\end{array}
782786
783787
.. math::

document/core/util/macros.def

+4
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@
420420
.. |VDIV| mathdef:: \xref{syntax/instructions}{syntax-instr-simd}{\K{div}}
421421
.. |VMIN| mathdef:: \xref{syntax/instructions}{syntax-instr-simd}{\K{min}}
422422
.. |VMAX| mathdef:: \xref{syntax/instructions}{syntax-instr-simd}{\K{max}}
423+
.. |VPMIN| mathdef:: \xref{syntax/instructions}{syntax-instr-simd}{\K{pmin}}
424+
.. |VPMAX| mathdef:: \xref{syntax/instructions}{syntax-instr-simd}{\K{pmax}}
423425
.. |NARROW| mathdef:: \xref{syntax/instructions}{syntax-instr-simd}{\K{narrow}}
424426
.. |WIDEN| mathdef:: \xref{syntax/instructions}{syntax-instr-simd}{\K{widen}}
425427
.. |AVGR| mathdef:: \xref{syntax/instructions}{syntax-instr-simd}{\K{avgr}}
@@ -1056,6 +1058,8 @@
10561058
.. |fgt| mathdef:: \xref{exec/numerics}{op-fgt}{\F{fgt}}
10571059
.. |fle| mathdef:: \xref{exec/numerics}{op-fle}{\F{fle}}
10581060
.. |fge| mathdef:: \xref{exec/numerics}{op-fge}{\F{fge}}
1061+
.. |fpmin| mathdef:: \xref{exec/numerics}{op-fpmin}{\F{fpmin}}
1062+
.. |fpmax| mathdef:: \xref{exec/numerics}{op-fpmax}{\F{fpmax}}
10591063

10601064
.. |extend| mathdef:: \xref{exec/numerics}{op-extend_u}{\F{extend}}
10611065
.. |extendu| mathdef:: \xref{exec/numerics}{op-extend_u}{\F{extend}^{\K{u}}}

0 commit comments

Comments
 (0)