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

[spec] Add missing i64.extend32_s syntax #1179

Merged
merged 2 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions document/core/appendix/index-instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ Instruction Binary Opcode Type
:math:`\I64.\EXTEND\K{8\_s}` :math:`\hex{C2}` :math:`[\I64] \to [\I64]` :ref:`validation <valid-unop>` :ref:`execution <exec-unop>`, :ref:`operator <op-iextendn_s>`
:math:`\I64.\EXTEND\K{16\_s}` :math:`\hex{C3}` :math:`[\I64] \to [\I64]` :ref:`validation <valid-unop>` :ref:`execution <exec-unop>`, :ref:`operator <op-iextendn_s>`
:math:`\I64.\EXTEND\K{32\_s}` :math:`\hex{C4}` :math:`[\I64] \to [\I64]` :ref:`validation <valid-unop>` :ref:`execution <exec-unop>`, :ref:`operator <op-iextendn_s>`
:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~\hex{00}` :math:`[\F32] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_s_sat>`
:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~\hex{01}` :math:`[\F32] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_u_sat>`
:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_s}` :math:`\hex{FC}~\hex{02}` :math:`[\F64] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_s_sat>`
:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_u}` :math:`\hex{FC}~\hex{03}` :math:`[\F64] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_u_sat>`
:math:`\I64.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~\hex{04}` :math:`[\F32] \to [\I64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_s_sat>`
:math:`\I64.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~\hex{05}` :math:`[\F32] \to [\I64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_u_sat>`
:math:`\I64.\TRUNC\K{\_sat}\_\F64\K{\_s}` :math:`\hex{FC}~\hex{06}` :math:`[\F64] \to [\I64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_s_sat>`
:math:`\I64.\TRUNC\K{\_sat\_}\F64\K{\_u}` :math:`\hex{FC}~\hex{07}` :math:`[\F64] \to [\I64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_u_sat>`
:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~\hex{00}` :math:`[\F32] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_s>`
:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~\hex{01}` :math:`[\F32] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_u>`
:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_s}` :math:`\hex{FC}~\hex{02}` :math:`[\F64] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_s>`
:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_u}` :math:`\hex{FC}~\hex{03}` :math:`[\F64] \to [\I32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_u>`
:math:`\I64.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~\hex{04}` :math:`[\F32] \to [\I64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_s>`
:math:`\I64.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~\hex{05}` :math:`[\F32] \to [\I64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_u>`
:math:`\I64.\TRUNC\K{\_sat}\_\F64\K{\_s}` :math:`\hex{FC}~\hex{06}` :math:`[\F64] \to [\I64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_s>`
:math:`\I64.\TRUNC\K{\_sat\_}\F64\K{\_u}` :math:`\hex{FC}~\hex{07}` :math:`[\F64] \to [\I64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-trunc_sat_u>`
========================================= ========================= ============================================= ======================================== ===============================================================
2 changes: 1 addition & 1 deletion document/core/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
# built documents.
#
# The short X.Y version.
version = u'1.0'
version = u'1.1'
# The full version, including alpha/beta/rc tags.
release = version + ''

Expand Down
36 changes: 18 additions & 18 deletions document/core/exec/numerics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,14 @@ The integer result of predicates -- i.e., :ref:`tests <syntax-testop>` and :ref:

.. _op-iextendn_s:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually expand to anything, so I'm fine with keeping it. The other made it difficult to understand the def from the Latex source, because the M on the rhs seemed to becoming out of nowhere.


:math:`\iextendns_N(i)`
:math:`\iextendMs_N(i)`
.......................

* Return :math:`\extends_{M,N}(i)`.

.. math::
\begin{array}{lll@{\qquad}l}
\iextendns_{N}(i) &=& \extends_{M,N}(i) \\
\iextendMs_{N}(i) &=& \extends_{M,N}(i) \\
\end{array}


Expand Down Expand Up @@ -1477,9 +1477,9 @@ Conversions
It is not defined for NaNs, infinities, or values for which the result is out of range.


.. _op-trunc_u_sat:
.. _op-trunc_sat_u:

