From 3d800b7abcaacc005ef471342baae55a90823130 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 9 Nov 2023 17:24:21 -0800 Subject: [PATCH] [Parser] Parse ref.test and ref.cast --- src/parser/contexts.h | 10 ++ src/parser/parsers.h | 8 +- src/wasm-ir-builder.h | 4 +- src/wasm.h | 2 + src/wasm/wasm-ir-builder.cpp | 14 ++- test/lit/wat-kitchen-sink.wast | 202 ++++++++++++++++++++------------- 6 files changed, 155 insertions(+), 85 deletions(-) diff --git a/src/parser/contexts.h b/src/parser/contexts.h index 485c596e7ec..bf6c291e7a4 100644 --- a/src/parser/contexts.h +++ b/src/parser/contexts.h @@ -395,6 +395,8 @@ struct NullInstrParserCtx { Result<> makeRefEq(Index) { return Ok{}; } Result<> makeRefI31(Index) { return Ok{}; } Result<> makeI31Get(Index, bool) { return Ok{}; } + template Result<> makeRefTest(Index, TypeT) { return Ok{}; } + template Result<> makeRefCast(Index, TypeT) { return Ok{}; } template Result<> makeStructNew(Index, HeapTypeT) { return Ok{}; @@ -1280,6 +1282,14 @@ struct ParseDefsCtx : TypeParserCtx { return withLoc(pos, irBuilder.makeI31Get(signed_)); } + Result<> makeRefTest(Index pos, Type type) { + return withLoc(pos, irBuilder.makeRefTest(type)); + } + + Result<> makeRefCast(Index pos, Type type) { + return withLoc(pos, irBuilder.makeRefCast(type)); + } + Result<> makeStructNew(Index pos, HeapType type) { return withLoc(pos, irBuilder.makeStructNew(type)); } diff --git a/src/parser/parsers.h b/src/parser/parsers.h index 0641e941c3d..6b6bb0aa568 100644 --- a/src/parser/parsers.h +++ b/src/parser/parsers.h @@ -1303,11 +1303,15 @@ template Result<> makeI31Get(Ctx& ctx, Index pos, bool signed_) { } template Result<> makeRefTest(Ctx& ctx, Index pos) { - return ctx.in.err("unimplemented instruction"); + auto type = reftype(ctx); + CHECK_ERR(type); + return ctx.makeRefTest(pos, *type); } template Result<> makeRefCast(Ctx& ctx, Index pos) { - return ctx.in.err("unimplemented instruction"); + auto type = reftype(ctx); + CHECK_ERR(type); + return ctx.makeRefCast(pos, *type); } template Result<> makeBrOnNull(Ctx& ctx, Index pos, bool onFail) { diff --git a/src/wasm-ir-builder.h b/src/wasm-ir-builder.h index 6d4fca3c3a0..c0cd7b4a187 100644 --- a/src/wasm-ir-builder.h +++ b/src/wasm-ir-builder.h @@ -149,8 +149,8 @@ class IRBuilder : public UnifiedExpressionVisitor> { [[nodiscard]] Result<> makeRefI31(); [[nodiscard]] Result<> makeI31Get(bool signed_); // [[nodiscard]] Result<> makeCallRef(); - // [[nodiscard]] Result<> makeRefTest(); - // [[nodiscard]] Result<> makeRefCast(); + [[nodiscard]] Result<> makeRefTest(Type type); + [[nodiscard]] Result<> makeRefCast(Type type); // [[nodiscard]] Result<> makeBrOn(); [[nodiscard]] Result<> makeStructNew(HeapType type); [[nodiscard]] Result<> makeStructNewDefault(HeapType type); diff --git a/src/wasm.h b/src/wasm.h index ba797d77375..96c9271fe08 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -1540,6 +1540,7 @@ class CallRef : public SpecificExpression { class RefTest : public SpecificExpression { public: + RefTest() = default; RefTest(MixedArena& allocator) {} Expression* ref; @@ -1553,6 +1554,7 @@ class RefTest : public SpecificExpression { class RefCast : public SpecificExpression { public: + RefCast() = default; RefCast(MixedArena& allocator) {} Expression* ref; diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp index cbb16ff685d..c973238e906 100644 --- a/src/wasm/wasm-ir-builder.cpp +++ b/src/wasm/wasm-ir-builder.cpp @@ -919,9 +919,19 @@ Result<> IRBuilder::makeI31Get(bool signed_) { // Result<> IRBuilder::makeCallRef() {} -// Result<> IRBuilder::makeRefTest() {} +Result<> IRBuilder::makeRefTest(Type type) { + RefTest curr; + CHECK_ERR(visitRefTest(&curr)); + push(builder.makeRefTest(curr.ref, type)); + return Ok{}; +} -// Result<> IRBuilder::makeRefCast() {} +Result<> IRBuilder::makeRefCast(Type type) { + RefCast curr; + CHECK_ERR(visitRefCast(&curr)); + push(builder.makeRefCast(curr.ref, type)); + return Ok{}; +} // Result<> IRBuilder::makeBrOn() {} diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast index f57541e90d5..77c31c7e10a 100644 --- a/test/lit/wat-kitchen-sink.wast +++ b/test/lit/wat-kitchen-sink.wast @@ -29,86 +29,88 @@ ;; CHECK: (type $10 (func (param v128 i32) (result v128))) - ;; CHECK: (type $packed-i8 (array (mut i8))) + ;; CHECK: (type $11 (func (param anyref))) - ;; CHECK: (type $packed-i16 (array (mut i16))) + ;; CHECK: (rec + ;; CHECK-NEXT: (type $s0 (struct )) + (type $s0 (sub (struct))) + ;; CHECK: (type $s1 (struct )) + (type $s1 (struct (field))) + ) - ;; CHECK: (type $13 (func (param i32 i64) (result f32))) + (rec) - ;; CHECK: (type $many (sub (func (param i32 i64 f32 f64) (result anyref (ref func))))) + ;; CHECK: (type $packed-i8 (array (mut i8))) - ;; CHECK: (type $15 (func (param i32 i32))) + ;; CHECK: (type $packed-i16 (array (mut i16))) - ;; CHECK: (type $16 (func (param i32 i32 f64 f64))) + ;; CHECK: (type $16 (func (param i32 i64) (result f32))) - ;; CHECK: (type $17 (func (param i64))) + ;; CHECK: (type $many (sub (func (param i32 i64 f32 f64) (result anyref (ref func))))) - ;; CHECK: (type $18 (func (param v128) (result i32))) + ;; CHECK: (type $18 (func (param i32 i32))) - ;; CHECK: (type $19 (func (param v128 v128) (result v128))) + ;; CHECK: (type $19 (func (param i32 i32 f64 f64))) - ;; CHECK: (type $20 (func (param v128 v128 v128) (result v128))) + ;; CHECK: (type $20 (func (param i64))) - ;; CHECK: (type $21 (func (param i32 i64 v128))) + ;; CHECK: (type $21 (func (param v128) (result i32))) - ;; CHECK: (type $22 (func (param i32 i32 i64 i64))) + ;; CHECK: (type $22 (func (param v128 v128) (result v128))) - ;; CHECK: (type $23 (func (param i32) (result i32))) + ;; CHECK: (type $23 (func (param v128 v128 v128) (result v128))) - ;; CHECK: (type $24 (func (param i32 i64) (result i32 i64))) + ;; CHECK: (type $24 (func (param i32 i64 v128))) - ;; CHECK: (type $25 (func (param i64) (result i32 i64))) + ;; CHECK: (type $25 (func (param i32 i32 i64 i64))) - ;; CHECK: (type $26 (func (param i32) (result i32 i64))) + ;; CHECK: (type $26 (func (param i32) (result i32))) - ;; CHECK: (type $27 (func (param anyref) (result i32))) + ;; CHECK: (type $27 (func (param i32 i64) (result i32 i64))) - ;; CHECK: (type $28 (func (param eqref eqref) (result i32))) + ;; CHECK: (type $28 (func (param i64) (result i32 i64))) - ;; CHECK: (type $29 (func (param i32) (result i31ref))) + ;; CHECK: (type $29 (func (param i32) (result i32 i64))) - ;; CHECK: (type $30 (func (param i31ref))) + ;; CHECK: (type $30 (func (param anyref) (result i32))) - ;; CHECK: (type $31 (func (param i32 i64) (result (ref $pair)))) + ;; CHECK: (type $31 (func (param eqref eqref) (result i32))) - ;; CHECK: (type $32 (func (result (ref $pair)))) + ;; CHECK: (type $32 (func (param i32) (result i31ref))) - ;; CHECK: (type $33 (func (param (ref $pair)) (result i32))) + ;; CHECK: (type $33 (func (param i31ref))) - ;; CHECK: (type $34 (func (param (ref $pair)) (result i64))) + ;; CHECK: (type $34 (func (param i32 i64) (result (ref $pair)))) - ;; CHECK: (type $35 (func (param (ref $pair) i32))) + ;; CHECK: (type $35 (func (result (ref $pair)))) - ;; CHECK: (type $36 (func (param (ref $pair) i64))) + ;; CHECK: (type $36 (func (param (ref $pair)) (result i32))) - ;; CHECK: (type $37 (func (param i64 i32) (result (ref $a1)))) + ;; CHECK: (type $37 (func (param (ref $pair)) (result i64))) - ;; CHECK: (type $38 (func (param i32) (result (ref $a1)))) + ;; CHECK: (type $38 (func (param (ref $pair) i32))) - ;; CHECK: (type $39 (func (param i32 i32) (result (ref $a1)))) + ;; CHECK: (type $39 (func (param (ref $pair) i64))) - ;; CHECK: (type $40 (func (param (ref $a1) i32) (result i64))) + ;; CHECK: (type $40 (func (param i64 i32) (result (ref $a1)))) - ;; CHECK: (type $41 (func (param (ref $packed-i8) i32) (result i32))) + ;; CHECK: (type $41 (func (param i32) (result (ref $a1)))) - ;; CHECK: (type $42 (func (param (ref $packed-i16) i32) (result i32))) + ;; CHECK: (type $42 (func (param i32 i32) (result (ref $a1)))) - ;; CHECK: (type $43 (func (param (ref $a2) i32 f32))) + ;; CHECK: (type $43 (func (param (ref $a1) i32) (result i64))) - ;; CHECK: (type $44 (func (param arrayref) (result i32))) + ;; CHECK: (type $44 (func (param (ref $packed-i8) i32) (result i32))) - ;; CHECK: (type $45 (func (param (ref $a2) i32 (ref $a2) i32 i32))) + ;; CHECK: (type $45 (func (param (ref $packed-i16) i32) (result i32))) - ;; CHECK: (type $46 (func (param (ref $a2) i32 f32 i32))) + ;; CHECK: (type $46 (func (param (ref $a2) i32 f32))) - ;; CHECK: (rec - ;; CHECK-NEXT: (type $s0 (struct )) - (type $s0 (sub (struct))) - ;; CHECK: (type $s1 (struct )) - (type $s1 (struct (field))) - ) + ;; CHECK: (type $47 (func (param arrayref) (result i32))) - (rec) + ;; CHECK: (type $48 (func (param (ref $a2) i32 (ref $a2) i32 i32))) + + ;; CHECK: (type $49 (func (param (ref $a2) i32 f32 i32))) ;; CHECK: (type $s2 (struct (field i32))) (type $s2 (struct i32)) @@ -158,7 +160,7 @@ (global (import "mod" "") (ref null $many)) (global (mut i32) i32.const 0) - ;; CHECK: (type $60 (func (param (ref $s0) (ref $s1) (ref $s2) (ref $s3) (ref $s4) (ref $s5) (ref $s6) (ref $s7) (ref $s8) (ref $a0) (ref $a1) (ref $a2) (ref $a3) (ref $subvoid) (ref $submany)))) + ;; CHECK: (type $61 (func (param (ref $s0) (ref $s1) (ref $s2) (ref $s3) (ref $s4) (ref $s5) (ref $s6) (ref $s7) (ref $s8) (ref $a0) (ref $a1) (ref $a2) (ref $a3) (ref $subvoid) (ref $submany)))) ;; CHECK: (import "" "mem" (memory $mimport$1 0)) @@ -680,7 +682,7 @@ drop ) - ;; CHECK: (func $locals (type $15) (param $0 i32) (param $x i32) + ;; CHECK: (func $locals (type $18) (param $0 i32) (param $x i32) ;; CHECK-NEXT: (local $2 i32) ;; CHECK-NEXT: (local $y i32) ;; CHECK-NEXT: (drop @@ -1716,7 +1718,7 @@ ) - ;; CHECK: (func $binary (type $16) (param $0 i32) (param $1 i32) (param $2 f64) (param $3 f64) + ;; CHECK: (func $binary (type $19) (param $0 i32) (param $1 i32) (param $2 f64) (param $3 f64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $0) @@ -1741,7 +1743,7 @@ drop ) - ;; CHECK: (func $unary (type $17) (param $0 i64) + ;; CHECK: (func $unary (type $20) (param $0 i64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i64.eqz ;; CHECK-NEXT: (local.get $0) @@ -2036,7 +2038,7 @@ atomic.fence ) - ;; CHECK: (func $simd-extract (type $18) (param $0 v128) (result i32) + ;; CHECK: (func $simd-extract (type $21) (param $0 v128) (result i32) ;; CHECK-NEXT: (i32x4.extract_lane 3 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2058,7 +2060,7 @@ i32x4.replace_lane 2 ) - ;; CHECK: (func $simd-shuffle (type $19) (param $0 v128) (param $1 v128) (result v128) + ;; CHECK: (func $simd-shuffle (type $22) (param $0 v128) (param $1 v128) (result v128) ;; CHECK-NEXT: (i8x16.shuffle 0 1 2 3 4 5 6 7 16 17 18 19 20 21 22 23 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2070,7 +2072,7 @@ i8x16.shuffle 0 1 2 3 4 5 6 7 16 17 18 19 20 21 22 23 ) - ;; CHECK: (func $simd-ternary (type $20) (param $0 v128) (param $1 v128) (param $2 v128) (result v128) + ;; CHECK: (func $simd-ternary (type $23) (param $0 v128) (param $1 v128) (param $2 v128) (result v128) ;; CHECK-NEXT: (v128.bitselect ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2117,7 +2119,7 @@ drop ) - ;; CHECK: (func $simd-load-store-lane (type $21) (param $0 i32) (param $1 i64) (param $2 v128) + ;; CHECK: (func $simd-load-store-lane (type $24) (param $0 i32) (param $1 i64) (param $2 v128) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (v128.load16_lane $mem 7 ;; CHECK-NEXT: (local.get $0) @@ -2180,7 +2182,7 @@ data.drop $passive ) - ;; CHECK: (func $memory-copy (type $22) (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i64) + ;; CHECK: (func $memory-copy (type $25) (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i64) ;; CHECK-NEXT: (memory.copy $mem $mem ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2251,7 +2253,7 @@ return ) - ;; CHECK: (func $return-one (type $23) (param $0 i32) (result i32) + ;; CHECK: (func $return-one (type $26) (param $0 i32) (result i32) ;; CHECK-NEXT: (return ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2261,7 +2263,7 @@ return ) - ;; CHECK: (func $return-two (type $24) (param $0 i32) (param $1 i64) (result i32 i64) + ;; CHECK: (func $return-two (type $27) (param $0 i32) (param $1 i64) (result i32 i64) ;; CHECK-NEXT: (return ;; CHECK-NEXT: (tuple.make ;; CHECK-NEXT: (local.get $0) @@ -2275,7 +2277,7 @@ return ) - ;; CHECK: (func $return-two-first-unreachable (type $25) (param $0 i64) (result i32 i64) + ;; CHECK: (func $return-two-first-unreachable (type $28) (param $0 i64) (result i32 i64) ;; CHECK-NEXT: (return ;; CHECK-NEXT: (tuple.make ;; CHECK-NEXT: (unreachable) @@ -2289,7 +2291,7 @@ return ) - ;; CHECK: (func $return-two-second-unreachable (type $26) (param $0 i32) (result i32 i64) + ;; CHECK: (func $return-two-second-unreachable (type $29) (param $0 i32) (result i32 i64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2306,7 +2308,7 @@ return ) - ;; CHECK: (func $ref-is-null (type $27) (param $0 anyref) (result i32) + ;; CHECK: (func $ref-is-null (type $30) (param $0 anyref) (result i32) ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2331,7 +2333,7 @@ drop ) - ;; CHECK: (func $ref-eq (type $28) (param $0 eqref) (param $1 eqref) (result i32) + ;; CHECK: (func $ref-eq (type $31) (param $0 eqref) (param $1 eqref) (result i32) ;; CHECK-NEXT: (ref.eq ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2343,7 +2345,7 @@ ref.eq ) - ;; CHECK: (func $i31-new (type $29) (param $0 i32) (result i31ref) + ;; CHECK: (func $i31-new (type $32) (param $0 i32) (result i31ref) ;; CHECK-NEXT: (ref.i31 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2353,7 +2355,7 @@ ref.i31 ) - ;; CHECK: (func $i31-get (type $30) (param $0 i31ref) + ;; CHECK: (func $i31-get (type $33) (param $0 i31ref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i31.get_s ;; CHECK-NEXT: (local.get $0) @@ -2374,7 +2376,49 @@ drop ) - ;; CHECK: (func $struct-new (type $31) (param $0 i32) (param $1 i64) (result (ref $pair)) + ;; CHECK: (func $ref-test (type $11) (param $0 anyref) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.test i31ref + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.test (ref $s0) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $ref-test (param anyref) + local.get 0 + ref.test i31ref + drop + local.get 0 + ref.test (ref $s0) + drop + ) + + ;; CHECK: (func $ref-cast (type $11) (param $0 anyref) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.cast i31ref + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.cast (ref $s0) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $ref-cast (param anyref) + local.get 0 + ref.cast i31ref + drop + local.get 0 + ref.cast (ref $s0) + drop + ) + + ;; CHECK: (func $struct-new (type $34) (param $0 i32) (param $1 i64) (result (ref $pair)) ;; CHECK-NEXT: (struct.new $pair ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2386,14 +2430,14 @@ struct.new $pair ) - ;; CHECK: (func $struct-new-default (type $32) (result (ref $pair)) + ;; CHECK: (func $struct-new-default (type $35) (result (ref $pair)) ;; CHECK-NEXT: (struct.new_default $pair) ;; CHECK-NEXT: ) (func $struct-new-default (result (ref $pair)) struct.new_default 14 ) - ;; CHECK: (func $struct-get-0 (type $33) (param $0 (ref $pair)) (result i32) + ;; CHECK: (func $struct-get-0 (type $36) (param $0 (ref $pair)) (result i32) ;; CHECK-NEXT: (struct.get $pair 0 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2403,7 +2447,7 @@ struct.get 14 0 ) - ;; CHECK: (func $struct-get-1 (type $34) (param $0 (ref $pair)) (result i64) + ;; CHECK: (func $struct-get-1 (type $37) (param $0 (ref $pair)) (result i64) ;; CHECK-NEXT: (struct.get $pair 1 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2413,7 +2457,7 @@ struct.get $pair 1 ) - ;; CHECK: (func $struct-set-0 (type $35) (param $0 (ref $pair)) (param $1 i32) + ;; CHECK: (func $struct-set-0 (type $38) (param $0 (ref $pair)) (param $1 i32) ;; CHECK-NEXT: (struct.set $pair 0 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2425,7 +2469,7 @@ struct.set $pair 0 ) - ;; CHECK: (func $struct-set-1 (type $36) (param $0 (ref $pair)) (param $1 i64) + ;; CHECK: (func $struct-set-1 (type $39) (param $0 (ref $pair)) (param $1 i64) ;; CHECK-NEXT: (struct.set $pair 1 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2437,7 +2481,7 @@ struct.set 14 1 ) - ;; CHECK: (func $array-new (type $37) (param $0 i64) (param $1 i32) (result (ref $a1)) + ;; CHECK: (func $array-new (type $40) (param $0 i64) (param $1 i32) (result (ref $a1)) ;; CHECK-NEXT: (array.new $a1 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2449,7 +2493,7 @@ array.new $a1 ) - ;; CHECK: (func $array-new-default (type $38) (param $0 i32) (result (ref $a1)) + ;; CHECK: (func $array-new-default (type $41) (param $0 i32) (result (ref $a1)) ;; CHECK-NEXT: (array.new_default $a1 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2459,7 +2503,7 @@ array.new_default 11 ) - ;; CHECK: (func $array-new-data (type $39) (param $0 i32) (param $1 i32) (result (ref $a1)) + ;; CHECK: (func $array-new-data (type $42) (param $0 i32) (param $1 i32) (result (ref $a1)) ;; CHECK-NEXT: (array.new_data $a1 $implicit-data ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2471,7 +2515,7 @@ array.new_data $a1 0 ) - ;; CHECK: (func $array-get (type $40) (param $0 (ref $a1)) (param $1 i32) (result i64) + ;; CHECK: (func $array-get (type $43) (param $0 (ref $a1)) (param $1 i32) (result i64) ;; CHECK-NEXT: (array.get $a1 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2483,7 +2527,7 @@ array.get $a1 ) - ;; CHECK: (func $array-get-s (type $41) (param $0 (ref $packed-i8)) (param $1 i32) (result i32) + ;; CHECK: (func $array-get-s (type $44) (param $0 (ref $packed-i8)) (param $1 i32) (result i32) ;; CHECK-NEXT: (array.get_s $packed-i8 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2495,7 +2539,7 @@ array.get_s 15 ) - ;; CHECK: (func $array-get-u (type $42) (param $0 (ref $packed-i16)) (param $1 i32) (result i32) + ;; CHECK: (func $array-get-u (type $45) (param $0 (ref $packed-i16)) (param $1 i32) (result i32) ;; CHECK-NEXT: (array.get_u $packed-i16 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2507,7 +2551,7 @@ array.get_u $packed-i16 ) - ;; CHECK: (func $array-set (type $43) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) + ;; CHECK: (func $array-set (type $46) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) ;; CHECK-NEXT: (array.set $a2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2521,7 +2565,7 @@ array.set $a2 ) - ;; CHECK: (func $array-len (type $44) (param $0 arrayref) (result i32) + ;; CHECK: (func $array-len (type $47) (param $0 arrayref) (result i32) ;; CHECK-NEXT: (array.len ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2531,7 +2575,7 @@ array.len ) - ;; CHECK: (func $array-copy (type $45) (param $0 (ref $a2)) (param $1 i32) (param $2 (ref $a2)) (param $3 i32) (param $4 i32) + ;; CHECK: (func $array-copy (type $48) (param $0 (ref $a2)) (param $1 i32) (param $2 (ref $a2)) (param $3 i32) (param $4 i32) ;; CHECK-NEXT: (array.copy $a2 $a2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2549,7 +2593,7 @@ array.copy $a2 $a2 ) - ;; CHECK: (func $array-fill (type $46) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) (param $3 i32) + ;; CHECK: (func $array-fill (type $49) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) (param $3 i32) ;; CHECK-NEXT: (array.fill $a2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2565,7 +2609,7 @@ array.fill $a2 ) - ;; CHECK: (func $call (type $13) (param $0 i32) (param $1 i64) (result f32) + ;; CHECK: (func $call (type $16) (param $0 i32) (param $1 i64) (result f32) ;; CHECK-NEXT: (call $call ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2577,7 +2621,7 @@ call $call ) - ;; CHECK: (func $return_call (type $13) (param $0 i32) (param $1 i64) (result f32) + ;; CHECK: (func $return_call (type $16) (param $0 i32) (param $1 i64) (result f32) ;; CHECK-NEXT: (return_call $return_call ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -2589,7 +2633,7 @@ return_call $return_call ) - ;; CHECK: (func $use-types (type $60) (param $0 (ref $s0)) (param $1 (ref $s1)) (param $2 (ref $s2)) (param $3 (ref $s3)) (param $4 (ref $s4)) (param $5 (ref $s5)) (param $6 (ref $s6)) (param $7 (ref $s7)) (param $8 (ref $s8)) (param $9 (ref $a0)) (param $10 (ref $a1)) (param $11 (ref $a2)) (param $12 (ref $a3)) (param $13 (ref $subvoid)) (param $14 (ref $submany)) + ;; CHECK: (func $use-types (type $61) (param $0 (ref $s0)) (param $1 (ref $s1)) (param $2 (ref $s2)) (param $3 (ref $s3)) (param $4 (ref $s4)) (param $5 (ref $s5)) (param $6 (ref $s6)) (param $7 (ref $s7)) (param $8 (ref $s8)) (param $9 (ref $a0)) (param $10 (ref $a1)) (param $11 (ref $a2)) (param $12 (ref $a3)) (param $13 (ref $subvoid)) (param $14 (ref $submany)) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $use-types