From 8942b64f6f5c6a622b2af34066cffed4fc223a60 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Thu, 11 Jul 2024 14:42:13 +0200 Subject: [PATCH 1/2] Refine cvtop --- document/core/valid/instructions.rst | 2 +- spectec/spec/wasm-3.0/1-syntax.watsup | 21 ++++-- spectec/spec/wasm-3.0/2-syntax-aux.watsup | 2 +- spectec/spec/wasm-3.0/3-numerics.watsup | 23 ++++--- spectec/spec/wasm-3.0/6-typing.watsup | 11 +-- spectec/spec/wasm-3.0/8-reduction.watsup | 8 +-- spectec/spec/wasm-3.0/A-binary.watsup | 58 ++++++++-------- spectec/src/backend-interpreter/construct.ml | 68 +++++++++---------- .../test-prose/doc/valid/instructions-in.rst | 2 +- spectec/test-splice/spec-latex.in.tex | 2 +- spectec/test-splice/spec-sphinx.in.rst | 2 +- 11 files changed, 100 insertions(+), 99 deletions(-) diff --git a/document/core/valid/instructions.rst b/document/core/valid/instructions.rst index 944c5b2007..721f7db5ab 100644 --- a/document/core/valid/instructions.rst +++ b/document/core/valid/instructions.rst @@ -195,7 +195,7 @@ $${rule: Instr_ok/relop} * The instruction is valid with type :math:`[t_1] \to [t_2]`. -$${rule: Instr_ok/cvtop-*} +$${rule: Instr_ok/cvtop} .. index:: reference instructions, reference type diff --git a/spectec/spec/wasm-3.0/1-syntax.watsup b/spectec/spec/wasm-3.0/1-syntax.watsup index 75af0efdb5..cc4c98a002 100644 --- a/spectec/spec/wasm-3.0/1-syntax.watsup +++ b/spectec/spec/wasm-3.0/1-syntax.watsup @@ -365,10 +365,19 @@ syntax relop_(Fnn) = | EQ | NE | LT | GT | LE | GE syntax cvtop_(numtype_1, numtype_2) hint(show cvtop_((%,%))) -syntax cvtop_(nt_1, nt_2) = - | CONVERT - | CONVERT_SAT -- if nt_1 = Inn /\ nt_2 = Fnn - | REINTERPRET -- if $size(nt_1) = $size(nt_2) +syntax cvtop_(Inn_1, Inn_2) = + | EXTEND sx hint(show %0#_#%1) -- if $sizenn1(Inn_1) < $sizenn2(Inn_2) + | WRAP -- if $sizenn1(Inn_1) > $sizenn2(Inn_2) +syntax cvtop_(Inn_1, Fnn_2) = + | CONVERT sx hint(show %0#_#%1) + | REINTERPRET -- if $sizenn1(Inn_1) = $sizenn2(Fnn_2) +syntax cvtop_(Fnn_1, Inn_2) = + | TRUNC sx hint(show %0#_#%1) + | TRUNC_SAT sx hint(show %0#_#%1) + | REINTERPRET -- if $sizenn1(Fnn_1) = $sizenn2(Inn_2) +syntax cvtop_(Fnn_1, Fnn_2) = + | PROMOTE -- if $sizenn1(Fnn_1) < $sizenn2(Fnn_2) + | DEMOTE -- if $sizenn1(Fnn_1) > $sizenn2(Fnn_2) ;; Vector operators @@ -514,9 +523,7 @@ syntax instr/num hint(desc "numeric instruction") = ... | BINOP numtype binop_(numtype) hint(show %.##%) | TESTOP numtype testop_(numtype) hint(show %.##%) | RELOP numtype relop_(numtype) hint(show %.##%) - | CVTOP numtype_1 numtype_2 cvtop_(numtype_2, numtype_1) sx? hint(show %1.%3#_#%2) hint(show %1.%3#_#%2#_#%4) - -- if numtype_1 =/= numtype_2 - ;; TODO(1, rossberg): constrain sx? or move it into cvtop + | CVTOP numtype_1 numtype_2 cvtop_(numtype_2, numtype_1) hint(show %1.##%3#_#%2) | ... syntax instr/vec hint(desc "vector instruction") = ... diff --git a/spectec/spec/wasm-3.0/2-syntax-aux.watsup b/spectec/spec/wasm-3.0/2-syntax-aux.watsup index 020b36fe84..374b43c6b3 100644 --- a/spectec/spec/wasm-3.0/2-syntax-aux.watsup +++ b/spectec/spec/wasm-3.0/2-syntax-aux.watsup @@ -357,7 +357,7 @@ def $free_instr(UNOP numtype unop) = $free_numtype(numtype) def $free_instr(BINOP numtype binop) = $free_numtype(numtype) def $free_instr(TESTOP numtype testop) = $free_numtype(numtype) def $free_instr(RELOP numtype relop) = $free_numtype(numtype) -def $free_instr(CVTOP numtype_1 numtype_2 cvtop sx?) = +def $free_instr(CVTOP numtype_1 numtype_2 cvtop) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) def $free_instr(VCONST vectype veclit) = $free_vectype(vectype) diff --git a/spectec/spec/wasm-3.0/3-numerics.watsup b/spectec/spec/wasm-3.0/3-numerics.watsup index 55a0de375c..62c52ed44d 100644 --- a/spectec/spec/wasm-3.0/3-numerics.watsup +++ b/spectec/spec/wasm-3.0/3-numerics.watsup @@ -19,6 +19,7 @@ def $invsigned(N, i) = j -- if $signed(N, j) = i ;; TODO(3, all): implement numerics internally +;; TODO(2, rossberg): show as function ids, not var ids def $unop(numtype, unop_(numtype), num_(numtype)) : num_(numtype)* hint(show %2#$_(%1)#((%3))) def $binop(numtype, binop_(numtype), num_(numtype), num_(numtype)) : num_(numtype)* @@ -27,8 +28,8 @@ def $testop(numtype, testop_(numtype), num_(numtype)) : num_(I32) hint(show %2#$_(%1)#((%3))) def $relop(numtype, relop_(numtype), num_(numtype), num_(numtype)) : num_(I32) hint(show %2#$_(%1)#(%3, %4)) -def $cvtop(numtype_1, numtype_2, cvtop_(numtype_1, numtype_2), sx?, num_(numtype_1)) : num_(numtype_2)* - hint(show %3#$_((%1,%2))^(%4)#((%5))) +def $cvtop(numtype_1, numtype_2, cvtop_(numtype_1, numtype_2), num_(numtype_1)) : num_(numtype_2)* + hint(show %3#$_((%1,%2))#((%4))) def $wrap(M, N, iN(M)) : iN(N) hint(show $wrap_((%,%))#((%))) def $ext(M, N, sx, iN(M)) : iN(N) hint(show $ext_((%,%))^(%)#((%))) @@ -166,15 +167,15 @@ def $relop(Fnn, GT, fN_1, fN_2) = $fgt($size(Fnn), fN_1, fN_2) def $relop(Fnn, LE, fN_1, fN_2) = $fle($size(Fnn), fN_1, fN_2) def $relop(Fnn, GE, fN_1, fN_2) = $fge($size(Fnn), fN_1, fN_2) -def $cvtop(I32, I64, CONVERT, sx, iN) = $ext(32, 64, sx, iN) -def $cvtop(I64, I32, CONVERT, sx?, iN) = $wrap(64, 32, iN) -def $cvtop(Fnn, Inn, CONVERT, sx, fN) = $trunc($size(Fnn), $size(Inn), sx, fN) -def $cvtop(Fnn, Inn, CONVERT_SAT, sx, fN) = $trunc_sat($size(Fnn), $size(Inn), sx, fN) -def $cvtop(F32, F64, CONVERT, sx?, fN) = $promote(32, 64, fN) -def $cvtop(F64, F32, CONVERT, sx?, fN) = $demote(64, 32, fN) -def $cvtop(Inn, Fnn, CONVERT, sx, iN) = $convert($size(Inn), $size(Fnn), sx, iN) -def $cvtop(Inn, Fnn, REINTERPRET, sx?, iN) = $reinterpret(Inn, Fnn, iN) -- if $size(Inn) = $size(Fnn) -def $cvtop(Fnn, Inn, REINTERPRET, sx?, fN) = $reinterpret(Fnn, Inn, fN) -- if $size(Inn) = $size(Fnn) +def $cvtop(Inn_1, Inn_2, EXTEND sx, iN_1) = $ext($sizenn1(Inn_1), $sizenn2(Inn_2), sx, iN_1) +def $cvtop(Inn_1, Inn_2, WRAP, iN_1) = $wrap($sizenn1(Inn_1), $sizenn2(Inn_2), iN_1) +def $cvtop(Fnn_1, Inn_2, TRUNC sx, fN_1) = $trunc($sizenn1(Fnn_1), $sizenn2(Inn_2), sx, fN_1) +def $cvtop(Fnn_1, Inn_2, TRUNC_SAT sx, fN_1) = $trunc_sat($sizenn1(Fnn_1), $sizenn2(Inn_2), sx, fN_1) +def $cvtop(Inn_1, Fnn_2, CONVERT sx, iN_1) = $convert($sizenn1(Inn_1), $sizenn2(Fnn_2), sx, iN_1) +def $cvtop(Fnn_1, Fnn_2, PROMOTE, fN_1) = $promote($sizenn1(Fnn_1), $sizenn2(Fnn_2), fN_1) +def $cvtop(Fnn_1, Fnn_2, DEMOTE, fN_1) = $demote($sizenn1(Fnn_1), $sizenn2(Fnn_2), fN_1) +def $cvtop(Inn_1, Fnn_2, REINTERPRET, iN_1) = $reinterpret(Inn_1, Fnn_2, iN_1) -- if $sizenn1(Inn_1) = $sizenn2(Fnn_2) +def $cvtop(Fnn_1, Inn_2, REINTERPRET, fN_1) = $reinterpret(Fnn_1, Inn_2, fN_1) -- if $sizenn1(Inn_1) = $sizenn2(Fnn_2) ;; Packed numbers diff --git a/spectec/spec/wasm-3.0/6-typing.watsup b/spectec/spec/wasm-3.0/6-typing.watsup index c4752398b0..1ce7563b63 100644 --- a/spectec/spec/wasm-3.0/6-typing.watsup +++ b/spectec/spec/wasm-3.0/6-typing.watsup @@ -720,15 +720,8 @@ rule Instr_ok/testop: rule Instr_ok/relop: C |- RELOP nt relop_nt : nt nt -> I32 - -;; TODO(1, rossberg): move side conditions to syntax -rule Instr_ok/cvtop-reinterpret: - C |- CVTOP nt_1 nt_2 REINTERPRET : nt_2 -> nt_1 - -- if $size(nt_1) = $size(nt_2) - -rule Instr_ok/cvtop-convert: - C |- CVTOP nt_1 nt_2 CONVERT sx? : nt_2 -> nt_1 - -- if sx? = eps <=> nt_1 = Inn_1 /\ nt_2 = Inn_2 /\ $size(nt_1) > $size(nt_2) \/ nt_1 = Fnn_1 /\ nt_2 = Fnn_2 +rule Instr_ok/cvtop: + C |- CVTOP nt_1 nt_2 cvtop : nt_2 -> nt_1 ;; Reference instructions diff --git a/spectec/spec/wasm-3.0/8-reduction.watsup b/spectec/spec/wasm-3.0/8-reduction.watsup index bfc33f0a90..a0aebeabc6 100644 --- a/spectec/spec/wasm-3.0/8-reduction.watsup +++ b/spectec/spec/wasm-3.0/8-reduction.watsup @@ -261,12 +261,12 @@ rule Step_pure/relop: rule Step_pure/cvtop-val: - (CONST nt_1 c_1) (CVTOP nt_2 nt_1 cvtop sx?) ~> (CONST nt_2 c) - -- if $cvtop(nt_1, nt_2, cvtop, sx?, c_1) = c ;; TODO(1, rossberg): nondet + (CONST nt_1 c_1) (CVTOP nt_2 nt_1 cvtop) ~> (CONST nt_2 c) + -- if $cvtop(nt_1, nt_2, cvtop, c_1) = c ;; TODO(1, rossberg): nondet rule Step_pure/cvtop-trap: - (CONST nt_1 c_1) (CVTOP nt_2 nt_1 cvtop sx?) ~> TRAP - -- if $cvtop(nt_1, nt_2, cvtop, sx?, c_1) = eps + (CONST nt_1 c_1) (CVTOP nt_2 nt_1 cvtop) ~> TRAP + -- if $cvtop(nt_1, nt_2, cvtop, c_1) = eps ;; Reference instructions diff --git a/spectec/spec/wasm-3.0/A-binary.watsup b/spectec/spec/wasm-3.0/A-binary.watsup index c8de25754c..14834c7381 100644 --- a/spectec/spec/wasm-3.0/A-binary.watsup +++ b/spectec/spec/wasm-3.0/A-binary.watsup @@ -540,27 +540,27 @@ grammar Binstr/num-bin-f64 : instr = ... grammar Binstr/num-cvt : instr = ... - | 0xA7 => CVTOP I32 I64 CONVERT - | 0xA8 => CVTOP I32 F32 CONVERT S - | 0xA9 => CVTOP I32 F32 CONVERT U - | 0xAA => CVTOP I32 F64 CONVERT S - | 0xAB => CVTOP I32 F64 CONVERT U - | 0xAC => CVTOP I64 I32 CONVERT S - | 0xAD => CVTOP I64 I32 CONVERT U - | 0xAE => CVTOP I64 F32 CONVERT S - | 0xAF => CVTOP I64 F32 CONVERT U - | 0xB0 => CVTOP I64 F64 CONVERT S - | 0xB1 => CVTOP I64 F64 CONVERT U - | 0xB2 => CVTOP F32 I32 CONVERT S - | 0xB3 => CVTOP F32 I32 CONVERT U - | 0xB4 => CVTOP F32 I64 CONVERT S - | 0xB5 => CVTOP F32 I64 CONVERT U - | 0xB6 => CVTOP F32 F64 CONVERT - | 0xB7 => CVTOP F64 I32 CONVERT S - | 0xB8 => CVTOP F64 I32 CONVERT U - | 0xB9 => CVTOP F64 I64 CONVERT S - | 0xBA => CVTOP F64 I64 CONVERT U - | 0xBB => CVTOP F64 F32 CONVERT + | 0xA7 => CVTOP I32 I64 WRAP + | 0xA8 => CVTOP I32 F32 (TRUNC S) + | 0xA9 => CVTOP I32 F32 (TRUNC U) + | 0xAA => CVTOP I32 F64 (TRUNC S) + | 0xAB => CVTOP I32 F64 (TRUNC U) + | 0xAC => CVTOP I64 I32 (EXTEND S) + | 0xAD => CVTOP I64 I32 (EXTEND U) + | 0xAE => CVTOP I64 F32 (TRUNC S) + | 0xAF => CVTOP I64 F32 (TRUNC U) + | 0xB0 => CVTOP I64 F64 (TRUNC S) + | 0xB1 => CVTOP I64 F64 (TRUNC U) + | 0xB2 => CVTOP F32 I32 (CONVERT S) + | 0xB3 => CVTOP F32 I32 (CONVERT U) + | 0xB4 => CVTOP F32 I64 (CONVERT S) + | 0xB5 => CVTOP F32 I64 (CONVERT U) + | 0xB6 => CVTOP F32 F64 DEMOTE + | 0xB7 => CVTOP F64 I32 (CONVERT S) + | 0xB8 => CVTOP F64 I32 (CONVERT U) + | 0xB9 => CVTOP F64 I64 (CONVERT S) + | 0xBA => CVTOP F64 I64 (CONVERT U) + | 0xBB => CVTOP F32 F64 PROMOTE | 0xBC => CVTOP I32 F32 REINTERPRET | 0xBD => CVTOP I64 F64 REINTERPRET | 0xBE => CVTOP F32 I32 REINTERPRET @@ -568,14 +568,14 @@ grammar Binstr/num-cvt : instr = ... | ... grammar Binstr/num-cvt-sat : instr = ... - | 0xFC 0:Bu32 => CVTOP I32 F32 CONVERT_SAT S - | 0xFC 1:Bu32 => CVTOP I32 F32 CONVERT_SAT U - | 0xFC 2:Bu32 => CVTOP I32 F64 CONVERT_SAT S - | 0xFC 3:Bu32 => CVTOP I32 F64 CONVERT_SAT U - | 0xFC 4:Bu32 => CVTOP I64 F32 CONVERT_SAT S - | 0xFC 5:Bu32 => CVTOP I64 F32 CONVERT_SAT U - | 0xFC 6:Bu32 => CVTOP I64 F64 CONVERT_SAT S - | 0xFC 7:Bu32 => CVTOP I64 F64 CONVERT_SAT U + | 0xFC 0:Bu32 => CVTOP I32 F32 (TRUNC_SAT S) + | 0xFC 1:Bu32 => CVTOP I32 F32 (TRUNC_SAT U) + | 0xFC 2:Bu32 => CVTOP I32 F64 (TRUNC_SAT S) + | 0xFC 3:Bu32 => CVTOP I32 F64 (TRUNC_SAT U) + | 0xFC 4:Bu32 => CVTOP I64 F32 (TRUNC_SAT S) + | 0xFC 5:Bu32 => CVTOP I64 F32 (TRUNC_SAT U) + | 0xFC 6:Bu32 => CVTOP I64 F64 (TRUNC_SAT S) + | 0xFC 7:Bu32 => CVTOP I64 F64 (TRUNC_SAT U) | ... diff --git a/spectec/src/backend-interpreter/construct.ml b/spectec/src/backend-interpreter/construct.ml index f84d0ee58f..c7634eb0c5 100644 --- a/spectec/src/backend-interpreter/construct.ml +++ b/spectec/src/backend-interpreter/construct.ml @@ -366,38 +366,38 @@ let al_to_float_relop: value -> FloatOp.relop = function let al_to_relop: value list -> relop = al_to_op al_to_int_relop al_to_float_relop let al_to_int_cvtop: value list -> IntOp.cvtop = function - | [ CaseV ("I64", []); CaseV ("I32", []); CaseV ("CONVERT", []); opt ] as l -> - (match opt with - | OptV (Some (CaseV ("S", []))) -> IntOp.ExtendSI32 - | OptV (Some (CaseV ("U", []))) -> IntOp.ExtendUI32 + | [ CaseV ("I64", []); CaseV ("I32", []); CaseV ("EXTEND", [ CaseV (sx, []) ]) ] as l -> + (match sx with + | "S" -> IntOp.ExtendSI32 + | "U" -> IntOp.ExtendUI32 | _ -> error_values "extend" l) - | [ CaseV ("I32", []); CaseV ("I64", []); CaseV ("CONVERT", []); OptV None ] -> IntOp.WrapI64 - | [ CaseV (_, []); CaseV (nt, []); CaseV ("CONVERT", []); OptV (Some (CaseV (sx, []))) ] as l -> + | [ CaseV ("I32", []); CaseV ("I64", []); CaseV ("WRAP", []) ] -> IntOp.WrapI64 + | [ CaseV (_, []); CaseV (nt, []); CaseV ("TRUNC", [ CaseV (sx, []) ]) ] as l -> (match nt, sx with | "F32", "S" -> IntOp.TruncSF32 | "F32", "U" -> IntOp.TruncUF32 | "F64", "S" -> IntOp.TruncSF64 | "F64", "U" -> IntOp.TruncUF64 | _ -> error_values "trunc" l) - | [ CaseV (_, []); CaseV (nt, []); CaseV ("CONVERT_SAT", []); OptV (Some (CaseV (sx, []))) ] as l -> + | [ CaseV (_, []); CaseV (nt, []); CaseV ("TRUNC_SAT", [ CaseV (sx, []) ]) ] as l -> (match nt, sx with | "F32", "S" -> IntOp.TruncSatSF32 | "F32", "U" -> IntOp.TruncSatUF32 | "F64", "S" -> IntOp.TruncSatSF64 | "F64", "U" -> IntOp.TruncSatUF64 | _ -> error_values "trunc_sat" l) - | [ _; _; CaseV ("REINTERPRET", []); OptV None ] -> IntOp.ReinterpretFloat + | [ _; _; CaseV ("REINTERPRET", []) ] -> IntOp.ReinterpretFloat | l -> error_values "integer cvtop" l let al_to_float_cvtop : value list -> FloatOp.cvtop = function - | [ CaseV (_, []); CaseV (nt, []); CaseV ("CONVERT", []); OptV (Some (CaseV (sx, []))) ] as l -> + | [ CaseV (_, []); CaseV (nt, []); CaseV ("CONVERT", [ CaseV (sx, []) ]) ] as l -> (match nt, sx with | "I32", "S" -> FloatOp.ConvertSI32 | "I32", "U" -> FloatOp.ConvertUI32 | "I64", "S" -> FloatOp.ConvertSI64 | "I64", "U" -> FloatOp.ConvertUI64 | _ -> error_values "convert" l) - | [ CaseV ("F64", []); CaseV ("F32", []); CaseV ("CONVERT", []); OptV None ] -> FloatOp.PromoteF32 - | [ CaseV ("F32", []); CaseV ("F64", []); CaseV ("CONVERT", []); OptV None ] -> FloatOp.DemoteF64 + | [ CaseV ("F64", []); CaseV ("F32", []); CaseV ("PROMOTE", []) ] -> FloatOp.PromoteF32 + | [ CaseV ("F32", []); CaseV ("F64", []); CaseV ("DEMOTE", []) ] -> FloatOp.DemoteF64 | [ _; _; CaseV ("REINTERPRET", []); OptV None ] -> FloatOp.ReinterpretInt | l -> error_values "float cvtop" l let al_to_cvtop: value list -> cvtop = function @@ -1306,41 +1306,41 @@ let al_of_float_relop = function let al_of_relop = al_of_op al_of_int_relop al_of_float_relop let al_of_int_cvtop num_bits = function - | IntOp.ExtendSI32 -> "I64", "Convert", Some (nullary "S") - | IntOp.ExtendUI32 -> "I64", "Convert", Some (nullary "U") - | IntOp.WrapI64 -> "I64", "Convert", None - | IntOp.TruncSF32 -> "F32", "Convert", Some (nullary "S") - | IntOp.TruncUF32 -> "F32", "Convert", Some (nullary "U") - | IntOp.TruncSF64 -> "F64", "Convert", Some (nullary "S") - | IntOp.TruncUF64 -> "F64", "Convert", Some (nullary "U") - | IntOp.TruncSatSF32 -> "F32", "Convert_sat", Some (nullary "S") - | IntOp.TruncSatUF32 -> "F32", "Convert_sat", Some (nullary "U") - | IntOp.TruncSatSF64 -> "F64", "Convert_sat", Some (nullary "S") - | IntOp.TruncSatUF64 -> "F64", "Convert_sat", Some (nullary "U") - | IntOp.ReinterpretFloat -> "F" ^ num_bits, "Reinterpret", None + | IntOp.ExtendSI32 -> "I64", "EXTEND", [ nullary "S" ] + | IntOp.ExtendUI32 -> "I64", "EXTEND", [ nullary "U" ] + | IntOp.WrapI64 -> "I64", "WRAP", [] + | IntOp.TruncSF32 -> "F32", "TRUNC", [ nullary "S" ] + | IntOp.TruncUF32 -> "F32", "TRUNC", [ nullary "U" ] + | IntOp.TruncSF64 -> "F64", "TRUNC", [ nullary "S" ] + | IntOp.TruncUF64 -> "F64", "TRUNC", [ nullary "U" ] + | IntOp.TruncSatSF32 -> "F32", "TRUNC_SAT", [ nullary "S" ] + | IntOp.TruncSatUF32 -> "F32", "TRUNC_SAT", [ nullary "U" ] + | IntOp.TruncSatSF64 -> "F64", "TRUNC_SAT", [ nullary "S" ] + | IntOp.TruncSatUF64 -> "F64", "TRUNC_SAT", [ nullary "U" ] + | IntOp.ReinterpretFloat -> "F" ^ num_bits, "REINTERPRET", [] let al_of_float_cvtop num_bits = function - | FloatOp.ConvertSI32 -> "I32", "Convert", Some (nullary ("S")) - | FloatOp.ConvertUI32 -> "I32", "Convert", Some (nullary ("U")) - | FloatOp.ConvertSI64 -> "I64", "Convert", Some (nullary ("S")) - | FloatOp.ConvertUI64 -> "I64", "Convert", Some (nullary ("U")) - | FloatOp.PromoteF32 -> "F32", "Convert", None - | FloatOp.DemoteF64 -> "F64", "Convert", None - | FloatOp.ReinterpretInt -> "I" ^ num_bits, "Reinterpret", None + | FloatOp.ConvertSI32 -> "I32", "CONVERT", [ nullary "S" ] + | FloatOp.ConvertUI32 -> "I32", "CONVERT", [ nullary "U" ] + | FloatOp.ConvertSI64 -> "I64", "CONVERT", [ nullary "S" ] + | FloatOp.ConvertUI64 -> "I64", "CONVERT", [ nullary "U" ] + | FloatOp.PromoteF32 -> "F32", "PROMOTE", [] + | FloatOp.DemoteF64 -> "F64", "DEMOTE", [] + | FloatOp.ReinterpretInt -> "I" ^ num_bits, "REINTERPRET", [] let al_of_cvtop = function | I32 op -> let to_, op', ext = al_of_int_cvtop "32" op in - [ nullary "I32"; nullary to_; nullary op'; optV ext ] + [ nullary "I32"; nullary to_; caseV (op', ext) ] | I64 op -> let to_, op', ext = al_of_int_cvtop "64" op in - [ nullary "I64"; nullary to_; nullary op'; optV ext ] + [ nullary "I64"; nullary to_; caseV (op', ext) ] | F32 op -> let to_, op', ext = al_of_float_cvtop "32" op in - [ nullary "F32"; nullary to_; nullary op'; optV ext ] + [ nullary "F32"; nullary to_; caseV (op', ext) ] | F64 op -> let to_, op', ext = al_of_float_cvtop "64" op in - [ nullary "F64"; nullary to_; nullary op'; optV ext ] + [ nullary "F64"; nullary to_; caseV (op', ext) ] (* Vector operator *) diff --git a/spectec/test-prose/doc/valid/instructions-in.rst b/spectec/test-prose/doc/valid/instructions-in.rst index d4c4896d46..8ebc5d2dd3 100644 --- a/spectec/test-prose/doc/valid/instructions-in.rst +++ b/spectec/test-prose/doc/valid/instructions-in.rst @@ -58,7 +58,7 @@ $${rule-prose: valid/cvtop} \ $${rule+: - Instr_ok/cvtop-* + Instr_ok/cvtop } Reference Instructions diff --git a/spectec/test-splice/spec-latex.in.tex b/spectec/test-splice/spec-latex.in.tex index 5b3d2afbbb..dd0b6071ea 100644 --- a/spectec/test-splice/spec-latex.in.tex +++ b/spectec/test-splice/spec-latex.in.tex @@ -56,7 +56,7 @@ \subsection*{Typing #{relation: Instr_ok}} ##{rule+: Instr_ok/if} -##{rule-ignore: Instr_ok/cvtop-*} +##{rule-ignore: Instr_ok/memory.grow} \subsection*{Runtime} diff --git a/spectec/test-splice/spec-sphinx.in.rst b/spectec/test-splice/spec-sphinx.in.rst index 7f03412676..baf45f2205 100644 --- a/spectec/test-splice/spec-sphinx.in.rst +++ b/spectec/test-splice/spec-sphinx.in.rst @@ -40,7 +40,7 @@ $${rule+: Instr_ok/loop} $${rule+: Instr_ok/if} -$${rule-ignore: Instr_ok/cvtop-*} +$${rule-ignore: Instr_ok/memory.grow} **Runtime** From e93cd656ce7753e9757830fa9f5f4ccaebe11228 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Thu, 11 Jul 2024 15:07:01 +0200 Subject: [PATCH 2/2] Adjust 1.0 & 2.0 specs --- spectec/spec/wasm-1.0/1-syntax.watsup | 5 +- spectec/spec/wasm-1.0/3-numerics.watsup | 20 +- spectec/spec/wasm-1.0/6-typing.watsup | 3 +- spectec/spec/wasm-1.0/8-reduction.watsup | 8 +- spectec/spec/wasm-1.0/A-binary.watsup | 43 +- spectec/spec/wasm-2.0/1-syntax.watsup | 12 +- spectec/spec/wasm-2.0/3-numerics.watsup | 22 +- spectec/spec/wasm-2.0/6-typing.watsup | 3 +- spectec/spec/wasm-2.0/8-reduction.watsup | 8 +- spectec/spec/wasm-2.0/A-binary.watsup | 54 +- spectec/test-frontend/TEST.md | 254 +++-- spectec/test-latex/TEST.md | 129 ++- spectec/test-middlend/TEST.md | 1274 ++++++++++++---------- spectec/test-prose/TEST.md | 230 ++-- spectec/test-splice/TEST.md | 24 +- 15 files changed, 1108 insertions(+), 981 deletions(-) diff --git a/spectec/spec/wasm-1.0/1-syntax.watsup b/spectec/spec/wasm-1.0/1-syntax.watsup index 413a2614df..dc104617e7 100644 --- a/spectec/spec/wasm-1.0/1-syntax.watsup +++ b/spectec/spec/wasm-1.0/1-syntax.watsup @@ -171,7 +171,8 @@ syntax relop_(Inn) = syntax relop_(Fnn) = | EQ | NE | LT | GT | LE | GE -syntax cvtop = CONVERT | REINTERPRET +syntax cvtop = + | EXTEND sx | WRAP | CONVERT sx | TRUNC sx | PROMOTE | DEMOTE | REINTERPRET syntax memarg hint(desc "memory argument") = {ALIGN u32, OFFSET u32} @@ -216,7 +217,7 @@ syntax instr/num hint(desc "numeric instruction") = ... | BINOP valtype binop_(valtype) hint(show %.%) | TESTOP valtype testop_(valtype) hint(show %.%) | RELOP valtype relop_(valtype) hint(show %.%) - | CVTOP valtype_1 valtype_2 cvtop sx? hint(show %1.%3#_#%2#_#%4) hint(show %1.%3#_#%2) + | CVTOP valtype_1 valtype_2 cvtop hint(show %1.%3#_#%2) -- if valtype_1 =/= valtype_2 | ... diff --git a/spectec/spec/wasm-1.0/3-numerics.watsup b/spectec/spec/wasm-1.0/3-numerics.watsup index 1405d6023c..dd68b0b894 100644 --- a/spectec/spec/wasm-1.0/3-numerics.watsup +++ b/spectec/spec/wasm-1.0/3-numerics.watsup @@ -22,8 +22,8 @@ def $testop(valtype, testop_(valtype), val_(valtype)) : val_(I32) hint(show %2#$_(%1)#((%3))) def $relop(valtype, relop_(valtype), val_(valtype), val_(valtype)) : val_(I32) hint(show %2#$_(%1)#(%3, %4)) -def $cvtop(valtype_1, valtype_2, cvtop, sx?, val_(valtype_1)) : val_(valtype_2)* - hint(show %3#$_((%1,%2))^(%4)#((%5))) +def $cvtop(valtype_1, valtype_2, cvtop, val_(valtype_1)) : val_(valtype_2)* + hint(show %3#$_((%1,%2))#((%4))) def $wrap(M, N, iN(M)) : iN(N) hint(show $wrap_((%,%))#((%))) def $ext(M, N, sx, iN(M)) : iN(N) hint(show $ext_((%,%))^(%)#((%))) @@ -136,11 +136,11 @@ def $relop(Fnn, GT, fN_1, fN_2) = $fgt($size(Fnn), fN_1, fN_2) def $relop(Fnn, LE, fN_1, fN_2) = $fle($size(Fnn), fN_1, fN_2) def $relop(Fnn, GE, fN_1, fN_2) = $fge($size(Fnn), fN_1, fN_2) -def $cvtop(I32, I64, CONVERT, sx, iN) = $ext(32, 64, sx, iN) -def $cvtop(I64, I32, CONVERT, sx?, iN) = $wrap(64, 32, iN) -def $cvtop(Fnn, Inn, CONVERT, sx, fN) = $trunc($size(Fnn), $size(Inn), sx, fN) -def $cvtop(F32, F64, CONVERT, sx?, fN) = $promote(32, 64, fN) -def $cvtop(F64, F32, CONVERT, sx?, fN) = $demote(64, 32, fN) -def $cvtop(Inn, Fnn, CONVERT, sx, iN) = $convert($size(Inn), $size(Fnn), sx, iN) -def $cvtop(Inn, Fnn, REINTERPRET, sx?, iN) = $reinterpret(Inn, Fnn, iN) -- if $size(Inn) = $size(Fnn) -def $cvtop(Fnn, Inn, REINTERPRET, sx?, fN) = $reinterpret(Fnn, Inn, fN) -- if $size(Inn) = $size(Fnn) \ No newline at end of file +def $cvtop(I32, I64, EXTEND sx, iN) = $ext(32, 64, sx, iN) +def $cvtop(I64, I32, WRAP, iN) = $wrap(64, 32, iN) +def $cvtop(Fnn, Inn, TRUNC sx, fN) = $trunc($size(Fnn), $size(Inn), sx, fN) +def $cvtop(F32, F64, PROMOTE, fN) = $promote(32, 64, fN) +def $cvtop(F64, F32, DEMOTE, fN) = $demote(64, 32, fN) +def $cvtop(Inn, Fnn, CONVERT sx, iN) = $convert($size(Inn), $size(Fnn), sx, iN) +def $cvtop(Inn, Fnn, REINTERPRET, iN) = $reinterpret(Inn, Fnn, iN) -- if $size(Inn) = $size(Fnn) +def $cvtop(Fnn, Inn, REINTERPRET, fN) = $reinterpret(Fnn, Inn, fN) -- if $size(Inn) = $size(Fnn) \ No newline at end of file diff --git a/spectec/spec/wasm-1.0/6-typing.watsup b/spectec/spec/wasm-1.0/6-typing.watsup index a17d019440..30537a6513 100644 --- a/spectec/spec/wasm-1.0/6-typing.watsup +++ b/spectec/spec/wasm-1.0/6-typing.watsup @@ -229,8 +229,7 @@ rule Instr_ok/cvtop-reinterpret: -- if $size(nt_1) = $size(nt_2) rule Instr_ok/cvtop-convert: - C |- CVTOP nt_1 nt_2 CONVERT sx? : nt_2 -> nt_1 - -- if sx? = eps <=> nt_1 = Inn_1 /\ nt_2 = Inn_2 /\ $size(nt_1) > $size(nt_2) \/ nt_1 = Fnn_1 /\ nt_2 = Fnn_2 + C |- CVTOP nt_1 nt_2 cvtop : nt_2 -> nt_1 ;; Local instructions diff --git a/spectec/spec/wasm-1.0/8-reduction.watsup b/spectec/spec/wasm-1.0/8-reduction.watsup index 2f8b8ec92f..7d0b3a33f7 100644 --- a/spectec/spec/wasm-1.0/8-reduction.watsup +++ b/spectec/spec/wasm-1.0/8-reduction.watsup @@ -193,12 +193,12 @@ rule Step_pure/relop: rule Step_pure/cvtop-val: - (CONST t_1 c_1) (CVTOP t_2 t_1 cvtop sx?) ~> (CONST t_2 c) - -- if $cvtop(t_1, t_2, cvtop, sx?, c_1) = c ;; TODO + (CONST t_1 c_1) (CVTOP t_2 t_1 cvtop) ~> (CONST t_2 c) + -- if $cvtop(t_1, t_2, cvtop, c_1) = c ;; TODO rule Step_pure/cvtop-trap: - (CONST t_1 c_1) (CVTOP t_2 t_1 cvtop sx?) ~> TRAP - -- if $cvtop(t_1, t_2, cvtop, sx?, c_1) = eps ;; TODO + (CONST t_1 c_1) (CVTOP t_2 t_1 cvtop) ~> TRAP + -- if $cvtop(t_1, t_2, cvtop, c_1) = eps ;; TODO ;; Local instructions diff --git a/spectec/spec/wasm-1.0/A-binary.watsup b/spectec/spec/wasm-1.0/A-binary.watsup index 4c9bf128e6..f0db6579a0 100644 --- a/spectec/spec/wasm-1.0/A-binary.watsup +++ b/spectec/spec/wasm-1.0/A-binary.watsup @@ -355,29 +355,28 @@ grammar Binstr/numeric-bin-f64 : instr = ... | 0xA6 => BINOP F64 COPYSIGN | ... - grammar Binstr/numeric-cvt : instr = ... - | 0xA7 => CVTOP I32 I64 CONVERT - | 0xA8 => CVTOP I32 F32 CONVERT S - | 0xA9 => CVTOP I32 F32 CONVERT U - | 0xAA => CVTOP I32 F64 CONVERT S - | 0xAB => CVTOP I32 F64 CONVERT U - | 0xAC => CVTOP I64 I32 CONVERT S - | 0xAD => CVTOP I64 I32 CONVERT U - | 0xAE => CVTOP I64 F32 CONVERT S - | 0xAF => CVTOP I64 F32 CONVERT U - | 0xB0 => CVTOP I64 F64 CONVERT S - | 0xB1 => CVTOP I64 F64 CONVERT U - | 0xB2 => CVTOP F32 I32 CONVERT S - | 0xB3 => CVTOP F32 I32 CONVERT U - | 0xB4 => CVTOP F32 I64 CONVERT S - | 0xB5 => CVTOP F32 I64 CONVERT U - | 0xB6 => CVTOP F32 F64 CONVERT - | 0xB7 => CVTOP F64 I32 CONVERT S - | 0xB8 => CVTOP F64 I32 CONVERT U - | 0xB9 => CVTOP F64 I64 CONVERT S - | 0xBA => CVTOP F64 I64 CONVERT U - | 0xBB => CVTOP F64 F32 CONVERT + | 0xA7 => CVTOP I32 I64 WRAP + | 0xA8 => CVTOP I32 F32 (TRUNC S) + | 0xA9 => CVTOP I32 F32 (TRUNC U) + | 0xAA => CVTOP I32 F64 (TRUNC S) + | 0xAB => CVTOP I32 F64 (TRUNC U) + | 0xAC => CVTOP I64 I32 (EXTEND S) + | 0xAD => CVTOP I64 I32 (EXTEND U) + | 0xAE => CVTOP I64 F32 (TRUNC S) + | 0xAF => CVTOP I64 F32 (TRUNC U) + | 0xB0 => CVTOP I64 F64 (TRUNC S) + | 0xB1 => CVTOP I64 F64 (TRUNC U) + | 0xB2 => CVTOP F32 I32 (CONVERT S) + | 0xB3 => CVTOP F32 I32 (CONVERT U) + | 0xB4 => CVTOP F32 I64 (CONVERT S) + | 0xB5 => CVTOP F32 I64 (CONVERT U) + | 0xB6 => CVTOP F32 F64 DEMOTE + | 0xB7 => CVTOP F64 I32 (CONVERT S) + | 0xB8 => CVTOP F64 I32 (CONVERT U) + | 0xB9 => CVTOP F64 I64 (CONVERT S) + | 0xBA => CVTOP F64 I64 (CONVERT U) + | 0xBB => CVTOP F32 F64 PROMOTE | 0xBC => CVTOP I32 F32 REINTERPRET | 0xBD => CVTOP I64 F64 REINTERPRET | 0xBE => CVTOP F32 I32 REINTERPRET diff --git a/spectec/spec/wasm-2.0/1-syntax.watsup b/spectec/spec/wasm-2.0/1-syntax.watsup index 2052b73ad5..73b225fc03 100644 --- a/spectec/spec/wasm-2.0/1-syntax.watsup +++ b/spectec/spec/wasm-2.0/1-syntax.watsup @@ -257,7 +257,15 @@ syntax relop_(Inn) = syntax relop_(Fnn) = | EQ | NE | LT | GT | LE | GE -syntax cvtop = CONVERT | CONVERT_SAT | REINTERPRET +syntax cvtop = + | EXTEND sx + | WRAP + | CONVERT sx + | TRUNC sx + | TRUNC_SAT sx + | PROMOTE + | DEMOTE + | REINTERPRET ;; Vector operators @@ -382,7 +390,7 @@ syntax instr/num hint(desc "numeric instruction") = ... | BINOP numtype binop_(numtype) hint(show %.%) | TESTOP numtype testop_(numtype) hint(show %.%) | RELOP numtype relop_(numtype) hint(show %.%) - | CVTOP numtype_1 numtype_2 cvtop sx? hint(show %1.%3#_#%2#_#%4) hint(show %1.%3#_#%2) + | CVTOP numtype_1 numtype_2 cvtop hint(show %1.%3#_#%2) -- if numtype_1 =/= numtype_2 | EXTEND numtype n hint(show %.EXTEND#%#_#S) | ... diff --git a/spectec/spec/wasm-2.0/3-numerics.watsup b/spectec/spec/wasm-2.0/3-numerics.watsup index a450425e7a..754806dd55 100644 --- a/spectec/spec/wasm-2.0/3-numerics.watsup +++ b/spectec/spec/wasm-2.0/3-numerics.watsup @@ -27,8 +27,8 @@ def $testop(numtype, testop_(numtype), num_(numtype)) : num_(I32) hint(show %2#$_(%1)#((%3))) def $relop(numtype, relop_(numtype), num_(numtype), num_(numtype)) : num_(I32) hint(show %2#$_(%1)#(%3, %4)) -def $cvtop(numtype_1, numtype_2, cvtop, sx?, num_(numtype_1)) : num_(numtype_2)* - hint(show %3#$_((%1,%2))^(%4)#((%5))) +def $cvtop(numtype_1, numtype_2, cvtop, num_(numtype_1)) : num_(numtype_2)* + hint(show %3#$_((%1,%2))#((%4))) def $wrap(M, N, iN(M)) : iN(N) hint(show $wrap_((%,%))#((%))) def $ext(M, N, sx, iN(M)) : iN(N) hint(show $ext_((%,%))^(%)#((%))) @@ -162,15 +162,15 @@ def $relop(Fnn, GT, fN_1, fN_2) = $fgt($size(Fnn), fN_1, fN_2) def $relop(Fnn, LE, fN_1, fN_2) = $fle($size(Fnn), fN_1, fN_2) def $relop(Fnn, GE, fN_1, fN_2) = $fge($size(Fnn), fN_1, fN_2) -def $cvtop(I32, I64, CONVERT, sx, iN) = $ext(32, 64, sx, iN) -def $cvtop(I64, I32, CONVERT, sx?, iN) = $wrap(64, 32, iN) -def $cvtop(Fnn, Inn, CONVERT, sx, fN) = $trunc($size(Fnn), $size(Inn), sx, fN) -def $cvtop(Fnn, Inn, CONVERT_SAT, sx, fN) = $trunc_sat($size(Fnn), $size(Inn), sx, fN) -def $cvtop(F32, F64, CONVERT, sx?, fN) = $promote(32, 64, fN) -def $cvtop(F64, F32, CONVERT, sx?, fN) = $demote(64, 32, fN) -def $cvtop(Inn, Fnn, CONVERT, sx, iN) = $convert($size(Inn), $size(Fnn), sx, iN) -def $cvtop(Inn, Fnn, CONVERT, sx?, iN) = $reinterpret(Inn, Fnn, iN) -- if $size(Inn) = $size(Fnn) -def $cvtop(Fnn, Inn, CONVERT, sx?, fN) = $reinterpret(Fnn, Inn, fN) -- if $size(Inn) = $size(Fnn) +def $cvtop(I32, I64, EXTEND sx, iN) = $ext(32, 64, sx, iN) +def $cvtop(I64, I32, WRAP, iN) = $wrap(64, 32, iN) +def $cvtop(Fnn, Inn, TRUNC sx, fN) = $trunc($size(Fnn), $size(Inn), sx, fN) +def $cvtop(Fnn, Inn, TRUNC_SAT sx, fN) = $trunc_sat($size(Fnn), $size(Inn), sx, fN) +def $cvtop(F32, F64, PROMOTE, fN) = $promote(32, 64, fN) +def $cvtop(F64, F32, DEMOTE, fN) = $demote(64, 32, fN) +def $cvtop(Inn, Fnn, CONVERT sx, iN) = $convert($size(Inn), $size(Fnn), sx, iN) +def $cvtop(Inn, Fnn, REINTERPRET, iN) = $reinterpret(Inn, Fnn, iN) -- if $size(Inn) = $size(Fnn) +def $cvtop(Fnn, Inn, REINTERPRET, fN) = $reinterpret(Fnn, Inn, fN) -- if $size(Inn) = $size(Fnn) ;; Packed values diff --git a/spectec/spec/wasm-2.0/6-typing.watsup b/spectec/spec/wasm-2.0/6-typing.watsup index d30a280b4f..b5e0e0b517 100644 --- a/spectec/spec/wasm-2.0/6-typing.watsup +++ b/spectec/spec/wasm-2.0/6-typing.watsup @@ -273,8 +273,7 @@ rule Instr_ok/cvtop-reinterpret: -- if $size(nt_1) = $size(nt_2) rule Instr_ok/cvtop-convert: - C |- CVTOP nt_1 nt_2 CONVERT sx? : nt_2 -> nt_1 - -- if sx? = eps <=> nt_1 = Inn_1 /\ nt_2 = Inn_2 /\ $size(nt_1) > $size(nt_2) \/ nt_1 = Fnn_1 /\ nt_2 = Fnn_2 + C |- CVTOP nt_1 nt_2 cvtop : nt_2 -> nt_1 ;; Reference instructions diff --git a/spectec/spec/wasm-2.0/8-reduction.watsup b/spectec/spec/wasm-2.0/8-reduction.watsup index ef2adfe5f4..b5dc0f2779 100644 --- a/spectec/spec/wasm-2.0/8-reduction.watsup +++ b/spectec/spec/wasm-2.0/8-reduction.watsup @@ -199,12 +199,12 @@ rule Step_pure/relop: rule Step_pure/cvtop-val: - (CONST nt_1 c_1) (CVTOP nt_2 nt_1 cvtop sx?) ~> (CONST nt_2 c) - -- if $cvtop(nt_1, nt_2, cvtop, sx?, c_1) = c ;; TODO + (CONST nt_1 c_1) (CVTOP nt_2 nt_1 cvtop) ~> (CONST nt_2 c) + -- if $cvtop(nt_1, nt_2, cvtop, c_1) = c ;; TODO rule Step_pure/cvtop-trap: - (CONST nt_1 c_1) (CVTOP nt_2 nt_1 cvtop sx?) ~> TRAP - -- if $cvtop(nt_1, nt_2, cvtop, sx?, c_1) = eps ;; TODO + (CONST nt_1 c_1) (CVTOP nt_2 nt_1 cvtop) ~> TRAP + -- if $cvtop(nt_1, nt_2, cvtop, c_1) = eps ;; TODO ;; Reference instructions diff --git a/spectec/spec/wasm-2.0/A-binary.watsup b/spectec/spec/wasm-2.0/A-binary.watsup index e64632c14c..91d9dbefc7 100644 --- a/spectec/spec/wasm-2.0/A-binary.watsup +++ b/spectec/spec/wasm-2.0/A-binary.watsup @@ -399,35 +399,45 @@ grammar Binstr/numeric-bin-f64 : instr = ... | 0xA6 => BINOP F64 COPYSIGN | ... - grammar Binstr/numeric-cvt : instr = ... - | 0xA7 => CVTOP I32 I64 CONVERT - | 0xA8 => CVTOP I32 F32 CONVERT S - | 0xA9 => CVTOP I32 F32 CONVERT U - | 0xAA => CVTOP I32 F64 CONVERT S - | 0xAB => CVTOP I32 F64 CONVERT U - | 0xAC => CVTOP I64 I32 CONVERT S - | 0xAD => CVTOP I64 I32 CONVERT U - | 0xAE => CVTOP I64 F32 CONVERT S - | 0xAF => CVTOP I64 F32 CONVERT U - | 0xB0 => CVTOP I64 F64 CONVERT S - | 0xB1 => CVTOP I64 F64 CONVERT U - | 0xB2 => CVTOP F32 I32 CONVERT S - | 0xB3 => CVTOP F32 I32 CONVERT U - | 0xB4 => CVTOP F32 I64 CONVERT S - | 0xB5 => CVTOP F32 I64 CONVERT U - | 0xB6 => CVTOP F32 F64 CONVERT - | 0xB7 => CVTOP F64 I32 CONVERT S - | 0xB8 => CVTOP F64 I32 CONVERT U - | 0xB9 => CVTOP F64 I64 CONVERT S - | 0xBA => CVTOP F64 I64 CONVERT U - | 0xBB => CVTOP F64 F32 CONVERT + | 0xA7 => CVTOP I32 I64 WRAP + | 0xA8 => CVTOP I32 F32 (TRUNC S) + | 0xA9 => CVTOP I32 F32 (TRUNC U) + | 0xAA => CVTOP I32 F64 (TRUNC S) + | 0xAB => CVTOP I32 F64 (TRUNC U) + | 0xAC => CVTOP I64 I32 (EXTEND S) + | 0xAD => CVTOP I64 I32 (EXTEND U) + | 0xAE => CVTOP I64 F32 (TRUNC S) + | 0xAF => CVTOP I64 F32 (TRUNC U) + | 0xB0 => CVTOP I64 F64 (TRUNC S) + | 0xB1 => CVTOP I64 F64 (TRUNC U) + | 0xB2 => CVTOP F32 I32 (CONVERT S) + | 0xB3 => CVTOP F32 I32 (CONVERT U) + | 0xB4 => CVTOP F32 I64 (CONVERT S) + | 0xB5 => CVTOP F32 I64 (CONVERT U) + | 0xB6 => CVTOP F32 F64 DEMOTE + | 0xB7 => CVTOP F64 I32 (CONVERT S) + | 0xB8 => CVTOP F64 I32 (CONVERT U) + | 0xB9 => CVTOP F64 I64 (CONVERT S) + | 0xBA => CVTOP F64 I64 (CONVERT U) + | 0xBB => CVTOP F32 F64 PROMOTE | 0xBC => CVTOP I32 F32 REINTERPRET | 0xBD => CVTOP I64 F64 REINTERPRET | 0xBE => CVTOP F32 I32 REINTERPRET | 0xBF => CVTOP F64 I64 REINTERPRET | ... +grammar Binstr/numeric-cvt-sat : instr = ... + | 0xFC 0:Bu32 => CVTOP I32 F32 (TRUNC_SAT S) + | 0xFC 1:Bu32 => CVTOP I32 F32 (TRUNC_SAT U) + | 0xFC 2:Bu32 => CVTOP I32 F64 (TRUNC_SAT S) + | 0xFC 3:Bu32 => CVTOP I32 F64 (TRUNC_SAT U) + | 0xFC 4:Bu32 => CVTOP I64 F32 (TRUNC_SAT S) + | 0xFC 5:Bu32 => CVTOP I64 F32 (TRUNC_SAT U) + | 0xFC 6:Bu32 => CVTOP I64 F64 (TRUNC_SAT S) + | 0xFC 7:Bu32 => CVTOP I64 F64 (TRUNC_SAT U) + | ... + grammar Binstr/numeric-extend : instr = ... | 0xC0 => UNOP I32 (EXTEND 8) | 0xC1 => UNOP I32 (EXTEND 16) diff --git a/spectec/test-frontend/TEST.md b/spectec/test-frontend/TEST.md index 41bb490b78..8141450789 100644 --- a/spectec/test-frontend/TEST.md +++ b/spectec/test-frontend/TEST.md @@ -792,12 +792,37 @@ syntax relop_(numtype : numtype) ;; 1-syntax.watsup -syntax cvtop_{nt_1 : numtype, nt_2 : numtype}(nt_1, nt_2) = - | CONVERT - | CONVERT_SAT{Inn : Inn, Fnn : Fnn} - -- if ((nt_1 = (Inn : Inn <: numtype)) /\ (nt_2 = (Fnn : Fnn <: numtype))) +syntax cvtop_(numtype_1 : numtype, numtype_2 : numtype) + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Inn_2 : Inn}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype)) = + | EXTEND{sx : sx}(sx : sx) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) < $sizenn2((Inn_2 : Inn <: numtype))) + | WRAP + -- if ($sizenn1((Inn_1 : Inn <: numtype)) > $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Fnn_2 : Fnn}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | CONVERT{sx : sx}(sx : sx) | REINTERPRET - -- if ($size(nt_1) = $size(nt_2)) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Inn_2 : Inn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype)) = + | TRUNC{sx : sx}(sx : sx) + | TRUNC_SAT{sx : sx}(sx : sx) + | REINTERPRET + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) = $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | PROMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) < $sizenn2((Fnn_2 : Fnn <: numtype))) + | DEMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) > $sizenn2((Fnn_2 : Fnn <: numtype))) + ;; 1-syntax.watsup syntax ishape = @@ -1135,8 +1160,7 @@ syntax instr = | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx? : sx?}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx?{sx : sx} : sx?) - -- if (numtype_1 =/= numtype_2) + | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)) | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) @@ -1763,7 +1787,7 @@ def $free_instr(instr : instr) : free ;; 2-syntax-aux.watsup:359.1-359.62 def $free_instr{numtype : numtype, relop : relop_(numtype)}(RELOP_instr(numtype, relop)) = $free_numtype(numtype) ;; 2-syntax-aux.watsup:360.1-361.55 - def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1), sx? : sx?}(CVTOP_instr(numtype_1, numtype_2, cvtop, sx?{sx : sx})) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) + def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1)}(CVTOP_instr(numtype_1, numtype_2, cvtop)) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) ;; 2-syntax-aux.watsup:363.1-363.64 def $free_instr{vectype : vectype, veclit : vec_(vectype)}(VCONST_instr(vectype, veclit)) = $free_vectype(vectype) ;; 2-syntax-aux.watsup:364.1-364.64 @@ -2592,27 +2616,27 @@ def $trunc(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) def $trunc_sat(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) ;; 3-numerics.watsup -def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), sx?, num_ : num_(numtype_1)) : num_(numtype_2)* +def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), num_ : num_(numtype_1)) : num_(numtype_2)* ;; 3-numerics.watsup - def $cvtop{sx : sx, iN : num_(I32_numtype)}(I32_numtype, I64_numtype, CONVERT_cvtop_, ?(sx), iN) = [$ext(32, 64, sx, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), EXTEND_cvtop_(sx), iN_1) = [$ext($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, iN : num_(I64_numtype)}(I64_numtype, I32_numtype, CONVERT_cvtop_, sx?{sx : sx}, iN) = [$wrap(64, 32, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), WRAP_cvtop_, iN_1) = [$wrap($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), iN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_cvtop_, ?(sx), fN) = [$trunc($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_cvtop_(sx), fN_1) = [$trunc($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_SAT_cvtop_, ?(sx), fN) = [$trunc_sat($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_SAT_cvtop_(sx), fN_1) = [$trunc_sat($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F32_numtype)}(F32_numtype, F64_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$promote(32, 64, fN)] + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), CONVERT_cvtop_(sx), iN_1) = [$convert($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F64_numtype)}(F64_numtype, F32_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$demote(64, 32, fN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), PROMOTE_cvtop_, fN_1) = [$promote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx : sx, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), CONVERT_cvtop_, ?(sx), iN) = [$convert($size((Inn : Inn <: numtype)), $size((Fnn : Fnn <: numtype)), sx, iN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), DEMOTE_cvtop_, fN_1) = [$demote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx? : sx?, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, iN) = [$reinterpret((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), iN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), REINTERPRET_cvtop_, iN_1) = [$reinterpret((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), iN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx? : sx?, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, fN) = [$reinterpret((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), fN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, fN_1 : num_((Fnn_1 : Fnn <: numtype)), Inn_1 : Inn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), REINTERPRET_cvtop_, fN_1) = [$reinterpret((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), fN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup def $narrow(M : M, N : N, sx : sx, iN : iN(M)) : iN(N) @@ -4216,411 +4240,405 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->_%%`_instrtype(`%`_resulttype([(nt : numtype <: valtype) (nt : numtype <: valtype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:725.1-727.34 - rule cvtop-reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, REINTERPRET_cvtop_, ?()), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ($size(nt_1) = $size(nt_2)) + ;; 6-typing.watsup:723.1-724.44 + rule cvtop{C : context, nt_1 : numtype, nt_2 : numtype, cvtop : cvtop_(nt_2, nt_1)}: + `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, cvtop), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - ;; 6-typing.watsup:729.1-731.112 - rule cvtop-convert{C : context, nt_1 : numtype, nt_2 : numtype, sx? : sx?, Inn_1 : Inn, Inn_2 : Inn, Fnn_1 : Fnn, Fnn_2 : Fnn}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, CONVERT_cvtop_, sx?{sx : sx}), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ((sx?{sx : sx} = ?()) <=> ((((nt_1 = (Inn_1 : Inn <: numtype)) /\ (nt_2 = (Inn_2 : Inn <: numtype))) /\ ($size(nt_1) > $size(nt_2))) \/ ((nt_1 = (Fnn_1 : Fnn <: numtype)) /\ (nt_2 = (Fnn_2 : Fnn <: numtype))))) - - ;; 6-typing.watsup:736.1-738.31 + ;; 6-typing.watsup:729.1-731.31 rule ref.null{C : context, ht : heaptype}: `%|-%:%`(C, REF.NULL_instr(ht), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:740.1-743.20 + ;; 6-typing.watsup:733.1-736.20 rule ref.func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, REF.FUNC_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNCS_context[x!`%`_idx.0] = dt) -- if x <- C.REFS_context - ;; 6-typing.watsup:745.1-746.34 + ;; 6-typing.watsup:738.1-739.34 rule ref.i31{C : context}: `%|-%:%`(C, REF.I31_instr, `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), I31_heaptype)]))) - ;; 6-typing.watsup:748.1-750.31 + ;; 6-typing.watsup:741.1-743.31 rule ref.is_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([I32_valtype]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:752.1-754.31 + ;; 6-typing.watsup:745.1-747.31 rule ref.as_non_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:756.1-757.51 + ;; 6-typing.watsup:749.1-750.51 rule ref.eq{C : context}: `%|-%:%`(C, REF.EQ_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype) REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:759.1-763.33 + ;; 6-typing.watsup:752.1-756.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.TEST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([I32_valtype]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:765.1-769.33 + ;; 6-typing.watsup:758.1-762.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.CAST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:774.1-775.42 + ;; 6-typing.watsup:767.1-768.42 rule i31.get{C : context, sx : sx}: `%|-%:%`(C, I31.GET_instr(sx), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), I31_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:780.1-782.44 + ;; 6-typing.watsup:773.1-775.44 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: `%|-%:%`(C, STRUCT.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)*{zt : storagetype}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) - ;; 6-typing.watsup:784.1-787.40 + ;; 6-typing.watsup:777.1-780.40 rule struct.new_default{C : context, x : idx, mut* : mut*, zt* : storagetype*, val* : val*}: `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) -- (if ($default_($unpack(zt)) = ?(val)))*{val : val, zt : storagetype} - ;; 6-typing.watsup:789.1-793.39 + ;; 6-typing.watsup:782.1-786.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype))]), [], `%`_resulttype([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:795.1-798.24 + ;; 6-typing.watsup:788.1-791.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(`MUT%?`_mut(?(())), zt)) - ;; 6-typing.watsup:803.1-805.42 + ;; 6-typing.watsup:796.1-798.42 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype([$unpack(zt) I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:807.1-810.37 + ;; 6-typing.watsup:800.1-803.37 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ($default_($unpack(zt)) = ?(val)) - ;; 6-typing.watsup:812.1-814.42 + ;; 6-typing.watsup:805.1-807.42 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, `%`_u32(n)), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)^n{}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:816.1-819.40 + ;; 6-typing.watsup:809.1-812.40 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt) - ;; 6-typing.watsup:821.1-825.24 + ;; 6-typing.watsup:814.1-818.24 rule array.new_data{C : context, x : idx, y : idx, mut : mut, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:827.1-830.39 + ;; 6-typing.watsup:820.1-823.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), [], `%`_resulttype([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:832.1-834.42 + ;; 6-typing.watsup:825.1-827.42 rule array.set{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:836.1-838.42 + ;; 6-typing.watsup:829.1-831.42 rule array.len{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.LEN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ARRAY_heaptype)]), [], `%`_resulttype([I32_valtype]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:840.1-842.42 + ;; 6-typing.watsup:833.1-835.42 rule array.fill{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:844.1-848.40 + ;; 6-typing.watsup:837.1-841.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`_nul(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x_1!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt_1))) -- Expand: `%~~%`(C.TYPES_context[x_2!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:850.1-853.44 + ;; 6-typing.watsup:843.1-846.44 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt) - ;; 6-typing.watsup:855.1-859.24 + ;; 6-typing.watsup:848.1-852.24 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:864.1-865.62 + ;; 6-typing.watsup:857.1-858.62 rule extern.convert_any{C : context, nul : nul}: `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, ANY_heaptype)]), [], `%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]))) - ;; 6-typing.watsup:867.1-868.62 + ;; 6-typing.watsup:860.1-861.62 rule any.convert_extern{C : context, nul : nul}: `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]), [], `%`_resulttype([REF_valtype(nul, ANY_heaptype)]))) - ;; 6-typing.watsup:873.1-874.35 + ;; 6-typing.watsup:866.1-867.35 rule vconst{C : context, c : vec_(V128_Vnn)}: `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:876.1-877.41 + ;; 6-typing.watsup:869.1-870.41 rule vvunop{C : context, vvunop : vvunop}: `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:879.1-880.48 + ;; 6-typing.watsup:872.1-873.48 rule vvbinop{C : context, vvbinop : vvbinop}: `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:882.1-883.55 + ;; 6-typing.watsup:875.1-876.55 rule vvternop{C : context, vvternop : vvternop}: `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:885.1-886.44 + ;; 6-typing.watsup:878.1-879.44 rule vvtestop{C : context, vvtestop : vvtestop}: `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:888.1-889.37 + ;; 6-typing.watsup:881.1-882.37 rule vunop{C : context, sh : shape, vunop : vunop_(sh)}: `%|-%:%`(C, VUNOP_instr(sh, vunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:891.1-892.44 + ;; 6-typing.watsup:884.1-885.44 rule vbinop{C : context, sh : shape, vbinop : vbinop_(sh)}: `%|-%:%`(C, VBINOP_instr(sh, vbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:894.1-895.40 + ;; 6-typing.watsup:887.1-888.40 rule vtestop{C : context, sh : shape, vtestop : vtestop_(sh)}: `%|-%:%`(C, VTESTOP_instr(sh, vtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:897.1-898.44 + ;; 6-typing.watsup:890.1-891.44 rule vrelop{C : context, sh : shape, vrelop : vrelop_(sh)}: `%|-%:%`(C, VRELOP_instr(sh, vrelop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:900.1-901.47 + ;; 6-typing.watsup:893.1-894.47 rule vshiftop{C : context, sh : ishape, vshiftop : vshiftop_(sh)}: `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype I32_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:903.1-904.33 + ;; 6-typing.watsup:896.1-897.33 rule vbitmask{C : context, sh : ishape}: `%|-%:%`(C, VBITMASK_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:906.1-907.39 + ;; 6-typing.watsup:899.1-900.39 rule vswizzle{C : context, sh : ishape}: `%|-%:%`(C, VSWIZZLE_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:909.1-911.29 + ;; 6-typing.watsup:902.1-904.29 rule vshuffle{C : context, sh : ishape, i* : nat*}: `%|-%:%`(C, VSHUFFLE_instr(sh, `%`_laneidx(i)*{i : nat}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- (if (i < (2 * $dim((sh : ishape <: shape))!`%`_dim.0)))*{i : nat} - ;; 6-typing.watsup:913.1-914.44 + ;; 6-typing.watsup:906.1-907.44 rule vsplat{C : context, sh : shape}: `%|-%:%`(C, VSPLAT_instr(sh), `%->_%%`_instrtype(`%`_resulttype([($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:917.1-919.21 + ;; 6-typing.watsup:910.1-912.21 rule vextract_lane{C : context, sh : shape, sx? : sx?, i : nat}: `%|-%:%`(C, VEXTRACT_LANE_instr(sh, sx?{sx : sx}, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([($unpackshape(sh) : numtype <: valtype)]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:921.1-923.21 + ;; 6-typing.watsup:914.1-916.21 rule vreplace_lane{C : context, sh : shape, i : nat}: `%|-%:%`(C, VREPLACE_LANE_instr(sh, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype ($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:925.1-926.53 + ;; 6-typing.watsup:918.1-919.53 rule vextunop{C : context, sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTUNOP_instr(sh_1, sh_2, vextunop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:928.1-929.60 + ;; 6-typing.watsup:921.1-922.60 rule vextbinop{C : context, sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTBINOP_instr(sh_1, sh_2, vextbinop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:931.1-932.48 + ;; 6-typing.watsup:924.1-925.48 rule vnarrow{C : context, sh_1 : ishape, sh_2 : ishape, sx : sx}: `%|-%:%`(C, VNARROW_instr(sh_1, sh_2, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:934.1-935.62 + ;; 6-typing.watsup:927.1-928.62 rule vcvtop{C : context, sh_1 : shape, sh_2 : shape, vcvtop : vcvtop_(sh_2, sh_1), half? : half_(sh_2, sh_1)?, sx? : sx?, zero? : zero_(sh_2, sh_1)?}: `%|-%:%`(C, VCVTOP_instr(sh_1, sh_2, vcvtop, half?{half : half_(sh_2, sh_1)}, sx?{sx : sx}, zero?{zero : zero_(sh_2, sh_1)}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:940.1-942.28 + ;; 6-typing.watsup:933.1-935.28 rule local.get{C : context, x : idx, t : valtype}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(SET_init, t)) - ;; 6-typing.watsup:944.1-946.29 + ;; 6-typing.watsup:937.1-939.29 rule local.set{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:948.1-950.29 + ;; 6-typing.watsup:941.1-943.29 rule local.tee{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([t]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:955.1-957.29 + ;; 6-typing.watsup:948.1-950.29 rule global.get{C : context, x : idx, t : valtype, mut : mut}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; 6-typing.watsup:959.1-961.29 + ;; 6-typing.watsup:952.1-954.29 rule global.set{C : context, x : idx, t : valtype}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [], `%`_resulttype([]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(`MUT%?`_mut(?(())), t)) - ;; 6-typing.watsup:966.1-968.29 + ;; 6-typing.watsup:959.1-961.29 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:970.1-972.29 + ;; 6-typing.watsup:963.1-965.29 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype)]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:974.1-976.29 + ;; 6-typing.watsup:967.1-969.29 rule table.size{C : context, x : idx, lim : limits, rt : reftype}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:978.1-980.29 + ;; 6-typing.watsup:971.1-973.29 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([(rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:982.1-984.29 + ;; 6-typing.watsup:975.1-977.29 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:986.1-990.36 + ;; 6-typing.watsup:979.1-983.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x_1!`%`_idx.0] = `%%`_tabletype(lim_1, rt_1)) -- if (C.TABLES_context[x_2!`%`_idx.0] = `%%`_tabletype(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:992.1-996.36 + ;; 6-typing.watsup:985.1-989.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt_1)) -- if (C.ELEMS_context[y!`%`_idx.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:998.1-1000.24 + ;; 6-typing.watsup:991.1-993.24 rule elem.drop{C : context, x : idx, rt : reftype}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (C.ELEMS_context[x!`%`_idx.0] = rt) - ;; 6-typing.watsup:1005.1-1007.23 + ;; 6-typing.watsup:998.1-1000.23 rule memory.size{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1009.1-1011.23 + ;; 6-typing.watsup:1002.1-1004.23 rule memory.grow{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1013.1-1015.23 + ;; 6-typing.watsup:1006.1-1008.23 rule memory.fill{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1017.1-1020.27 + ;; 6-typing.watsup:1010.1-1013.27 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x_1!`%`_idx.0] = mt_1) -- if (C.MEMS_context[x_2!`%`_idx.0] = mt_2) - ;; 6-typing.watsup:1022.1-1025.24 + ;; 6-typing.watsup:1015.1-1018.24 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1027.1-1029.24 + ;; 6-typing.watsup:1020.1-1022.24 rule data.drop{C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (C.DATAS_context[x!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1040.1-1043.43 + ;; 6-typing.watsup:1033.1-1036.43 rule load-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(nt : numtype <: valtype)]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1045.1-1048.35 + ;; 6-typing.watsup:1038.1-1041.35 rule load-pack{C : context, Inn : Inn, M : M, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr((Inn : Inn <: numtype), ?(`%%`_loadop_(`%`_sz(M), sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(Inn : Inn <: valtype)]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1059.1-1062.43 + ;; 6-typing.watsup:1052.1-1055.43 rule store-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (nt : numtype <: valtype)]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1064.1-1067.35 + ;; 6-typing.watsup:1057.1-1060.35 rule store-pack{C : context, Inn : Inn, M : M, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr((Inn : Inn <: numtype), ?(`%`_sz(M)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (Inn : Inn <: valtype)]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1069.1-1072.46 + ;; 6-typing.watsup:1062.1-1065.46 rule vload-val{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1074.1-1077.39 + ;; 6-typing.watsup:1067.1-1070.39 rule vload-pack{C : context, M : M, N : N, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(`SHAPE%X%%`_vloadop_(`%`_sz(M), N, sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ((M / 8) * N)) - ;; 6-typing.watsup:1079.1-1082.35 + ;; 6-typing.watsup:1072.1-1075.35 rule vload-splat{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(SPLAT_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1084.1-1087.35 + ;; 6-typing.watsup:1077.1-1080.35 rule vload-zero{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(ZERO_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1089.1-1093.21 + ;; 6-typing.watsup:1082.1-1086.21 rule vload_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VLOAD_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) -- if (i < (128 / N)) - ;; 6-typing.watsup:1095.1-1098.46 + ;; 6-typing.watsup:1088.1-1091.46 rule vstore{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VSTORE_instr(V128_vectype, x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1100.1-1104.21 + ;; 6-typing.watsup:1093.1-1097.21 rule vstore_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VSTORE_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) @@ -4883,13 +4901,13 @@ relation Export_ok: `%|-%:%%`(context, export, name, externtype) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1296.1-1296.100 +;; 6-typing.watsup:1289.1-1289.100 relation Globals_ok: `%|-%:%`(context, global*, globaltype*) - ;; 6-typing.watsup:1338.1-1339.17 + ;; 6-typing.watsup:1331.1-1332.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1341.1-1344.54 + ;; 6-typing.watsup:1334.1-1337.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) @@ -4899,13 +4917,13 @@ relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1295.1-1295.98 +;; 6-typing.watsup:1288.1-1288.98 relation Types_ok: `%|-%:%`(context, type*, deftype*) - ;; 6-typing.watsup:1330.1-1331.17 + ;; 6-typing.watsup:1323.1-1324.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1333.1-1336.49 + ;; 6-typing.watsup:1326.1-1329.49 rule cons{C : context, type_1 : type, type* : type*, dt_1* : deftype*, dt* : deftype*}: `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{dt_1 : deftype} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%`(C, type_1, dt_1*{dt_1 : deftype}) @@ -5201,14 +5219,14 @@ relation Step_pure: `%~>%`(instr*, instr*) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup - rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?, c : num_(nt_2)}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [CONST_instr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) + rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), c : num_(nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [CONST_instr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = [c]) ;; 8-reduction.watsup - rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [TRAP_instr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) + rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [TRAP_instr]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: diff --git a/spectec/test-latex/TEST.md b/spectec/test-latex/TEST.md index 3295bebf47..ff081ca926 100644 --- a/spectec/test-latex/TEST.md +++ b/spectec/test-latex/TEST.md @@ -2022,11 +2022,21 @@ $$ $$ \begin{array}{@{}lrrl@{}l@{}} -& {{\mathit{cvtop}}}_{{\mathit{nt}}_1, {\mathit{nt}}_2} &::=& \mathsf{convert} \\ &&|& -\mathsf{convert\_sat} - &\qquad \mbox{if}~{\mathit{nt}}_1 = {\mathsf{i}}{N} \land {\mathit{nt}}_2 = {\mathsf{f}}{N} \\ &&|& +& {{\mathit{cvtop}}}_{{{\mathsf{i}}{N}}_1, {{\mathsf{i}}{N}}_2} &::=& {\mathsf{extend}}{\mathsf{\_}}{{\mathit{sx}}} + &\qquad \mbox{if}~N_1 < N_2 \\ &&|& +\mathsf{wrap} + &\qquad \mbox{if}~N_1 > N_2 \\ +& {{\mathit{cvtop}}}_{{{\mathsf{i}}{N}}_1, {{\mathsf{f}}{N}}_2} &::=& {\mathsf{convert}}{\mathsf{\_}}{{\mathit{sx}}} \\ &&|& \mathsf{reinterpret} - &\qquad \mbox{if}~{|{\mathit{nt}}_1|} = {|{\mathit{nt}}_2|} \\ + &\qquad \mbox{if}~N_1 = N_2 \\ +& {{\mathit{cvtop}}}_{{{\mathsf{f}}{N}}_1, {{\mathsf{i}}{N}}_2} &::=& {\mathsf{trunc}}{\mathsf{\_}}{{\mathit{sx}}} \\ &&|& +{\mathsf{trunc\_sat}}{\mathsf{\_}}{{\mathit{sx}}} \\ &&|& +\mathsf{reinterpret} + &\qquad \mbox{if}~N_1 = N_2 \\ +& {{\mathit{cvtop}}}_{{{\mathsf{f}}{N}}_1, {{\mathsf{f}}{N}}_2} &::=& \mathsf{promote} + &\qquad \mbox{if}~N_1 < N_2 \\ &&|& +\mathsf{demote} + &\qquad \mbox{if}~N_1 > N_2 \\ \end{array} $$ @@ -2214,8 +2224,7 @@ $$ {\mathit{numtype}} {.} {{\mathit{binop}}}_{{\mathit{numtype}}} \\ &&|& {\mathit{numtype}} {.} {{\mathit{testop}}}_{{\mathit{numtype}}} \\ &&|& {\mathit{numtype}} {.} {{\mathit{relop}}}_{{\mathit{numtype}}} \\ &&|& -{\mathit{numtype}}_1 {.} {{{\mathit{cvtop}}}_{{\mathit{numtype}}_2, {\mathit{numtype}}_1}}{\mathsf{\_}}{{\mathit{numtype}}_2}{\mathsf{\_}}{{{\mathit{sx}}^?}} - &\qquad \mbox{if}~{\mathit{numtype}}_1 \neq {\mathit{numtype}}_2 \\ &&|& +{\mathit{numtype}}_1 {.} {{{\mathit{cvtop}}}_{{\mathit{numtype}}_2, {\mathit{numtype}}_1}}{\mathsf{\_}}{{\mathit{numtype}}_2} \\ &&|& {\mathit{vectype}}{.}\mathsf{const}~{{\mathit{vec}}}_{{\mathit{vectype}}} \\ &&|& {\mathit{vectype}} {.} {\mathit{vvunop}} \\ &&|& {\mathit{vectype}} {.} {\mathit{vvbinop}} \\ &&|& @@ -2867,7 +2876,7 @@ $$ {\mathrm{free}}_{\mathit{instr}}({\mathit{numtype}} {.} {\mathit{binop}}) &=& {\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}}) \\ {\mathrm{free}}_{\mathit{instr}}({\mathit{numtype}} {.} {\mathit{testop}}) &=& {\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}}) \\ {\mathrm{free}}_{\mathit{instr}}({\mathit{numtype}} {.} {\mathit{relop}}) &=& {\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}}) \\ -{\mathrm{free}}_{\mathit{instr}}({\mathit{numtype}}_1 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{numtype}}_2}{\mathsf{\_}}{{{\mathit{sx}}^?}}) &=& {\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}}_1) \oplus {\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}}_2) \\ +{\mathrm{free}}_{\mathit{instr}}({\mathit{numtype}}_1 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{numtype}}_2}) &=& {\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}}_1) \oplus {\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}}_2) \\ {\mathrm{free}}_{\mathit{instr}}({\mathit{vectype}}{.}\mathsf{const}~{\mathit{veclit}}) &=& {\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}}) \\ {\mathrm{free}}_{\mathit{instr}}({\mathit{vectype}} {.} {\mathit{vvunop}}) &=& {\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}}) \\ {\mathrm{free}}_{\mathit{instr}}({\mathit{vectype}} {.} {\mathit{vvbinop}}) &=& {\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}}) \\ @@ -3514,17 +3523,17 @@ $$ $$ \begin{array}{@{}lcl@{}l@{}} -{\mathsf{convert}}{{{}_{\mathsf{i{\scriptstyle 32}}, \mathsf{i{\scriptstyle 64}}}^{{\mathit{sx}}}}}{({\mathit{iN}})} &=& {{{{\mathrm{ext}}}_{32, 64}^{{\mathit{sx}}}}}{({\mathit{iN}})} \\ -{\mathsf{convert}}{{{}_{\mathsf{i{\scriptstyle 64}}, \mathsf{i{\scriptstyle 32}}}^{{{\mathit{sx}}^?}}}}{({\mathit{iN}})} &=& {{{\mathrm{wrap}}}_{64, 32}}{({\mathit{iN}})} \\ -{\mathsf{convert}}{{{}_{{\mathsf{f}}{N}, {\mathsf{i}}{N}}^{{\mathit{sx}}}}}{({\mathit{fN}})} &=& {{{{\mathrm{trunc}}}_{{|{\mathsf{f}}{N}|}, {|{\mathsf{i}}{N}|}}^{{\mathit{sx}}}}}{({\mathit{fN}})} \\ -{\mathsf{convert\_sat}}{{{}_{{\mathsf{f}}{N}, {\mathsf{i}}{N}}^{{\mathit{sx}}}}}{({\mathit{fN}})} &=& {{{{\mathrm{trunc\_sat}}}_{{|{\mathsf{f}}{N}|}, {|{\mathsf{i}}{N}|}}^{{\mathit{sx}}}}}{({\mathit{fN}})} \\ -{\mathsf{convert}}{{{}_{\mathsf{f{\scriptstyle 32}}, \mathsf{f{\scriptstyle 64}}}^{{{\mathit{sx}}^?}}}}{({\mathit{fN}})} &=& {{{\mathrm{promote}}}_{32, 64}}{({\mathit{fN}})} \\ -{\mathsf{convert}}{{{}_{\mathsf{f{\scriptstyle 64}}, \mathsf{f{\scriptstyle 32}}}^{{{\mathit{sx}}^?}}}}{({\mathit{fN}})} &=& {{{\mathrm{demote}}}_{64, 32}}{({\mathit{fN}})} \\ -{\mathsf{convert}}{{{}_{{\mathsf{i}}{N}, {\mathsf{f}}{N}}^{{\mathit{sx}}}}}{({\mathit{iN}})} &=& {{{{\mathrm{convert}}}_{{|{\mathsf{i}}{N}|}, {|{\mathsf{f}}{N}|}}^{{\mathit{sx}}}}}{({\mathit{iN}})} \\ -{\mathsf{reinterpret}}{{{}_{{\mathsf{i}}{N}, {\mathsf{f}}{N}}^{{{\mathit{sx}}^?}}}}{({\mathit{iN}})} &=& {{{\mathrm{reinterpret}}}_{{\mathsf{i}}{N}, {\mathsf{f}}{N}}}{{\mathit{iN}}} - &\qquad \mbox{if}~{|{\mathsf{i}}{N}|} = {|{\mathsf{f}}{N}|} \\ -{\mathsf{reinterpret}}{{{}_{{\mathsf{f}}{N}, {\mathsf{i}}{N}}^{{{\mathit{sx}}^?}}}}{({\mathit{fN}})} &=& {{{\mathrm{reinterpret}}}_{{\mathsf{f}}{N}, {\mathsf{i}}{N}}}{{\mathit{fN}}} - &\qquad \mbox{if}~{|{\mathsf{i}}{N}|} = {|{\mathsf{f}}{N}|} \\ +{{\mathsf{extend}}{\mathsf{\_}}{{\mathit{sx}}}}{{}_{{{\mathsf{i}}{N}}_1, {{\mathsf{i}}{N}}_2}}{({\mathit{iN}}_1)} &=& {{{{\mathrm{ext}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{iN}}_1)} \\ +{\mathsf{wrap}}{{}_{{{\mathsf{i}}{N}}_1, {{\mathsf{i}}{N}}_2}}{({\mathit{iN}}_1)} &=& {{{\mathrm{wrap}}}_{N_1, N_2}}{({\mathit{iN}}_1)} \\ +{{\mathsf{trunc}}{\mathsf{\_}}{{\mathit{sx}}}}{{}_{{{\mathsf{f}}{N}}_1, {{\mathsf{i}}{N}}_2}}{({\mathit{fN}}_1)} &=& {{{{\mathrm{trunc}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{fN}}_1)} \\ +{{\mathsf{trunc\_sat}}{\mathsf{\_}}{{\mathit{sx}}}}{{}_{{{\mathsf{f}}{N}}_1, {{\mathsf{i}}{N}}_2}}{({\mathit{fN}}_1)} &=& {{{{\mathrm{trunc\_sat}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{fN}}_1)} \\ +{{\mathsf{convert}}{\mathsf{\_}}{{\mathit{sx}}}}{{}_{{{\mathsf{i}}{N}}_1, {{\mathsf{f}}{N}}_2}}{({\mathit{iN}}_1)} &=& {{{{\mathrm{convert}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{iN}}_1)} \\ +{\mathsf{promote}}{{}_{{{\mathsf{f}}{N}}_1, {{\mathsf{f}}{N}}_2}}{({\mathit{fN}}_1)} &=& {{{\mathrm{promote}}}_{N_1, N_2}}{({\mathit{fN}}_1)} \\ +{\mathsf{demote}}{{}_{{{\mathsf{f}}{N}}_1, {{\mathsf{f}}{N}}_2}}{({\mathit{fN}}_1)} &=& {{{\mathrm{demote}}}_{N_1, N_2}}{({\mathit{fN}}_1)} \\ +{\mathsf{reinterpret}}{{}_{{{\mathsf{i}}{N}}_1, {{\mathsf{f}}{N}}_2}}{({\mathit{iN}}_1)} &=& {{{\mathrm{reinterpret}}}_{{{\mathsf{i}}{N}}_1, {{\mathsf{f}}{N}}_2}}{{\mathit{iN}}_1} + &\qquad \mbox{if}~N_1 = N_2 \\ +{\mathsf{reinterpret}}{{}_{{{\mathsf{f}}{N}}_1, {{\mathsf{i}}{N}}_2}}{({\mathit{fN}}_1)} &=& {{{\mathrm{reinterpret}}}_{{{\mathsf{f}}{N}}_1, {{\mathsf{i}}{N}}_2}}{{\mathit{fN}}_1} + &\qquad \mbox{if}~N_1 = N_2 \\ \end{array} $$ @@ -5917,26 +5926,12 @@ C \vdash {\mathit{nt}} {.} {\mathit{relop}}_{\mathit{nt}} : {\mathit{nt}}~{\math \end{array} $$ -\vspace{1ex} - -$$ -\begin{array}{@{}c@{}}\displaystyle -\frac{ -{|{\mathit{nt}}_1|} = {|{\mathit{nt}}_2|} -}{ -C \vdash {\mathit{nt}}_1 {.} {\mathsf{reinterpret}}{\mathsf{\_}}{{\mathit{nt}}_2} : {\mathit{nt}}_2 \rightarrow {\mathit{nt}}_1 -} \, {[\textsc{\scriptsize T{-}cvtop{-}reinterpret}]} -\qquad -\end{array} -$$ - $$ \begin{array}{@{}c@{}}\displaystyle \frac{ -{{\mathit{sx}}^?} = \epsilon \Leftrightarrow {\mathit{nt}}_1 = {{\mathsf{i}}{N}}_1 \land {\mathit{nt}}_2 = {{\mathsf{i}}{N}}_2 \land {|{\mathit{nt}}_1|} > {|{\mathit{nt}}_2|} \lor {\mathit{nt}}_1 = {{\mathsf{f}}{N}}_1 \land {\mathit{nt}}_2 = {{\mathsf{f}}{N}}_2 }{ -C \vdash {\mathit{nt}}_1 {.} {\mathsf{convert}}{\mathsf{\_}}{{\mathit{nt}}_2}{\mathsf{\_}}{{{\mathit{sx}}^?}} : {\mathit{nt}}_2 \rightarrow {\mathit{nt}}_1 -} \, {[\textsc{\scriptsize T{-}cvtop{-}convert}]} +C \vdash {\mathit{nt}}_1 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{nt}}_2} : {\mathit{nt}}_2 \rightarrow {\mathit{nt}}_1 +} \, {[\textsc{\scriptsize T{-}cvtop}]} \qquad \end{array} $$ @@ -7960,10 +7955,10 @@ $$ $$ \begin{array}{@{}l@{}rcl@{}l@{}} -{[\textsc{\scriptsize E{-}cvtop{-}val}]} \quad & ({\mathit{nt}}_1{.}\mathsf{const}~c_1)~({\mathit{nt}}_2 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{nt}}_1}{\mathsf{\_}}{{{\mathit{sx}}^?}}) &\hookrightarrow& ({\mathit{nt}}_2{.}\mathsf{const}~c) - &\qquad \mbox{if}~{{\mathit{cvtop}}}{{{}_{{\mathit{nt}}_1, {\mathit{nt}}_2}^{{{\mathit{sx}}^?}}}}{(c_1)} = c \\ -{[\textsc{\scriptsize E{-}cvtop{-}trap}]} \quad & ({\mathit{nt}}_1{.}\mathsf{const}~c_1)~({\mathit{nt}}_2 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{nt}}_1}{\mathsf{\_}}{{{\mathit{sx}}^?}}) &\hookrightarrow& \mathsf{trap} - &\qquad \mbox{if}~{{\mathit{cvtop}}}{{{}_{{\mathit{nt}}_1, {\mathit{nt}}_2}^{{{\mathit{sx}}^?}}}}{(c_1)} = \epsilon \\ +{[\textsc{\scriptsize E{-}cvtop{-}val}]} \quad & ({\mathit{nt}}_1{.}\mathsf{const}~c_1)~({\mathit{nt}}_2 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{nt}}_1}) &\hookrightarrow& ({\mathit{nt}}_2{.}\mathsf{const}~c) + &\qquad \mbox{if}~{{\mathit{cvtop}}}{{}_{{\mathit{nt}}_1, {\mathit{nt}}_2}}{(c_1)} = c \\ +{[\textsc{\scriptsize E{-}cvtop{-}trap}]} \quad & ({\mathit{nt}}_1{.}\mathsf{const}~c_1)~({\mathit{nt}}_2 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{nt}}_1}) &\hookrightarrow& \mathsf{trap} + &\qquad \mbox{if}~{{\mathit{cvtop}}}{{}_{{\mathit{nt}}_1, {\mathit{nt}}_2}}{(c_1)} = \epsilon \\ \end{array} $$ @@ -9487,39 +9482,39 @@ $$ $$ \begin{array}{@{}l@{}rrl@{}l@{}l@{}l@{}} & {\mathtt{instr}} &::=& \ldots \\ &&|& -\mathtt{0xA7} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}} \\ &&|& -\mathtt{0xA8} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xA9} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xAA} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xAB} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xAC} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xAD} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xAE} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xAF} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xB0} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xB1} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xB2} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xB3} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xB4} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xB5} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xB6} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& -\mathtt{0xB7} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xB8} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xB9} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xBA} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xBB} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {\mathsf{convert}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xA7} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{wrap}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}} \\ &&|& +\mathtt{0xA8} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {{\mathsf{trunc}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xA9} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {{\mathsf{trunc}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xAA} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {{\mathsf{trunc}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& +\mathtt{0xAB} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {{\mathsf{trunc}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& +\mathtt{0xAC} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{extend}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}} \\ &&|& +\mathtt{0xAD} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{extend}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}} \\ &&|& +\mathtt{0xAE} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{trunc}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xAF} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{trunc}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xB0} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{trunc}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& +\mathtt{0xB1} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{trunc}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& +\mathtt{0xB2} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {{\mathsf{convert}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}} \\ &&|& +\mathtt{0xB3} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {{\mathsf{convert}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}} \\ &&|& +\mathtt{0xB4} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {{\mathsf{convert}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}} \\ &&|& +\mathtt{0xB5} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {{\mathsf{convert}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}} \\ &&|& +\mathtt{0xB6} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {\mathsf{demote}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& +\mathtt{0xB7} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {{\mathsf{convert}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}} \\ &&|& +\mathtt{0xB8} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {{\mathsf{convert}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}} \\ &&|& +\mathtt{0xB9} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {{\mathsf{convert}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}} \\ &&|& +\mathtt{0xBA} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {{\mathsf{convert}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}} \\ &&|& +\mathtt{0xBB} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {\mathsf{promote}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& \mathtt{0xBC} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{reinterpret}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& \mathtt{0xBD} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{reinterpret}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& \mathtt{0xBE} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 32}} {.} {\mathsf{reinterpret}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 32}}} \\ &&|& \mathtt{0xBF} &\quad\Rightarrow&\quad \mathsf{f{\scriptstyle 64}} {.} {\mathsf{reinterpret}}{\mathsf{\_}}{\mathsf{i{\scriptstyle 64}}} \\ &&|& -\mathtt{0xFC}~~0{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert\_sat}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xFC}~~1{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert\_sat}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xFC}~~2{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert\_sat}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xFC}~~3{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {\mathsf{convert\_sat}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xFC}~~4{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert\_sat}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xFC}~~5{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert\_sat}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& -\mathtt{0xFC}~~6{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert\_sat}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{s}} \\ &&|& -\mathtt{0xFC}~~7{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {\mathsf{convert\_sat}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}}{\mathsf{\_}}{\mathsf{u}} \\ &&|& +\mathtt{0xFC}~~0{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {{\mathsf{trunc\_sat}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xFC}~~1{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {{\mathsf{trunc\_sat}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xFC}~~2{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {{\mathsf{trunc\_sat}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& +\mathtt{0xFC}~~3{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 32}} {.} {{\mathsf{trunc\_sat}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& +\mathtt{0xFC}~~4{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{trunc\_sat}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xFC}~~5{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{trunc\_sat}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 32}}} \\ &&|& +\mathtt{0xFC}~~6{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{trunc\_sat}}{\mathsf{\_}}{\mathsf{s}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& +\mathtt{0xFC}~~7{:}{\mathtt{u32}} &\quad\Rightarrow&\quad \mathsf{i{\scriptstyle 64}} {.} {{\mathsf{trunc\_sat}}{\mathsf{\_}}{\mathsf{u}}}{\mathsf{\_}}{\mathsf{f{\scriptstyle 64}}} \\ &&|& \ldots \\ \end{array} $$ diff --git a/spectec/test-middlend/TEST.md b/spectec/test-middlend/TEST.md index bd27e493bc..1eb0bd3287 100644 --- a/spectec/test-middlend/TEST.md +++ b/spectec/test-middlend/TEST.md @@ -782,12 +782,37 @@ syntax relop_(numtype : numtype) ;; 1-syntax.watsup -syntax cvtop_{nt_1 : numtype, nt_2 : numtype}(nt_1, nt_2) = - | CONVERT - | CONVERT_SAT{Inn : Inn, Fnn : Fnn} - -- if ((nt_1 = (Inn : Inn <: numtype)) /\ (nt_2 = (Fnn : Fnn <: numtype))) +syntax cvtop_(numtype_1 : numtype, numtype_2 : numtype) + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Inn_2 : Inn}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype)) = + | EXTEND{sx : sx}(sx : sx) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) < $sizenn2((Inn_2 : Inn <: numtype))) + | WRAP + -- if ($sizenn1((Inn_1 : Inn <: numtype)) > $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Fnn_2 : Fnn}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | CONVERT{sx : sx}(sx : sx) + | REINTERPRET + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Inn_2 : Inn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype)) = + | TRUNC{sx : sx}(sx : sx) + | TRUNC_SAT{sx : sx}(sx : sx) | REINTERPRET - -- if ($size(nt_1) = $size(nt_2)) + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) = $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | PROMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) < $sizenn2((Fnn_2 : Fnn <: numtype))) + | DEMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) > $sizenn2((Fnn_2 : Fnn <: numtype))) + ;; 1-syntax.watsup syntax ishape = @@ -1125,8 +1150,7 @@ syntax instr = | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx? : sx?}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx?{sx : sx} : sx?) - -- if (numtype_1 =/= numtype_2) + | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)) | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) @@ -1753,7 +1777,7 @@ def $free_instr(instr : instr) : free ;; 2-syntax-aux.watsup:359.1-359.62 def $free_instr{numtype : numtype, relop : relop_(numtype)}(RELOP_instr(numtype, relop)) = $free_numtype(numtype) ;; 2-syntax-aux.watsup:360.1-361.55 - def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1), sx? : sx?}(CVTOP_instr(numtype_1, numtype_2, cvtop, sx?{sx : sx})) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) + def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1)}(CVTOP_instr(numtype_1, numtype_2, cvtop)) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) ;; 2-syntax-aux.watsup:363.1-363.64 def $free_instr{vectype : vectype, veclit : vec_(vectype)}(VCONST_instr(vectype, veclit)) = $free_vectype(vectype) ;; 2-syntax-aux.watsup:364.1-364.64 @@ -2582,27 +2606,27 @@ def $trunc(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) def $trunc_sat(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) ;; 3-numerics.watsup -def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), sx?, num_ : num_(numtype_1)) : num_(numtype_2)* +def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), num_ : num_(numtype_1)) : num_(numtype_2)* ;; 3-numerics.watsup - def $cvtop{sx : sx, iN : num_(I32_numtype)}(I32_numtype, I64_numtype, CONVERT_cvtop_, ?(sx), iN) = [$ext(32, 64, sx, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), EXTEND_cvtop_(sx), iN_1) = [$ext($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, iN : num_(I64_numtype)}(I64_numtype, I32_numtype, CONVERT_cvtop_, sx?{sx : sx}, iN) = [$wrap(64, 32, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), WRAP_cvtop_, iN_1) = [$wrap($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), iN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_cvtop_, ?(sx), fN) = [$trunc($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_cvtop_(sx), fN_1) = [$trunc($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_SAT_cvtop_, ?(sx), fN) = [$trunc_sat($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_SAT_cvtop_(sx), fN_1) = [$trunc_sat($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F32_numtype)}(F32_numtype, F64_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$promote(32, 64, fN)] + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), CONVERT_cvtop_(sx), iN_1) = [$convert($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F64_numtype)}(F64_numtype, F32_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$demote(64, 32, fN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), PROMOTE_cvtop_, fN_1) = [$promote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx : sx, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), CONVERT_cvtop_, ?(sx), iN) = [$convert($size((Inn : Inn <: numtype)), $size((Fnn : Fnn <: numtype)), sx, iN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), DEMOTE_cvtop_, fN_1) = [$demote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx? : sx?, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, iN) = [$reinterpret((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), iN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), REINTERPRET_cvtop_, iN_1) = [$reinterpret((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), iN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx? : sx?, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, fN) = [$reinterpret((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), fN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, fN_1 : num_((Fnn_1 : Fnn <: numtype)), Inn_1 : Inn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), REINTERPRET_cvtop_, fN_1) = [$reinterpret((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), fN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup def $narrow(M : M, N : N, sx : sx, iN : iN(M)) : iN(N) @@ -4206,411 +4230,405 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->_%%`_instrtype(`%`_resulttype([(nt : numtype <: valtype) (nt : numtype <: valtype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:725.1-727.34 - rule cvtop-reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, REINTERPRET_cvtop_, ?()), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ($size(nt_1) = $size(nt_2)) - - ;; 6-typing.watsup:729.1-731.112 - rule cvtop-convert{C : context, nt_1 : numtype, nt_2 : numtype, sx? : sx?, Inn_1 : Inn, Inn_2 : Inn, Fnn_1 : Fnn, Fnn_2 : Fnn}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, CONVERT_cvtop_, sx?{sx : sx}), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ((sx?{sx : sx} = ?()) <=> ((((nt_1 = (Inn_1 : Inn <: numtype)) /\ (nt_2 = (Inn_2 : Inn <: numtype))) /\ ($size(nt_1) > $size(nt_2))) \/ ((nt_1 = (Fnn_1 : Fnn <: numtype)) /\ (nt_2 = (Fnn_2 : Fnn <: numtype))))) + ;; 6-typing.watsup:723.1-724.44 + rule cvtop{C : context, nt_1 : numtype, nt_2 : numtype, cvtop : cvtop_(nt_2, nt_1)}: + `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, cvtop), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - ;; 6-typing.watsup:736.1-738.31 + ;; 6-typing.watsup:729.1-731.31 rule ref.null{C : context, ht : heaptype}: `%|-%:%`(C, REF.NULL_instr(ht), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:740.1-743.20 + ;; 6-typing.watsup:733.1-736.20 rule ref.func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, REF.FUNC_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNCS_context[x!`%`_idx.0] = dt) -- if x <- C.REFS_context - ;; 6-typing.watsup:745.1-746.34 + ;; 6-typing.watsup:738.1-739.34 rule ref.i31{C : context}: `%|-%:%`(C, REF.I31_instr, `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), I31_heaptype)]))) - ;; 6-typing.watsup:748.1-750.31 + ;; 6-typing.watsup:741.1-743.31 rule ref.is_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([I32_valtype]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:752.1-754.31 + ;; 6-typing.watsup:745.1-747.31 rule ref.as_non_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:756.1-757.51 + ;; 6-typing.watsup:749.1-750.51 rule ref.eq{C : context}: `%|-%:%`(C, REF.EQ_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype) REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:759.1-763.33 + ;; 6-typing.watsup:752.1-756.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.TEST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([I32_valtype]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:765.1-769.33 + ;; 6-typing.watsup:758.1-762.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.CAST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:774.1-775.42 + ;; 6-typing.watsup:767.1-768.42 rule i31.get{C : context, sx : sx}: `%|-%:%`(C, I31.GET_instr(sx), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), I31_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:780.1-782.44 + ;; 6-typing.watsup:773.1-775.44 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: `%|-%:%`(C, STRUCT.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)*{zt : storagetype}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) - ;; 6-typing.watsup:784.1-787.40 + ;; 6-typing.watsup:777.1-780.40 rule struct.new_default{C : context, x : idx, mut* : mut*, zt* : storagetype*, val* : val*}: `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) -- (if ($default_($unpack(zt)) = ?(val)))*{val : val, zt : storagetype} - ;; 6-typing.watsup:789.1-793.39 + ;; 6-typing.watsup:782.1-786.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype))]), [], `%`_resulttype([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:795.1-798.24 + ;; 6-typing.watsup:788.1-791.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(`MUT%?`_mut(?(())), zt)) - ;; 6-typing.watsup:803.1-805.42 + ;; 6-typing.watsup:796.1-798.42 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype([$unpack(zt) I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:807.1-810.37 + ;; 6-typing.watsup:800.1-803.37 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ($default_($unpack(zt)) = ?(val)) - ;; 6-typing.watsup:812.1-814.42 + ;; 6-typing.watsup:805.1-807.42 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, `%`_u32(n)), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)^n{}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:816.1-819.40 + ;; 6-typing.watsup:809.1-812.40 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt) - ;; 6-typing.watsup:821.1-825.24 + ;; 6-typing.watsup:814.1-818.24 rule array.new_data{C : context, x : idx, y : idx, mut : mut, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:827.1-830.39 + ;; 6-typing.watsup:820.1-823.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), [], `%`_resulttype([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:832.1-834.42 + ;; 6-typing.watsup:825.1-827.42 rule array.set{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:836.1-838.42 + ;; 6-typing.watsup:829.1-831.42 rule array.len{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.LEN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ARRAY_heaptype)]), [], `%`_resulttype([I32_valtype]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:840.1-842.42 + ;; 6-typing.watsup:833.1-835.42 rule array.fill{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:844.1-848.40 + ;; 6-typing.watsup:837.1-841.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`_nul(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x_1!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt_1))) -- Expand: `%~~%`(C.TYPES_context[x_2!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:850.1-853.44 + ;; 6-typing.watsup:843.1-846.44 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt) - ;; 6-typing.watsup:855.1-859.24 + ;; 6-typing.watsup:848.1-852.24 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:864.1-865.62 + ;; 6-typing.watsup:857.1-858.62 rule extern.convert_any{C : context, nul : nul}: `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, ANY_heaptype)]), [], `%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]))) - ;; 6-typing.watsup:867.1-868.62 + ;; 6-typing.watsup:860.1-861.62 rule any.convert_extern{C : context, nul : nul}: `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]), [], `%`_resulttype([REF_valtype(nul, ANY_heaptype)]))) - ;; 6-typing.watsup:873.1-874.35 + ;; 6-typing.watsup:866.1-867.35 rule vconst{C : context, c : vec_(V128_Vnn)}: `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:876.1-877.41 + ;; 6-typing.watsup:869.1-870.41 rule vvunop{C : context, vvunop : vvunop}: `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:879.1-880.48 + ;; 6-typing.watsup:872.1-873.48 rule vvbinop{C : context, vvbinop : vvbinop}: `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:882.1-883.55 + ;; 6-typing.watsup:875.1-876.55 rule vvternop{C : context, vvternop : vvternop}: `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:885.1-886.44 + ;; 6-typing.watsup:878.1-879.44 rule vvtestop{C : context, vvtestop : vvtestop}: `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:888.1-889.37 + ;; 6-typing.watsup:881.1-882.37 rule vunop{C : context, sh : shape, vunop : vunop_(sh)}: `%|-%:%`(C, VUNOP_instr(sh, vunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:891.1-892.44 + ;; 6-typing.watsup:884.1-885.44 rule vbinop{C : context, sh : shape, vbinop : vbinop_(sh)}: `%|-%:%`(C, VBINOP_instr(sh, vbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:894.1-895.40 + ;; 6-typing.watsup:887.1-888.40 rule vtestop{C : context, sh : shape, vtestop : vtestop_(sh)}: `%|-%:%`(C, VTESTOP_instr(sh, vtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:897.1-898.44 + ;; 6-typing.watsup:890.1-891.44 rule vrelop{C : context, sh : shape, vrelop : vrelop_(sh)}: `%|-%:%`(C, VRELOP_instr(sh, vrelop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:900.1-901.47 + ;; 6-typing.watsup:893.1-894.47 rule vshiftop{C : context, sh : ishape, vshiftop : vshiftop_(sh)}: `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype I32_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:903.1-904.33 + ;; 6-typing.watsup:896.1-897.33 rule vbitmask{C : context, sh : ishape}: `%|-%:%`(C, VBITMASK_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:906.1-907.39 + ;; 6-typing.watsup:899.1-900.39 rule vswizzle{C : context, sh : ishape}: `%|-%:%`(C, VSWIZZLE_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:909.1-911.29 + ;; 6-typing.watsup:902.1-904.29 rule vshuffle{C : context, sh : ishape, i* : nat*}: `%|-%:%`(C, VSHUFFLE_instr(sh, `%`_laneidx(i)*{i : nat}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- (if (i < (2 * $dim((sh : ishape <: shape))!`%`_dim.0)))*{i : nat} - ;; 6-typing.watsup:913.1-914.44 + ;; 6-typing.watsup:906.1-907.44 rule vsplat{C : context, sh : shape}: `%|-%:%`(C, VSPLAT_instr(sh), `%->_%%`_instrtype(`%`_resulttype([($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:917.1-919.21 + ;; 6-typing.watsup:910.1-912.21 rule vextract_lane{C : context, sh : shape, sx? : sx?, i : nat}: `%|-%:%`(C, VEXTRACT_LANE_instr(sh, sx?{sx : sx}, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([($unpackshape(sh) : numtype <: valtype)]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:921.1-923.21 + ;; 6-typing.watsup:914.1-916.21 rule vreplace_lane{C : context, sh : shape, i : nat}: `%|-%:%`(C, VREPLACE_LANE_instr(sh, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype ($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:925.1-926.53 + ;; 6-typing.watsup:918.1-919.53 rule vextunop{C : context, sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTUNOP_instr(sh_1, sh_2, vextunop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:928.1-929.60 + ;; 6-typing.watsup:921.1-922.60 rule vextbinop{C : context, sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTBINOP_instr(sh_1, sh_2, vextbinop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:931.1-932.48 + ;; 6-typing.watsup:924.1-925.48 rule vnarrow{C : context, sh_1 : ishape, sh_2 : ishape, sx : sx}: `%|-%:%`(C, VNARROW_instr(sh_1, sh_2, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:934.1-935.62 + ;; 6-typing.watsup:927.1-928.62 rule vcvtop{C : context, sh_1 : shape, sh_2 : shape, vcvtop : vcvtop_(sh_2, sh_1), half? : half_(sh_2, sh_1)?, sx? : sx?, zero? : zero_(sh_2, sh_1)?}: `%|-%:%`(C, VCVTOP_instr(sh_1, sh_2, vcvtop, half?{half : half_(sh_2, sh_1)}, sx?{sx : sx}, zero?{zero : zero_(sh_2, sh_1)}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:940.1-942.28 + ;; 6-typing.watsup:933.1-935.28 rule local.get{C : context, x : idx, t : valtype}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(SET_init, t)) - ;; 6-typing.watsup:944.1-946.29 + ;; 6-typing.watsup:937.1-939.29 rule local.set{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:948.1-950.29 + ;; 6-typing.watsup:941.1-943.29 rule local.tee{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([t]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:955.1-957.29 + ;; 6-typing.watsup:948.1-950.29 rule global.get{C : context, x : idx, t : valtype, mut : mut}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; 6-typing.watsup:959.1-961.29 + ;; 6-typing.watsup:952.1-954.29 rule global.set{C : context, x : idx, t : valtype}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [], `%`_resulttype([]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(`MUT%?`_mut(?(())), t)) - ;; 6-typing.watsup:966.1-968.29 + ;; 6-typing.watsup:959.1-961.29 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:970.1-972.29 + ;; 6-typing.watsup:963.1-965.29 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype)]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:974.1-976.29 + ;; 6-typing.watsup:967.1-969.29 rule table.size{C : context, x : idx, lim : limits, rt : reftype}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:978.1-980.29 + ;; 6-typing.watsup:971.1-973.29 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([(rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:982.1-984.29 + ;; 6-typing.watsup:975.1-977.29 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:986.1-990.36 + ;; 6-typing.watsup:979.1-983.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x_1!`%`_idx.0] = `%%`_tabletype(lim_1, rt_1)) -- if (C.TABLES_context[x_2!`%`_idx.0] = `%%`_tabletype(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:992.1-996.36 + ;; 6-typing.watsup:985.1-989.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt_1)) -- if (C.ELEMS_context[y!`%`_idx.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:998.1-1000.24 + ;; 6-typing.watsup:991.1-993.24 rule elem.drop{C : context, x : idx, rt : reftype}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (C.ELEMS_context[x!`%`_idx.0] = rt) - ;; 6-typing.watsup:1005.1-1007.23 + ;; 6-typing.watsup:998.1-1000.23 rule memory.size{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1009.1-1011.23 + ;; 6-typing.watsup:1002.1-1004.23 rule memory.grow{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1013.1-1015.23 + ;; 6-typing.watsup:1006.1-1008.23 rule memory.fill{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1017.1-1020.27 + ;; 6-typing.watsup:1010.1-1013.27 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x_1!`%`_idx.0] = mt_1) -- if (C.MEMS_context[x_2!`%`_idx.0] = mt_2) - ;; 6-typing.watsup:1022.1-1025.24 + ;; 6-typing.watsup:1015.1-1018.24 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1027.1-1029.24 + ;; 6-typing.watsup:1020.1-1022.24 rule data.drop{C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (C.DATAS_context[x!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1040.1-1043.43 + ;; 6-typing.watsup:1033.1-1036.43 rule load-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(nt : numtype <: valtype)]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1045.1-1048.35 + ;; 6-typing.watsup:1038.1-1041.35 rule load-pack{C : context, Inn : Inn, M : M, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr((Inn : Inn <: numtype), ?(`%%`_loadop_(`%`_sz(M), sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(Inn : Inn <: valtype)]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1059.1-1062.43 + ;; 6-typing.watsup:1052.1-1055.43 rule store-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (nt : numtype <: valtype)]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1064.1-1067.35 + ;; 6-typing.watsup:1057.1-1060.35 rule store-pack{C : context, Inn : Inn, M : M, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr((Inn : Inn <: numtype), ?(`%`_sz(M)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (Inn : Inn <: valtype)]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1069.1-1072.46 + ;; 6-typing.watsup:1062.1-1065.46 rule vload-val{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1074.1-1077.39 + ;; 6-typing.watsup:1067.1-1070.39 rule vload-pack{C : context, M : M, N : N, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(`SHAPE%X%%`_vloadop_(`%`_sz(M), N, sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ((M / 8) * N)) - ;; 6-typing.watsup:1079.1-1082.35 + ;; 6-typing.watsup:1072.1-1075.35 rule vload-splat{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(SPLAT_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1084.1-1087.35 + ;; 6-typing.watsup:1077.1-1080.35 rule vload-zero{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(ZERO_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1089.1-1093.21 + ;; 6-typing.watsup:1082.1-1086.21 rule vload_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VLOAD_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) -- if (i < (128 / N)) - ;; 6-typing.watsup:1095.1-1098.46 + ;; 6-typing.watsup:1088.1-1091.46 rule vstore{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VSTORE_instr(V128_vectype, x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1100.1-1104.21 + ;; 6-typing.watsup:1093.1-1097.21 rule vstore_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VSTORE_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) @@ -4873,13 +4891,13 @@ relation Export_ok: `%|-%:%%`(context, export, name, externtype) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1296.1-1296.100 +;; 6-typing.watsup:1289.1-1289.100 relation Globals_ok: `%|-%:%`(context, global*, globaltype*) - ;; 6-typing.watsup:1338.1-1339.17 + ;; 6-typing.watsup:1331.1-1332.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1341.1-1344.54 + ;; 6-typing.watsup:1334.1-1337.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) @@ -4889,13 +4907,13 @@ relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1295.1-1295.98 +;; 6-typing.watsup:1288.1-1288.98 relation Types_ok: `%|-%:%`(context, type*, deftype*) - ;; 6-typing.watsup:1330.1-1331.17 + ;; 6-typing.watsup:1323.1-1324.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1333.1-1336.49 + ;; 6-typing.watsup:1326.1-1329.49 rule cons{C : context, type_1 : type, type* : type*, dt_1* : deftype*, dt* : deftype*}: `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{dt_1 : deftype} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%`(C, type_1, dt_1*{dt_1 : deftype}) @@ -5191,14 +5209,14 @@ relation Step_pure: `%~>%`(instr*, instr*) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup - rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?, c : num_(nt_2)}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [CONST_instr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) + rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), c : num_(nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [CONST_instr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = [c]) ;; 8-reduction.watsup - rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [TRAP_instr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) + rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [TRAP_instr]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -7202,12 +7220,37 @@ syntax relop_(numtype : numtype) ;; 1-syntax.watsup -syntax cvtop_{nt_1 : numtype, nt_2 : numtype}(nt_1, nt_2) = - | CONVERT - | CONVERT_SAT{Inn : Inn, Fnn : Fnn} - -- if ((nt_1 = (Inn : Inn <: numtype)) /\ (nt_2 = (Fnn : Fnn <: numtype))) +syntax cvtop_(numtype_1 : numtype, numtype_2 : numtype) + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Inn_2 : Inn}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype)) = + | EXTEND{sx : sx}(sx : sx) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) < $sizenn2((Inn_2 : Inn <: numtype))) + | WRAP + -- if ($sizenn1((Inn_1 : Inn <: numtype)) > $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Fnn_2 : Fnn}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | CONVERT{sx : sx}(sx : sx) | REINTERPRET - -- if ($size(nt_1) = $size(nt_2)) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Inn_2 : Inn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype)) = + | TRUNC{sx : sx}(sx : sx) + | TRUNC_SAT{sx : sx}(sx : sx) + | REINTERPRET + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) = $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | PROMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) < $sizenn2((Fnn_2 : Fnn <: numtype))) + | DEMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) > $sizenn2((Fnn_2 : Fnn <: numtype))) + ;; 1-syntax.watsup syntax ishape = @@ -7545,8 +7588,7 @@ syntax instr = | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx? : sx?}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx?{sx : sx} : sx?) - -- if (numtype_1 =/= numtype_2) + | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)) | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) @@ -8176,7 +8218,7 @@ def $free_instr(instr : instr) : free ;; 2-syntax-aux.watsup:359.1-359.62 def $free_instr{numtype : numtype, relop : relop_(numtype)}(RELOP_instr(numtype, relop)) = $free_numtype(numtype) ;; 2-syntax-aux.watsup:360.1-361.55 - def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1), sx? : sx?}(CVTOP_instr(numtype_1, numtype_2, cvtop, sx?{sx : sx})) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) + def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1)}(CVTOP_instr(numtype_1, numtype_2, cvtop)) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) ;; 2-syntax-aux.watsup:363.1-363.64 def $free_instr{vectype : vectype, veclit : vec_(vectype)}(VCONST_instr(vectype, veclit)) = $free_vectype(vectype) ;; 2-syntax-aux.watsup:364.1-364.64 @@ -9005,27 +9047,27 @@ def $trunc(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) def $trunc_sat(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) ;; 3-numerics.watsup -def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), sx?, num_ : num_(numtype_1)) : num_(numtype_2)* +def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), num_ : num_(numtype_1)) : num_(numtype_2)* ;; 3-numerics.watsup - def $cvtop{sx : sx, iN : num_(I32_numtype)}(I32_numtype, I64_numtype, CONVERT_cvtop_, ?(sx), iN) = [$ext(32, 64, sx, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), EXTEND_cvtop_(sx), iN_1) = [$ext($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, iN : num_(I64_numtype)}(I64_numtype, I32_numtype, CONVERT_cvtop_, sx?{sx : sx}, iN) = [$wrap(64, 32, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), WRAP_cvtop_, iN_1) = [$wrap($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), iN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_cvtop_, ?(sx), fN) = [$trunc($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_cvtop_(sx), fN_1) = [$trunc($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_SAT_cvtop_, ?(sx), fN) = [$trunc_sat($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_SAT_cvtop_(sx), fN_1) = [$trunc_sat($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F32_numtype)}(F32_numtype, F64_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$promote(32, 64, fN)] + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), CONVERT_cvtop_(sx), iN_1) = [$convert($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F64_numtype)}(F64_numtype, F32_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$demote(64, 32, fN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), PROMOTE_cvtop_, fN_1) = [$promote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx : sx, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), CONVERT_cvtop_, ?(sx), iN) = [$convert($size((Inn : Inn <: numtype)), $size((Fnn : Fnn <: numtype)), sx, iN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), DEMOTE_cvtop_, fN_1) = [$demote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx? : sx?, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, iN) = [$reinterpret((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), iN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), REINTERPRET_cvtop_, iN_1) = [$reinterpret((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), iN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx? : sx?, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, fN) = [$reinterpret((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), fN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, fN_1 : num_((Fnn_1 : Fnn <: numtype)), Inn_1 : Inn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), REINTERPRET_cvtop_, fN_1) = [$reinterpret((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), fN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup def $narrow(M : M, N : N, sx : sx, iN : iN(M)) : iN(N) @@ -10631,411 +10673,405 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->_%%`_instrtype(`%`_resulttype([(nt : numtype <: valtype) (nt : numtype <: valtype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:725.1-727.34 - rule cvtop-reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, REINTERPRET_cvtop_, ?()), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ($size(nt_1) = $size(nt_2)) + ;; 6-typing.watsup:723.1-724.44 + rule cvtop{C : context, nt_1 : numtype, nt_2 : numtype, cvtop : cvtop_(nt_2, nt_1)}: + `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, cvtop), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - ;; 6-typing.watsup:729.1-731.112 - rule cvtop-convert{C : context, nt_1 : numtype, nt_2 : numtype, sx? : sx?, Inn_1 : Inn, Inn_2 : Inn, Fnn_1 : Fnn, Fnn_2 : Fnn}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, CONVERT_cvtop_, sx?{sx : sx}), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ((sx?{sx : sx} = ?()) <=> ((((nt_1 = (Inn_1 : Inn <: numtype)) /\ (nt_2 = (Inn_2 : Inn <: numtype))) /\ ($size(nt_1) > $size(nt_2))) \/ ((nt_1 = (Fnn_1 : Fnn <: numtype)) /\ (nt_2 = (Fnn_2 : Fnn <: numtype))))) - - ;; 6-typing.watsup:736.1-738.31 + ;; 6-typing.watsup:729.1-731.31 rule ref.null{C : context, ht : heaptype}: `%|-%:%`(C, REF.NULL_instr(ht), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:740.1-743.20 + ;; 6-typing.watsup:733.1-736.20 rule ref.func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, REF.FUNC_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNCS_context[x!`%`_idx.0] = dt) -- if x <- C.REFS_context - ;; 6-typing.watsup:745.1-746.34 + ;; 6-typing.watsup:738.1-739.34 rule ref.i31{C : context}: `%|-%:%`(C, REF.I31_instr, `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), I31_heaptype)]))) - ;; 6-typing.watsup:748.1-750.31 + ;; 6-typing.watsup:741.1-743.31 rule ref.is_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([I32_valtype]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:752.1-754.31 + ;; 6-typing.watsup:745.1-747.31 rule ref.as_non_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:756.1-757.51 + ;; 6-typing.watsup:749.1-750.51 rule ref.eq{C : context}: `%|-%:%`(C, REF.EQ_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype) REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:759.1-763.33 + ;; 6-typing.watsup:752.1-756.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.TEST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([I32_valtype]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:765.1-769.33 + ;; 6-typing.watsup:758.1-762.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.CAST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:774.1-775.42 + ;; 6-typing.watsup:767.1-768.42 rule i31.get{C : context, sx : sx}: `%|-%:%`(C, I31.GET_instr(sx), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), I31_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:780.1-782.44 + ;; 6-typing.watsup:773.1-775.44 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: `%|-%:%`(C, STRUCT.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)*{zt : storagetype}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) - ;; 6-typing.watsup:784.1-787.40 + ;; 6-typing.watsup:777.1-780.40 rule struct.new_default{C : context, x : idx, mut* : mut*, zt* : storagetype*, val* : val*}: `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) -- (if ($default_($unpack(zt)) = ?(val)))*{val : val, zt : storagetype} - ;; 6-typing.watsup:789.1-793.39 + ;; 6-typing.watsup:782.1-786.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype))]), [], `%`_resulttype([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:795.1-798.24 + ;; 6-typing.watsup:788.1-791.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(`MUT%?`_mut(?(())), zt)) - ;; 6-typing.watsup:803.1-805.42 + ;; 6-typing.watsup:796.1-798.42 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype([$unpack(zt) I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:807.1-810.37 + ;; 6-typing.watsup:800.1-803.37 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ($default_($unpack(zt)) = ?(val)) - ;; 6-typing.watsup:812.1-814.42 + ;; 6-typing.watsup:805.1-807.42 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, `%`_u32(n)), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)^n{}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:816.1-819.40 + ;; 6-typing.watsup:809.1-812.40 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt) - ;; 6-typing.watsup:821.1-825.24 + ;; 6-typing.watsup:814.1-818.24 rule array.new_data{C : context, x : idx, y : idx, mut : mut, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:827.1-830.39 + ;; 6-typing.watsup:820.1-823.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), [], `%`_resulttype([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:832.1-834.42 + ;; 6-typing.watsup:825.1-827.42 rule array.set{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:836.1-838.42 + ;; 6-typing.watsup:829.1-831.42 rule array.len{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.LEN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ARRAY_heaptype)]), [], `%`_resulttype([I32_valtype]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:840.1-842.42 + ;; 6-typing.watsup:833.1-835.42 rule array.fill{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:844.1-848.40 + ;; 6-typing.watsup:837.1-841.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`_nul(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x_1!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt_1))) -- Expand: `%~~%`(C.TYPES_context[x_2!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:850.1-853.44 + ;; 6-typing.watsup:843.1-846.44 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt) - ;; 6-typing.watsup:855.1-859.24 + ;; 6-typing.watsup:848.1-852.24 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:864.1-865.62 + ;; 6-typing.watsup:857.1-858.62 rule extern.convert_any{C : context, nul : nul}: `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, ANY_heaptype)]), [], `%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]))) - ;; 6-typing.watsup:867.1-868.62 + ;; 6-typing.watsup:860.1-861.62 rule any.convert_extern{C : context, nul : nul}: `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]), [], `%`_resulttype([REF_valtype(nul, ANY_heaptype)]))) - ;; 6-typing.watsup:873.1-874.35 + ;; 6-typing.watsup:866.1-867.35 rule vconst{C : context, c : vec_(V128_Vnn)}: `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:876.1-877.41 + ;; 6-typing.watsup:869.1-870.41 rule vvunop{C : context, vvunop : vvunop}: `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:879.1-880.48 + ;; 6-typing.watsup:872.1-873.48 rule vvbinop{C : context, vvbinop : vvbinop}: `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:882.1-883.55 + ;; 6-typing.watsup:875.1-876.55 rule vvternop{C : context, vvternop : vvternop}: `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:885.1-886.44 + ;; 6-typing.watsup:878.1-879.44 rule vvtestop{C : context, vvtestop : vvtestop}: `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:888.1-889.37 + ;; 6-typing.watsup:881.1-882.37 rule vunop{C : context, sh : shape, vunop : vunop_(sh)}: `%|-%:%`(C, VUNOP_instr(sh, vunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:891.1-892.44 + ;; 6-typing.watsup:884.1-885.44 rule vbinop{C : context, sh : shape, vbinop : vbinop_(sh)}: `%|-%:%`(C, VBINOP_instr(sh, vbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:894.1-895.40 + ;; 6-typing.watsup:887.1-888.40 rule vtestop{C : context, sh : shape, vtestop : vtestop_(sh)}: `%|-%:%`(C, VTESTOP_instr(sh, vtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:897.1-898.44 + ;; 6-typing.watsup:890.1-891.44 rule vrelop{C : context, sh : shape, vrelop : vrelop_(sh)}: `%|-%:%`(C, VRELOP_instr(sh, vrelop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:900.1-901.47 + ;; 6-typing.watsup:893.1-894.47 rule vshiftop{C : context, sh : ishape, vshiftop : vshiftop_(sh)}: `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype I32_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:903.1-904.33 + ;; 6-typing.watsup:896.1-897.33 rule vbitmask{C : context, sh : ishape}: `%|-%:%`(C, VBITMASK_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:906.1-907.39 + ;; 6-typing.watsup:899.1-900.39 rule vswizzle{C : context, sh : ishape}: `%|-%:%`(C, VSWIZZLE_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:909.1-911.29 + ;; 6-typing.watsup:902.1-904.29 rule vshuffle{C : context, sh : ishape, i* : nat*}: `%|-%:%`(C, VSHUFFLE_instr(sh, `%`_laneidx(i)*{i : nat}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- (if (i < (2 * $dim((sh : ishape <: shape))!`%`_dim.0)))*{i : nat} - ;; 6-typing.watsup:913.1-914.44 + ;; 6-typing.watsup:906.1-907.44 rule vsplat{C : context, sh : shape}: `%|-%:%`(C, VSPLAT_instr(sh), `%->_%%`_instrtype(`%`_resulttype([($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:917.1-919.21 + ;; 6-typing.watsup:910.1-912.21 rule vextract_lane{C : context, sh : shape, sx? : sx?, i : nat}: `%|-%:%`(C, VEXTRACT_LANE_instr(sh, sx?{sx : sx}, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([($unpackshape(sh) : numtype <: valtype)]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:921.1-923.21 + ;; 6-typing.watsup:914.1-916.21 rule vreplace_lane{C : context, sh : shape, i : nat}: `%|-%:%`(C, VREPLACE_LANE_instr(sh, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype ($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:925.1-926.53 + ;; 6-typing.watsup:918.1-919.53 rule vextunop{C : context, sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTUNOP_instr(sh_1, sh_2, vextunop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:928.1-929.60 + ;; 6-typing.watsup:921.1-922.60 rule vextbinop{C : context, sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTBINOP_instr(sh_1, sh_2, vextbinop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:931.1-932.48 + ;; 6-typing.watsup:924.1-925.48 rule vnarrow{C : context, sh_1 : ishape, sh_2 : ishape, sx : sx}: `%|-%:%`(C, VNARROW_instr(sh_1, sh_2, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:934.1-935.62 + ;; 6-typing.watsup:927.1-928.62 rule vcvtop{C : context, sh_1 : shape, sh_2 : shape, vcvtop : vcvtop_(sh_2, sh_1), half? : half_(sh_2, sh_1)?, sx? : sx?, zero? : zero_(sh_2, sh_1)?}: `%|-%:%`(C, VCVTOP_instr(sh_1, sh_2, vcvtop, half?{half : half_(sh_2, sh_1)}, sx?{sx : sx}, zero?{zero : zero_(sh_2, sh_1)}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:940.1-942.28 + ;; 6-typing.watsup:933.1-935.28 rule local.get{C : context, x : idx, t : valtype}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(SET_init, t)) - ;; 6-typing.watsup:944.1-946.29 + ;; 6-typing.watsup:937.1-939.29 rule local.set{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:948.1-950.29 + ;; 6-typing.watsup:941.1-943.29 rule local.tee{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([t]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:955.1-957.29 + ;; 6-typing.watsup:948.1-950.29 rule global.get{C : context, x : idx, t : valtype, mut : mut}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; 6-typing.watsup:959.1-961.29 + ;; 6-typing.watsup:952.1-954.29 rule global.set{C : context, x : idx, t : valtype}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [], `%`_resulttype([]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(`MUT%?`_mut(?(())), t)) - ;; 6-typing.watsup:966.1-968.29 + ;; 6-typing.watsup:959.1-961.29 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:970.1-972.29 + ;; 6-typing.watsup:963.1-965.29 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype)]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:974.1-976.29 + ;; 6-typing.watsup:967.1-969.29 rule table.size{C : context, x : idx, lim : limits, rt : reftype}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:978.1-980.29 + ;; 6-typing.watsup:971.1-973.29 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([(rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:982.1-984.29 + ;; 6-typing.watsup:975.1-977.29 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:986.1-990.36 + ;; 6-typing.watsup:979.1-983.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x_1!`%`_idx.0] = `%%`_tabletype(lim_1, rt_1)) -- if (C.TABLES_context[x_2!`%`_idx.0] = `%%`_tabletype(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:992.1-996.36 + ;; 6-typing.watsup:985.1-989.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt_1)) -- if (C.ELEMS_context[y!`%`_idx.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:998.1-1000.24 + ;; 6-typing.watsup:991.1-993.24 rule elem.drop{C : context, x : idx, rt : reftype}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (C.ELEMS_context[x!`%`_idx.0] = rt) - ;; 6-typing.watsup:1005.1-1007.23 + ;; 6-typing.watsup:998.1-1000.23 rule memory.size{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1009.1-1011.23 + ;; 6-typing.watsup:1002.1-1004.23 rule memory.grow{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1013.1-1015.23 + ;; 6-typing.watsup:1006.1-1008.23 rule memory.fill{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1017.1-1020.27 + ;; 6-typing.watsup:1010.1-1013.27 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x_1!`%`_idx.0] = mt_1) -- if (C.MEMS_context[x_2!`%`_idx.0] = mt_2) - ;; 6-typing.watsup:1022.1-1025.24 + ;; 6-typing.watsup:1015.1-1018.24 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1027.1-1029.24 + ;; 6-typing.watsup:1020.1-1022.24 rule data.drop{C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (C.DATAS_context[x!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1040.1-1043.43 + ;; 6-typing.watsup:1033.1-1036.43 rule load-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(nt : numtype <: valtype)]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1045.1-1048.35 + ;; 6-typing.watsup:1038.1-1041.35 rule load-pack{C : context, Inn : Inn, M : M, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr((Inn : Inn <: numtype), ?(`%%`_loadop_(`%`_sz(M), sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(Inn : Inn <: valtype)]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1059.1-1062.43 + ;; 6-typing.watsup:1052.1-1055.43 rule store-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (nt : numtype <: valtype)]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1064.1-1067.35 + ;; 6-typing.watsup:1057.1-1060.35 rule store-pack{C : context, Inn : Inn, M : M, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr((Inn : Inn <: numtype), ?(`%`_sz(M)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (Inn : Inn <: valtype)]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1069.1-1072.46 + ;; 6-typing.watsup:1062.1-1065.46 rule vload-val{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1074.1-1077.39 + ;; 6-typing.watsup:1067.1-1070.39 rule vload-pack{C : context, M : M, N : N, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(`SHAPE%X%%`_vloadop_(`%`_sz(M), N, sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ((M / 8) * N)) - ;; 6-typing.watsup:1079.1-1082.35 + ;; 6-typing.watsup:1072.1-1075.35 rule vload-splat{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(SPLAT_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1084.1-1087.35 + ;; 6-typing.watsup:1077.1-1080.35 rule vload-zero{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(ZERO_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1089.1-1093.21 + ;; 6-typing.watsup:1082.1-1086.21 rule vload_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VLOAD_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) -- if (i < (128 / N)) - ;; 6-typing.watsup:1095.1-1098.46 + ;; 6-typing.watsup:1088.1-1091.46 rule vstore{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VSTORE_instr(V128_vectype, x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1100.1-1104.21 + ;; 6-typing.watsup:1093.1-1097.21 rule vstore_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VSTORE_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) @@ -11298,13 +11334,13 @@ relation Export_ok: `%|-%:%%`(context, export, name, externtype) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1296.1-1296.100 +;; 6-typing.watsup:1289.1-1289.100 relation Globals_ok: `%|-%:%`(context, global*, globaltype*) - ;; 6-typing.watsup:1338.1-1339.17 + ;; 6-typing.watsup:1331.1-1332.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1341.1-1344.54 + ;; 6-typing.watsup:1334.1-1337.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) @@ -11314,13 +11350,13 @@ relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1295.1-1295.98 +;; 6-typing.watsup:1288.1-1288.98 relation Types_ok: `%|-%:%`(context, type*, deftype*) - ;; 6-typing.watsup:1330.1-1331.17 + ;; 6-typing.watsup:1323.1-1324.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1333.1-1336.49 + ;; 6-typing.watsup:1326.1-1329.49 rule cons{C : context, type_1 : type, type* : type*, dt_1* : deftype*, dt* : deftype*}: `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{dt_1 : deftype} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%`(C, type_1, dt_1*{dt_1 : deftype}) @@ -11616,14 +11652,14 @@ relation Step_pure: `%~>%`(instr*, instr*) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup - rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?, c : num_(nt_2)}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [CONST_instr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) + rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), c : num_(nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [CONST_instr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = [c]) ;; 8-reduction.watsup - rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [TRAP_instr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) + rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [TRAP_instr]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -13627,12 +13663,37 @@ syntax relop_(numtype : numtype) ;; 1-syntax.watsup -syntax cvtop_{nt_1 : numtype, nt_2 : numtype}(nt_1, nt_2) = - | CONVERT - | CONVERT_SAT{Inn : Inn, Fnn : Fnn} - -- if ((nt_1 = (Inn : Inn <: numtype)) /\ (nt_2 = (Fnn : Fnn <: numtype))) +syntax cvtop_(numtype_1 : numtype, numtype_2 : numtype) + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Inn_2 : Inn}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype)) = + | EXTEND{sx : sx}(sx : sx) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) < $sizenn2((Inn_2 : Inn <: numtype))) + | WRAP + -- if ($sizenn1((Inn_1 : Inn <: numtype)) > $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Fnn_2 : Fnn}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | CONVERT{sx : sx}(sx : sx) | REINTERPRET - -- if ($size(nt_1) = $size(nt_2)) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Inn_2 : Inn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype)) = + | TRUNC{sx : sx}(sx : sx) + | TRUNC_SAT{sx : sx}(sx : sx) + | REINTERPRET + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) = $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | PROMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) < $sizenn2((Fnn_2 : Fnn <: numtype))) + | DEMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) > $sizenn2((Fnn_2 : Fnn <: numtype))) + ;; 1-syntax.watsup syntax ishape = @@ -13970,8 +14031,7 @@ syntax instr = | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx? : sx?}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx?{sx : sx} : sx?) - -- if (numtype_1 =/= numtype_2) + | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)) | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) @@ -14601,7 +14661,7 @@ def $free_instr(instr : instr) : free ;; 2-syntax-aux.watsup:359.1-359.62 def $free_instr{numtype : numtype, relop : relop_(numtype)}(RELOP_instr(numtype, relop)) = $free_numtype(numtype) ;; 2-syntax-aux.watsup:360.1-361.55 - def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1), sx? : sx?}(CVTOP_instr(numtype_1, numtype_2, cvtop, sx?{sx : sx})) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) + def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1)}(CVTOP_instr(numtype_1, numtype_2, cvtop)) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) ;; 2-syntax-aux.watsup:363.1-363.64 def $free_instr{vectype : vectype, veclit : vec_(vectype)}(VCONST_instr(vectype, veclit)) = $free_vectype(vectype) ;; 2-syntax-aux.watsup:364.1-364.64 @@ -15430,27 +15490,27 @@ def $trunc(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) def $trunc_sat(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) ;; 3-numerics.watsup -def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), sx?, num_ : num_(numtype_1)) : num_(numtype_2)* +def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), num_ : num_(numtype_1)) : num_(numtype_2)* ;; 3-numerics.watsup - def $cvtop{sx : sx, iN : num_(I32_numtype)}(I32_numtype, I64_numtype, CONVERT_cvtop_, ?(sx), iN) = [$ext(32, 64, sx, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), EXTEND_cvtop_(sx), iN_1) = [$ext($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, iN : num_(I64_numtype)}(I64_numtype, I32_numtype, CONVERT_cvtop_, sx?{sx : sx}, iN) = [$wrap(64, 32, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), WRAP_cvtop_, iN_1) = [$wrap($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), iN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_cvtop_, ?(sx), fN) = [$trunc($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_cvtop_(sx), fN_1) = [$trunc($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_SAT_cvtop_, ?(sx), fN) = [$trunc_sat($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_SAT_cvtop_(sx), fN_1) = [$trunc_sat($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F32_numtype)}(F32_numtype, F64_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$promote(32, 64, fN)] + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), CONVERT_cvtop_(sx), iN_1) = [$convert($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F64_numtype)}(F64_numtype, F32_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$demote(64, 32, fN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), PROMOTE_cvtop_, fN_1) = [$promote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx : sx, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), CONVERT_cvtop_, ?(sx), iN) = [$convert($size((Inn : Inn <: numtype)), $size((Fnn : Fnn <: numtype)), sx, iN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), DEMOTE_cvtop_, fN_1) = [$demote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx? : sx?, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, iN) = [$reinterpret((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), iN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), REINTERPRET_cvtop_, iN_1) = [$reinterpret((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), iN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx? : sx?, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, fN) = [$reinterpret((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), fN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, fN_1 : num_((Fnn_1 : Fnn <: numtype)), Inn_1 : Inn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), REINTERPRET_cvtop_, fN_1) = [$reinterpret((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), fN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup def $narrow(M : M, N : N, sx : sx, iN : iN(M)) : iN(N) @@ -17056,411 +17116,405 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->_%%`_instrtype(`%`_resulttype([(nt : numtype <: valtype) (nt : numtype <: valtype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:725.1-727.34 - rule cvtop-reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, REINTERPRET_cvtop_, ?()), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ($size(nt_1) = $size(nt_2)) - - ;; 6-typing.watsup:729.1-731.112 - rule cvtop-convert{C : context, nt_1 : numtype, nt_2 : numtype, sx? : sx?, Inn_1 : Inn, Inn_2 : Inn, Fnn_1 : Fnn, Fnn_2 : Fnn}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, CONVERT_cvtop_, sx?{sx : sx}), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ((sx?{sx : sx} = ?()) <=> ((((nt_1 = (Inn_1 : Inn <: numtype)) /\ (nt_2 = (Inn_2 : Inn <: numtype))) /\ ($size(nt_1) > $size(nt_2))) \/ ((nt_1 = (Fnn_1 : Fnn <: numtype)) /\ (nt_2 = (Fnn_2 : Fnn <: numtype))))) + ;; 6-typing.watsup:723.1-724.44 + rule cvtop{C : context, nt_1 : numtype, nt_2 : numtype, cvtop : cvtop_(nt_2, nt_1)}: + `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, cvtop), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - ;; 6-typing.watsup:736.1-738.31 + ;; 6-typing.watsup:729.1-731.31 rule ref.null{C : context, ht : heaptype}: `%|-%:%`(C, REF.NULL_instr(ht), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:740.1-743.20 + ;; 6-typing.watsup:733.1-736.20 rule ref.func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, REF.FUNC_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNCS_context[x!`%`_idx.0] = dt) -- if x <- C.REFS_context - ;; 6-typing.watsup:745.1-746.34 + ;; 6-typing.watsup:738.1-739.34 rule ref.i31{C : context}: `%|-%:%`(C, REF.I31_instr, `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), I31_heaptype)]))) - ;; 6-typing.watsup:748.1-750.31 + ;; 6-typing.watsup:741.1-743.31 rule ref.is_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([I32_valtype]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:752.1-754.31 + ;; 6-typing.watsup:745.1-747.31 rule ref.as_non_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:756.1-757.51 + ;; 6-typing.watsup:749.1-750.51 rule ref.eq{C : context}: `%|-%:%`(C, REF.EQ_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype) REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:759.1-763.33 + ;; 6-typing.watsup:752.1-756.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.TEST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([I32_valtype]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:765.1-769.33 + ;; 6-typing.watsup:758.1-762.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.CAST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:774.1-775.42 + ;; 6-typing.watsup:767.1-768.42 rule i31.get{C : context, sx : sx}: `%|-%:%`(C, I31.GET_instr(sx), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), I31_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:780.1-782.44 + ;; 6-typing.watsup:773.1-775.44 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: `%|-%:%`(C, STRUCT.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)*{zt : storagetype}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) - ;; 6-typing.watsup:784.1-787.40 + ;; 6-typing.watsup:777.1-780.40 rule struct.new_default{C : context, x : idx, mut* : mut*, zt* : storagetype*, val* : val*}: `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) -- (if ($default_($unpack(zt)) = ?(val)))*{val : val, zt : storagetype} - ;; 6-typing.watsup:789.1-793.39 + ;; 6-typing.watsup:782.1-786.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype))]), [], `%`_resulttype([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:795.1-798.24 + ;; 6-typing.watsup:788.1-791.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(`MUT%?`_mut(?(())), zt)) - ;; 6-typing.watsup:803.1-805.42 + ;; 6-typing.watsup:796.1-798.42 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype([$unpack(zt) I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:807.1-810.37 + ;; 6-typing.watsup:800.1-803.37 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ($default_($unpack(zt)) = ?(val)) - ;; 6-typing.watsup:812.1-814.42 + ;; 6-typing.watsup:805.1-807.42 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, `%`_u32(n)), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)^n{}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:816.1-819.40 + ;; 6-typing.watsup:809.1-812.40 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt) - ;; 6-typing.watsup:821.1-825.24 + ;; 6-typing.watsup:814.1-818.24 rule array.new_data{C : context, x : idx, y : idx, mut : mut, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:827.1-830.39 + ;; 6-typing.watsup:820.1-823.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), [], `%`_resulttype([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:832.1-834.42 + ;; 6-typing.watsup:825.1-827.42 rule array.set{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:836.1-838.42 + ;; 6-typing.watsup:829.1-831.42 rule array.len{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.LEN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ARRAY_heaptype)]), [], `%`_resulttype([I32_valtype]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:840.1-842.42 + ;; 6-typing.watsup:833.1-835.42 rule array.fill{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:844.1-848.40 + ;; 6-typing.watsup:837.1-841.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`_nul(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x_1!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt_1))) -- Expand: `%~~%`(C.TYPES_context[x_2!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:850.1-853.44 + ;; 6-typing.watsup:843.1-846.44 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt) - ;; 6-typing.watsup:855.1-859.24 + ;; 6-typing.watsup:848.1-852.24 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:864.1-865.62 + ;; 6-typing.watsup:857.1-858.62 rule extern.convert_any{C : context, nul : nul}: `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, ANY_heaptype)]), [], `%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]))) - ;; 6-typing.watsup:867.1-868.62 + ;; 6-typing.watsup:860.1-861.62 rule any.convert_extern{C : context, nul : nul}: `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]), [], `%`_resulttype([REF_valtype(nul, ANY_heaptype)]))) - ;; 6-typing.watsup:873.1-874.35 + ;; 6-typing.watsup:866.1-867.35 rule vconst{C : context, c : vec_(V128_Vnn)}: `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:876.1-877.41 + ;; 6-typing.watsup:869.1-870.41 rule vvunop{C : context, vvunop : vvunop}: `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:879.1-880.48 + ;; 6-typing.watsup:872.1-873.48 rule vvbinop{C : context, vvbinop : vvbinop}: `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:882.1-883.55 + ;; 6-typing.watsup:875.1-876.55 rule vvternop{C : context, vvternop : vvternop}: `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:885.1-886.44 + ;; 6-typing.watsup:878.1-879.44 rule vvtestop{C : context, vvtestop : vvtestop}: `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:888.1-889.37 + ;; 6-typing.watsup:881.1-882.37 rule vunop{C : context, sh : shape, vunop : vunop_(sh)}: `%|-%:%`(C, VUNOP_instr(sh, vunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:891.1-892.44 + ;; 6-typing.watsup:884.1-885.44 rule vbinop{C : context, sh : shape, vbinop : vbinop_(sh)}: `%|-%:%`(C, VBINOP_instr(sh, vbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:894.1-895.40 + ;; 6-typing.watsup:887.1-888.40 rule vtestop{C : context, sh : shape, vtestop : vtestop_(sh)}: `%|-%:%`(C, VTESTOP_instr(sh, vtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:897.1-898.44 + ;; 6-typing.watsup:890.1-891.44 rule vrelop{C : context, sh : shape, vrelop : vrelop_(sh)}: `%|-%:%`(C, VRELOP_instr(sh, vrelop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:900.1-901.47 + ;; 6-typing.watsup:893.1-894.47 rule vshiftop{C : context, sh : ishape, vshiftop : vshiftop_(sh)}: `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype I32_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:903.1-904.33 + ;; 6-typing.watsup:896.1-897.33 rule vbitmask{C : context, sh : ishape}: `%|-%:%`(C, VBITMASK_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:906.1-907.39 + ;; 6-typing.watsup:899.1-900.39 rule vswizzle{C : context, sh : ishape}: `%|-%:%`(C, VSWIZZLE_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:909.1-911.29 + ;; 6-typing.watsup:902.1-904.29 rule vshuffle{C : context, sh : ishape, i* : nat*}: `%|-%:%`(C, VSHUFFLE_instr(sh, `%`_laneidx(i)*{i : nat}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- (if (i < (2 * $dim((sh : ishape <: shape))!`%`_dim.0)))*{i : nat} - ;; 6-typing.watsup:913.1-914.44 + ;; 6-typing.watsup:906.1-907.44 rule vsplat{C : context, sh : shape}: `%|-%:%`(C, VSPLAT_instr(sh), `%->_%%`_instrtype(`%`_resulttype([($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:917.1-919.21 + ;; 6-typing.watsup:910.1-912.21 rule vextract_lane{C : context, sh : shape, sx? : sx?, i : nat}: `%|-%:%`(C, VEXTRACT_LANE_instr(sh, sx?{sx : sx}, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([($unpackshape(sh) : numtype <: valtype)]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:921.1-923.21 + ;; 6-typing.watsup:914.1-916.21 rule vreplace_lane{C : context, sh : shape, i : nat}: `%|-%:%`(C, VREPLACE_LANE_instr(sh, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype ($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:925.1-926.53 + ;; 6-typing.watsup:918.1-919.53 rule vextunop{C : context, sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTUNOP_instr(sh_1, sh_2, vextunop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:928.1-929.60 + ;; 6-typing.watsup:921.1-922.60 rule vextbinop{C : context, sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTBINOP_instr(sh_1, sh_2, vextbinop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:931.1-932.48 + ;; 6-typing.watsup:924.1-925.48 rule vnarrow{C : context, sh_1 : ishape, sh_2 : ishape, sx : sx}: `%|-%:%`(C, VNARROW_instr(sh_1, sh_2, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:934.1-935.62 + ;; 6-typing.watsup:927.1-928.62 rule vcvtop{C : context, sh_1 : shape, sh_2 : shape, vcvtop : vcvtop_(sh_2, sh_1), half? : half_(sh_2, sh_1)?, sx? : sx?, zero? : zero_(sh_2, sh_1)?}: `%|-%:%`(C, VCVTOP_instr(sh_1, sh_2, vcvtop, half?{half : half_(sh_2, sh_1)}, sx?{sx : sx}, zero?{zero : zero_(sh_2, sh_1)}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:940.1-942.28 + ;; 6-typing.watsup:933.1-935.28 rule local.get{C : context, x : idx, t : valtype}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(SET_init, t)) - ;; 6-typing.watsup:944.1-946.29 + ;; 6-typing.watsup:937.1-939.29 rule local.set{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:948.1-950.29 + ;; 6-typing.watsup:941.1-943.29 rule local.tee{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([t]))) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:955.1-957.29 + ;; 6-typing.watsup:948.1-950.29 rule global.get{C : context, x : idx, t : valtype, mut : mut}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; 6-typing.watsup:959.1-961.29 + ;; 6-typing.watsup:952.1-954.29 rule global.set{C : context, x : idx, t : valtype}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [], `%`_resulttype([]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(`MUT%?`_mut(?(())), t)) - ;; 6-typing.watsup:966.1-968.29 + ;; 6-typing.watsup:959.1-961.29 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:970.1-972.29 + ;; 6-typing.watsup:963.1-965.29 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype)]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:974.1-976.29 + ;; 6-typing.watsup:967.1-969.29 rule table.size{C : context, x : idx, lim : limits, rt : reftype}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:978.1-980.29 + ;; 6-typing.watsup:971.1-973.29 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([(rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:982.1-984.29 + ;; 6-typing.watsup:975.1-977.29 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:986.1-990.36 + ;; 6-typing.watsup:979.1-983.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x_1!`%`_idx.0] = `%%`_tabletype(lim_1, rt_1)) -- if (C.TABLES_context[x_2!`%`_idx.0] = `%%`_tabletype(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:992.1-996.36 + ;; 6-typing.watsup:985.1-989.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt_1)) -- if (C.ELEMS_context[y!`%`_idx.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:998.1-1000.24 + ;; 6-typing.watsup:991.1-993.24 rule elem.drop{C : context, x : idx, rt : reftype}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (C.ELEMS_context[x!`%`_idx.0] = rt) - ;; 6-typing.watsup:1005.1-1007.23 + ;; 6-typing.watsup:998.1-1000.23 rule memory.size{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1009.1-1011.23 + ;; 6-typing.watsup:1002.1-1004.23 rule memory.grow{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1013.1-1015.23 + ;; 6-typing.watsup:1006.1-1008.23 rule memory.fill{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1017.1-1020.27 + ;; 6-typing.watsup:1010.1-1013.27 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x_1!`%`_idx.0] = mt_1) -- if (C.MEMS_context[x_2!`%`_idx.0] = mt_2) - ;; 6-typing.watsup:1022.1-1025.24 + ;; 6-typing.watsup:1015.1-1018.24 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1027.1-1029.24 + ;; 6-typing.watsup:1020.1-1022.24 rule data.drop{C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (C.DATAS_context[x!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1040.1-1043.43 + ;; 6-typing.watsup:1033.1-1036.43 rule load-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(nt : numtype <: valtype)]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1045.1-1048.35 + ;; 6-typing.watsup:1038.1-1041.35 rule load-pack{C : context, Inn : Inn, M : M, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr((Inn : Inn <: numtype), ?(`%%`_loadop_(`%`_sz(M), sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(Inn : Inn <: valtype)]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1059.1-1062.43 + ;; 6-typing.watsup:1052.1-1055.43 rule store-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (nt : numtype <: valtype)]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1064.1-1067.35 + ;; 6-typing.watsup:1057.1-1060.35 rule store-pack{C : context, Inn : Inn, M : M, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr((Inn : Inn <: numtype), ?(`%`_sz(M)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (Inn : Inn <: valtype)]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1069.1-1072.46 + ;; 6-typing.watsup:1062.1-1065.46 rule vload-val{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1074.1-1077.39 + ;; 6-typing.watsup:1067.1-1070.39 rule vload-pack{C : context, M : M, N : N, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(`SHAPE%X%%`_vloadop_(`%`_sz(M), N, sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ((M / 8) * N)) - ;; 6-typing.watsup:1079.1-1082.35 + ;; 6-typing.watsup:1072.1-1075.35 rule vload-splat{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(SPLAT_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1084.1-1087.35 + ;; 6-typing.watsup:1077.1-1080.35 rule vload-zero{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(ZERO_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1089.1-1093.21 + ;; 6-typing.watsup:1082.1-1086.21 rule vload_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VLOAD_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) -- if (i < (128 / N)) - ;; 6-typing.watsup:1095.1-1098.46 + ;; 6-typing.watsup:1088.1-1091.46 rule vstore{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VSTORE_instr(V128_vectype, x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1100.1-1104.21 + ;; 6-typing.watsup:1093.1-1097.21 rule vstore_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VSTORE_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (C.MEMS_context[x!`%`_idx.0] = mt) @@ -17723,13 +17777,13 @@ relation Export_ok: `%|-%:%%`(context, export, name, externtype) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1296.1-1296.100 +;; 6-typing.watsup:1289.1-1289.100 relation Globals_ok: `%|-%:%`(context, global*, globaltype*) - ;; 6-typing.watsup:1338.1-1339.17 + ;; 6-typing.watsup:1331.1-1332.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1341.1-1344.54 + ;; 6-typing.watsup:1334.1-1337.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) @@ -17739,13 +17793,13 @@ relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1295.1-1295.98 +;; 6-typing.watsup:1288.1-1288.98 relation Types_ok: `%|-%:%`(context, type*, deftype*) - ;; 6-typing.watsup:1330.1-1331.17 + ;; 6-typing.watsup:1323.1-1324.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1333.1-1336.49 + ;; 6-typing.watsup:1326.1-1329.49 rule cons{C : context, type_1 : type, type* : type*, dt_1* : deftype*, dt* : deftype*}: `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{dt_1 : deftype} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%`(C, type_1, dt_1*{dt_1 : deftype}) @@ -18041,14 +18095,14 @@ relation Step_pure: `%~>%`(instr*, instr*) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup - rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?, c : num_(nt_2)}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [CONST_instr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) + rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), c : num_(nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [CONST_instr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = [c]) ;; 8-reduction.watsup - rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [TRAP_instr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) + rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [TRAP_instr]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -20052,12 +20106,37 @@ syntax relop_(numtype : numtype) ;; 1-syntax.watsup -syntax cvtop_{nt_1 : numtype, nt_2 : numtype}(nt_1, nt_2) = - | CONVERT - | CONVERT_SAT{Inn : Inn, Fnn : Fnn} - -- if ((nt_1 = (Inn : Inn <: numtype)) /\ (nt_2 = (Fnn : Fnn <: numtype))) +syntax cvtop_(numtype_1 : numtype, numtype_2 : numtype) + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Inn_2 : Inn}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype)) = + | EXTEND{sx : sx}(sx : sx) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) < $sizenn2((Inn_2 : Inn <: numtype))) + | WRAP + -- if ($sizenn1((Inn_1 : Inn <: numtype)) > $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Fnn_2 : Fnn}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | CONVERT{sx : sx}(sx : sx) | REINTERPRET - -- if ($size(nt_1) = $size(nt_2)) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Inn_2 : Inn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype)) = + | TRUNC{sx : sx}(sx : sx) + | TRUNC_SAT{sx : sx}(sx : sx) + | REINTERPRET + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) = $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | PROMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) < $sizenn2((Fnn_2 : Fnn <: numtype))) + | DEMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) > $sizenn2((Fnn_2 : Fnn <: numtype))) + ;; 1-syntax.watsup syntax ishape = @@ -20395,8 +20474,7 @@ syntax instr = | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx? : sx?}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx?{sx : sx} : sx?) - -- if (numtype_1 =/= numtype_2) + | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)) | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) @@ -21026,7 +21104,7 @@ def $free_instr(instr : instr) : free ;; 2-syntax-aux.watsup:359.1-359.62 def $free_instr{numtype : numtype, relop : relop_(numtype)}(RELOP_instr(numtype, relop)) = $free_numtype(numtype) ;; 2-syntax-aux.watsup:360.1-361.55 - def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1), sx? : sx?}(CVTOP_instr(numtype_1, numtype_2, cvtop, sx?{sx : sx})) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) + def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1)}(CVTOP_instr(numtype_1, numtype_2, cvtop)) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) ;; 2-syntax-aux.watsup:363.1-363.64 def $free_instr{vectype : vectype, veclit : vec_(vectype)}(VCONST_instr(vectype, veclit)) = $free_vectype(vectype) ;; 2-syntax-aux.watsup:364.1-364.64 @@ -21855,27 +21933,27 @@ def $trunc(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) def $trunc_sat(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) ;; 3-numerics.watsup -def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), sx?, num_ : num_(numtype_1)) : num_(numtype_2)* +def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), num_ : num_(numtype_1)) : num_(numtype_2)* ;; 3-numerics.watsup - def $cvtop{sx : sx, iN : num_(I32_numtype)}(I32_numtype, I64_numtype, CONVERT_cvtop_, ?(sx), iN) = [$ext(32, 64, sx, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), EXTEND_cvtop_(sx), iN_1) = [$ext($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, iN : num_(I64_numtype)}(I64_numtype, I32_numtype, CONVERT_cvtop_, sx?{sx : sx}, iN) = [$wrap(64, 32, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), WRAP_cvtop_, iN_1) = [$wrap($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), iN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_cvtop_, ?(sx), fN) = [$trunc($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_cvtop_(sx), fN_1) = [$trunc($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_SAT_cvtop_, ?(sx), fN) = [$trunc_sat($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_SAT_cvtop_(sx), fN_1) = [$trunc_sat($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F32_numtype)}(F32_numtype, F64_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$promote(32, 64, fN)] + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), CONVERT_cvtop_(sx), iN_1) = [$convert($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F64_numtype)}(F64_numtype, F32_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$demote(64, 32, fN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), PROMOTE_cvtop_, fN_1) = [$promote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx : sx, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), CONVERT_cvtop_, ?(sx), iN) = [$convert($size((Inn : Inn <: numtype)), $size((Fnn : Fnn <: numtype)), sx, iN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), DEMOTE_cvtop_, fN_1) = [$demote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx? : sx?, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, iN) = [$reinterpret((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), iN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), REINTERPRET_cvtop_, iN_1) = [$reinterpret((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), iN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx? : sx?, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, fN) = [$reinterpret((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), fN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, fN_1 : num_((Fnn_1 : Fnn <: numtype)), Inn_1 : Inn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), REINTERPRET_cvtop_, fN_1) = [$reinterpret((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), fN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup def $narrow(M : M, N : N, sx : sx, iN : iN(M)) : iN(N) @@ -23516,72 +23594,66 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->_%%`_instrtype(`%`_resulttype([(nt : numtype <: valtype) (nt : numtype <: valtype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:725.1-727.34 - rule cvtop-reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, REINTERPRET_cvtop_, ?()), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ($size(nt_1) = $size(nt_2)) + ;; 6-typing.watsup:723.1-724.44 + rule cvtop{C : context, nt_1 : numtype, nt_2 : numtype, cvtop : cvtop_(nt_2, nt_1)}: + `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, cvtop), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - ;; 6-typing.watsup:729.1-731.112 - rule cvtop-convert{C : context, nt_1 : numtype, nt_2 : numtype, sx? : sx?, Inn_1 : Inn, Inn_2 : Inn, Fnn_1 : Fnn, Fnn_2 : Fnn}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, CONVERT_cvtop_, sx?{sx : sx}), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ((sx?{sx : sx} = ?()) <=> ((((nt_1 = (Inn_1 : Inn <: numtype)) /\ (nt_2 = (Inn_2 : Inn <: numtype))) /\ ($size(nt_1) > $size(nt_2))) \/ ((nt_1 = (Fnn_1 : Fnn <: numtype)) /\ (nt_2 = (Fnn_2 : Fnn <: numtype))))) - - ;; 6-typing.watsup:736.1-738.31 + ;; 6-typing.watsup:729.1-731.31 rule ref.null{C : context, ht : heaptype}: `%|-%:%`(C, REF.NULL_instr(ht), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:740.1-743.20 + ;; 6-typing.watsup:733.1-736.20 rule ref.func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, REF.FUNC_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), (dt : deftype <: heaptype))]))) -- if (x!`%`_idx.0 < |C.FUNCS_context|) -- if (C.FUNCS_context[x!`%`_idx.0] = dt) -- if x <- C.REFS_context - ;; 6-typing.watsup:745.1-746.34 + ;; 6-typing.watsup:738.1-739.34 rule ref.i31{C : context}: `%|-%:%`(C, REF.I31_instr, `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), I31_heaptype)]))) - ;; 6-typing.watsup:748.1-750.31 + ;; 6-typing.watsup:741.1-743.31 rule ref.is_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([I32_valtype]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:752.1-754.31 + ;; 6-typing.watsup:745.1-747.31 rule ref.as_non_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:756.1-757.51 + ;; 6-typing.watsup:749.1-750.51 rule ref.eq{C : context}: `%|-%:%`(C, REF.EQ_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype) REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:759.1-763.33 + ;; 6-typing.watsup:752.1-756.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.TEST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([I32_valtype]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:765.1-769.33 + ;; 6-typing.watsup:758.1-762.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.CAST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:774.1-775.42 + ;; 6-typing.watsup:767.1-768.42 rule i31.get{C : context, sx : sx}: `%|-%:%`(C, I31.GET_instr(sx), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), I31_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:780.1-782.44 + ;; 6-typing.watsup:773.1-775.44 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: `%|-%:%`(C, STRUCT.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)*{zt : storagetype}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) - ;; 6-typing.watsup:784.1-787.40 + ;; 6-typing.watsup:777.1-780.40 rule struct.new_default{C : context, x : idx, mut* : mut*, zt* : storagetype*, val* : val*}: `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -23590,7 +23662,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype}))) -- (if ($default_($unpack(zt)) = ?(val)))*{val : val, zt : storagetype} - ;; 6-typing.watsup:789.1-793.39 + ;; 6-typing.watsup:782.1-786.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype))]), [], `%`_resulttype([$unpack(zt)]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -23599,7 +23671,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:795.1-798.24 + ;; 6-typing.watsup:788.1-791.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -23607,26 +23679,26 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], STRUCT_comptype(`%`_structtype(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`_fieldtype(`MUT%?`_mut(?(())), zt)) - ;; 6-typing.watsup:803.1-805.42 + ;; 6-typing.watsup:796.1-798.42 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype([$unpack(zt) I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:807.1-810.37 + ;; 6-typing.watsup:800.1-803.37 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ($default_($unpack(zt)) = ?(val)) - ;; 6-typing.watsup:812.1-814.42 + ;; 6-typing.watsup:805.1-807.42 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, `%`_u32(n)), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)^n{}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) - ;; 6-typing.watsup:816.1-819.40 + ;; 6-typing.watsup:809.1-812.40 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -23634,7 +23706,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt) - ;; 6-typing.watsup:821.1-825.24 + ;; 6-typing.watsup:814.1-818.24 rule array.new_data{C : context, x : idx, y : idx, mut : mut, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -23643,32 +23715,32 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:827.1-830.39 + ;; 6-typing.watsup:820.1-823.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), [], `%`_resulttype([$unpack(zt)]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:832.1-834.42 + ;; 6-typing.watsup:825.1-827.42 rule array.set{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:836.1-838.42 + ;; 6-typing.watsup:829.1-831.42 rule array.len{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.LEN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ARRAY_heaptype)]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:840.1-842.42 + ;; 6-typing.watsup:833.1-835.42 rule array.fill{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:844.1-848.40 + ;; 6-typing.watsup:837.1-841.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`_nul(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x_1!`%`_idx.0 < |C.TYPES_context|) @@ -23677,7 +23749,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Expand: `%~~%`(C.TYPES_context[x_2!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:850.1-853.44 + ;; 6-typing.watsup:843.1-846.44 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -23685,7 +23757,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt) - ;; 6-typing.watsup:855.1-859.24 + ;; 6-typing.watsup:848.1-852.24 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -23694,158 +23766,158 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:864.1-865.62 + ;; 6-typing.watsup:857.1-858.62 rule extern.convert_any{C : context, nul : nul}: `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, ANY_heaptype)]), [], `%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]))) - ;; 6-typing.watsup:867.1-868.62 + ;; 6-typing.watsup:860.1-861.62 rule any.convert_extern{C : context, nul : nul}: `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]), [], `%`_resulttype([REF_valtype(nul, ANY_heaptype)]))) - ;; 6-typing.watsup:873.1-874.35 + ;; 6-typing.watsup:866.1-867.35 rule vconst{C : context, c : vec_(V128_Vnn)}: `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:876.1-877.41 + ;; 6-typing.watsup:869.1-870.41 rule vvunop{C : context, vvunop : vvunop}: `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:879.1-880.48 + ;; 6-typing.watsup:872.1-873.48 rule vvbinop{C : context, vvbinop : vvbinop}: `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:882.1-883.55 + ;; 6-typing.watsup:875.1-876.55 rule vvternop{C : context, vvternop : vvternop}: `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:885.1-886.44 + ;; 6-typing.watsup:878.1-879.44 rule vvtestop{C : context, vvtestop : vvtestop}: `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:888.1-889.37 + ;; 6-typing.watsup:881.1-882.37 rule vunop{C : context, sh : shape, vunop : vunop_(sh)}: `%|-%:%`(C, VUNOP_instr(sh, vunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:891.1-892.44 + ;; 6-typing.watsup:884.1-885.44 rule vbinop{C : context, sh : shape, vbinop : vbinop_(sh)}: `%|-%:%`(C, VBINOP_instr(sh, vbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:894.1-895.40 + ;; 6-typing.watsup:887.1-888.40 rule vtestop{C : context, sh : shape, vtestop : vtestop_(sh)}: `%|-%:%`(C, VTESTOP_instr(sh, vtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:897.1-898.44 + ;; 6-typing.watsup:890.1-891.44 rule vrelop{C : context, sh : shape, vrelop : vrelop_(sh)}: `%|-%:%`(C, VRELOP_instr(sh, vrelop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:900.1-901.47 + ;; 6-typing.watsup:893.1-894.47 rule vshiftop{C : context, sh : ishape, vshiftop : vshiftop_(sh)}: `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype I32_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:903.1-904.33 + ;; 6-typing.watsup:896.1-897.33 rule vbitmask{C : context, sh : ishape}: `%|-%:%`(C, VBITMASK_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:906.1-907.39 + ;; 6-typing.watsup:899.1-900.39 rule vswizzle{C : context, sh : ishape}: `%|-%:%`(C, VSWIZZLE_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:909.1-911.29 + ;; 6-typing.watsup:902.1-904.29 rule vshuffle{C : context, sh : ishape, i* : nat*}: `%|-%:%`(C, VSHUFFLE_instr(sh, `%`_laneidx(i)*{i : nat}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- (if (i < (2 * $dim((sh : ishape <: shape))!`%`_dim.0)))*{i : nat} - ;; 6-typing.watsup:913.1-914.44 + ;; 6-typing.watsup:906.1-907.44 rule vsplat{C : context, sh : shape}: `%|-%:%`(C, VSPLAT_instr(sh), `%->_%%`_instrtype(`%`_resulttype([($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:917.1-919.21 + ;; 6-typing.watsup:910.1-912.21 rule vextract_lane{C : context, sh : shape, sx? : sx?, i : nat}: `%|-%:%`(C, VEXTRACT_LANE_instr(sh, sx?{sx : sx}, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([($unpackshape(sh) : numtype <: valtype)]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:921.1-923.21 + ;; 6-typing.watsup:914.1-916.21 rule vreplace_lane{C : context, sh : shape, i : nat}: `%|-%:%`(C, VREPLACE_LANE_instr(sh, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype ($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:925.1-926.53 + ;; 6-typing.watsup:918.1-919.53 rule vextunop{C : context, sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTUNOP_instr(sh_1, sh_2, vextunop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:928.1-929.60 + ;; 6-typing.watsup:921.1-922.60 rule vextbinop{C : context, sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTBINOP_instr(sh_1, sh_2, vextbinop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:931.1-932.48 + ;; 6-typing.watsup:924.1-925.48 rule vnarrow{C : context, sh_1 : ishape, sh_2 : ishape, sx : sx}: `%|-%:%`(C, VNARROW_instr(sh_1, sh_2, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:934.1-935.62 + ;; 6-typing.watsup:927.1-928.62 rule vcvtop{C : context, sh_1 : shape, sh_2 : shape, vcvtop : vcvtop_(sh_2, sh_1), half? : half_(sh_2, sh_1)?, sx? : sx?, zero? : zero_(sh_2, sh_1)?}: `%|-%:%`(C, VCVTOP_instr(sh_1, sh_2, vcvtop, half?{half : half_(sh_2, sh_1)}, sx?{sx : sx}, zero?{zero : zero_(sh_2, sh_1)}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:940.1-942.28 + ;; 6-typing.watsup:933.1-935.28 rule local.get{C : context, x : idx, t : valtype}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (x!`%`_idx.0 < |C.LOCALS_context|) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(SET_init, t)) - ;; 6-typing.watsup:944.1-946.29 + ;; 6-typing.watsup:937.1-939.29 rule local.set{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.LOCALS_context|) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:948.1-950.29 + ;; 6-typing.watsup:941.1-943.29 rule local.tee{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([t]))) -- if (x!`%`_idx.0 < |C.LOCALS_context|) -- if (C.LOCALS_context[x!`%`_idx.0] = `%%`_localtype(init, t)) - ;; 6-typing.watsup:955.1-957.29 + ;; 6-typing.watsup:948.1-950.29 rule global.get{C : context, x : idx, t : valtype, mut : mut}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (x!`%`_idx.0 < |C.GLOBALS_context|) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; 6-typing.watsup:959.1-961.29 + ;; 6-typing.watsup:952.1-954.29 rule global.set{C : context, x : idx, t : valtype}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.GLOBALS_context|) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(`MUT%?`_mut(?(())), t)) - ;; 6-typing.watsup:966.1-968.29 + ;; 6-typing.watsup:959.1-961.29 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:970.1-972.29 + ;; 6-typing.watsup:963.1-965.29 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:974.1-976.29 + ;; 6-typing.watsup:967.1-969.29 rule table.size{C : context, x : idx, lim : limits, rt : reftype}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:978.1-980.29 + ;; 6-typing.watsup:971.1-973.29 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([(rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:982.1-984.29 + ;; 6-typing.watsup:975.1-977.29 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- if (C.TABLES_context[x!`%`_idx.0] = `%%`_tabletype(lim, rt)) - ;; 6-typing.watsup:986.1-990.36 + ;; 6-typing.watsup:979.1-983.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x_1!`%`_idx.0 < |C.TABLES_context|) @@ -23854,7 +23926,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (C.TABLES_context[x_2!`%`_idx.0] = `%%`_tabletype(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:992.1-996.36 + ;; 6-typing.watsup:985.1-989.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) @@ -23863,31 +23935,31 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (C.ELEMS_context[y!`%`_idx.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:998.1-1000.24 + ;; 6-typing.watsup:991.1-993.24 rule elem.drop{C : context, x : idx, rt : reftype}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.ELEMS_context|) -- if (C.ELEMS_context[x!`%`_idx.0] = rt) - ;; 6-typing.watsup:1005.1-1007.23 + ;; 6-typing.watsup:998.1-1000.23 rule memory.size{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1009.1-1011.23 + ;; 6-typing.watsup:1002.1-1004.23 rule memory.grow{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1013.1-1015.23 + ;; 6-typing.watsup:1006.1-1008.23 rule memory.fill{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) - ;; 6-typing.watsup:1017.1-1020.27 + ;; 6-typing.watsup:1010.1-1013.27 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x_1!`%`_idx.0 < |C.MEMS_context|) @@ -23895,7 +23967,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (C.MEMS_context[x_1!`%`_idx.0] = mt_1) -- if (C.MEMS_context[x_2!`%`_idx.0] = mt_2) - ;; 6-typing.watsup:1022.1-1025.24 + ;; 6-typing.watsup:1015.1-1018.24 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) @@ -23903,69 +23975,69 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1027.1-1029.24 + ;; 6-typing.watsup:1020.1-1022.24 rule data.drop{C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.DATAS_context|) -- if (C.DATAS_context[x!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1040.1-1043.43 + ;; 6-typing.watsup:1033.1-1036.43 rule load-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(nt : numtype <: valtype)]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1045.1-1048.35 + ;; 6-typing.watsup:1038.1-1041.35 rule load-pack{C : context, Inn : Inn, M : M, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr((Inn : Inn <: numtype), ?(`%%`_loadop_(`%`_sz(M), sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(Inn : Inn <: valtype)]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1059.1-1062.43 + ;; 6-typing.watsup:1052.1-1055.43 rule store-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (nt : numtype <: valtype)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) - ;; 6-typing.watsup:1064.1-1067.35 + ;; 6-typing.watsup:1057.1-1060.35 rule store-pack{C : context, Inn : Inn, M : M, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr((Inn : Inn <: numtype), ?(`%`_sz(M)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (Inn : Inn <: valtype)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) - ;; 6-typing.watsup:1069.1-1072.46 + ;; 6-typing.watsup:1062.1-1065.46 rule vload-val{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1074.1-1077.39 + ;; 6-typing.watsup:1067.1-1070.39 rule vload-pack{C : context, M : M, N : N, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(`SHAPE%X%%`_vloadop_(`%`_sz(M), N, sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ((M / 8) * N)) - ;; 6-typing.watsup:1079.1-1082.35 + ;; 6-typing.watsup:1072.1-1075.35 rule vload-splat{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(SPLAT_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1084.1-1087.35 + ;; 6-typing.watsup:1077.1-1080.35 rule vload-zero{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(ZERO_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) - ;; 6-typing.watsup:1089.1-1093.21 + ;; 6-typing.watsup:1082.1-1086.21 rule vload_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VLOAD_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) @@ -23973,14 +24045,14 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) -- if (i < (128 / N)) - ;; 6-typing.watsup:1095.1-1098.46 + ;; 6-typing.watsup:1088.1-1091.46 rule vstore{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VSTORE_instr(V128_vectype, x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if (C.MEMS_context[x!`%`_idx.0] = mt) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) - ;; 6-typing.watsup:1100.1-1104.21 + ;; 6-typing.watsup:1093.1-1097.21 rule vstore_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VSTORE_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) @@ -24257,13 +24329,13 @@ relation Export_ok: `%|-%:%%`(context, export, name, externtype) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1296.1-1296.100 +;; 6-typing.watsup:1289.1-1289.100 relation Globals_ok: `%|-%:%`(context, global*, globaltype*) - ;; 6-typing.watsup:1338.1-1339.17 + ;; 6-typing.watsup:1331.1-1332.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1341.1-1344.54 + ;; 6-typing.watsup:1334.1-1337.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) @@ -24273,13 +24345,13 @@ relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1295.1-1295.98 +;; 6-typing.watsup:1288.1-1288.98 relation Types_ok: `%|-%:%`(context, type*, deftype*) - ;; 6-typing.watsup:1330.1-1331.17 + ;; 6-typing.watsup:1323.1-1324.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1333.1-1336.49 + ;; 6-typing.watsup:1326.1-1329.49 rule cons{C : context, type_1 : type, type* : type*, dt_1* : deftype*, dt* : deftype*}: `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{dt_1 : deftype} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%`(C, type_1, dt_1*{dt_1 : deftype}) @@ -24590,14 +24662,14 @@ relation Step_pure: `%~>%`(instr*, instr*) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup - rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?, c : num_(nt_2)}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [CONST_instr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) + rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), c : num_(nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [CONST_instr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = [c]) ;; 8-reduction.watsup - rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [TRAP_instr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) + rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [TRAP_instr]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -26644,12 +26716,37 @@ syntax relop_(numtype : numtype) ;; 1-syntax.watsup -syntax cvtop_{nt_1 : numtype, nt_2 : numtype}(nt_1, nt_2) = - | CONVERT - | CONVERT_SAT{Inn : Inn, Fnn : Fnn} - -- if ((nt_1 = (Inn : Inn <: numtype)) /\ (nt_2 = (Fnn : Fnn <: numtype))) +syntax cvtop_(numtype_1 : numtype, numtype_2 : numtype) + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Inn_2 : Inn}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype)) = + | EXTEND{sx : sx}(sx : sx) + -- if ($sizenn1((Inn_1 : Inn <: numtype)) < $sizenn2((Inn_2 : Inn <: numtype))) + | WRAP + -- if ($sizenn1((Inn_1 : Inn <: numtype)) > $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Inn_1 : Inn, Fnn_2 : Fnn}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | CONVERT{sx : sx}(sx : sx) + | REINTERPRET + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Inn_2 : Inn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype)) = + | TRUNC{sx : sx}(sx : sx) + | TRUNC_SAT{sx : sx}(sx : sx) | REINTERPRET - -- if ($size(nt_1) = $size(nt_2)) + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) = $sizenn2((Inn_2 : Inn <: numtype))) + + + ;; 1-syntax.watsup + syntax cvtop_{Fnn_1 : Fnn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype)) = + | PROMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) < $sizenn2((Fnn_2 : Fnn <: numtype))) + | DEMOTE + -- if ($sizenn1((Fnn_1 : Fnn <: numtype)) > $sizenn2((Fnn_2 : Fnn <: numtype))) + ;; 1-syntax.watsup syntax ishape = @@ -26987,8 +27084,7 @@ syntax instr = | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx? : sx?}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1), sx?{sx : sx} : sx?) - -- if (numtype_1 =/= numtype_2) + | CVTOP{numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)}(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_2, numtype_1)) | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) @@ -27618,7 +27714,7 @@ def $free_instr(instr : instr) : free ;; 2-syntax-aux.watsup:359.1-359.62 def $free_instr{numtype : numtype, relop : relop_(numtype)}(RELOP_instr(numtype, relop)) = $free_numtype(numtype) ;; 2-syntax-aux.watsup:360.1-361.55 - def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1), sx? : sx?}(CVTOP_instr(numtype_1, numtype_2, cvtop, sx?{sx : sx})) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) + def $free_instr{numtype_1 : numtype, numtype_2 : numtype, cvtop : cvtop_(numtype_2, numtype_1)}(CVTOP_instr(numtype_1, numtype_2, cvtop)) = $free_numtype(numtype_1) ++ $free_numtype(numtype_2) ;; 2-syntax-aux.watsup:363.1-363.64 def $free_instr{vectype : vectype, veclit : vec_(vectype)}(VCONST_instr(vectype, veclit)) = $free_vectype(vectype) ;; 2-syntax-aux.watsup:364.1-364.64 @@ -28448,27 +28544,27 @@ def $trunc(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) def $trunc_sat(M : M, N : N, sx : sx, fN : fN(M)) : iN(N) ;; 3-numerics.watsup -def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), sx?, num_ : num_(numtype_1)) : num_(numtype_2)* +def $cvtop(numtype_1 : numtype, numtype_2 : numtype, cvtop_ : cvtop_(numtype_1, numtype_2), num_ : num_(numtype_1)) : num_(numtype_2)* ;; 3-numerics.watsup - def $cvtop{sx : sx, iN : num_(I32_numtype)}(I32_numtype, I64_numtype, CONVERT_cvtop_, ?(sx), iN) = [$ext(32, 64, sx, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), EXTEND_cvtop_(sx), iN_1) = [$ext($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, iN : num_(I64_numtype)}(I64_numtype, I32_numtype, CONVERT_cvtop_, sx?{sx : sx}, iN) = [$wrap(64, 32, iN)] + def $cvtop{Inn_1 : Inn, Inn_2 : Inn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Inn_2 : Inn <: numtype), WRAP_cvtop_, iN_1) = [$wrap($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), iN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_cvtop_, ?(sx), fN) = [$trunc($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_cvtop_(sx), fN_1) = [$trunc($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx : sx, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), CONVERT_SAT_cvtop_, ?(sx), fN) = [$trunc_sat($size((Fnn : Fnn <: numtype)), $size((Inn : Inn <: numtype)), sx, fN)] + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, sx : sx, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), TRUNC_SAT_cvtop_(sx), fN_1) = [$trunc_sat($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Inn_2 : Inn <: numtype)), sx, fN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F32_numtype)}(F32_numtype, F64_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$promote(32, 64, fN)] + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, sx : sx, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), CONVERT_cvtop_(sx), iN_1) = [$convert($sizenn1((Inn_1 : Inn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), sx, iN_1)] ;; 3-numerics.watsup - def $cvtop{sx? : sx?, fN : num_(F64_numtype)}(F64_numtype, F32_numtype, CONVERT_cvtop_, sx?{sx : sx}, fN) = [$demote(64, 32, fN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), PROMOTE_cvtop_, fN_1) = [$promote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx : sx, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), CONVERT_cvtop_, ?(sx), iN) = [$convert($size((Inn : Inn <: numtype)), $size((Fnn : Fnn <: numtype)), sx, iN)] + def $cvtop{Fnn_1 : Fnn, Fnn_2 : Fnn, fN_1 : num_((Fnn_1 : Fnn <: numtype))}((Fnn_1 : Fnn <: numtype), (Fnn_2 : Fnn <: numtype), DEMOTE_cvtop_, fN_1) = [$demote($sizenn1((Fnn_1 : Fnn <: numtype)), $sizenn2((Fnn_2 : Fnn <: numtype)), fN_1)] ;; 3-numerics.watsup - def $cvtop{Inn : Inn, Fnn : Fnn, sx? : sx?, iN : num_((Inn : Inn <: numtype))}((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, iN) = [$reinterpret((Inn : Inn <: numtype), (Fnn : Fnn <: numtype), iN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Inn_1 : Inn, Fnn_2 : Fnn, iN_1 : num_((Inn_1 : Inn <: numtype))}((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), REINTERPRET_cvtop_, iN_1) = [$reinterpret((Inn_1 : Inn <: numtype), (Fnn_2 : Fnn <: numtype), iN_1)] + -- if ($sizenn1((Inn_1 : Inn <: numtype)) = $sizenn2((Fnn_2 : Fnn <: numtype))) ;; 3-numerics.watsup - def $cvtop{Fnn : Fnn, Inn : Inn, sx? : sx?, fN : num_((Fnn : Fnn <: numtype))}((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), REINTERPRET_cvtop_, sx?{sx : sx}, fN) = [$reinterpret((Fnn : Fnn <: numtype), (Inn : Inn <: numtype), fN)] - -- if ($size((Inn : Inn <: numtype)) = $size((Fnn : Fnn <: numtype))) + def $cvtop{Fnn_1 : Fnn, Inn_2 : Inn, fN_1 : num_((Fnn_1 : Fnn <: numtype)), Inn_1 : Inn, Fnn_2 : Fnn}((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), REINTERPRET_cvtop_, fN_1) = [$reinterpret((Fnn_1 : Fnn <: numtype), (Inn_2 : Inn <: numtype), fN_1)] + -- where $sizenn2((Fnn_2 : Fnn <: numtype)) = $sizenn1((Inn_1 : Inn <: numtype)) ;; 3-numerics.watsup def $narrow(M : M, N : N, sx : sx, iN : iN(M)) : iN(N) @@ -30119,72 +30215,66 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->_%%`_instrtype(`%`_resulttype([(nt : numtype <: valtype) (nt : numtype <: valtype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:725.1-727.34 - rule cvtop-reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, REINTERPRET_cvtop_, ?()), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ($size(nt_1) = $size(nt_2)) - - ;; 6-typing.watsup:729.1-731.112 - rule cvtop-convert{C : context, nt_1 : numtype, nt_2 : numtype, sx? : sx?, Inn_1 : Inn, Inn_2 : Inn, Fnn_1 : Fnn, Fnn_2 : Fnn}: - `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, CONVERT_cvtop_, sx?{sx : sx}), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - -- if ((sx?{sx : sx} = ?()) <=> ((((nt_1 = (Inn_1 : Inn <: numtype)) /\ (nt_2 = (Inn_2 : Inn <: numtype))) /\ ($size(nt_1) > $size(nt_2))) \/ ((nt_1 = (Fnn_1 : Fnn <: numtype)) /\ (nt_2 = (Fnn_2 : Fnn <: numtype))))) + ;; 6-typing.watsup:723.1-724.44 + rule cvtop{C : context, nt_1 : numtype, nt_2 : numtype, cvtop : cvtop_(nt_2, nt_1)}: + `%|-%:%`(C, CVTOP_instr(nt_1, nt_2, cvtop), `%->_%%`_instrtype(`%`_resulttype([(nt_2 : numtype <: valtype)]), [], `%`_resulttype([(nt_1 : numtype <: valtype)]))) - ;; 6-typing.watsup:736.1-738.31 + ;; 6-typing.watsup:729.1-731.31 rule ref.null{C : context, ht : heaptype}: `%|-%:%`(C, REF.NULL_instr(ht), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:740.1-743.20 + ;; 6-typing.watsup:733.1-736.20 rule ref.func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, REF.FUNC_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), (dt : deftype <: heaptype))]))) -- if (x!`%`_idx.0 < |C.FUNCS_context|) -- if x <- C.REFS_context -- where dt = C.FUNCS_context[x!`%`_idx.0] - ;; 6-typing.watsup:745.1-746.34 + ;; 6-typing.watsup:738.1-739.34 rule ref.i31{C : context}: `%|-%:%`(C, REF.I31_instr, `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), I31_heaptype)]))) - ;; 6-typing.watsup:748.1-750.31 + ;; 6-typing.watsup:741.1-743.31 rule ref.is_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([I32_valtype]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:752.1-754.31 + ;; 6-typing.watsup:745.1-747.31 rule ref.as_non_null{C : context, ht : heaptype}: `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ht)]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ht)]))) -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:756.1-757.51 + ;; 6-typing.watsup:749.1-750.51 rule ref.eq{C : context}: `%|-%:%`(C, REF.EQ_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype) REF_valtype(`NULL%?`_nul(?(())), EQ_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:759.1-763.33 + ;; 6-typing.watsup:752.1-756.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.TEST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([I32_valtype]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_sub: `%|-%<:%`(C, rt, rt') -- Reftype_ok: `%|-%:OK`(C, rt') - ;; 6-typing.watsup:765.1-769.33 + ;; 6-typing.watsup:758.1-762.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: `%|-%:%`(C, REF.CAST_instr(rt), `%->_%%`_instrtype(`%`_resulttype([(rt' : reftype <: valtype)]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:OK`(C, rt) -- Reftype_sub: `%|-%<:%`(C, rt, rt') -- Reftype_ok: `%|-%:OK`(C, rt') - ;; 6-typing.watsup:774.1-775.42 + ;; 6-typing.watsup:767.1-768.42 rule i31.get{C : context, sx : sx}: `%|-%:%`(C, I31.GET_instr(sx), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), I31_heaptype)]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:780.1-782.44 + ;; 6-typing.watsup:773.1-775.44 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: `%|-%:%`(C, STRUCT.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)*{zt : storagetype}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- where STRUCT_comptype(`%`_structtype(`%%`_fieldtype(mut, zt)*{mut : mut, zt : storagetype})) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) - ;; 6-typing.watsup:784.1-787.40 + ;; 6-typing.watsup:777.1-780.40 rule struct.new_default{C : context, x : idx, mut* : mut*, zt* : storagetype*, val* : val*}: `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30193,7 +30283,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- (where ?(val) = $default_($unpack(zt)))*{val : val, zt : storagetype} -- if (|val*{val : val}| = |zt*{zt : storagetype}|) - ;; 6-typing.watsup:789.1-793.39 + ;; 6-typing.watsup:782.1-786.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype))]), [], `%`_resulttype([$unpack(zt)]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30202,7 +30292,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where `%%`_fieldtype(mut, zt) = yt*{yt : fieldtype}[i] -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:795.1-798.24 + ;; 6-typing.watsup:788.1-791.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`_u32(i)), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30210,26 +30300,26 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (i < |yt*{yt : fieldtype}|) -- where `%%`_fieldtype(`MUT%?`_mut(?(())), zt) = yt*{yt : fieldtype}[i] - ;; 6-typing.watsup:803.1-805.42 + ;; 6-typing.watsup:796.1-798.42 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_instr(x), `%->_%%`_instrtype(`%`_resulttype([$unpack(zt) I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- where ARRAY_comptype(`%%`_arraytype(mut, zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) - ;; 6-typing.watsup:807.1-810.37 + ;; 6-typing.watsup:800.1-803.37 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- where ARRAY_comptype(`%%`_arraytype(mut, zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- where ?(val) = $default_($unpack(zt)) - ;; 6-typing.watsup:812.1-814.42 + ;; 6-typing.watsup:805.1-807.42 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, `%`_u32(n)), `%->_%%`_instrtype(`%`_resulttype($unpack(zt)^n{}), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- where ARRAY_comptype(`%%`_arraytype(mut, zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) - ;; 6-typing.watsup:816.1-819.40 + ;; 6-typing.watsup:809.1-812.40 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30237,7 +30327,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where ARRAY_comptype(`%%`_arraytype(mut, (rt : reftype <: storagetype))) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt) - ;; 6-typing.watsup:821.1-825.24 + ;; 6-typing.watsup:814.1-818.24 rule array.new_data-0{C : context, x : idx, y : idx, mut : mut, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30246,7 +30336,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where ARRAY_comptype(`%%`_arraytype(mut, zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- where (numtype : numtype <: valtype) = $unpack(zt) - ;; 6-typing.watsup:821.1-825.24 + ;; 6-typing.watsup:814.1-818.24 rule array.new_data-1{C : context, x : idx, y : idx, mut : mut, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype]), [], `%`_resulttype([REF_valtype(`NULL%?`_nul(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30255,32 +30345,32 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where ARRAY_comptype(`%%`_arraytype(mut, zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- where (vectype : vectype <: valtype) = $unpack(zt) - ;; 6-typing.watsup:827.1-830.39 + ;; 6-typing.watsup:820.1-823.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), [], `%`_resulttype([$unpack(zt)]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- where ARRAY_comptype(`%%`_arraytype(mut, zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) - ;; 6-typing.watsup:832.1-834.42 + ;; 6-typing.watsup:825.1-827.42 rule array.set{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- where ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) - ;; 6-typing.watsup:836.1-838.42 + ;; 6-typing.watsup:829.1-831.42 rule array.len{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.LEN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ARRAY_heaptype)]), [], `%`_resulttype([I32_valtype]))) -- where $expanddt(C.TYPES_context[x!`%`_idx.0]) = ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt)) -- if (x!`%`_idx.0 < |C.TYPES_context|) - ;; 6-typing.watsup:840.1-842.42 + ;; 6-typing.watsup:833.1-835.42 rule array.fill{C : context, x : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) -- where ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) - ;; 6-typing.watsup:844.1-848.40 + ;; 6-typing.watsup:837.1-841.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`_nul(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x_1!`%`_idx.0 < |C.TYPES_context|) @@ -30289,7 +30379,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) -- if ($expanddt(C.TYPES_context[x_1!`%`_idx.0]) = ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt_1))) - ;; 6-typing.watsup:850.1-853.44 + ;; 6-typing.watsup:843.1-846.44 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30297,7 +30387,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt) -- if ($expanddt(C.TYPES_context[x!`%`_idx.0]) = ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt))) - ;; 6-typing.watsup:855.1-859.24 + ;; 6-typing.watsup:848.1-852.24 rule array.init_data-0{C : context, x : idx, y : idx, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30306,7 +30396,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- where (numtype : numtype <: valtype) = $unpack(zt) - ;; 6-typing.watsup:855.1-859.24 + ;; 6-typing.watsup:848.1-852.24 rule array.init_data-1{C : context, x : idx, y : idx, zt : storagetype, numtype : numtype, vectype : vectype}: `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([REF_valtype(`NULL%?`_nul(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TYPES_context|) @@ -30315,158 +30405,158 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where ARRAY_comptype(`%%`_arraytype(`MUT%?`_mut(?(())), zt)) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- where (vectype : vectype <: valtype) = $unpack(zt) - ;; 6-typing.watsup:864.1-865.62 + ;; 6-typing.watsup:857.1-858.62 rule extern.convert_any{C : context, nul : nul}: `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, ANY_heaptype)]), [], `%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]))) - ;; 6-typing.watsup:867.1-868.62 + ;; 6-typing.watsup:860.1-861.62 rule any.convert_extern{C : context, nul : nul}: `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->_%%`_instrtype(`%`_resulttype([REF_valtype(nul, EXTERN_heaptype)]), [], `%`_resulttype([REF_valtype(nul, ANY_heaptype)]))) - ;; 6-typing.watsup:873.1-874.35 + ;; 6-typing.watsup:866.1-867.35 rule vconst{C : context, c : vec_(V128_Vnn)}: `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:876.1-877.41 + ;; 6-typing.watsup:869.1-870.41 rule vvunop{C : context, vvunop : vvunop}: `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:879.1-880.48 + ;; 6-typing.watsup:872.1-873.48 rule vvbinop{C : context, vvbinop : vvbinop}: `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:882.1-883.55 + ;; 6-typing.watsup:875.1-876.55 rule vvternop{C : context, vvternop : vvternop}: `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:885.1-886.44 + ;; 6-typing.watsup:878.1-879.44 rule vvtestop{C : context, vvtestop : vvtestop}: `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:888.1-889.37 + ;; 6-typing.watsup:881.1-882.37 rule vunop{C : context, sh : shape, vunop : vunop_(sh)}: `%|-%:%`(C, VUNOP_instr(sh, vunop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:891.1-892.44 + ;; 6-typing.watsup:884.1-885.44 rule vbinop{C : context, sh : shape, vbinop : vbinop_(sh)}: `%|-%:%`(C, VBINOP_instr(sh, vbinop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:894.1-895.40 + ;; 6-typing.watsup:887.1-888.40 rule vtestop{C : context, sh : shape, vtestop : vtestop_(sh)}: `%|-%:%`(C, VTESTOP_instr(sh, vtestop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:897.1-898.44 + ;; 6-typing.watsup:890.1-891.44 rule vrelop{C : context, sh : shape, vrelop : vrelop_(sh)}: `%|-%:%`(C, VRELOP_instr(sh, vrelop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:900.1-901.47 + ;; 6-typing.watsup:893.1-894.47 rule vshiftop{C : context, sh : ishape, vshiftop : vshiftop_(sh)}: `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop), `%->_%%`_instrtype(`%`_resulttype([V128_valtype I32_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:903.1-904.33 + ;; 6-typing.watsup:896.1-897.33 rule vbitmask{C : context, sh : ishape}: `%|-%:%`(C, VBITMASK_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([I32_valtype]))) - ;; 6-typing.watsup:906.1-907.39 + ;; 6-typing.watsup:899.1-900.39 rule vswizzle{C : context, sh : ishape}: `%|-%:%`(C, VSWIZZLE_instr(sh), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:909.1-911.29 + ;; 6-typing.watsup:902.1-904.29 rule vshuffle{C : context, sh : ishape, i* : nat*}: `%|-%:%`(C, VSHUFFLE_instr(sh, `%`_laneidx(i)*{i : nat}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- (if (i < (2 * $dim((sh : ishape <: shape))!`%`_dim.0)))*{i : nat} - ;; 6-typing.watsup:913.1-914.44 + ;; 6-typing.watsup:906.1-907.44 rule vsplat{C : context, sh : shape}: `%|-%:%`(C, VSPLAT_instr(sh), `%->_%%`_instrtype(`%`_resulttype([($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:917.1-919.21 + ;; 6-typing.watsup:910.1-912.21 rule vextract_lane{C : context, sh : shape, sx? : sx?, i : nat}: `%|-%:%`(C, VEXTRACT_LANE_instr(sh, sx?{sx : sx}, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([($unpackshape(sh) : numtype <: valtype)]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:921.1-923.21 + ;; 6-typing.watsup:914.1-916.21 rule vreplace_lane{C : context, sh : shape, i : nat}: `%|-%:%`(C, VREPLACE_LANE_instr(sh, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([V128_valtype ($unpackshape(sh) : numtype <: valtype)]), [], `%`_resulttype([V128_valtype]))) -- if (i < $dim(sh)!`%`_dim.0) - ;; 6-typing.watsup:925.1-926.53 + ;; 6-typing.watsup:918.1-919.53 rule vextunop{C : context, sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTUNOP_instr(sh_1, sh_2, vextunop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:928.1-929.60 + ;; 6-typing.watsup:921.1-922.60 rule vextbinop{C : context, sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_2, sh_1), sx : sx}: `%|-%:%`(C, VEXTBINOP_instr(sh_1, sh_2, vextbinop, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:931.1-932.48 + ;; 6-typing.watsup:924.1-925.48 rule vnarrow{C : context, sh_1 : ishape, sh_2 : ishape, sx : sx}: `%|-%:%`(C, VNARROW_instr(sh_1, sh_2, sx), `%->_%%`_instrtype(`%`_resulttype([V128_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:934.1-935.62 + ;; 6-typing.watsup:927.1-928.62 rule vcvtop{C : context, sh_1 : shape, sh_2 : shape, vcvtop : vcvtop_(sh_2, sh_1), half? : half_(sh_2, sh_1)?, sx? : sx?, zero? : zero_(sh_2, sh_1)?}: `%|-%:%`(C, VCVTOP_instr(sh_1, sh_2, vcvtop, half?{half : half_(sh_2, sh_1)}, sx?{sx : sx}, zero?{zero : zero_(sh_2, sh_1)}), `%->_%%`_instrtype(`%`_resulttype([V128_valtype]), [], `%`_resulttype([V128_valtype]))) - ;; 6-typing.watsup:940.1-942.28 + ;; 6-typing.watsup:933.1-935.28 rule local.get{C : context, x : idx, t : valtype}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (x!`%`_idx.0 < |C.LOCALS_context|) -- where `%%`_localtype(SET_init, t) = C.LOCALS_context[x!`%`_idx.0] - ;; 6-typing.watsup:944.1-946.29 + ;; 6-typing.watsup:937.1-939.29 rule local.set{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.LOCALS_context|) -- where `%%`_localtype(init, t) = C.LOCALS_context[x!`%`_idx.0] - ;; 6-typing.watsup:948.1-950.29 + ;; 6-typing.watsup:941.1-943.29 rule local.tee{C : context, x : idx, t : valtype, init : init}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [x], `%`_resulttype([t]))) -- if (x!`%`_idx.0 < |C.LOCALS_context|) -- where `%%`_localtype(init, t) = C.LOCALS_context[x!`%`_idx.0] - ;; 6-typing.watsup:955.1-957.29 + ;; 6-typing.watsup:948.1-950.29 rule global.get{C : context, x : idx, t : valtype, mut : mut}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([t]))) -- if (x!`%`_idx.0 < |C.GLOBALS_context|) -- where `%%`_globaltype(mut, t) = C.GLOBALS_context[x!`%`_idx.0] - ;; 6-typing.watsup:959.1-961.29 + ;; 6-typing.watsup:952.1-954.29 rule global.set{C : context, x : idx, t : valtype}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([t]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.GLOBALS_context|) -- where `%%`_globaltype(`MUT%?`_mut(?(())), t) = C.GLOBALS_context[x!`%`_idx.0] - ;; 6-typing.watsup:966.1-968.29 + ;; 6-typing.watsup:959.1-961.29 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(rt : reftype <: valtype)]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- where `%%`_tabletype(lim, rt) = C.TABLES_context[x!`%`_idx.0] - ;; 6-typing.watsup:970.1-972.29 + ;; 6-typing.watsup:963.1-965.29 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.SET_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- where `%%`_tabletype(lim, rt) = C.TABLES_context[x!`%`_idx.0] - ;; 6-typing.watsup:974.1-976.29 + ;; 6-typing.watsup:967.1-969.29 rule table.size{C : context, x : idx, lim : limits, rt : reftype}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- where `%%`_tabletype(lim, rt) = C.TABLES_context[x!`%`_idx.0] - ;; 6-typing.watsup:978.1-980.29 + ;; 6-typing.watsup:971.1-973.29 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([(rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- where `%%`_tabletype(lim, rt) = C.TABLES_context[x!`%`_idx.0] - ;; 6-typing.watsup:982.1-984.29 + ;; 6-typing.watsup:975.1-977.29 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (rt : reftype <: valtype) I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) -- where `%%`_tabletype(lim, rt) = C.TABLES_context[x!`%`_idx.0] - ;; 6-typing.watsup:986.1-990.36 + ;; 6-typing.watsup:979.1-983.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x_1!`%`_idx.0 < |C.TABLES_context|) @@ -30475,7 +30565,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where `%%`_tabletype(lim_2, rt_2) = C.TABLES_context[x_2!`%`_idx.0] -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:992.1-996.36 + ;; 6-typing.watsup:985.1-989.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.TABLES_context|) @@ -30484,31 +30574,31 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where `%%`_tabletype(lim, rt_1) = C.TABLES_context[x!`%`_idx.0] -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:998.1-1000.24 + ;; 6-typing.watsup:991.1-993.24 rule elem.drop{C : context, x : idx, rt : reftype}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.ELEMS_context|) -- where rt = C.ELEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1005.1-1007.23 + ;; 6-typing.watsup:998.1-1000.23 rule memory.size{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1009.1-1011.23 + ;; 6-typing.watsup:1002.1-1004.23 rule memory.grow{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([I32_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1013.1-1015.23 + ;; 6-typing.watsup:1006.1-1008.23 rule memory.fill{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr(x), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1017.1-1020.27 + ;; 6-typing.watsup:1010.1-1013.27 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x_1!`%`_idx.0 < |C.MEMS_context|) @@ -30516,7 +30606,7 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- where mt_1 = C.MEMS_context[x_1!`%`_idx.0] -- where mt_2 = C.MEMS_context[x_2!`%`_idx.0] - ;; 6-typing.watsup:1022.1-1025.24 + ;; 6-typing.watsup:1015.1-1018.24 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->_%%`_instrtype(`%`_resulttype([I32_valtype I32_valtype I32_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) @@ -30524,69 +30614,69 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (C.DATAS_context[y!`%`_idx.0] = OK_datatype) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1027.1-1029.24 + ;; 6-typing.watsup:1020.1-1022.24 rule data.drop{C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.DATAS_context|) -- if (C.DATAS_context[x!`%`_idx.0] = OK_datatype) - ;; 6-typing.watsup:1040.1-1043.43 + ;; 6-typing.watsup:1033.1-1036.43 rule load-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(nt : numtype <: valtype)]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1045.1-1048.35 + ;; 6-typing.watsup:1038.1-1041.35 rule load-pack{C : context, Inn : Inn, M : M, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, LOAD_instr((Inn : Inn <: numtype), ?(`%%`_loadop_(`%`_sz(M), sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([(Inn : Inn <: valtype)]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1059.1-1062.43 + ;; 6-typing.watsup:1052.1-1055.43 rule store-val{C : context, nt : numtype, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr(nt, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (nt : numtype <: valtype)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($size(nt) / 8)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1064.1-1067.35 + ;; 6-typing.watsup:1057.1-1060.35 rule store-pack{C : context, Inn : Inn, M : M, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, STORE_instr((Inn : Inn <: numtype), ?(`%`_sz(M)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype (Inn : Inn <: valtype)]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (M / 8)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1069.1-1072.46 + ;; 6-typing.watsup:1062.1-1065.46 rule vload-val{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1074.1-1077.39 + ;; 6-typing.watsup:1067.1-1070.39 rule vload-pack{C : context, M : M, N : N, sx : sx, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(`SHAPE%X%%`_vloadop_(`%`_sz(M), N, sx)), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ((M / 8) * N)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1079.1-1082.35 + ;; 6-typing.watsup:1072.1-1075.35 rule vload-splat{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(SPLAT_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1084.1-1087.35 + ;; 6-typing.watsup:1077.1-1080.35 rule vload-zero{C : context, N : N, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VLOAD_instr(V128_vectype, ?(ZERO_vloadop_(`%`_sz(N))), x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= (N / 8)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1089.1-1093.21 + ;; 6-typing.watsup:1082.1-1086.21 rule vload_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VLOAD_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([V128_valtype]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) @@ -30594,14 +30684,14 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- if (i < (128 / N)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1095.1-1098.46 + ;; 6-typing.watsup:1088.1-1091.46 rule vstore{C : context, x : idx, memarg : memarg, mt : memtype}: `%|-%:%`(C, VSTORE_instr(V128_vectype, x, memarg), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) -- if ((2 ^ memarg.ALIGN_memarg!`%`_u32.0) <= ($vsize(V128_vectype) / 8)) -- where mt = C.MEMS_context[x!`%`_idx.0] - ;; 6-typing.watsup:1100.1-1104.21 + ;; 6-typing.watsup:1093.1-1097.21 rule vstore_lane{C : context, N : N, x : idx, memarg : memarg, i : nat, mt : memtype}: `%|-%:%`(C, VSTORE_LANE_instr(V128_vectype, `%`_sz(N), x, memarg, `%`_laneidx(i)), `%->_%%`_instrtype(`%`_resulttype([I32_valtype V128_valtype]), [], `%`_resulttype([]))) -- if (x!`%`_idx.0 < |C.MEMS_context|) @@ -30878,13 +30968,13 @@ relation Export_ok: `%|-%:%%`(context, export, name, externtype) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1296.1-1296.100 +;; 6-typing.watsup:1289.1-1289.100 relation Globals_ok: `%|-%:%`(context, global*, globaltype*) - ;; 6-typing.watsup:1338.1-1339.17 + ;; 6-typing.watsup:1331.1-1332.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1341.1-1344.54 + ;; 6-typing.watsup:1334.1-1337.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) @@ -30894,13 +30984,13 @@ relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup rec { -;; 6-typing.watsup:1295.1-1295.98 +;; 6-typing.watsup:1288.1-1288.98 relation Types_ok: `%|-%:%`(context, type*, deftype*) - ;; 6-typing.watsup:1330.1-1331.17 + ;; 6-typing.watsup:1323.1-1324.17 rule empty{C : context}: `%|-%:%`(C, [], []) - ;; 6-typing.watsup:1333.1-1336.49 + ;; 6-typing.watsup:1326.1-1329.49 rule cons{C : context, type_1 : type, type* : type*, dt_1* : deftype*, dt* : deftype*}: `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{dt_1 : deftype} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%`(C, type_1, dt_1*{dt_1 : deftype}) @@ -31216,14 +31306,14 @@ relation Step_pure: `%~>%`(instr*, instr*) -- where c = $relop(nt, relop, c_1, c_2) ;; 8-reduction.watsup - rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?, c : num_(nt_2)}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [CONST_instr(nt_2, c)]) - -- where [c] = $cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) + rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), c : num_(nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [CONST_instr(nt_2, c)]) + -- where [c] = $cvtop(nt_1, nt_2, cvtop, c_1) ;; 8-reduction.watsup - rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2), sx? : sx?}: - `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop, sx?{sx : sx})], [TRAP_instr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) + rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop_(nt_1, nt_2)}: + `%~>%`([CONST_instr(nt_1, c_1) CVTOP_instr(nt_2, nt_1, cvtop)], [TRAP_instr]) + -- if ($cvtop(nt_1, nt_2, cvtop, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index 2adcfb3b27..f580dc3f5d 100644 --- a/spectec/test-prose/TEST.md +++ b/spectec/test-prose/TEST.md @@ -95,7 +95,7 @@ validation_of_TESTOP t testop_t validation_of_RELOP t relop_t - The instruction is valid with type ([t, t] -> [I32]). -validation_of_CVTOP nt_1 nt_2 REINTERPRET ?() +validation_of_CVTOP nt_1 nt_2 REINTERPRET - $size(nt_1) must be equal to $size(nt_2). - The instruction is valid with type ([nt_2] -> [nt_1]). @@ -495,38 +495,38 @@ relop valty_u1 relop_u0 val__u3 val__u5 13. Let fN_2 be val__u5. 14. Return $fge($size(Fnn), fN_1, fN_2). -cvtop valty_u0 valty_u1 cvtop_u5 sx_u2? val__u4 -1. If ((valty_u0 is I32) and ((valty_u1 is I64) and (cvtop_u5 is CONVERT))), then: +cvtop valty_u0 valty_u1 cvtop_u2 val__u4 +1. If ((valty_u0 is I32) and (valty_u1 is I64)), then: a. Let iN be val__u4. - b. If sx_u2? is defined, then: - 1) Let ?(sx) be sx_u2?. + b. If cvtop_u2 is of the case EXTEND, then: + 1) Let (EXTEND sx) be cvtop_u2. 2) Return [$ext(32, 64, sx, iN)]. -2. If ((valty_u0 is I64) and ((valty_u1 is I32) and (cvtop_u5 is CONVERT))), then: +2. If ((valty_u0 is I64) and ((valty_u1 is I32) and (cvtop_u2 is WRAP))), then: a. Let iN be val__u4. b. Return [$wrap(64, 32, iN)]. -3. If ((cvtop_u5 is CONVERT) and the type of valty_u0 is Fnn), then: +3. If the type of valty_u0 is Fnn, then: a. Let Fnn be valty_u0. b. If the type of valty_u1 is Inn, then: 1) Let Inn be valty_u1. 2) Let fN be val__u4. - 3) If sx_u2? is defined, then: - a) Let ?(sx) be sx_u2?. + 3) If cvtop_u2 is of the case TRUNC, then: + a) Let (TRUNC sx) be cvtop_u2. b) Return [$trunc($size(Fnn), $size(Inn), sx, fN)]. -4. If ((valty_u0 is F32) and ((valty_u1 is F64) and (cvtop_u5 is CONVERT))), then: +4. If ((valty_u0 is F32) and ((valty_u1 is F64) and (cvtop_u2 is PROMOTE))), then: a. Let fN be val__u4. b. Return [$promote(32, 64, fN)]. -5. If ((valty_u0 is F64) and ((valty_u1 is F32) and (cvtop_u5 is CONVERT))), then: +5. If ((valty_u0 is F64) and ((valty_u1 is F32) and (cvtop_u2 is DEMOTE))), then: a. Let fN be val__u4. b. Return [$demote(64, 32, fN)]. -6. If ((cvtop_u5 is CONVERT) and the type of valty_u1 is Fnn), then: +6. If the type of valty_u1 is Fnn, then: a. Let Fnn be valty_u1. b. If the type of valty_u0 is Inn, then: 1) Let Inn be valty_u0. 2) Let iN be val__u4. - 3) If sx_u2? is defined, then: - a) Let ?(sx) be sx_u2?. + 3) If cvtop_u2 is of the case CONVERT, then: + a) Let (CONVERT sx) be cvtop_u2. b) Return [$convert($size(Inn), $size(Fnn), sx, iN)]. -7. Assert: Due to validation, (cvtop_u5 is REINTERPRET). +7. Assert: Due to validation, (cvtop_u2 is REINTERPRET). 8. If the type of valty_u1 is Fnn, then: a. Let Fnn be valty_u1. b. If the type of valty_u0 is Inn, then: @@ -1028,13 +1028,13 @@ execution_of_RELOP t relop 5. Let c be $relop(t, relop, c_1, c_2). 6. Push the value (I32.CONST c) to the stack. -execution_of_CVTOP t_2 t_1 cvtop sx? +execution_of_CVTOP t_2 t_1 cvtop 1. Assert: Due to validation, a value of value type t_1 is on the top of the stack. 2. Pop the value (t_1.CONST c_1) from the stack. -3. If (|$cvtop(t_1, t_2, cvtop, sx?, c_1)| is 1), then: - a. Let [c] be $cvtop(t_1, t_2, cvtop, sx?, c_1). +3. If (|$cvtop(t_1, t_2, cvtop, c_1)| is 1), then: + a. Let [c] be $cvtop(t_1, t_2, cvtop, c_1). b. Push the value (t_2.CONST c) to the stack. -4. If ($cvtop(t_1, t_2, cvtop, sx?, c_1) is []), then: +4. If ($cvtop(t_1, t_2, cvtop, c_1) is []), then: a. Trap. execution_of_LOCAL.TEE x @@ -1310,7 +1310,7 @@ validation_of_TESTOP nt testop_nt validation_of_RELOP nt relop_nt - The instruction is valid with type ([nt, nt] -> [I32]). -validation_of_CVTOP nt_1 nt_2 REINTERPRET ?() +validation_of_CVTOP nt_1 nt_2 REINTERPRET - $size(nt_1) must be equal to $size(nt_2). - The instruction is valid with type ([nt_2] -> [nt_1]). @@ -1967,47 +1967,47 @@ relop numty_u1 relop_u0 num__u3 num__u5 13. Let fN_2 be num__u5. 14. Return $fge($size(Fnn), fN_1, fN_2). -cvtop numty_u0 numty_u1 cvtop_u5 sx_u2? num__u4 -1. If ((numty_u0 is I32) and ((numty_u1 is I64) and (cvtop_u5 is CONVERT))), then: +cvtop numty_u0 numty_u1 cvtop_u2 num__u4 +1. If ((numty_u0 is I32) and (numty_u1 is I64)), then: a. Let iN be num__u4. - b. If sx_u2? is defined, then: - 1) Let ?(sx) be sx_u2?. + b. If cvtop_u2 is of the case EXTEND, then: + 1) Let (EXTEND sx) be cvtop_u2. 2) Return [$ext(32, 64, sx, iN)]. -2. If ((numty_u0 is I64) and ((numty_u1 is I32) and (cvtop_u5 is CONVERT))), then: +2. If ((numty_u0 is I64) and ((numty_u1 is I32) and (cvtop_u2 is WRAP))), then: a. Let iN be num__u4. b. Return [$wrap(64, 32, iN)]. -3. If ((cvtop_u5 is CONVERT) and the type of numty_u0 is Fnn), then: +3. If the type of numty_u0 is Fnn, then: a. Let Fnn be numty_u0. b. If the type of numty_u1 is Inn, then: 1) Let Inn be numty_u1. 2) Let fN be num__u4. - 3) If sx_u2? is defined, then: - a) Let ?(sx) be sx_u2?. + 3) If cvtop_u2 is of the case TRUNC, then: + a) Let (TRUNC sx) be cvtop_u2. b) Return [$trunc($size(Fnn), $size(Inn), sx, fN)]. -4. If ((cvtop_u5 is CONVERT_SAT) and the type of numty_u0 is Fnn), then: - a. Let Fnn be numty_u0. - b. If the type of numty_u1 is Inn, then: - 1) Let Inn be numty_u1. - 2) Let fN be num__u4. - 3) If sx_u2? is defined, then: - a) Let ?(sx) be sx_u2?. + 4) If cvtop_u2 is of the case TRUNC_SAT, then: + a) Let (TRUNC_SAT sx) be cvtop_u2. b) Return [$trunc_sat($size(Fnn), $size(Inn), sx, fN)]. -5. If ((numty_u0 is F32) and ((numty_u1 is F64) and (cvtop_u5 is CONVERT))), then: +4. If ((numty_u0 is F32) and ((numty_u1 is F64) and (cvtop_u2 is PROMOTE))), then: a. Let fN be num__u4. b. Return [$promote(32, 64, fN)]. -6. If ((numty_u0 is F64) and ((numty_u1 is F32) and (cvtop_u5 is CONVERT))), then: +5. If ((numty_u0 is F64) and ((numty_u1 is F32) and (cvtop_u2 is DEMOTE))), then: a. Let fN be num__u4. b. Return [$demote(64, 32, fN)]. -7. Assert: Due to validation, (cvtop_u5 is CONVERT). -8. If the type of numty_u1 is Fnn, then: +6. If the type of numty_u1 is Fnn, then: a. Let Fnn be numty_u1. b. If the type of numty_u0 is Inn, then: 1) Let Inn be numty_u0. 2) Let iN be num__u4. - 3) If sx_u2? is defined, then: - a) Let ?(sx) be sx_u2?. + 3) If cvtop_u2 is of the case CONVERT, then: + a) Let (CONVERT sx) be cvtop_u2. b) Return [$convert($size(Inn), $size(Fnn), sx, iN)]. - 4) If ($size(Inn) is $size(Fnn)), then: +7. Assert: Due to validation, (cvtop_u2 is REINTERPRET). +8. If the type of numty_u1 is Fnn, then: + a. Let Fnn be numty_u1. + b. If the type of numty_u0 is Inn, then: + 1) Let Inn be numty_u0. + 2) Let iN be num__u4. + 3) If ($size(Inn) is $size(Fnn)), then: a) Return [$reinterpret(Inn, Fnn, iN)]. 9. Assert: Due to validation, the type of numty_u0 is Fnn. 10. Let Fnn be numty_u0. @@ -2957,13 +2957,13 @@ execution_of_RELOP nt relop 5. Let c be $relop(nt, relop, c_1, c_2). 6. Push the value (I32.CONST c) to the stack. -execution_of_CVTOP nt_2 nt_1 cvtop sx? +execution_of_CVTOP nt_2 nt_1 cvtop 1. Assert: Due to validation, a value of value type nt_1 is on the top of the stack. 2. Pop the value (nt_1.CONST c_1) from the stack. -3. If (|$cvtop(nt_1, nt_2, cvtop, sx?, c_1)| is 1), then: - a. Let [c] be $cvtop(nt_1, nt_2, cvtop, sx?, c_1). +3. If (|$cvtop(nt_1, nt_2, cvtop, c_1)| is 1), then: + a. Let [c] be $cvtop(nt_1, nt_2, cvtop, c_1). b. Push the value (nt_2.CONST c) to the stack. -4. If ($cvtop(nt_1, nt_2, cvtop, sx?, c_1) is []), then: +4. If ($cvtop(nt_1, nt_2, cvtop, c_1) is []), then: a. Trap. execution_of_REF.IS_NULL @@ -3649,14 +3649,14 @@ watsup 0.4 generator 6-typing.watsup:691.6-691.40: prem_to_instrs: Yet `Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype})` 6-typing.watsup:698.6-698.45: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`_nul(?(())), FUNC_heaptype))` 6-typing.watsup:702.6-702.40: prem_to_instrs: Yet `Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype})` -6-typing.watsup:763.6-763.33: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, rt')` -6-typing.watsup:769.6-769.33: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, rt')` -6-typing.watsup:787.7-787.38: prem_to_instrs: Yet `where ?(val) = $default_($unpack(zt))` -6-typing.watsup:819.6-819.40: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt)` -6-typing.watsup:848.6-848.40: prem_to_instrs: Yet `Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1)` -6-typing.watsup:853.6-853.44: prem_to_instrs: Yet `Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt)` -6-typing.watsup:990.6-990.36: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt_2, rt_1)` -6-typing.watsup:996.6-996.36: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt_2, rt_1)` +6-typing.watsup:756.6-756.33: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, rt')` +6-typing.watsup:762.6-762.33: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, rt')` +6-typing.watsup:780.7-780.38: prem_to_instrs: Yet `where ?(val) = $default_($unpack(zt))` +6-typing.watsup:812.6-812.40: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt)` +6-typing.watsup:841.6-841.40: prem_to_instrs: Yet `Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1)` +6-typing.watsup:846.6-846.44: prem_to_instrs: Yet `Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt)` +6-typing.watsup:983.6-983.36: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt_2, rt_1)` +6-typing.watsup:989.6-989.36: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt_2, rt_1)` ================= Generated prose ================= @@ -3806,8 +3806,7 @@ validation_of_TESTOP nt testop_nt validation_of_RELOP nt relop_nt - The instruction is valid with type ([nt, nt] ->_ [] ++ [I32]). -validation_of_CVTOP nt_1 nt_2 REINTERPRET ?() -- $size(nt_1) must be equal to $size(nt_2). +validation_of_CVTOP nt_1 nt_2 cvtop - The instruction is valid with type ([nt_2] ->_ [] ++ [nt_1]). validation_of_REF.NULL ht @@ -5452,60 +5451,67 @@ relop numty_u1 relop_u0 num__u3 num__u5 13. Let fN_2 be num__u5. 14. Return $fge($size(Fnn), fN_1, fN_2). -cvtop numty_u0 numty_u1 cvtop_u7 sx_u2? num__u4 -1. If ((numty_u0 is I32) and ((numty_u1 is I64) and (cvtop_u7 is CONVERT))), then: - a. Let iN be num__u4. - b. If sx_u2? is defined, then: - 1) Let ?(sx) be sx_u2?. - 2) Return [$ext(32, 64, sx, iN)]. -2. If ((numty_u0 is I64) and ((numty_u1 is I32) and (cvtop_u7 is CONVERT))), then: - a. Let iN be num__u4. - b. Return [$wrap(64, 32, iN)]. -3. If ((cvtop_u7 is CONVERT) and the type of numty_u0 is Fnn), then: - a. Let Fnn be numty_u0. +cvtop numty_u1 numty_u4 cvtop_u0 num__u3 +1. If the type of numty_u1 is Inn, then: + a. Let Inn_1 be numty_u1. + b. If the type of numty_u4 is Inn, then: + 1) Let Inn_2 be numty_u4. + 2) Let iN_1 be num__u3. + 3) If cvtop_u0 is of the case EXTEND, then: + a) Let (EXTEND sx) be cvtop_u0. + b) Return [$ext($sizenn1(Inn_1), $sizenn2(Inn_2), sx, iN_1)]. +2. If ((cvtop_u0 is WRAP) and the type of numty_u1 is Inn), then: + a. Let Inn_1 be numty_u1. + b. If the type of numty_u4 is Inn, then: + 1) Let Inn_2 be numty_u4. + 2) Let iN_1 be num__u3. + 3) Return [$wrap($sizenn1(Inn_1), $sizenn2(Inn_2), iN_1)]. +3. If the type of numty_u1 is Fnn, then: + a. Let Fnn_1 be numty_u1. + b. If the type of numty_u4 is Inn, then: + 1) Let Inn_2 be numty_u4. + 2) Let fN_1 be num__u3. + 3) If cvtop_u0 is of the case TRUNC, then: + a) Let (TRUNC sx) be cvtop_u0. + b) Return [$trunc($sizenn1(Fnn_1), $sizenn2(Inn_2), sx, fN_1)]. + 4) If cvtop_u0 is of the case TRUNC_SAT, then: + a) Let (TRUNC_SAT sx) be cvtop_u0. + b) Return [$trunc_sat($sizenn1(Fnn_1), $sizenn2(Inn_2), sx, fN_1)]. +4. If the type of numty_u4 is Fnn, then: + a. Let Fnn_2 be numty_u4. b. If the type of numty_u1 is Inn, then: - 1) Let Inn be numty_u1. - 2) Let fN be num__u4. - 3) If sx_u2? is defined, then: - a) Let ?(sx) be sx_u2?. - b) Return [$trunc($size(Fnn), $size(Inn), sx, fN)]. -4. If ((cvtop_u7 is CONVERT_SAT) and the type of numty_u0 is Fnn), then: - a. Let Fnn be numty_u0. + 1) Let Inn_1 be numty_u1. + 2) Let iN_1 be num__u3. + 3) If cvtop_u0 is of the case CONVERT, then: + a) Let (CONVERT sx) be cvtop_u0. + b) Return [$convert($sizenn1(Inn_1), $sizenn2(Fnn_2), sx, iN_1)]. +5. If ((cvtop_u0 is PROMOTE) and the type of numty_u1 is Fnn), then: + a. Let Fnn_1 be numty_u1. + b. If the type of numty_u4 is Fnn, then: + 1) Let Fnn_2 be numty_u4. + 2) Let fN_1 be num__u3. + 3) Return [$promote($sizenn1(Fnn_1), $sizenn2(Fnn_2), fN_1)]. +6. If ((cvtop_u0 is DEMOTE) and the type of numty_u1 is Fnn), then: + a. Let Fnn_1 be numty_u1. + b. If the type of numty_u4 is Fnn, then: + 1) Let Fnn_2 be numty_u4. + 2) Let fN_1 be num__u3. + 3) Return [$demote($sizenn1(Fnn_1), $sizenn2(Fnn_2), fN_1)]. +7. Assert: Due to validation, (cvtop_u0 is REINTERPRET). +8. If the type of numty_u4 is Fnn, then: + a. Let Fnn_2 be numty_u4. b. If the type of numty_u1 is Inn, then: - 1) Let Inn be numty_u1. - 2) Let fN be num__u4. - 3) If sx_u2? is defined, then: - a) Let ?(sx) be sx_u2?. - b) Return [$trunc_sat($size(Fnn), $size(Inn), sx, fN)]. -5. If ((numty_u0 is F32) and ((numty_u1 is F64) and (cvtop_u7 is CONVERT))), then: - a. Let fN be num__u4. - b. Return [$promote(32, 64, fN)]. -6. If ((numty_u0 is F64) and ((numty_u1 is F32) and (cvtop_u7 is CONVERT))), then: - a. Let fN be num__u4. - b. Return [$demote(64, 32, fN)]. -7. If ((cvtop_u7 is CONVERT) and the type of numty_u1 is Fnn), then: - a. Let Fnn be numty_u1. - b. If the type of numty_u0 is Inn, then: - 1) Let Inn be numty_u0. - 2) Let iN be num__u4. - 3) If sx_u2? is defined, then: - a) Let ?(sx) be sx_u2?. - b) Return [$convert($size(Inn), $size(Fnn), sx, iN)]. -8. Assert: Due to validation, (cvtop_u7 is REINTERPRET). -9. If the type of numty_u1 is Fnn, then: - a. Let Fnn be numty_u1. - b. If the type of numty_u0 is Inn, then: - 1) Let Inn be numty_u0. - 2) Let iN be num__u4. - 3) If ($size(Inn) is $size(Fnn)), then: - a) Return [$reinterpret(Inn, Fnn, iN)]. -10. Assert: Due to validation, the type of numty_u0 is Fnn. -11. Let Fnn be numty_u0. -12. Assert: Due to validation, the type of numty_u1 is Inn. -13. Let Inn be numty_u1. -14. Let fN be num__u4. -15. Assert: Due to validation, ($size(Inn) is $size(Fnn)). -16. Return [$reinterpret(Fnn, Inn, fN)]. + 1) Let Inn_1 be numty_u1. + 2) Let iN_1 be num__u3. + 3) If ($sizenn1(Inn_1) is $sizenn2(Fnn_2)), then: + a) Return [$reinterpret(Inn_1, Fnn_2, iN_1)]. +9. Assert: Due to validation, the type of numty_u1 is Fnn. +10. Let Fnn_1 be numty_u1. +11. Assert: Due to validation, the type of numty_u4 is Inn. +12. Let Inn_2 be numty_u4. +13. Let fN_1 be num__u3. +14. Assert: Due to validation, the type of $inverse_of_sizenn2($sizenn1(Inn_1)) is Fnn. +15. Return [$reinterpret(Fnn_1, Inn_2, fN_1)]. invibytes N b* 1. Let n be $inverse_of_ibytes(N, b*). @@ -6587,13 +6593,13 @@ execution_of_RELOP nt relop 5. Let c be $relop(nt, relop, c_1, c_2). 6. Push the value (I32.CONST c) to the stack. -execution_of_CVTOP nt_2 nt_1 cvtop sx? +execution_of_CVTOP nt_2 nt_1 cvtop 1. Assert: Due to validation, a value of value type nt_1 is on the top of the stack. 2. Pop the value (nt_1.CONST c_1) from the stack. -3. If (|$cvtop(nt_1, nt_2, cvtop, sx?, c_1)| is 1), then: - a. Let [c] be $cvtop(nt_1, nt_2, cvtop, sx?, c_1). +3. If (|$cvtop(nt_1, nt_2, cvtop, c_1)| is 1), then: + a. Let [c] be $cvtop(nt_1, nt_2, cvtop, c_1). b. Push the value (nt_2.CONST c) to the stack. -4. If ($cvtop(nt_1, nt_2, cvtop, sx?, c_1) is []), then: +4. If ($cvtop(nt_1, nt_2, cvtop, c_1) is []), then: a. Trap. execution_of_REF.I31 diff --git a/spectec/test-splice/TEST.md b/spectec/test-splice/TEST.md index 3d4ed6e39b..dd72d0b697 100644 --- a/spectec/test-splice/TEST.md +++ b/spectec/test-splice/TEST.md @@ -24,14 +24,14 @@ $ (../src/exe-watsup/main.exe ../spec/wasm-3.0/*.watsup -l --splice-latex -p spe ../spec/wasm-3.0/6-typing.watsup:691.6-691.40: prem_to_instrs: Yet `Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype})` ../spec/wasm-3.0/6-typing.watsup:698.6-698.45: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`_nul(?(())), FUNC_heaptype))` ../spec/wasm-3.0/6-typing.watsup:702.6-702.40: prem_to_instrs: Yet `Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype})` -../spec/wasm-3.0/6-typing.watsup:763.6-763.33: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, rt')` -../spec/wasm-3.0/6-typing.watsup:769.6-769.33: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, rt')` -../spec/wasm-3.0/6-typing.watsup:787.7-787.38: prem_to_instrs: Yet `where ?(val) = $default_($unpack(zt))` -../spec/wasm-3.0/6-typing.watsup:819.6-819.40: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt)` -../spec/wasm-3.0/6-typing.watsup:848.6-848.40: prem_to_instrs: Yet `Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1)` -../spec/wasm-3.0/6-typing.watsup:853.6-853.44: prem_to_instrs: Yet `Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt)` -../spec/wasm-3.0/6-typing.watsup:990.6-990.36: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt_2, rt_1)` -../spec/wasm-3.0/6-typing.watsup:996.6-996.36: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt_2, rt_1)` +../spec/wasm-3.0/6-typing.watsup:756.6-756.33: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, rt')` +../spec/wasm-3.0/6-typing.watsup:762.6-762.33: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt, rt')` +../spec/wasm-3.0/6-typing.watsup:780.7-780.38: prem_to_instrs: Yet `where ?(val) = $default_($unpack(zt))` +../spec/wasm-3.0/6-typing.watsup:812.6-812.40: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, C.ELEMS_context[y!`%`_idx.0], rt)` +../spec/wasm-3.0/6-typing.watsup:841.6-841.40: prem_to_instrs: Yet `Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1)` +../spec/wasm-3.0/6-typing.watsup:846.6-846.44: prem_to_instrs: Yet `Storagetype_sub: `%|-%<:%`(C, (C.ELEMS_context[y!`%`_idx.0] : reftype <: storagetype), zt)` +../spec/wasm-3.0/6-typing.watsup:983.6-983.36: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt_2, rt_1)` +../spec/wasm-3.0/6-typing.watsup:989.6-989.36: prem_to_instrs: Yet `Reftype_sub: `%|-%<:%`(C, rt_2, rt_1)` == Splicing... \documentclass[a4paper]{scrartcl} @@ -93,8 +93,7 @@ $$ {\mathit{numtype}} {.} {{\mathit{binop}}}_{{\mathit{numtype}}} \\ &&|& {\mathit{numtype}} {.} {{\mathit{testop}}}_{{\mathit{numtype}}} \\ &&|& {\mathit{numtype}} {.} {{\mathit{relop}}}_{{\mathit{numtype}}} \\ &&|& -{\mathit{numtype}}_1 {.} {{{\mathit{cvtop}}}_{{\mathit{numtype}}_2, {\mathit{numtype}}_1}}{\mathsf{\_}}{{\mathit{numtype}}_2}{\mathsf{\_}}{{{\mathit{sx}}^?}} - &\qquad \mbox{if}~{\mathit{numtype}}_1 \neq {\mathit{numtype}}_2 \\ &&|& +{\mathit{numtype}}_1 {.} {{{\mathit{cvtop}}}_{{\mathit{numtype}}_2, {\mathit{numtype}}_1}}{\mathsf{\_}}{{\mathit{numtype}}_2} \\ &&|& \mathsf{local{.}get}~{\mathit{localidx}} \\ &&|& \mathsf{local{.}set}~{\mathit{localidx}} \\ &&|& \mathsf{local{.}tee}~{\mathit{localidx}} \\ &&|& @@ -345,6 +344,9 @@ warning: syntax `config` was never spliced warning: syntax `consttype` was never spliced warning: syntax `context` was never spliced warning: syntax `cvtop_` was never spliced +warning: syntax `cvtop_` was never spliced +warning: syntax `cvtop_` was never spliced +warning: syntax `cvtop_` was never spliced warning: syntax `data` was never spliced warning: syntax `dataaddr` was never spliced warning: syntax `dataidx` was never spliced @@ -795,6 +797,7 @@ warning: rule `Instr_ok/unop` was never spliced warning: rule `Instr_ok/binop` was never spliced warning: rule `Instr_ok/testop` was never spliced warning: rule `Instr_ok/relop` was never spliced +warning: rule `Instr_ok/cvtop` was never spliced warning: rule `Instr_ok/ref.null` was never spliced warning: rule `Instr_ok/ref.func` was never spliced warning: rule `Instr_ok/ref.i31` was never spliced @@ -856,7 +859,6 @@ warning: rule `Instr_ok/table.copy` was never spliced warning: rule `Instr_ok/table.init` was never spliced warning: rule `Instr_ok/elem.drop` was never spliced warning: rule `Instr_ok/memory.size` was never spliced -warning: rule `Instr_ok/memory.grow` was never spliced warning: rule `Instr_ok/memory.fill` was never spliced warning: rule `Instr_ok/memory.copy` was never spliced warning: rule `Instr_ok/memory.init` was never spliced