:math:`\truncusat_{M,N}(z)`
:math:`\truncsatu_{M,N}(z)`
...........................

* If :math:`z` is a NaN, then return :math:`0`.
Expand All @@ -1496,18 +1496,18 @@ Conversions

.. math::
\begin{array}{lll@{\qquad}l}
\truncusat_{M,N}(\pm \NAN(n)) &=& 0 \\
\truncusat_{M,N}(- \infty) &=& 0 \\
\truncusat_{M,N}(+ \infty) &=& 2^N - 1 \\
\truncusat_{M,N}(- q) &=& 0 & (\iff \trunc(- q) < 0) \\
\truncusat_{M,N}(+ q) &=& 2^N - 1 & (\iff \trunc(+ q) > 2^N - 1) \\
\truncusat_{M,N}(\pm q) &=& \trunc(\pm q) & (otherwise) \\
\truncsatu_{M,N}(\pm \NAN(n)) &=& 0 \\
\truncsatu_{M,N}(- \infty) &=& 0 \\
\truncsatu_{M,N}(+ \infty) &=& 2^N - 1 \\
\truncsatu_{M,N}(- q) &=& 0 & (\iff \trunc(- q) < 0) \\
\truncsatu_{M,N}(+ q) &=& 2^N - 1 & (\iff \trunc(+ q) > 2^N - 1) \\
\truncsatu_{M,N}(\pm q) &=& \trunc(\pm q) & (otherwise) \\
\end{array}


.. _op-trunc_s_sat:
.. _op-trunc_sat_s:

:math:`\truncssat_{M,N}(z)`
:math:`\truncsats_{M,N}(z)`
...........................

* If :math:`z` is a NaN, then return :math:`0`.
Expand All @@ -1524,12 +1524,12 @@ Conversions

.. math::
\begin{array}{lll@{\qquad}l}
\truncssat_{M,N}(\pm \NAN(n)) &=& 0 \\
\truncssat_{M,N}(- \infty) &=& -2^{N-1} \\
\truncssat_{M,N}(+ \infty) &=& 2^{N-1}-1 \\
\truncssat_{M,N}(- q) &=& -2^{N-1} & (\iff \trunc(- q) < -2^{N-1}) \\
\truncssat_{M,N}(+ q) &=& 2^{N-1} - 1 & (\iff \trunc(+ q) > 2^{N-1} - 1) \\
\truncssat_{M,N}(\pm q) &=& \trunc(\pm q) & (otherwise) \\
\truncsats_{M,N}(\pm \NAN(n)) &=& 0 \\
\truncsats_{M,N}(- \infty) &=& -2^{N-1} \\
\truncsats_{M,N}(+ \infty) &=& 2^{N-1}-1 \\
\truncsats_{M,N}(- q) &=& -2^{N-1} & (\iff \trunc(- q) < -2^{N-1}) \\
\truncsats_{M,N}(+ q) &=& 2^{N-1} - 1 & (\iff \trunc(+ q) > 2^{N-1} - 1) \\
\truncsats_{M,N}(\pm q) &=& \trunc(\pm q) & (otherwise) \\
\end{array}


Expand Down
5 changes: 3 additions & 2 deletions document/core/syntax/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ These operations closely match respective operations available in hardware.
\K{f}\X{nn}\K{.}\frelop \\&&|&
\K{i}\X{nn}\K{.}\EXTEND\K{8\_s} ~|~
\K{i}\X{nn}\K{.}\EXTEND\K{16\_s} ~|~
\K{i64.}\EXTEND\K{\_i32}\K{\_}\sx ~|~
\K{i64.}\EXTEND\K{32\_s} \\&&|&
\K{i32.}\WRAP\K{\_i64} ~|~
\K{i64.}\EXTEND\K{\_i32}\K{\_}\sx ~|~
\K{i}\X{nn}\K{.}\TRUNC\K{\_f}\X{mm}\K{\_}\sx \\&&|&
\K{i}\X{nn}\K{.}\TRUNC\K{\_sat\_f}\X{mm}\K{\_}\sx \\&&|&
\K{f32.}\DEMOTE\K{\_f64} ~|~
Expand Down Expand Up @@ -153,7 +154,7 @@ Occasionally, it is convenient to group operators together according to the foll
\production{unary operator} & \unop &::=&
\iunop ~|~
\funop ~|~
\EXTEND{N}\K{\_s} ~|~ \\
\EXTEND{N}\K{\_s} \\
\production{binary operator} & \binop &::=& \ibinop ~|~ \fbinop \\
\production{test operator} & \testop &::=& \itestop \\
\production{relational operator} & \relop &::=& \irelop ~|~ \frelop \\
Expand Down
2 changes: 1 addition & 1 deletion document/core/text/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ where :math:`x` is the smallest existing :ref:`type index <syntax-typeidx>` whos
If no such index exists, then a new :ref:`type definition <text-type>` of the form

