From 46cb01332674d5975c278a6342c3f88531cc81c8 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Mon, 20 Apr 2020 13:11:30 +0200 Subject: [PATCH 1/2] [spec] Add missing i64.extend32_s syntax --- document/core/appendix/index-instructions.rst | 16 ++++----- document/core/conf.py | 2 +- document/core/exec/numerics.rst | 36 +++++++++---------- document/core/syntax/instructions.rst | 5 +-- document/core/util/macros.def | 6 ++-- interpreter/binary/encode.ml | 16 ++++----- interpreter/exec/eval_numeric.ml | 16 ++++----- interpreter/syntax/ast.ml | 2 +- interpreter/syntax/operators.ml | 28 +++++++-------- interpreter/text/arrange.ml | 8 ++--- interpreter/valid/valid.ml | 8 ++--- 11 files changed, 72 insertions(+), 71 deletions(-) diff --git a/document/core/appendix/index-instructions.rst b/document/core/appendix/index-instructions.rst index bd4ba04d80..d9a73b6e76 100644 --- a/document/core/appendix/index-instructions.rst +++ b/document/core/appendix/index-instructions.rst @@ -204,12 +204,12 @@ Instruction Binary Opcode Type :math:`\I64.\EXTEND\K{8\_s}` :math:`\hex{C2}` :math:`[\I64] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` :math:`\I64.\EXTEND\K{16\_s}` :math:`\hex{C3}` :math:`[\I64] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` :math:`\I64.\EXTEND\K{32\_s}` :math:`\hex{C4}` :math:`[\I64] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` -:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~\hex{00}` :math:`[\F32] \to [\I32]` :ref:`validation ` :ref:`execution `, :ref:`operator ` -:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~\hex{01}` :math:`[\F32] \to [\I32]` :ref:`validation ` :ref:`execution `, :ref:`operator ` -:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_s}` :math:`\hex{FC}~\hex{02}` :math:`[\F64] \to [\I32]` :ref:`validation ` :ref:`execution `, :ref:`operator ` -:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_u}` :math:`\hex{FC}~\hex{03}` :math:`[\F64] \to [\I32]` :ref:`validation ` :ref:`execution `, :ref:`operator ` -:math:`\I64.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~\hex{04}` :math:`[\F32] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` -:math:`\I64.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~\hex{05}` :math:`[\F32] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` -:math:`\I64.\TRUNC\K{\_sat}\_\F64\K{\_s}` :math:`\hex{FC}~\hex{06}` :math:`[\F64] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` -:math:`\I64.\TRUNC\K{\_sat\_}\F64\K{\_u}` :math:`\hex{FC}~\hex{07}` :math:`[\F64] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` +:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~\hex{00}` :math:`[\F32] \to [\I32]` :ref:`validation ` :ref:`execution `, :ref:`operator ` +:math:`\I32.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~\hex{01}` :math:`[\F32] \to [\I32]` :ref:`validation ` :ref:`execution `, :ref:`operator ` +:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_s}` :math:`\hex{FC}~\hex{02}` :math:`[\F64] \to [\I32]` :ref:`validation ` :ref:`execution `, :ref:`operator ` +:math:`\I32.\TRUNC\K{\_sat\_}\F64\K{\_u}` :math:`\hex{FC}~\hex{03}` :math:`[\F64] \to [\I32]` :ref:`validation ` :ref:`execution `, :ref:`operator ` +:math:`\I64.\TRUNC\K{\_sat\_}\F32\K{\_s}` :math:`\hex{FC}~\hex{04}` :math:`[\F32] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` +:math:`\I64.\TRUNC\K{\_sat\_}\F32\K{\_u}` :math:`\hex{FC}~\hex{05}` :math:`[\F32] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` +:math:`\I64.\TRUNC\K{\_sat}\_\F64\K{\_s}` :math:`\hex{FC}~\hex{06}` :math:`[\F64] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` +:math:`\I64.\TRUNC\K{\_sat\_}\F64\K{\_u}` :math:`\hex{FC}~\hex{07}` :math:`[\F64] \to [\I64]` :ref:`validation ` :ref:`execution `, :ref:`operator ` ========================================= ========================= ============================================= ======================================== =============================================================== diff --git a/document/core/conf.py b/document/core/conf.py index 056ba446aa..5f85c59ef6 100644 --- a/document/core/conf.py +++ b/document/core/conf.py @@ -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 + '' diff --git a/document/core/exec/numerics.rst b/document/core/exec/numerics.rst index 4a5e5372bf..cd5596a904 100644 --- a/document/core/exec/numerics.rst +++ b/document/core/exec/numerics.rst @@ -614,14 +614,14 @@ The integer result of predicates -- i.e., :ref:`tests ` and :ref: .. _op-iextendn_s: -: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} @@ -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`. @@ -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`. @@ -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} diff --git a/document/core/syntax/instructions.rst b/document/core/syntax/instructions.rst index d707beb48c..4a21904f74 100644 --- a/document/core/syntax/instructions.rst +++ b/document/core/syntax/instructions.rst @@ -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} ~|~ @@ -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 \\ diff --git a/document/core/util/macros.def b/document/core/util/macros.def index 2c3b687174..d7523ed127 100644 --- a/document/core/util/macros.def +++ b/document/core/util/macros.def @@ -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}} @@ -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}}} diff --git a/interpreter/binary/encode.ml b/interpreter/binary/encode.ml index 3b98c804e0..c216d5de23 100644 --- a/interpreter/binary/encode.ml +++ b/interpreter/binary/encode.ml @@ -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 @@ -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 diff --git a/interpreter/exec/eval_numeric.ml b/interpreter/exec/eval_numeric.ml index f54a77f2c2..7257e66a6c 100644 --- a/interpreter/exec/eval_numeric.ml +++ b/interpreter/exec/eval_numeric.ml @@ -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)) @@ -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 diff --git a/interpreter/syntax/ast.ml b/interpreter/syntax/ast.ml index 12369afbaa..5e6b244723 100644 --- a/interpreter/syntax/ast.ml +++ b/interpreter/syntax/ast.ml @@ -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 diff --git a/interpreter/syntax/operators.ml b/interpreter/syntax/operators.ml index 57c87d1681..ceeb13ff49 100644 --- a/interpreter/syntax/operators.ml +++ b/interpreter/syntax/operators.ml @@ -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) @@ -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) @@ -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 diff --git a/interpreter/text/arrange.ml b/interpreter/text/arrange.ml index 77cf930d35..961600a7b1 100644 --- a/interpreter/text/arrange.ml +++ b/interpreter/text/arrange.ml @@ -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 diff --git a/interpreter/valid/valid.ml b/interpreter/valid/valid.ml index 584331b2c7..7dd573b541 100644 --- a/interpreter/valid/valid.ml +++ b/interpreter/valid/valid.ml @@ -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 -> From 9f63dd11df0a3a1a592a9a5b5155050c9f172d5a Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Mon, 20 Apr 2020 14:46:13 +0200 Subject: [PATCH 2/2] Missing asterisk --- document/core/text/modules.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/core/text/modules.rst b/document/core/text/modules.rst index b0013b3633..12c8e309d1 100644 --- a/document/core/text/modules.rst +++ b/document/core/text/modules.rst @@ -132,7 +132,7 @@ where :math:`x` is the smallest existing :ref:`type index ` whos If no such index exists, then a new :ref:`type definition ` 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.