Skip to content

Commit b07c837

Browse files
authored
[spec] Add missing i64.extend32_s syntax (#1179)
1 parent bc753b8 commit b07c837

File tree

12 files changed

+73
-72
lines changed

12 files changed

+73
-72
lines changed

document/core/appendix/index-instructions.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,12 @@ Instruction Binary Opcode Type
204204
: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>`
205205
: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>`
206206
: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>`
207-
: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>`
208-
: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>`
209-
: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>`
210-
: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>`
211-
: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>`
212-
: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>`
213-
: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>`
214-
: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>`
207+
: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>`
208+
: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>`
209+
: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>`
210+
: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>`
211+
: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>`
212+
: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>`
213+
: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>`
214+
: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>`
215215
========================================= ========================= ============================================= ======================================== ===============================================================

document/core/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
# built documents.
6969
#
7070
# The short X.Y version.
71-
version = u'1.0'
71+
version = u'1.1'
7272
# The full version, including alpha/beta/rc tags.
7373
release = version + ''
7474

document/core/exec/numerics.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -614,14 +614,14 @@ The integer result of predicates -- i.e., :ref:`tests <syntax-testop>` and :ref:
614614
615615
.. _op-iextendn_s:
616616

617-
:math:`\iextendns_N(i)`
617+
:math:`\iextendMs_N(i)`
618618
.......................
619619

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

622622
.. math::
623623
\begin{array}{lll@{\qquad}l}
624-
\iextendns_{N}(i) &=& \extends_{M,N}(i) \\
624+
\iextendMs_{N}(i) &=& \extends_{M,N}(i) \\
625625
\end{array}
626626
627627
@@ -1477,9 +1477,9 @@ Conversions
14771477
It is not defined for NaNs, infinities, or values for which the result is out of range.
14781478

14791479

1480-
.. _op-trunc_u_sat:
1480+
.. _op-trunc_sat_u:
14811481

1482-
:math:`\truncusat_{M,N}(z)`
1482+
:math:`\truncsatu_{M,N}(z)`
14831483
...........................
14841484

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

14971497
.. math::
14981498
\begin{array}{lll@{\qquad}l}
1499-
\truncusat_{M,N}(\pm \NAN(n)) &=& 0 \\
1500-
\truncusat_{M,N}(- \infty) &=& 0 \\
1501-
\truncusat_{M,N}(+ \infty) &=& 2^N - 1 \\
1502-
\truncusat_{M,N}(- q) &=& 0 & (\iff \trunc(- q) < 0) \\
1503-
\truncusat_{M,N}(+ q) &=& 2^N - 1 & (\iff \trunc(+ q) > 2^N - 1) \\
1504-
\truncusat_{M,N}(\pm q) &=& \trunc(\pm q) & (otherwise) \\
1499+
\truncsatu_{M,N}(\pm \NAN(n)) &=& 0 \\
1500+
\truncsatu_{M,N}(- \infty) &=& 0 \\
1501+
\truncsatu_{M,N}(+ \infty) &=& 2^N - 1 \\
1502+
\truncsatu_{M,N}(- q) &=& 0 & (\iff \trunc(- q) < 0) \\
1503+
\truncsatu_{M,N}(+ q) &=& 2^N - 1 & (\iff \trunc(+ q) > 2^N - 1) \\
1504+
\truncsatu_{M,N}(\pm q) &=& \trunc(\pm q) & (otherwise) \\
15051505
\end{array}
15061506
15071507
1508-
.. _op-trunc_s_sat:
1508+
.. _op-trunc_sat_s:
15091509

1510-
:math:`\truncssat_{M,N}(z)`
1510+
:math:`\truncsats_{M,N}(z)`
15111511
...........................
15121512

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

15251525
.. math::
15261526
\begin{array}{lll@{\qquad}l}
1527-
\truncssat_{M,N}(\pm \NAN(n)) &=& 0 \\
1528-
\truncssat_{M,N}(- \infty) &=& -2^{N-1} \\
1529-
\truncssat_{M,N}(+ \infty) &=& 2^{N-1}-1 \\
1530-
\truncssat_{M,N}(- q) &=& -2^{N-1} & (\iff \trunc(- q) < -2^{N-1}) \\
1531-
\truncssat_{M,N}(+ q) &=& 2^{N-1} - 1 & (\iff \trunc(+ q) > 2^{N-1} - 1) \\
1532-
\truncssat_{M,N}(\pm q) &=& \trunc(\pm q) & (otherwise) \\
1527+
\truncsats_{M,N}(\pm \NAN(n)) &=& 0 \\
1528+
\truncsats_{M,N}(- \infty) &=& -2^{N-1} \\
1529+
\truncsats_{M,N}(+ \infty) &=& 2^{N-1}-1 \\
1530+
\truncsats_{M,N}(- q) &=& -2^{N-1} & (\iff \trunc(- q) < -2^{N-1}) \\
1531+
\truncsats_{M,N}(+ q) &=& 2^{N-1} - 1 & (\iff \trunc(+ q) > 2^{N-1} - 1) \\
1532+
\truncsats_{M,N}(\pm q) &=& \trunc(\pm q) & (otherwise) \\
15331533
\end{array}
15341534
15351535

document/core/syntax/instructions.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ These operations closely match respective operations available in hardware.
6161
\K{f}\X{nn}\K{.}\frelop \\&&|&
6262
\K{i}\X{nn}\K{.}\EXTEND\K{8\_s} ~|~
6363
\K{i}\X{nn}\K{.}\EXTEND\K{16\_s} ~|~
64-
\K{i64.}\EXTEND\K{\_i32}\K{\_}\sx ~|~
64+
\K{i64.}\EXTEND\K{32\_s} \\&&|&
6565
\K{i32.}\WRAP\K{\_i64} ~|~
66+
\K{i64.}\EXTEND\K{\_i32}\K{\_}\sx ~|~
6667
\K{i}\X{nn}\K{.}\TRUNC\K{\_f}\X{mm}\K{\_}\sx \\&&|&
6768
\K{i}\X{nn}\K{.}\TRUNC\K{\_sat\_f}\X{mm}\K{\_}\sx \\&&|&
6869
\K{f32.}\DEMOTE\K{\_f64} ~|~
@@ -153,7 +154,7 @@ Occasionally, it is convenient to group operators together according to the foll
153154
\production{unary operator} & \unop &::=&
154155
\iunop ~|~
155156
\funop ~|~
156-
\EXTEND{N}\K{\_s} ~|~ \\
157+
\EXTEND{N}\K{\_s} \\
157158
\production{binary operator} & \binop &::=& \ibinop ~|~ \fbinop \\
158159
\production{test operator} & \testop &::=& \itestop \\
159160
\production{relational operator} & \relop &::=& \irelop ~|~ \frelop \\

document/core/text/modules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ where :math:`x` is the smallest existing :ref:`type index <syntax-typeidx>` whos
132132
If no such index exists, then a new :ref:`type definition <text-type>` of the form
133133

134134
.. math::
135-
\text{(}~\text{type}~~\text{(}~\text{func}~~\Tparam^\ast~~\Tresult~\text{)}~\text{)}
135+
\text{(}~\text{type}~~\text{(}~\text{func}~~\Tparam^\ast~~\Tresult^\ast~\text{)}~\text{)}
136136
137137
is inserted at the end of the module.
138138

document/core/util/macros.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@
932932
.. |iles| mathdef:: \xref{exec/numerics}{op-ile_s}{\F{ile\_s}}
933933
.. |igeu| mathdef:: \xref{exec/numerics}{op-ige_u}{\F{ige\_u}}
934934
.. |iges| mathdef:: \xref{exec/numerics}{op-ige_s}{\F{ige\_s}}
935-
.. |iextendns| mathdef:: \xref{exec/numerics}{op-iextendn_s}{\F{iextend}M\F{\_s}}
935+
.. |iextendMs| mathdef:: \xref{exec/numerics}{op-iextendn_s}{\F{iextend}M\F{\_s}}
936936

937937
.. |fadd| mathdef:: \xref{exec/numerics}{op-fadd}{\F{fadd}}
938938
.. |fsub| mathdef:: \xref{exec/numerics}{op-fsub}{\F{fsub}}
@@ -961,8 +961,8 @@
961961
.. |wrap| mathdef:: \xref{exec/numerics}{op-wrap}{\F{wrap}}
962962
.. |truncu| mathdef:: \xref{exec/numerics}{op-trunc_u}{\F{trunc}^{\K{u}}}
963963
.. |truncs| mathdef:: \xref{exec/numerics}{op-trunc_s}{\F{trunc}^{\K{s}}}
964-
.. |truncusat| mathdef:: \xref{exec/numerics}{op-trunc_sat_u}{\F{trunc\_sat\_u}}
965-
.. |truncssat| mathdef:: \xref{exec/numerics}{op-trunc_sat_s}{\F{trunc\_sat\_s}}
964+
.. |truncsatu| mathdef:: \xref{exec/numerics}{op-trunc_sat_u}{\F{trunc\_sat\_u}}
965+
.. |truncsats| mathdef:: \xref{exec/numerics}{op-trunc_sat_s}{\F{trunc\_sat\_s}}
966966
.. |promote| mathdef:: \xref{exec/numerics}{op-promote}{\F{promote}}
967967
.. |demote| mathdef:: \xref{exec/numerics}{op-demote}{\F{demote}}
968968
.. |convertu| mathdef:: \xref{exec/numerics}{op-convert_u}{\F{convert}^{\K{u}}}

interpreter/binary/encode.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ let encode m =
341341
| Convert (I32 I32Op.TruncUF32) -> op 0xa9
342342
| Convert (I32 I32Op.TruncSF64) -> op 0xaa
343343
| Convert (I32 I32Op.TruncUF64) -> op 0xab
344-
| Convert (I32 I32Op.TruncSSatF32) -> op 0xfc; op 0x00
345-
| Convert (I32 I32Op.TruncUSatF32) -> op 0xfc; op 0x01
346-
| Convert (I32 I32Op.TruncSSatF64) -> op 0xfc; op 0x02
347-
| Convert (I32 I32Op.TruncUSatF64) -> op 0xfc; op 0x03
344+
| Convert (I32 I32Op.TruncSatSF32) -> op 0xfc; op 0x00
345+
| Convert (I32 I32Op.TruncSatUF32) -> op 0xfc; op 0x01
346+
| Convert (I32 I32Op.TruncSatSF64) -> op 0xfc; op 0x02
347+
| Convert (I32 I32Op.TruncSatUF64) -> op 0xfc; op 0x03
348348
| Convert (I32 I32Op.ReinterpretFloat) -> op 0xbc
349349

350350
| Convert (I64 I64Op.ExtendSI32) -> op 0xac
@@ -354,10 +354,10 @@ let encode m =
354354
| Convert (I64 I64Op.TruncUF32) -> op 0xaf
355355
| Convert (I64 I64Op.TruncSF64) -> op 0xb0
356356
| Convert (I64 I64Op.TruncUF64) -> op 0xb1
357-
| Convert (I64 I64Op.TruncSSatF32) -> op 0xfc; op 0x04
358-
| Convert (I64 I64Op.TruncUSatF32) -> op 0xfc; op 0x05
359-
| Convert (I64 I64Op.TruncSSatF64) -> op 0xfc; op 0x06
360-
| Convert (I64 I64Op.TruncUSatF64) -> op 0xfc; op 0x07
357+
| Convert (I64 I64Op.TruncSatSF32) -> op 0xfc; op 0x04
358+
| Convert (I64 I64Op.TruncSatUF32) -> op 0xfc; op 0x05
359+
| Convert (I64 I64Op.TruncSatSF64) -> op 0xfc; op 0x06
360+
| Convert (I64 I64Op.TruncSatUF64) -> op 0xfc; op 0x07
361361
| Convert (I64 I64Op.ReinterpretFloat) -> op 0xbd
362362

363363
| Convert (F32 F32Op.ConvertSI32) -> op 0xb2

interpreter/exec/eval_numeric.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ struct
131131
| TruncUF32 -> I32 (I32_convert.trunc_f32_u (F32Op.of_value 1 v))
132132
| TruncSF64 -> I32 (I32_convert.trunc_f64_s (F64Op.of_value 1 v))
133133
| TruncUF64 -> I32 (I32_convert.trunc_f64_u (F64Op.of_value 1 v))
134-
| TruncSSatF32 -> I32 (I32_convert.trunc_sat_f32_s (F32Op.of_value 1 v))
135-
| TruncUSatF32 -> I32 (I32_convert.trunc_sat_f32_u (F32Op.of_value 1 v))
136-
| TruncSSatF64 -> I32 (I32_convert.trunc_sat_f64_s (F64Op.of_value 1 v))
137-
| TruncUSatF64 -> I32 (I32_convert.trunc_sat_f64_u (F64Op.of_value 1 v))
134+
| TruncSatSF32 -> I32 (I32_convert.trunc_sat_f32_s (F32Op.of_value 1 v))
135+
| TruncSatUF32 -> I32 (I32_convert.trunc_sat_f32_u (F32Op.of_value 1 v))
136+
| TruncSatSF64 -> I32 (I32_convert.trunc_sat_f64_s (F64Op.of_value 1 v))
137+
| TruncSatUF64 -> I32 (I32_convert.trunc_sat_f64_u (F64Op.of_value 1 v))
138138
| ReinterpretFloat -> I32 (I32_convert.reinterpret_f32 (F32Op.of_value 1 v))
139139
| ExtendSI32 -> raise (TypeError (1, v, I32Type))
140140
| ExtendUI32 -> raise (TypeError (1, v, I32Type))
@@ -152,10 +152,10 @@ struct
152152
| TruncUF32 -> I64 (I64_convert.trunc_f32_u (F32Op.of_value 1 v))
153153
| TruncSF64 -> I64 (I64_convert.trunc_f64_s (F64Op.of_value 1 v))
154154
| TruncUF64 -> I64 (I64_convert.trunc_f64_u (F64Op.of_value 1 v))
155-
| TruncSSatF32 -> I64 (I64_convert.trunc_sat_f32_s (F32Op.of_value 1 v))
156-
| TruncUSatF32 -> I64 (I64_convert.trunc_sat_f32_u (F32Op.of_value 1 v))
157-
| TruncSSatF64 -> I64 (I64_convert.trunc_sat_f64_s (F64Op.of_value 1 v))
158-
| TruncUSatF64 -> I64 (I64_convert.trunc_sat_f64_u (F64Op.of_value 1 v))
155+
| TruncSatSF32 -> I64 (I64_convert.trunc_sat_f32_s (F32Op.of_value 1 v))
156+
| TruncSatUF32 -> I64 (I64_convert.trunc_sat_f32_u (F32Op.of_value 1 v))
157+
| TruncSatSF64 -> I64 (I64_convert.trunc_sat_f64_s (F64Op.of_value 1 v))
158+
| TruncSatUF64 -> I64 (I64_convert.trunc_sat_f64_u (F64Op.of_value 1 v))
159159
| ReinterpretFloat -> I64 (I64_convert.reinterpret_f64 (F64Op.of_value 1 v))
160160
| WrapI64 -> raise (TypeError (1, v, I64Type))
161161
end

interpreter/syntax/ast.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct
3030
type relop = Eq | Ne | LtS | LtU | GtS | GtU | LeS | LeU | GeS | GeU
3131
type cvtop = ExtendSI32 | ExtendUI32 | WrapI64
3232
| TruncSF32 | TruncUF32 | TruncSF64 | TruncUF64
33-
| TruncSSatF32 | TruncUSatF32 | TruncSSatF64 | TruncUSatF64
33+
| TruncSatSF32 | TruncSatUF32 | TruncSatSF64 | TruncSatUF64
3434
| ReinterpretFloat
3535
end
3636

interpreter/syntax/operators.ml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,21 @@ let f64_le = Compare (F64 F64Op.Le)
172172
let f64_gt = Compare (F64 F64Op.Gt)
173173
let f64_ge = Compare (F64 F64Op.Ge)
174174

175+
let i32_extend8_s = Unary (I32 (I32Op.ExtendS Pack8))
176+
let i32_extend16_s = Unary (I32 (I32Op.ExtendS Pack16))
177+
let i64_extend8_s = Unary (I64 (I64Op.ExtendS Pack8))
178+
let i64_extend16_s = Unary (I64 (I64Op.ExtendS Pack16))
179+
let i64_extend32_s = Unary (I64 (I64Op.ExtendS Pack32))
180+
175181
let i32_wrap_i64 = Convert (I32 I32Op.WrapI64)
176182
let i32_trunc_f32_s = Convert (I32 I32Op.TruncSF32)
177183
let i32_trunc_f32_u = Convert (I32 I32Op.TruncUF32)
178184
let i32_trunc_f64_s = Convert (I32 I32Op.TruncSF64)
179185
let i32_trunc_f64_u = Convert (I32 I32Op.TruncUF64)
180-
let i32_trunc_sat_f32_s = Convert (I32 I32Op.TruncSSatF32)
181-
let i32_trunc_sat_f32_u = Convert (I32 I32Op.TruncUSatF32)
182-
let i32_trunc_sat_f64_s = Convert (I32 I32Op.TruncSSatF64)
183-
let i32_trunc_sat_f64_u = Convert (I32 I32Op.TruncUSatF64)
186+
let i32_trunc_sat_f32_s = Convert (I32 I32Op.TruncSatSF32)
187+
let i32_trunc_sat_f32_u = Convert (I32 I32Op.TruncSatUF32)
188+
let i32_trunc_sat_f64_s = Convert (I32 I32Op.TruncSatSF64)
189+
let i32_trunc_sat_f64_u = Convert (I32 I32Op.TruncSatUF64)
184190
let i64_extend_i32_s = Convert (I64 I64Op.ExtendSI32)
185191
let i64_extend_i32_u = Convert (I64 I64Op.ExtendUI32)
186192
let i64_trunc_f32_s = Convert (I64 I64Op.TruncSF32)
@@ -191,10 +197,10 @@ let f32_convert_i32_s = Convert (F32 F32Op.ConvertSI32)
191197
let f32_convert_i32_u = Convert (F32 F32Op.ConvertUI32)
192198
let f32_convert_i64_s = Convert (F32 F32Op.ConvertSI64)
193199
let f32_convert_i64_u = Convert (F32 F32Op.ConvertUI64)
194-
let i64_trunc_sat_f32_s = Convert (I64 I64Op.TruncSSatF32)
195-
let i64_trunc_sat_f32_u = Convert (I64 I64Op.TruncUSatF32)
196-
let i64_trunc_sat_f64_s = Convert (I64 I64Op.TruncSSatF64)
197-
let i64_trunc_sat_f64_u = Convert (I64 I64Op.TruncUSatF64)
200+
let i64_trunc_sat_f32_s = Convert (I64 I64Op.TruncSatSF32)
201+
let i64_trunc_sat_f32_u = Convert (I64 I64Op.TruncSatUF32)
202+
let i64_trunc_sat_f64_s = Convert (I64 I64Op.TruncSatSF64)
203+
let i64_trunc_sat_f64_u = Convert (I64 I64Op.TruncSatUF64)
198204
let f32_demote_f64 = Convert (F32 F32Op.DemoteF64)
199205
let f64_convert_i32_s = Convert (F64 F64Op.ConvertSI32)
200206
let f64_convert_i32_u = Convert (F64 F64Op.ConvertUI32)
@@ -206,12 +212,6 @@ let i64_reinterpret_f64 = Convert (I64 I64Op.ReinterpretFloat)
206212
let f32_reinterpret_i32 = Convert (F32 F32Op.ReinterpretInt)
207213
let f64_reinterpret_i64 = Convert (F64 F64Op.ReinterpretInt)
208214

209-
let i32_extend8_s = Unary (I32 (I32Op.ExtendS Pack8))
210-
let i32_extend16_s = Unary (I32 (I32Op.ExtendS Pack16))
211-
let i64_extend8_s = Unary (I64 (I64Op.ExtendS Pack8))
212-
let i64_extend16_s = Unary (I64 (I64Op.ExtendS Pack16))
213-
let i64_extend32_s = Unary (I64 (I64Op.ExtendS Pack32))
214-
215215
let memory_size = MemorySize
216216
let memory_grow = MemoryGrow
217217

interpreter/text/arrange.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ struct
135135
| TruncUF32 -> "trunc_f32_u"
136136
| TruncSF64 -> "trunc_f64_s"
137137
| TruncUF64 -> "trunc_f64_u"
138-
| TruncSSatF32 -> "trunc_sat_f32_s"
139-
| TruncUSatF32 -> "trunc_sat_f32_u"
140-
| TruncSSatF64 -> "trunc_sat_f64_s"
141-
| TruncUSatF64 -> "trunc_sat_f64_u"
138+
| TruncSatSF32 -> "trunc_sat_f32_s"
139+
| TruncSatUF32 -> "trunc_sat_f32_u"
140+
| TruncSatSF64 -> "trunc_sat_f64_s"
141+
| TruncSatUF64 -> "trunc_sat_f64_u"
142142
| ReinterpretFloat -> "reinterpret_f" ^ xx
143143
end
144144

interpreter/valid/valid.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,17 @@ let type_cvtop at = function
106106
(match cvtop with
107107
| ExtendSI32 | ExtendUI32 -> error at "invalid conversion"
108108
| WrapI64 -> I64Type
109-
| TruncSF32 | TruncUF32 | TruncSSatF32 | TruncUSatF32
109+
| TruncSF32 | TruncUF32 | TruncSatSF32 | TruncSatUF32
110110
| ReinterpretFloat -> F32Type
111-
| TruncSF64 | TruncUF64 | TruncSSatF64 | TruncUSatF64 -> F64Type
111+
| TruncSF64 | TruncUF64 | TruncSatSF64 | TruncSatUF64 -> F64Type
112112
), I32Type
113113
| Values.I64 cvtop ->
114114
let open I64Op in
115115
(match cvtop with
116116
| ExtendSI32 | ExtendUI32 -> I32Type
117117
| WrapI64 -> error at "invalid conversion"
118-
| TruncSF32 | TruncUF32 | TruncSSatF32 | TruncUSatF32 -> F32Type
119-
| TruncSF64 | TruncUF64 | TruncSSatF64 | TruncUSatF64
118+
| TruncSF32 | TruncUF32 | TruncSatSF32 | TruncSatUF32 -> F32Type
119+
| TruncSF64 | TruncUF64 | TruncSatSF64 | TruncSatUF64
120120
| ReinterpretFloat -> F64Type
121121
), I64Type
122122
| Values.F32 cvtop ->

0 commit comments

Comments
 (0)