.. math::
\text{(}~\text{type}~~\text{(}~\text{func}~~\Tparam^\ast~~\Tresult~\text{)}~\text{)}
\text{(}~\text{type}~~\text{(}~\text{func}~~\Tparam^\ast~~\Tresult^\ast~\text{)}~\text{)}

is inserted at the end of the module.

Expand Down
6 changes: 3 additions & 3 deletions document/core/util/macros.def
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@
.. |iles| mathdef:: \xref{exec/numerics}{op-ile_s}{\F{ile\_s}}
.. |igeu| mathdef:: \xref{exec/numerics}{op-ige_u}{\F{ige\_u}}
.. |iges| mathdef:: \xref{exec/numerics}{op-ige_s}{\F{ige\_s}}
.. |iextendns| mathdef:: \xref{exec/numerics}{op-iextendn_s}{\F{iextend}M\F{\_s}}
.. |iextendMs| mathdef:: \xref{exec/numerics}{op-iextendn_s}{\F{iextend}M\F{\_s}}

.. |fadd| mathdef:: \xref{exec/numerics}{op-fadd}{\F{fadd}}
.. |fsub| mathdef:: \xref{exec/numerics}{op-fsub}{\F{fsub}}
Expand Down Expand Up @@ -961,8 +961,8 @@
.. |wrap| mathdef:: \xref{exec/numerics}{op-wrap}{\F{wrap}}
.. |truncu| mathdef:: \xref{exec/numerics}{op-trunc_u}{\F{trunc}^{\K{u}}}
.. |truncs| mathdef:: \xref{exec/numerics}{op-trunc_s}{\F{trunc}^{\K{s}}}
.. |truncusat| mathdef:: \xref{exec/numerics}{op-trunc_sat_u}{\F{trunc\_sat\_u}}
.. |truncssat| mathdef:: \xref{exec/numerics}{op-trunc_sat_s}{\F{trunc\_sat\_s}}
.. |truncsatu| mathdef:: \xref{exec/numerics}{op-trunc_sat_u}{\F{trunc\_sat\_u}}
.. |truncsats| mathdef:: \xref{exec/numerics}{op-trunc_sat_s}{\F{trunc\_sat\_s}}
.. |promote| mathdef:: \xref{exec/numerics}{op-promote}{\F{promote}}
.. |demote| mathdef:: \xref{exec/numerics}{op-demote}{\F{demote}}
.. |convertu| mathdef:: \xref{exec/numerics}{op-convert_u}{\F{convert}^{\K{u}}}
Expand Down
16 changes: 8 additions & 8 deletions interpreter/binary/encode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ let encode m =
| Convert (I32 I32Op.TruncUF32) -> op 0xa9
| Convert (I32 I32Op.TruncSF64) -> op 0xaa
| Convert (I32 I32Op.TruncUF64) -> op 0xab
| Convert (I32 I32Op.TruncSSatF32) -> op 0xfc; op 0x00
| Convert (I32 I32Op.TruncUSatF32) -> op 0xfc; op 0x01
| Convert (I32 I32Op.TruncSSatF64) -> op 0xfc; op 0x02
| Convert (I32 I32Op.TruncUSatF64) -> op 0xfc; op 0x03
| Convert (I32 I32Op.TruncSatSF32) -> op 0xfc; op 0x00
| Convert (I32 I32Op.TruncSatUF32) -> op 0xfc; op 0x01
| Convert (I32 I32Op.TruncSatSF64) -> op 0xfc; op 0x02
| Convert (I32 I32Op.TruncSatUF64) -> op 0xfc; op 0x03
| Convert (I32 I32Op.ReinterpretFloat) -> op 0xbc

| Convert (I64 I64Op.ExtendSI32) -> op 0xac
Expand All @@ -354,10 +354,10 @@ let encode m =
| Convert (I64 I64Op.TruncUF32) -> op 0xaf
| Convert (I64 I64Op.TruncSF64) -> op 0xb0
| Convert (I64 I64Op.TruncUF64) -> op 0xb1
| Convert (I64 I64Op.TruncSSatF32) -> op 0xfc; op 0x04
| Convert (I64 I64Op.TruncUSatF32) -> op 0xfc; op 0x05
| Convert (I64 I64Op.TruncSSatF64) -> op 0xfc; op 0x06
| Convert (I64 I64Op.TruncUSatF64) -> op 0xfc; op 0x07
| Convert (I64 I64Op.TruncSatSF32) -> op 0xfc; op 0x04
| Convert (I64 I64Op.TruncSatUF32) -> op 0xfc; op 0x05
| Convert (I64 I64Op.TruncSatSF64) -> op 0xfc; op 0x06
| Convert (I64 I64Op.TruncSatUF64) -> op 0xfc; op 0x07
| Convert (I64 I64Op.ReinterpretFloat) -> op 0xbd

| Convert (F32 F32Op.ConvertSI32) -> op 0xb2
Expand Down
16 changes: 8 additions & 8 deletions interpreter/exec/eval_numeric.ml
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ struct
| TruncUF32 -> I32 (I32_convert.trunc_f32_u (F32Op.of_value 1 v))
| TruncSF64 -> I32 (I32_convert.trunc_f64_s (F64Op.of_value 1 v))
| TruncUF64 -> I32 (I32_convert.trunc_f64_u (F64Op.of_value 1 v))
| TruncSSatF32 -> I32 (I32_convert.trunc_sat_f32_s (F32Op.of_value 1 v))
| TruncUSatF32 -> I32 (I32_convert.trunc_sat_f32_u (F32Op.of_value 1 v))
| TruncSSatF64 -> I32 (I32_convert.trunc_sat_f64_s (F64Op.of_value 1 v))
| TruncUSatF64 -> I32 (I32_convert.trunc_sat_f64_u (F64Op.of_value 1 v))
| TruncSatSF32 -> I32 (I32_convert.trunc_sat_f32_s (F32Op.of_value 1 v))
| TruncSatUF32 -> I32 (I32_convert.trunc_sat_f32_u (F32Op.of_value 1 v))
| TruncSatSF64 -> I32 (I32_convert.trunc_sat_f64_s (F64Op.of_value 1 v))
| TruncSatUF64 -> I32 (I32_convert.trunc_sat_f64_u (F64Op.of_value 1 v))
| ReinterpretFloat -> I32 (I32_convert.reinterpret_f32 (F32Op.of_value 1 v))
| ExtendSI32 -> raise (TypeError (1, v, I32Type))
| ExtendUI32 -> raise (TypeError (1, v, I32Type))
Expand All @@ -152,10 +152,10 @@ struct
| TruncUF32 -> I64 (I64_convert.trunc_f32_u (F32Op.of_value 1 v))
| TruncSF64 -> I64 (I64_convert.trunc_f64_s (F64Op.of_value 1 v))
| TruncUF64 -> I64 (I64_convert.trunc_f64_u (F64Op.of_value 1 v))
| TruncSSatF32 -> I64 (I64_convert.trunc_sat_f32_s (F32Op.of_value 1 v))
| TruncUSatF32 -> I64 (I64_convert.trunc_sat_f32_u (F32Op.of_value 1 v))
| TruncSSatF64 -> I64 (I64_convert.trunc_sat_f64_s (F64Op.of_value 1 v))
| TruncUSatF64 -> I64 (I64_convert.trunc_sat_f64_u (F64Op.of_value 1 v))
| TruncSatSF32 -> I64 (I64_convert.trunc_sat_f32_s (F32Op.of_value 1 v))
| TruncSatUF32 -> I64 (I64_convert.trunc_sat_f32_u (F32Op.of_value 1 v))
| TruncSatSF64 -> I64 (I64_convert.trunc_sat_f64_s (F64Op.of_value 1 v))
| TruncSatUF64 -> I64 (I64_convert.trunc_sat_f64_u (F64Op.of_value 1 v))
| ReinterpretFloat -> I64 (I64_convert.reinterpret_f64 (F64Op.of_value 1 v))
| WrapI64 -> raise (TypeError (1, v, I64Type))
end
Expand Down
2 changes: 1 addition & 1 deletion interpreter/syntax/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct
type relop = Eq | Ne | LtS | LtU | GtS | GtU | LeS | LeU | GeS | GeU
type cvtop = ExtendSI32 | ExtendUI32 | WrapI64
| TruncSF32 | TruncUF32 | TruncSF64 | TruncUF64
| TruncSSatF32 | TruncUSatF32 | TruncSSatF64 | TruncUSatF64
| TruncSatSF32 | TruncSatUF32 | TruncSatSF64 | TruncSatUF64
| ReinterpretFloat
end

Expand Down
28 changes: 14 additions & 14 deletions interpreter/syntax/operators.ml
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,21 @@ let f64_le = Compare (F64 F64Op.Le)
let f64_gt = Compare (F64 F64Op.Gt)
let f64_ge = Compare (F64 F64Op.Ge)

let i32_extend8_s = Unary (I32 (I32Op.ExtendS Pack8))
let i32_extend16_s = Unary (I32 (I32Op.ExtendS Pack16))
let i64_extend8_s = Unary (I64 (I64Op.ExtendS Pack8))
let i64_extend16_s = Unary (I64 (I64Op.ExtendS Pack16))
let i64_extend32_s = Unary (I64 (I64Op.ExtendS Pack32))

let i32_wrap_i64 = Convert (I32 I32Op.WrapI64)
let i32_trunc_f32_s = Convert (I32 I32Op.TruncSF32)
let i32_trunc_f32_u = Convert (I32 I32Op.TruncUF32)
let i32_trunc_f64_s = Convert (I32 I32Op.TruncSF64)
let i32_trunc_f64_u = Convert (I32 I32Op.TruncUF64)
let i32_trunc_sat_f32_s = Convert (I32 I32Op.TruncSSatF32)
let i32_trunc_sat_f32_u = Convert (I32 I32Op.TruncUSatF32)
let i32_trunc_sat_f64_s = Convert (I32 I32Op.TruncSSatF64)
let i32_trunc_sat_f64_u = Convert (I32 I32Op.TruncUSatF64)
let i32_trunc_sat_f32_s = Convert (I32 I32Op.TruncSatSF32)
let i32_trunc_sat_f32_u = Convert (I32 I32Op.TruncSatUF32)
let i32_trunc_sat_f64_s = Convert (I32 I32Op.TruncSatSF64)
let i32_trunc_sat_f64_u = Convert (I32 I32Op.TruncSatUF64)
let i64_extend_i32_s = Convert (I64 I64Op.ExtendSI32)
let i64_extend_i32_u = Convert (I64 I64Op.ExtendUI32)
let i64_trunc_f32_s = Convert (I64 I64Op.TruncSF32)
Expand All @@ -191,10 +197,10 @@ let f32_convert_i32_s = Convert (F32 F32Op.ConvertSI32)
let f32_convert_i32_u = Convert (F32 F32Op.ConvertUI32)
let f32_convert_i64_s = Convert (F32 F32Op.ConvertSI64)
let f32_convert_i64_u = Convert (F32 F32Op.ConvertUI64)
let i64_trunc_sat_f32_s = Convert (I64 I64Op.TruncSSatF32)
let i64_trunc_sat_f32_u = Convert (I64 I64Op.TruncUSatF32)
let i64_trunc_sat_f64_s = Convert (I64 I64Op.TruncSSatF64)
let i64_trunc_sat_f64_u = Convert (I64 I64Op.TruncUSatF64)
let i64_trunc_sat_f32_s = Convert (I64 I64Op.TruncSatSF32)
let i64_trunc_sat_f32_u = Convert (I64 I64Op.TruncSatUF32)
let i64_trunc_sat_f64_s = Convert (I64 I64Op.TruncSatSF64)
let i64_trunc_sat_f64_u = Convert (I64 I64Op.TruncSatUF64)
let f32_demote_f64 = Convert (F32 F32Op.DemoteF64)
let f64_convert_i32_s = Convert (F64 F64Op.ConvertSI32)
let f64_convert_i32_u = Convert (F64 F64Op.ConvertUI32)
Expand All @@ -206,12 +212,6 @@ let i64_reinterpret_f64 = Convert (I64 I64Op.ReinterpretFloat)
let f32_reinterpret_i32 = Convert (F32 F32Op.ReinterpretInt)
let f64_reinterpret_i64 = Convert (F64 F64Op.ReinterpretInt)

let i32_extend8_s = Unary (I32 (I32Op.ExtendS Pack8))
let i32_extend16_s = Unary (I32 (I32Op.ExtendS Pack16))
let i64_extend8_s = Unary (I64 (I64Op.ExtendS Pack8))
let i64_extend16_s = Unary (I64 (I64Op.ExtendS Pack16))
let i64_extend32_s = Unary (I64 (I64Op.ExtendS Pack32))

let memory_size = MemorySize
let memory_grow = MemoryGrow

8 changes: 4 additions & 4 deletions interpreter/text/arrange.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ struct
| TruncUF32 -> "trunc_f32_u"
| TruncSF64 -> "trunc_f64_s"
| TruncUF64 -> "trunc_f64_u"
| TruncSSatF32 -> "trunc_sat_f32_s"
| TruncUSatF32 -> "trunc_sat_f32_u"
| TruncSSatF64 -> "trunc_sat_f64_s"
| TruncUSatF64 -> "trunc_sat_f64_u"
| TruncSatSF32 -> "trunc_sat_f32_s"
| TruncSatUF32 -> "trunc_sat_f32_u"
| TruncSatSF64 -> "trunc_sat_f64_s"
| TruncSatUF64 -> "trunc_sat_f64_u"
| ReinterpretFloat -> "reinterpret_f" ^ xx
end

Expand Down
8 changes: 4 additions & 4 deletions interpreter/valid/valid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ let type_cvtop at = function
(match cvtop with
| ExtendSI32 | ExtendUI32 -> error at "invalid conversion"
| WrapI64 -> I64Type
| TruncSF32 | TruncUF32 | TruncSSatF32 | TruncUSatF32
| TruncSF32 | TruncUF32 | TruncSatSF32 | TruncSatUF32
| ReinterpretFloat -> F32Type
| TruncSF64 | TruncUF64 | TruncSSatF64 | TruncUSatF64 -> F64Type
| TruncSF64 | TruncUF64 | TruncSatSF64 | TruncSatUF64 -> F64Type
), I32Type
| Values.I64 cvtop ->
let open I64Op in
(match cvtop with
| ExtendSI32 | ExtendUI32 -> I32Type
| WrapI64 -> error at "invalid conversion"
| TruncSF32 | TruncUF32 | TruncSSatF32 | TruncUSatF32 -> F32Type
| TruncSF64 | TruncUF64 | TruncSSatF64 | TruncUSatF64
| TruncSF32 | TruncUF32 | TruncSatSF32 | TruncSatUF32 -> F32Type
| TruncSF64 | TruncUF64 | TruncSatSF64 | TruncSatUF64
| ReinterpretFloat -> F64Type
), I64Type
| Values.F32 cvtop ->
Expand Down