diff options
42 files changed, 489 insertions, 1266 deletions
diff --git a/src/passes/LegalizeJSInterface.cpp b/src/passes/LegalizeJSInterface.cpp index 6002c7ad7..cde4373f8 100644 --- a/src/passes/LegalizeJSInterface.cpp +++ b/src/passes/LegalizeJSInterface.cpp @@ -29,9 +29,6 @@ // across modules, we still want to legalize dynCalls so JS can call into the // table even to a signature that is not legal. // -// This pass also legalizes according to asm.js FFI rules, which -// disallow f32s. TODO: an option to not do that, if it matters? -// #include <utility> #include "wasm.h" @@ -124,9 +121,9 @@ private: template<typename T> bool isIllegal(T* t) { for (auto param : t->params) { - if (param == i64 || param == f32) return true; + if (param == i64) return true; } - return t->result == i64 || t->result == f32; + return t->result == i64; } // Check if an export should be legalized. @@ -158,9 +155,6 @@ private: call->operands.push_back(I64Utilities::recreateI64(builder, legal->params.size(), legal->params.size() + 1)); legal->params.push_back(i32); legal->params.push_back(i32); - } else if (param == f32) { - call->operands.push_back(builder.makeUnary(DemoteFloat64, builder.makeGetLocal(legal->params.size(), f64))); - legal->params.push_back(f64); } else { call->operands.push_back(builder.makeGetLocal(legal->params.size(), param)); legal->params.push_back(param); @@ -177,9 +171,6 @@ private: block->list.push_back(I64Utilities::getI64Low(builder, index)); block->finalize(); legal->body = block; - } else if (func->result == f32) { - legal->result = f64; - legal->body = builder.makeUnary(PromoteFloat32, call); } else { legal->result = func->result; legal->body = call; @@ -216,9 +207,6 @@ private: call->operands.push_back(I64Utilities::getI64High(builder, func->params.size())); type->params.push_back(i32); type->params.push_back(i32); - } else if (param == f32) { - call->operands.push_back(builder.makeUnary(PromoteFloat32, builder.makeGetLocal(func->params.size(), f32))); - type->params.push_back(f64); } else { call->operands.push_back(builder.makeGetLocal(func->params.size(), param)); type->params.push_back(param); @@ -232,10 +220,6 @@ private: Expression* get = builder.makeCall(f->name, {}, call->type); func->body = I64Utilities::recreateI64(builder, call, get); type->result = i32; - } else if (imFunctionType->result == f32) { - call->type = f64; - func->body = builder.makeUnary(DemoteFloat64, call); - type->result = f64; } else { call->type = imFunctionType->result; func->body = call; diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp index 680e145b4..a66c8d1ac 100644 --- a/src/wasm/wasm-emscripten.cpp +++ b/src/wasm/wasm-emscripten.cpp @@ -241,6 +241,9 @@ Function* EmscriptenGlueGenerator::generateAssignGOTEntriesFunction() { } else { ImportInfo info(wasm); f = info.getImportedFunction(ENV, g->base); + if (!f) { + Fatal() << "GOT.func entry with no import/export: " << g->base; + } } Name getter((std::string("fp$") + g->base.c_str() + std::string("$") + getSig(f)).c_str()); diff --git a/test/lld/duplicate_imports.wast.out b/test/lld/duplicate_imports.wast.out index b8d046ab7..be9d7f77a 100644 --- a/test/lld/duplicate_imports.wast.out +++ b/test/lld/duplicate_imports.wast.out @@ -7,12 +7,10 @@ (type $FUNCSIG$fifd (func (param i32 f32 f64) (result f32))) (type $FUNCSIG$fidd (func (param i32 f64 f64) (result f32))) (type $legaltype$puts2 (func (param i32 i32) (result i32))) - (type $legaltype$invoke_ffd (func (param i32 f64 f64) (result f64))) - (type $legaltype$invoke_ffd2 (func (param i32 f64 f64) (result f64))) (import "env" "puts" (func $puts1 (param i32) (result i32))) + (import "env" "invoke_ffd" (func $invoke_ffd (param i32 f32 f64) (result f32))) + (import "env" "invoke_ffd" (func $invoke_ffd2 (param i32 f64 f64) (result f32))) (import "env" "puts" (func $legalimport$puts2 (param i32 i32) (result i32))) - (import "env" "invoke_ffd" (func $legalimport$invoke_ffd (param i32 f64 f64) (result f64))) - (import "env" "invoke_ffd" (func $legalimport$invoke_ffd2 (param i32 f64 f64) (result f64))) (memory $0 2) (data (i32.const 568) "Hello, world\00") (table $0 1 1 funcref) @@ -80,26 +78,6 @@ ) ) ) - (func $legalfunc$invoke_ffd (; 11 ;) (param $0 i32) (param $1 f32) (param $2 f64) (result f32) - (f32.demote_f64 - (call $legalimport$invoke_ffd - (local.get $0) - (f64.promote_f32 - (local.get $1) - ) - (local.get $2) - ) - ) - ) - (func $legalfunc$invoke_ffd2 (; 12 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f32) - (f32.demote_f64 - (call $legalimport$invoke_ffd2 - (local.get $0) - (local.get $1) - (local.get $2) - ) - ) - ) ) (; --BEGIN METADATA -- diff --git a/test/min.fromasm b/test/min.fromasm index 39c6fe26d..386520834 100644 --- a/test/min.fromasm +++ b/test/min.fromasm @@ -3,44 +3,38 @@ (data (global.get $__memory_base) "min.asm.js") (import "env" "__memory_base" (global $__memory_base i32)) (global $M (mut i32) (i32.const 0)) - (export "floats" (func $legalstub$floats)) + (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) - (export "neg" (func $legalstub$neg)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) (export "ctzzzz" (func $ctzzzz)) - (func $ctzzzz (; 0 ;) (; has Stack IR ;) (result i32) - (i32.const 2) - ) - (func $ub (; 1 ;) (; has Stack IR ;) (result i32) - (drop - (call $ub) - ) - (global.get $M) - ) - (func $legalstub$floats (; 2 ;) (; has Stack IR ;) (param $0 f64) (result f64) - (f64.promote_f32 - (f32.add - (f32.const 0) - (f32.demote_f64 - (local.get $0) - ) - ) + (func $floats (; 0 ;) (; has Stack IR ;) (param $0 f32) (result f32) + (f32.add + (f32.const 0) + (local.get $0) ) ) - (func $legalstub$neg (; 3 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f64) + (func $neg (; 1 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f32) (i32.store (local.get $0) (local.get $1) ) - (f64.promote_f32 - (f32.neg - (f32.load - (local.get $0) - ) + (f32.neg + (f32.load + (local.get $0) ) ) ) - (func $legalstub$bitcasts (; 4 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) + (func $bitcasts (; 2 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) (nop) ) + (func $ctzzzz (; 3 ;) (; has Stack IR ;) (result i32) + (i32.const 2) + ) + (func $ub (; 4 ;) (; has Stack IR ;) (result i32) + (drop + (call $ub) + ) + (global.get $M) + ) ) diff --git a/test/min.fromasm.clamp b/test/min.fromasm.clamp index 39c6fe26d..386520834 100644 --- a/test/min.fromasm.clamp +++ b/test/min.fromasm.clamp @@ -3,44 +3,38 @@ (data (global.get $__memory_base) "min.asm.js") (import "env" "__memory_base" (global $__memory_base i32)) (global $M (mut i32) (i32.const 0)) - (export "floats" (func $legalstub$floats)) + (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) - (export "neg" (func $legalstub$neg)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) (export "ctzzzz" (func $ctzzzz)) - (func $ctzzzz (; 0 ;) (; has Stack IR ;) (result i32) - (i32.const 2) - ) - (func $ub (; 1 ;) (; has Stack IR ;) (result i32) - (drop - (call $ub) - ) - (global.get $M) - ) - (func $legalstub$floats (; 2 ;) (; has Stack IR ;) (param $0 f64) (result f64) - (f64.promote_f32 - (f32.add - (f32.const 0) - (f32.demote_f64 - (local.get $0) - ) - ) + (func $floats (; 0 ;) (; has Stack IR ;) (param $0 f32) (result f32) + (f32.add + (f32.const 0) + (local.get $0) ) ) - (func $legalstub$neg (; 3 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f64) + (func $neg (; 1 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f32) (i32.store (local.get $0) (local.get $1) ) - (f64.promote_f32 - (f32.neg - (f32.load - (local.get $0) - ) + (f32.neg + (f32.load + (local.get $0) ) ) ) - (func $legalstub$bitcasts (; 4 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) + (func $bitcasts (; 2 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) (nop) ) + (func $ctzzzz (; 3 ;) (; has Stack IR ;) (result i32) + (i32.const 2) + ) + (func $ub (; 4 ;) (; has Stack IR ;) (result i32) + (drop + (call $ub) + ) + (global.get $M) + ) ) diff --git a/test/min.fromasm.clamp.no-opts b/test/min.fromasm.clamp.no-opts index 73a8dd281..ac8e11e87 100644 --- a/test/min.fromasm.clamp.no-opts +++ b/test/min.fromasm.clamp.no-opts @@ -6,10 +6,10 @@ (import "env" "tempDoublePtr" (global $tDP$asm2wasm$import i32)) (global $tDP (mut i32) (global.get $tDP$asm2wasm$import)) (global $M (mut i32) (i32.const 0)) - (export "floats" (func $legalstub$floats)) + (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) - (export "neg" (func $legalstub$neg)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) (export "ctzzzz" (func $ctzzzz)) (func $floats (; 0 ;) (param $f f32) (result f32) (local $t f32) @@ -73,29 +73,4 @@ (global.get $M) ) ) - (func $legalstub$floats (; 5 ;) (param $0 f64) (result f64) - (f64.promote_f32 - (call $floats - (f32.demote_f64 - (local.get $0) - ) - ) - ) - ) - (func $legalstub$neg (; 6 ;) (param $0 i32) (param $1 i32) (result f64) - (f64.promote_f32 - (call $neg - (local.get $0) - (local.get $1) - ) - ) - ) - (func $legalstub$bitcasts (; 7 ;) (param $0 i32) (param $1 f64) - (call $bitcasts - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - ) - ) ) diff --git a/test/min.fromasm.imprecise b/test/min.fromasm.imprecise index 29c5fcc1b..6d7516136 100644 --- a/test/min.fromasm.imprecise +++ b/test/min.fromasm.imprecise @@ -1,44 +1,38 @@ (module (import "env" "memory" (memory $memory 256 256)) (global $M (mut i32) (i32.const 0)) - (export "floats" (func $legalstub$floats)) + (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) - (export "neg" (func $legalstub$neg)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) (export "ctzzzz" (func $ctzzzz)) - (func $ctzzzz (; 0 ;) (; has Stack IR ;) (result i32) - (i32.const 2) - ) - (func $ub (; 1 ;) (; has Stack IR ;) (result i32) - (drop - (call $ub) - ) - (global.get $M) - ) - (func $legalstub$floats (; 2 ;) (; has Stack IR ;) (param $0 f64) (result f64) - (f64.promote_f32 - (f32.add - (f32.const 0) - (f32.demote_f64 - (local.get $0) - ) - ) + (func $floats (; 0 ;) (; has Stack IR ;) (param $0 f32) (result f32) + (f32.add + (f32.const 0) + (local.get $0) ) ) - (func $legalstub$neg (; 3 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f64) + (func $neg (; 1 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f32) (i32.store (local.get $0) (local.get $1) ) - (f64.promote_f32 - (f32.neg - (f32.load - (local.get $0) - ) + (f32.neg + (f32.load + (local.get $0) ) ) ) - (func $legalstub$bitcasts (; 4 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) + (func $bitcasts (; 2 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) (nop) ) + (func $ctzzzz (; 3 ;) (; has Stack IR ;) (result i32) + (i32.const 2) + ) + (func $ub (; 4 ;) (; has Stack IR ;) (result i32) + (drop + (call $ub) + ) + (global.get $M) + ) ) diff --git a/test/min.fromasm.imprecise.no-opts b/test/min.fromasm.imprecise.no-opts index 73a8dd281..ac8e11e87 100644 --- a/test/min.fromasm.imprecise.no-opts +++ b/test/min.fromasm.imprecise.no-opts @@ -6,10 +6,10 @@ (import "env" "tempDoublePtr" (global $tDP$asm2wasm$import i32)) (global $tDP (mut i32) (global.get $tDP$asm2wasm$import)) (global $M (mut i32) (i32.const 0)) - (export "floats" (func $legalstub$floats)) + (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) - (export "neg" (func $legalstub$neg)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) (export "ctzzzz" (func $ctzzzz)) (func $floats (; 0 ;) (param $f f32) (result f32) (local $t f32) @@ -73,29 +73,4 @@ (global.get $M) ) ) - (func $legalstub$floats (; 5 ;) (param $0 f64) (result f64) - (f64.promote_f32 - (call $floats - (f32.demote_f64 - (local.get $0) - ) - ) - ) - ) - (func $legalstub$neg (; 6 ;) (param $0 i32) (param $1 i32) (result f64) - (f64.promote_f32 - (call $neg - (local.get $0) - (local.get $1) - ) - ) - ) - (func $legalstub$bitcasts (; 7 ;) (param $0 i32) (param $1 f64) - (call $bitcasts - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - ) - ) ) diff --git a/test/min.fromasm.no-opts b/test/min.fromasm.no-opts index 73a8dd281..ac8e11e87 100644 --- a/test/min.fromasm.no-opts +++ b/test/min.fromasm.no-opts @@ -6,10 +6,10 @@ (import "env" "tempDoublePtr" (global $tDP$asm2wasm$import i32)) (global $tDP (mut i32) (global.get $tDP$asm2wasm$import)) (global $M (mut i32) (i32.const 0)) - (export "floats" (func $legalstub$floats)) + (export "floats" (func $floats)) (export "getTempRet0" (func $ub)) - (export "neg" (func $legalstub$neg)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "neg" (func $neg)) + (export "bitcasts" (func $bitcasts)) (export "ctzzzz" (func $ctzzzz)) (func $floats (; 0 ;) (param $f f32) (result f32) (local $t f32) @@ -73,29 +73,4 @@ (global.get $M) ) ) - (func $legalstub$floats (; 5 ;) (param $0 f64) (result f64) - (f64.promote_f32 - (call $floats - (f32.demote_f64 - (local.get $0) - ) - ) - ) - ) - (func $legalstub$neg (; 6 ;) (param $0 i32) (param $1 i32) (result f64) - (f64.promote_f32 - (call $neg - (local.get $0) - (local.get $1) - ) - ) - ) - (func $legalstub$bitcasts (; 7 ;) (param $0 i32) (param $1 f64) - (call $bitcasts - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - ) - ) ) diff --git a/test/passes/emit-js-wrapper=a.js.txt b/test/passes/emit-js-wrapper=a.js.txt index 5ba2dd322..50a1c64c0 100644 --- a/test/passes/emit-js-wrapper=a.js.txt +++ b/test/passes/emit-js-wrapper=a.js.txt @@ -10,7 +10,7 @@ (export "add" (func $add)) (export "no_return" (func $no-return)) (export "types" (func $legalstub$types)) - (export "types2" (func $legalstub$types2)) + (export "types2" (func $types2)) (export "types3" (func $legalstub$types3)) (func $add (; 1 ;) (type $0) (param $x i32) (param $y i32) (result i32) (i32.add @@ -41,7 +41,7 @@ (func $types3 (; 6 ;) (type $4) (param $x i32) (param $z f32) (param $w f64) (result i64) (i64.const 1) ) - (func $legalstub$types (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (param $4 f64) + (func $legalstub$types (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f32) (param $4 f64) (call $types (local.get $0) (i64.or @@ -55,29 +55,16 @@ (i64.const 32) ) ) - (f32.demote_f64 - (local.get $3) - ) + (local.get $3) (local.get $4) ) ) - (func $legalstub$types2 (; 8 ;) (param $0 i32) (param $1 f64) (param $2 f64) - (call $types2 - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - (local.get $2) - ) - ) - (func $legalstub$types3 (; 9 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result i32) + (func $legalstub$types3 (; 8 ;) (param $0 i32) (param $1 f32) (param $2 f64) (result i32) (local $3 i64) (local.set $3 (call $types3 (local.get $0) - (f32.demote_f64 - (local.get $1) - ) + (local.get $1) (local.get $2) ) ) diff --git a/test/unit.fromasm b/test/unit.fromasm index 1c0954564..8ca8266e2 100644 --- a/test/unit.fromasm +++ b/test/unit.fromasm @@ -11,7 +11,7 @@ (import "env" "memory" (memory $memory 256 256)) (data (global.get $__memory_base) "unit.asm.js") (import "env" "table" (table $table 25 25 funcref)) - (elem (global.get $__table_base) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) + (elem (global.get $__table_base) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $fr $cneg $fr $fr $fr $fr $fr $fr $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) (import "env" "gb" (global $n$asm2wasm$import i32)) @@ -32,22 +32,22 @@ (export "pick" (func $big_negative)) (export "doubleCompares" (func $doubleCompares)) (export "intOps" (func $intOps)) - (export "conversions" (func $legalstub$conversions)) + (export "conversions" (func $conversions)) (export "switcher" (func $switcher)) (export "frem" (func $frem)) - (export "frem_float" (func $legalstub$frem_float)) + (export "frem_float" (func $frem_float)) (export "big_uint_div_u" (func $big_uint_div_u)) (export "trapping_sint_div_s" (func $trapping_sint_div_s)) - (export "fr" (func $legalstub$fr)) + (export "fr" (func $fr)) (export "negZero" (func $negZero)) (export "neg" (func $neg)) (export "smallCompare" (func $smallCompare)) (export "cneg_nosemicolon" (func $cneg_nosemicolon)) (export "forLoop" (func $forLoop)) - (export "ceiling_32_64" (func $legalstub$ceiling_32_64)) + (export "ceiling_32_64" (func $ceiling_32_64)) (export "aborts" (func $aborts)) (export "continues" (func $continues)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "bitcasts" (func $bitcasts)) (export "recursiveBlockMerging" (func $recursiveBlockMerging)) (export "lb" (func $lb)) (export "zeroInit" (func $zeroInit)) @@ -76,7 +76,7 @@ (export "store_fround" (func $store_fround)) (export "exportedNumber" (global $exportedNumber)) (export "relocatableAndModules" (func $relocatableAndModules)) - (export "exported_f32_user" (func $legalstub$exported_f32_user)) + (export "exported_f32_user" (func $exported_f32_user)) (export "keepAlive" (func $keepAlive)) (func $big_negative (; 8 ;) (; has Stack IR ;) (nop) @@ -146,7 +146,21 @@ (local.get $0) ) ) - (func $switcher (; 12 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $conversions (; 12 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f32) + (drop + (call $f64-to-int + (local.get $1) + ) + ) + (drop + (call $f64-to-int + (f64.promote_f32 + (local.get $2) + ) + ) + ) + ) + (func $switcher (; 13 ;) (; has Stack IR ;) (param $0 i32) (result i32) (block $switch (block $switch-case0 (block $switch-case @@ -203,34 +217,45 @@ ) (i32.const 0) ) - (func $frem (; 13 ;) (; has Stack IR ;) (result f64) + (func $frem (; 14 ;) (; has Stack IR ;) (result f64) (call $f64-rem (f64.const 5.5) (f64.const 1.2) ) ) - (func $big_uint_div_u (; 14 ;) (; has Stack IR ;) (result i32) + (func $frem_float (; 15 ;) (; has Stack IR ;) (result f32) + (f32.demote_f64 + (call $f64-rem + (f64.const 5.5) + (f64.const 1.2000000476837158) + ) + ) + ) + (func $big_uint_div_u (; 16 ;) (; has Stack IR ;) (result i32) (i32.const 2147483647) ) - (func $trapping_sint_div_s (; 15 ;) (; has Stack IR ;) (result i32) + (func $trapping_sint_div_s (; 17 ;) (; has Stack IR ;) (result i32) (i32.const 0) ) - (func $negZero (; 16 ;) (; has Stack IR ;) (result f64) + (func $fr (; 18 ;) (; has Stack IR ;) (param $0 f32) + (nop) + ) + (func $negZero (; 19 ;) (; has Stack IR ;) (result f64) (f64.const -0) ) - (func $neg (; 17 ;) (; has Stack IR ;) + (func $neg (; 20 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vf) (f32.const -0) (i32.const 9) ) ) - (func $cneg (; 18 ;) (; has Stack IR ;) (param $0 f32) + (func $cneg (; 21 ;) (; has Stack IR ;) (param $0 f32) (call_indirect (type $FUNCSIG$vf) (local.get $0) (i32.const 9) ) ) - (func $smallCompare (; 19 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) + (func $smallCompare (; 22 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) (if (result i32) (i32.lt_u (local.tee $0 @@ -255,13 +280,13 @@ (local.get $0) ) ) - (func $cneg_nosemicolon (; 20 ;) (; has Stack IR ;) + (func $cneg_nosemicolon (; 23 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vi) (i32.const 1) (i32.const 17) ) ) - (func $forLoop (; 21 ;) (; has Stack IR ;) + (func $forLoop (; 24 ;) (; has Stack IR ;) (local $0 i32) (local.set $0 (i32.const 1) @@ -287,7 +312,10 @@ ) ) ) - (func $aborts (; 22 ;) (; has Stack IR ;) + (func $ceiling_32_64 (; 25 ;) (; has Stack IR ;) (param $0 f32) (param $1 f64) + (nop) + ) + (func $aborts (; 26 ;) (; has Stack IR ;) (drop (call $abort (f64.const 0) @@ -316,7 +344,7 @@ ) ) ) - (func $continues (; 23 ;) (; has Stack IR ;) + (func $continues (; 27 ;) (; has Stack IR ;) (loop $while-in (call $print (i32.const 1) @@ -335,7 +363,10 @@ (br $while-in) ) ) - (func $recursiveBlockMerging (; 24 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $bitcasts (; 28 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) + (nop) + ) + (func $recursiveBlockMerging (; 29 ;) (; has Stack IR ;) (param $0 i32) (result i32) (drop (call $lb (i32.add @@ -410,7 +441,7 @@ ) ) ) - (func $lb (; 25 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $lb (; 30 ;) (; has Stack IR ;) (param $0 i32) (result i32) (i32.store (local.get $0) (i32.add @@ -420,7 +451,7 @@ ) (i32.const 0) ) - (func $zeroInit (; 26 ;) (; has Stack IR ;) (param $0 i32) + (func $zeroInit (; 31 ;) (; has Stack IR ;) (param $0 i32) (local $1 i32) (if (i32.eq @@ -446,7 +477,7 @@ ) ) ) - (func $phi (; 27 ;) (; has Stack IR ;) (result i32) + (func $phi (; 32 ;) (; has Stack IR ;) (result i32) (block $do-once (result i32) (drop (br_if $do-once @@ -459,7 +490,7 @@ (i32.const 1) ) ) - (func $smallIf (; 28 ;) (; has Stack IR ;) + (func $smallIf (; 33 ;) (; has Stack IR ;) (if (call $return_int) (drop @@ -469,7 +500,7 @@ ) ) ) - (func $dropCall (; 29 ;) (; has Stack IR ;) (result i32) + (func $dropCall (; 34 ;) (; has Stack IR ;) (result i32) (if (call $return_int) (block @@ -490,7 +521,7 @@ ) (call $phi) ) - (func $useSetGlobal (; 30 ;) (; has Stack IR ;) (result i32) + (func $useSetGlobal (; 35 ;) (; has Stack IR ;) (result i32) (global.set $Int (i32.const 10) ) @@ -502,13 +533,13 @@ ) (global.get $Int) ) - (func $usesSetGlobal2 (; 31 ;) (; has Stack IR ;) (result i32) + (func $usesSetGlobal2 (; 36 ;) (; has Stack IR ;) (result i32) (global.set $Int (i32.const 40) ) (i32.const 50) ) - (func $breakThroughMany (; 32 ;) (; has Stack IR ;) (param $0 i32) + (func $breakThroughMany (; 37 ;) (; has Stack IR ;) (param $0 i32) (if (local.get $0) (loop $while-in @@ -524,7 +555,7 @@ ) ) ) - (func $ifChainEmpty (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $ifChainEmpty (; 38 ;) (; has Stack IR ;) (param $0 i32) (result i32) (if (i32.eq (local.get $0) @@ -536,12 +567,12 @@ ) (i32.const 0) ) - (func $heap8NoShift (; 34 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $heap8NoShift (; 39 ;) (; has Stack IR ;) (param $0 i32) (result i32) (i32.load8_s (local.get $0) ) ) - (func $conditionalTypeFun (; 35 ;) (; has Stack IR ;) + (func $conditionalTypeFun (; 40 ;) (; has Stack IR ;) (drop (if (result i32) (call $return_int) @@ -567,7 +598,7 @@ ) ) ) - (func $loadSigned (; 36 ;) (; has Stack IR ;) (param $0 i32) + (func $loadSigned (; 41 ;) (; has Stack IR ;) (param $0 i32) (call $loadSigned (i32.load8_s (local.get $0) @@ -633,13 +664,10 @@ ) ) ) - (func $z (; 37 ;) (; has Stack IR ;) (param $0 f32) - (nop) - ) - (func $w (; 38 ;) (; has Stack IR ;) (result f64) + (func $w (; 42 ;) (; has Stack IR ;) (result f64) (f64.const 0) ) - (func $globalOpts (; 39 ;) (; has Stack IR ;) + (func $globalOpts (; 43 ;) (; has Stack IR ;) (local $0 i32) (i32.store8 (i32.const 13) @@ -669,7 +697,7 @@ (local.get $0) ) ) - (func $dropCallImport (; 40 ;) (; has Stack IR ;) + (func $dropCallImport (; 44 ;) (; has Stack IR ;) (if (call $return_int) (drop @@ -677,7 +705,7 @@ ) ) ) - (func $loophi (; 41 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) + (func $loophi (; 45 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (local $2 i32) (loop $while-in (block $while-out @@ -707,7 +735,7 @@ ) ) ) - (func $loophi2 (; 42 ;) (; has Stack IR ;) (result i32) + (func $loophi2 (; 46 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -740,7 +768,7 @@ ) (local.get $1) ) - (func $loophi2b (; 43 ;) (; has Stack IR ;) (result i32) + (func $loophi2b (; 47 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (loop $label$continue$L7 @@ -772,7 +800,7 @@ ) (local.get $0) ) - (func $relooperJumpThreading (; 44 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $relooperJumpThreading (; 48 ;) (; has Stack IR ;) (param $0 i32) (result i32) (block $__rjto$0 (block $__rjti$0 (if @@ -941,7 +969,7 @@ ) (local.get $0) ) - (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 45 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) + (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 49 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (loop $while-in (block $__rjti$1 (if @@ -966,7 +994,7 @@ (br $while-in) ) ) - (func $relooperJumpThreading_irreducible (; 46 ;) (; has Stack IR ;) (param $0 i32) + (func $relooperJumpThreading_irreducible (; 50 ;) (; has Stack IR ;) (param $0 i32) (local $1 i32) (if (i32.eq @@ -1018,7 +1046,7 @@ ) ) ) - (func $__Z12multi_varargiz (; 47 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $__Z12multi_varargiz (; 51 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (if (local.get $3) (loop $while-in @@ -1035,10 +1063,10 @@ ) ) ) - (func $jumpThreadDrop (; 48 ;) (; has Stack IR ;) (result i32) + (func $jumpThreadDrop (; 52 ;) (; has Stack IR ;) (result i32) (call $return_int) ) - (func $dropIgnoredImportInIf (; 49 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $dropIgnoredImportInIf (; 53 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (if (local.get $0) (drop @@ -1048,7 +1076,7 @@ ) ) ) - (func $dropIgnoredImportsInIf (; 50 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $dropIgnoredImportsInIf (; 54 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (drop (if (result i32) (local.get $0) @@ -1061,7 +1089,7 @@ ) ) ) - (func $store_fround (; 51 ;) (; has Stack IR ;) (param $0 i32) + (func $store_fround (; 55 ;) (; has Stack IR ;) (param $0 i32) (f64.store (i32.const 80) (f64.promote_f32 @@ -1071,7 +1099,7 @@ ) ) ) - (func $relocatableAndModules (; 52 ;) (; has Stack IR ;) (result i32) + (func $relocatableAndModules (; 56 ;) (; has Stack IR ;) (result i32) (call_indirect (type $FUNCSIG$v) (i32.const 10) ) @@ -1084,7 +1112,10 @@ (i32.const 30) ) ) - (func $keepAlive (; 53 ;) (; has Stack IR ;) + (func $exported_f32_user (; 57 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) (param $2 f64) (result f32) + (local.get $1) + ) + (func $keepAlive (; 58 ;) (; has Stack IR ;) (drop (call $f64-to-int (f64.const 100) @@ -1143,52 +1174,10 @@ ) ) ) - (func $vi (; 54 ;) (; has Stack IR ;) (param $0 i32) + (func $vi (; 59 ;) (; has Stack IR ;) (param $0 i32) (nop) ) - (func $ii (; 55 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $ii (; 60 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local.get $0) ) - (func $legalstub$conversions (; 56 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) - (drop - (call $f64-to-int - (local.get $1) - ) - ) - (drop - (call $f64-to-int - (f64.promote_f32 - (f32.demote_f64 - (local.get $2) - ) - ) - ) - ) - ) - (func $legalstub$frem_float (; 57 ;) (; has Stack IR ;) (result f64) - (f64.promote_f32 - (f32.demote_f64 - (call $f64-rem - (f64.const 5.5) - (f64.const 1.2000000476837158) - ) - ) - ) - ) - (func $legalstub$fr (; 58 ;) (; has Stack IR ;) (param $0 f64) - (nop) - ) - (func $legalstub$ceiling_32_64 (; 59 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64) - (nop) - ) - (func $legalstub$bitcasts (; 60 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) - (nop) - ) - (func $legalstub$exported_f32_user (; 61 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) - (f64.promote_f32 - (f32.demote_f64 - (local.get $1) - ) - ) - ) ) diff --git a/test/unit.fromasm.clamp b/test/unit.fromasm.clamp index 654171c6a..c6c967925 100644 --- a/test/unit.fromasm.clamp +++ b/test/unit.fromasm.clamp @@ -10,7 +10,7 @@ (import "env" "memory" (memory $memory 256 256)) (data (global.get $__memory_base) "unit.asm.js") (import "env" "table" (table $table 25 25 funcref)) - (elem (global.get $__table_base) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) + (elem (global.get $__table_base) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $fr $cneg $fr $fr $fr $fr $fr $fr $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) (import "env" "gb" (global $n$asm2wasm$import i32)) @@ -30,22 +30,22 @@ (export "pick" (func $big_negative)) (export "doubleCompares" (func $doubleCompares)) (export "intOps" (func $intOps)) - (export "conversions" (func $legalstub$conversions)) + (export "conversions" (func $conversions)) (export "switcher" (func $switcher)) (export "frem" (func $frem)) - (export "frem_float" (func $legalstub$frem_float)) + (export "frem_float" (func $frem_float)) (export "big_uint_div_u" (func $big_uint_div_u)) (export "trapping_sint_div_s" (func $trapping_sint_div_s)) - (export "fr" (func $legalstub$fr)) + (export "fr" (func $fr)) (export "negZero" (func $negZero)) (export "neg" (func $neg)) (export "smallCompare" (func $smallCompare)) (export "cneg_nosemicolon" (func $cneg_nosemicolon)) (export "forLoop" (func $forLoop)) - (export "ceiling_32_64" (func $legalstub$ceiling_32_64)) + (export "ceiling_32_64" (func $ceiling_32_64)) (export "aborts" (func $aborts)) (export "continues" (func $continues)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "bitcasts" (func $bitcasts)) (export "recursiveBlockMerging" (func $recursiveBlockMerging)) (export "lb" (func $lb)) (export "zeroInit" (func $zeroInit)) @@ -74,7 +74,7 @@ (export "store_fround" (func $store_fround)) (export "exportedNumber" (global $exportedNumber)) (export "relocatableAndModules" (func $relocatableAndModules)) - (export "exported_f32_user" (func $legalstub$exported_f32_user)) + (export "exported_f32_user" (func $exported_f32_user)) (export "keepAlive" (func $keepAlive)) (func $big_negative (; 7 ;) (; has Stack IR ;) (nop) @@ -198,7 +198,17 @@ ) ) ) - (func $switcher (; 13 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $conversions (; 13 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f32) + (drop + (call $f64-to-int + (local.get $1) + ) + ) + (call $f32-to-int + (local.get $2) + ) + ) + (func $switcher (; 14 ;) (; has Stack IR ;) (param $0 i32) (result i32) (block $switch (block $switch-case0 (block $switch-case @@ -255,34 +265,45 @@ ) (i32.const 0) ) - (func $frem (; 14 ;) (; has Stack IR ;) (result f64) + (func $frem (; 15 ;) (; has Stack IR ;) (result f64) (call $f64-rem (f64.const 5.5) (f64.const 1.2) ) ) - (func $big_uint_div_u (; 15 ;) (; has Stack IR ;) (result i32) + (func $frem_float (; 16 ;) (; has Stack IR ;) (result f32) + (f32.demote_f64 + (call $f64-rem + (f64.const 5.5) + (f64.const 1.2000000476837158) + ) + ) + ) + (func $big_uint_div_u (; 17 ;) (; has Stack IR ;) (result i32) (i32.const 2147483647) ) - (func $trapping_sint_div_s (; 16 ;) (; has Stack IR ;) (result i32) + (func $trapping_sint_div_s (; 18 ;) (; has Stack IR ;) (result i32) (i32.const 0) ) - (func $negZero (; 17 ;) (; has Stack IR ;) (result f64) + (func $fr (; 19 ;) (; has Stack IR ;) (param $0 f32) + (nop) + ) + (func $negZero (; 20 ;) (; has Stack IR ;) (result f64) (f64.const -0) ) - (func $neg (; 18 ;) (; has Stack IR ;) + (func $neg (; 21 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vf) (f32.const -0) (i32.const 9) ) ) - (func $cneg (; 19 ;) (; has Stack IR ;) (param $0 f32) + (func $cneg (; 22 ;) (; has Stack IR ;) (param $0 f32) (call_indirect (type $FUNCSIG$vf) (local.get $0) (i32.const 9) ) ) - (func $smallCompare (; 20 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) + (func $smallCompare (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) (if (result i32) (i32.lt_u (local.tee $0 @@ -307,13 +328,13 @@ (local.get $0) ) ) - (func $cneg_nosemicolon (; 21 ;) (; has Stack IR ;) + (func $cneg_nosemicolon (; 24 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vi) (i32.const 1) (i32.const 17) ) ) - (func $forLoop (; 22 ;) (; has Stack IR ;) + (func $forLoop (; 25 ;) (; has Stack IR ;) (local $0 i32) (local.set $0 (i32.const 1) @@ -339,7 +360,10 @@ ) ) ) - (func $aborts (; 23 ;) (; has Stack IR ;) + (func $ceiling_32_64 (; 26 ;) (; has Stack IR ;) (param $0 f32) (param $1 f64) + (nop) + ) + (func $aborts (; 27 ;) (; has Stack IR ;) (drop (call $abort (f64.const 0) @@ -368,7 +392,7 @@ ) ) ) - (func $continues (; 24 ;) (; has Stack IR ;) + (func $continues (; 28 ;) (; has Stack IR ;) (loop $while-in (call $print (i32.const 1) @@ -387,7 +411,10 @@ (br $while-in) ) ) - (func $recursiveBlockMerging (; 25 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $bitcasts (; 29 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) + (nop) + ) + (func $recursiveBlockMerging (; 30 ;) (; has Stack IR ;) (param $0 i32) (result i32) (drop (call $lb (i32.add @@ -462,7 +489,7 @@ ) ) ) - (func $lb (; 26 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $lb (; 31 ;) (; has Stack IR ;) (param $0 i32) (result i32) (i32.store (local.get $0) (i32.add @@ -472,7 +499,7 @@ ) (i32.const 0) ) - (func $zeroInit (; 27 ;) (; has Stack IR ;) (param $0 i32) + (func $zeroInit (; 32 ;) (; has Stack IR ;) (param $0 i32) (local $1 i32) (if (i32.eq @@ -498,7 +525,7 @@ ) ) ) - (func $phi (; 28 ;) (; has Stack IR ;) (result i32) + (func $phi (; 33 ;) (; has Stack IR ;) (result i32) (block $do-once (result i32) (drop (br_if $do-once @@ -511,7 +538,7 @@ (i32.const 1) ) ) - (func $smallIf (; 29 ;) (; has Stack IR ;) + (func $smallIf (; 34 ;) (; has Stack IR ;) (if (call $return_int) (drop @@ -521,7 +548,7 @@ ) ) ) - (func $dropCall (; 30 ;) (; has Stack IR ;) (result i32) + (func $dropCall (; 35 ;) (; has Stack IR ;) (result i32) (if (call $return_int) (block @@ -542,7 +569,7 @@ ) (call $phi) ) - (func $useSetGlobal (; 31 ;) (; has Stack IR ;) (result i32) + (func $useSetGlobal (; 36 ;) (; has Stack IR ;) (result i32) (global.set $Int (i32.const 10) ) @@ -554,13 +581,13 @@ ) (global.get $Int) ) - (func $usesSetGlobal2 (; 32 ;) (; has Stack IR ;) (result i32) + (func $usesSetGlobal2 (; 37 ;) (; has Stack IR ;) (result i32) (global.set $Int (i32.const 40) ) (i32.const 50) ) - (func $breakThroughMany (; 33 ;) (; has Stack IR ;) (param $0 i32) + (func $breakThroughMany (; 38 ;) (; has Stack IR ;) (param $0 i32) (if (local.get $0) (loop $while-in @@ -576,7 +603,7 @@ ) ) ) - (func $ifChainEmpty (; 34 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $ifChainEmpty (; 39 ;) (; has Stack IR ;) (param $0 i32) (result i32) (if (i32.eq (local.get $0) @@ -588,12 +615,12 @@ ) (i32.const 0) ) - (func $heap8NoShift (; 35 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $heap8NoShift (; 40 ;) (; has Stack IR ;) (param $0 i32) (result i32) (i32.load8_s (local.get $0) ) ) - (func $conditionalTypeFun (; 36 ;) (; has Stack IR ;) + (func $conditionalTypeFun (; 41 ;) (; has Stack IR ;) (drop (if (result i32) (call $return_int) @@ -619,7 +646,7 @@ ) ) ) - (func $loadSigned (; 37 ;) (; has Stack IR ;) (param $0 i32) + (func $loadSigned (; 42 ;) (; has Stack IR ;) (param $0 i32) (call $loadSigned (i32.load8_s (local.get $0) @@ -685,13 +712,10 @@ ) ) ) - (func $z (; 38 ;) (; has Stack IR ;) (param $0 f32) - (nop) - ) - (func $w (; 39 ;) (; has Stack IR ;) (result f64) + (func $w (; 43 ;) (; has Stack IR ;) (result f64) (f64.const 0) ) - (func $globalOpts (; 40 ;) (; has Stack IR ;) + (func $globalOpts (; 44 ;) (; has Stack IR ;) (local $0 i32) (i32.store8 (i32.const 13) @@ -721,7 +745,7 @@ (local.get $0) ) ) - (func $dropCallImport (; 41 ;) (; has Stack IR ;) + (func $dropCallImport (; 45 ;) (; has Stack IR ;) (if (call $return_int) (drop @@ -729,7 +753,7 @@ ) ) ) - (func $loophi (; 42 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) + (func $loophi (; 46 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (local $2 i32) (loop $while-in (block $while-out @@ -759,7 +783,7 @@ ) ) ) - (func $loophi2 (; 43 ;) (; has Stack IR ;) (result i32) + (func $loophi2 (; 47 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -792,7 +816,7 @@ ) (local.get $1) ) - (func $loophi2b (; 44 ;) (; has Stack IR ;) (result i32) + (func $loophi2b (; 48 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (loop $label$continue$L7 @@ -824,7 +848,7 @@ ) (local.get $0) ) - (func $relooperJumpThreading (; 45 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $relooperJumpThreading (; 49 ;) (; has Stack IR ;) (param $0 i32) (result i32) (block $__rjto$0 (block $__rjti$0 (if @@ -993,7 +1017,7 @@ ) (local.get $0) ) - (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 46 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) + (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 50 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (loop $while-in (block $__rjti$1 (if @@ -1018,7 +1042,7 @@ (br $while-in) ) ) - (func $relooperJumpThreading_irreducible (; 47 ;) (; has Stack IR ;) (param $0 i32) + (func $relooperJumpThreading_irreducible (; 51 ;) (; has Stack IR ;) (param $0 i32) (local $1 i32) (if (i32.eq @@ -1070,7 +1094,7 @@ ) ) ) - (func $__Z12multi_varargiz (; 48 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $__Z12multi_varargiz (; 52 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (if (local.get $3) (loop $while-in @@ -1087,10 +1111,10 @@ ) ) ) - (func $jumpThreadDrop (; 49 ;) (; has Stack IR ;) (result i32) + (func $jumpThreadDrop (; 53 ;) (; has Stack IR ;) (result i32) (call $return_int) ) - (func $dropIgnoredImportInIf (; 50 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $dropIgnoredImportInIf (; 54 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (if (local.get $0) (drop @@ -1100,7 +1124,7 @@ ) ) ) - (func $dropIgnoredImportsInIf (; 51 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $dropIgnoredImportsInIf (; 55 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (drop (if (result i32) (local.get $0) @@ -1113,7 +1137,7 @@ ) ) ) - (func $store_fround (; 52 ;) (; has Stack IR ;) (param $0 i32) + (func $store_fround (; 56 ;) (; has Stack IR ;) (param $0 i32) (f64.store (i32.const 80) (f64.promote_f32 @@ -1123,7 +1147,7 @@ ) ) ) - (func $relocatableAndModules (; 53 ;) (; has Stack IR ;) (result i32) + (func $relocatableAndModules (; 57 ;) (; has Stack IR ;) (result i32) (call_indirect (type $FUNCSIG$v) (i32.const 10) ) @@ -1136,7 +1160,10 @@ (i32.const 30) ) ) - (func $keepAlive (; 54 ;) (; has Stack IR ;) + (func $exported_f32_user (; 58 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) (param $2 f64) (result f32) + (local.get $1) + ) + (func $keepAlive (; 59 ;) (; has Stack IR ;) (drop (call $f64-to-int (f64.const 100) @@ -1190,48 +1217,10 @@ ) ) ) - (func $vi (; 55 ;) (; has Stack IR ;) (param $0 i32) + (func $vi (; 60 ;) (; has Stack IR ;) (param $0 i32) (nop) ) - (func $ii (; 56 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $ii (; 61 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local.get $0) ) - (func $legalstub$conversions (; 57 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) - (drop - (call $f64-to-int - (local.get $1) - ) - ) - (call $f32-to-int - (f32.demote_f64 - (local.get $2) - ) - ) - ) - (func $legalstub$frem_float (; 58 ;) (; has Stack IR ;) (result f64) - (f64.promote_f32 - (f32.demote_f64 - (call $f64-rem - (f64.const 5.5) - (f64.const 1.2000000476837158) - ) - ) - ) - ) - (func $legalstub$fr (; 59 ;) (; has Stack IR ;) (param $0 f64) - (nop) - ) - (func $legalstub$ceiling_32_64 (; 60 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64) - (nop) - ) - (func $legalstub$bitcasts (; 61 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) - (nop) - ) - (func $legalstub$exported_f32_user (; 62 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) - (f64.promote_f32 - (f32.demote_f64 - (local.get $1) - ) - ) - ) ) diff --git a/test/unit.fromasm.clamp.no-opts b/test/unit.fromasm.clamp.no-opts index 95cb543e2..2c45360f2 100644 --- a/test/unit.fromasm.clamp.no-opts +++ b/test/unit.fromasm.clamp.no-opts @@ -37,22 +37,22 @@ (export "pick" (func $exportMe)) (export "doubleCompares" (func $doubleCompares)) (export "intOps" (func $intOps)) - (export "conversions" (func $legalstub$conversions)) + (export "conversions" (func $conversions)) (export "switcher" (func $switcher)) (export "frem" (func $frem)) - (export "frem_float" (func $legalstub$frem_float)) + (export "frem_float" (func $frem_float)) (export "big_uint_div_u" (func $big_uint_div_u)) (export "trapping_sint_div_s" (func $trapping_sint_div_s)) - (export "fr" (func $legalstub$fr)) + (export "fr" (func $fr)) (export "negZero" (func $negZero)) (export "neg" (func $neg)) (export "smallCompare" (func $smallCompare)) (export "cneg_nosemicolon" (func $cneg_nosemicolon)) (export "forLoop" (func $forLoop)) - (export "ceiling_32_64" (func $legalstub$ceiling_32_64)) + (export "ceiling_32_64" (func $ceiling_32_64)) (export "aborts" (func $aborts)) (export "continues" (func $continues)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "bitcasts" (func $bitcasts)) (export "recursiveBlockMerging" (func $recursiveBlockMerging)) (export "lb" (func $lb)) (export "zeroInit" (func $zeroInit)) @@ -81,7 +81,7 @@ (export "store_fround" (func $store_fround)) (export "exportedNumber" (global $exportedNumber)) (export "relocatableAndModules" (func $relocatableAndModules)) - (export "exported_f32_user" (func $legalstub$exported_f32_user)) + (export "exported_f32_user" (func $exported_f32_user)) (export "keepAlive" (func $keepAlive)) (func $big_negative (; 7 ;) (local $temp f64) @@ -2234,52 +2234,4 @@ (local.get $x) ) ) - (func $legalstub$conversions (; 86 ;) (param $0 i32) (param $1 f64) (param $2 f64) - (call $conversions - (local.get $0) - (local.get $1) - (f32.demote_f64 - (local.get $2) - ) - ) - ) - (func $legalstub$frem_float (; 87 ;) (result f64) - (f64.promote_f32 - (call $frem_float) - ) - ) - (func $legalstub$fr (; 88 ;) (param $0 f64) - (call $fr - (f32.demote_f64 - (local.get $0) - ) - ) - ) - (func $legalstub$ceiling_32_64 (; 89 ;) (param $0 f64) (param $1 f64) - (call $ceiling_32_64 - (f32.demote_f64 - (local.get $0) - ) - (local.get $1) - ) - ) - (func $legalstub$bitcasts (; 90 ;) (param $0 i32) (param $1 f64) - (call $bitcasts - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - ) - ) - (func $legalstub$exported_f32_user (; 91 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) - (f64.promote_f32 - (call $exported_f32_user - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - (local.get $2) - ) - ) - ) ) diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise index fb55716e8..b40a5bd06 100644 --- a/test/unit.fromasm.imprecise +++ b/test/unit.fromasm.imprecise @@ -9,7 +9,7 @@ (type $FUNCSIG$i (func (result i32))) (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table $table 25 25 funcref)) - (elem (global.get $__table_base) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) + (elem (global.get $__table_base) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $fr $cneg $fr $fr $fr $fr $fr $fr $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "__table_base" (global $__table_base i32)) (import "env" "gb" (global $n$asm2wasm$import i32)) (import "env" "setTempRet0" (func $setTempRet0 (param i32) (result i32))) @@ -28,22 +28,22 @@ (export "pick" (func $big_negative)) (export "doubleCompares" (func $doubleCompares)) (export "intOps" (func $intOps)) - (export "conversions" (func $legalstub$conversions)) + (export "conversions" (func $conversions)) (export "switcher" (func $switcher)) (export "frem" (func $frem)) - (export "frem_float" (func $legalstub$frem_float)) + (export "frem_float" (func $frem_float)) (export "big_uint_div_u" (func $big_uint_div_u)) (export "trapping_sint_div_s" (func $trapping_sint_div_s)) - (export "fr" (func $legalstub$fr)) + (export "fr" (func $fr)) (export "negZero" (func $negZero)) (export "neg" (func $neg)) (export "smallCompare" (func $smallCompare)) (export "cneg_nosemicolon" (func $cneg_nosemicolon)) (export "forLoop" (func $forLoop)) - (export "ceiling_32_64" (func $legalstub$ceiling_32_64)) + (export "ceiling_32_64" (func $ceiling_32_64)) (export "aborts" (func $aborts)) (export "continues" (func $continues)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "bitcasts" (func $bitcasts)) (export "recursiveBlockMerging" (func $recursiveBlockMerging)) (export "lb" (func $lb)) (export "zeroInit" (func $zeroInit)) @@ -72,7 +72,7 @@ (export "store_fround" (func $store_fround)) (export "exportedNumber" (global $exportedNumber)) (export "relocatableAndModules" (func $relocatableAndModules)) - (export "exported_f32_user" (func $legalstub$exported_f32_user)) + (export "exported_f32_user" (func $exported_f32_user)) (export "keepAlive" (func $keepAlive)) (func $big_negative (; 7 ;) (; has Stack IR ;) (nop) @@ -142,7 +142,10 @@ (local.get $0) ) ) - (func $switcher (; 11 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $conversions (; 11 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f32) + (nop) + ) + (func $switcher (; 12 ;) (; has Stack IR ;) (param $0 i32) (result i32) (block $switch (block $switch-case0 (block $switch-case @@ -199,37 +202,48 @@ ) (i32.const 0) ) - (func $frem (; 12 ;) (; has Stack IR ;) (result f64) + (func $frem (; 13 ;) (; has Stack IR ;) (result f64) (call $f64-rem (f64.const 5.5) (f64.const 1.2) ) ) - (func $big_uint_div_u (; 13 ;) (; has Stack IR ;) (result i32) + (func $frem_float (; 14 ;) (; has Stack IR ;) (result f32) + (f32.demote_f64 + (call $f64-rem + (f64.const 5.5) + (f64.const 1.2000000476837158) + ) + ) + ) + (func $big_uint_div_u (; 15 ;) (; has Stack IR ;) (result i32) (i32.const 2147483647) ) - (func $trapping_sint_div_s (; 14 ;) (; has Stack IR ;) (result i32) + (func $trapping_sint_div_s (; 16 ;) (; has Stack IR ;) (result i32) (i32.div_s (i32.const -2147483648) (i32.const -1) ) ) - (func $negZero (; 15 ;) (; has Stack IR ;) (result f64) + (func $fr (; 17 ;) (; has Stack IR ;) (param $0 f32) + (nop) + ) + (func $negZero (; 18 ;) (; has Stack IR ;) (result f64) (f64.const -0) ) - (func $neg (; 16 ;) (; has Stack IR ;) + (func $neg (; 19 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vf) (f32.const -0) (i32.const 9) ) ) - (func $cneg (; 17 ;) (; has Stack IR ;) (param $0 f32) + (func $cneg (; 20 ;) (; has Stack IR ;) (param $0 f32) (call_indirect (type $FUNCSIG$vf) (local.get $0) (i32.const 9) ) ) - (func $smallCompare (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) + (func $smallCompare (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) (if (result i32) (i32.lt_u (local.tee $0 @@ -254,13 +268,13 @@ (local.get $0) ) ) - (func $cneg_nosemicolon (; 19 ;) (; has Stack IR ;) + (func $cneg_nosemicolon (; 22 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vi) (i32.const 1) (i32.const 17) ) ) - (func $forLoop (; 20 ;) (; has Stack IR ;) + (func $forLoop (; 23 ;) (; has Stack IR ;) (local $0 i32) (local.set $0 (i32.const 1) @@ -286,7 +300,10 @@ ) ) ) - (func $aborts (; 21 ;) (; has Stack IR ;) + (func $ceiling_32_64 (; 24 ;) (; has Stack IR ;) (param $0 f32) (param $1 f64) + (nop) + ) + (func $aborts (; 25 ;) (; has Stack IR ;) (drop (call $abort (f64.const 0) @@ -315,7 +332,7 @@ ) ) ) - (func $continues (; 22 ;) (; has Stack IR ;) + (func $continues (; 26 ;) (; has Stack IR ;) (loop $while-in (call $print (i32.const 1) @@ -334,7 +351,10 @@ (br $while-in) ) ) - (func $recursiveBlockMerging (; 23 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $bitcasts (; 27 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) + (nop) + ) + (func $recursiveBlockMerging (; 28 ;) (; has Stack IR ;) (param $0 i32) (result i32) (drop (call $lb (i32.add @@ -409,7 +429,7 @@ ) ) ) - (func $lb (; 24 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $lb (; 29 ;) (; has Stack IR ;) (param $0 i32) (result i32) (i32.store (local.get $0) (i32.add @@ -419,7 +439,7 @@ ) (i32.const 0) ) - (func $zeroInit (; 25 ;) (; has Stack IR ;) (param $0 i32) + (func $zeroInit (; 30 ;) (; has Stack IR ;) (param $0 i32) (local $1 i32) (if (i32.eq @@ -445,7 +465,7 @@ ) ) ) - (func $phi (; 26 ;) (; has Stack IR ;) (result i32) + (func $phi (; 31 ;) (; has Stack IR ;) (result i32) (block $do-once (result i32) (drop (br_if $do-once @@ -458,7 +478,7 @@ (i32.const 1) ) ) - (func $smallIf (; 27 ;) (; has Stack IR ;) + (func $smallIf (; 32 ;) (; has Stack IR ;) (if (call $return_int) (drop @@ -468,7 +488,7 @@ ) ) ) - (func $dropCall (; 28 ;) (; has Stack IR ;) (result i32) + (func $dropCall (; 33 ;) (; has Stack IR ;) (result i32) (if (call $return_int) (block @@ -489,7 +509,7 @@ ) (call $phi) ) - (func $useSetGlobal (; 29 ;) (; has Stack IR ;) (result i32) + (func $useSetGlobal (; 34 ;) (; has Stack IR ;) (result i32) (global.set $Int (i32.const 10) ) @@ -501,13 +521,13 @@ ) (global.get $Int) ) - (func $usesSetGlobal2 (; 30 ;) (; has Stack IR ;) (result i32) + (func $usesSetGlobal2 (; 35 ;) (; has Stack IR ;) (result i32) (global.set $Int (i32.const 40) ) (i32.const 50) ) - (func $breakThroughMany (; 31 ;) (; has Stack IR ;) (param $0 i32) + (func $breakThroughMany (; 36 ;) (; has Stack IR ;) (param $0 i32) (if (local.get $0) (loop $while-in @@ -523,7 +543,7 @@ ) ) ) - (func $ifChainEmpty (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $ifChainEmpty (; 37 ;) (; has Stack IR ;) (param $0 i32) (result i32) (if (i32.eq (local.get $0) @@ -535,12 +555,12 @@ ) (i32.const 0) ) - (func $heap8NoShift (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $heap8NoShift (; 38 ;) (; has Stack IR ;) (param $0 i32) (result i32) (i32.load8_s (local.get $0) ) ) - (func $conditionalTypeFun (; 34 ;) (; has Stack IR ;) + (func $conditionalTypeFun (; 39 ;) (; has Stack IR ;) (drop (if (result i32) (call $return_int) @@ -566,7 +586,7 @@ ) ) ) - (func $loadSigned (; 35 ;) (; has Stack IR ;) (param $0 i32) + (func $loadSigned (; 40 ;) (; has Stack IR ;) (param $0 i32) (call $loadSigned (i32.load8_s (local.get $0) @@ -632,13 +652,10 @@ ) ) ) - (func $z (; 36 ;) (; has Stack IR ;) (param $0 f32) - (nop) - ) - (func $w (; 37 ;) (; has Stack IR ;) (result f64) + (func $w (; 41 ;) (; has Stack IR ;) (result f64) (f64.const 0) ) - (func $globalOpts (; 38 ;) (; has Stack IR ;) + (func $globalOpts (; 42 ;) (; has Stack IR ;) (local $0 i32) (i32.store8 (i32.const 13) @@ -668,7 +685,7 @@ (local.get $0) ) ) - (func $dropCallImport (; 39 ;) (; has Stack IR ;) + (func $dropCallImport (; 43 ;) (; has Stack IR ;) (if (call $return_int) (drop @@ -676,7 +693,7 @@ ) ) ) - (func $loophi (; 40 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) + (func $loophi (; 44 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (local $2 i32) (loop $while-in (block $while-out @@ -706,7 +723,7 @@ ) ) ) - (func $loophi2 (; 41 ;) (; has Stack IR ;) (result i32) + (func $loophi2 (; 45 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -739,7 +756,7 @@ ) (local.get $1) ) - (func $loophi2b (; 42 ;) (; has Stack IR ;) (result i32) + (func $loophi2b (; 46 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (loop $label$continue$L7 @@ -771,7 +788,7 @@ ) (local.get $0) ) - (func $relooperJumpThreading (; 43 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $relooperJumpThreading (; 47 ;) (; has Stack IR ;) (param $0 i32) (result i32) (block $__rjto$0 (block $__rjti$0 (if @@ -940,7 +957,7 @@ ) (local.get $0) ) - (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 44 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) + (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 48 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (loop $while-in (block $__rjti$1 (if @@ -965,7 +982,7 @@ (br $while-in) ) ) - (func $relooperJumpThreading_irreducible (; 45 ;) (; has Stack IR ;) (param $0 i32) + (func $relooperJumpThreading_irreducible (; 49 ;) (; has Stack IR ;) (param $0 i32) (local $1 i32) (if (i32.eq @@ -1017,7 +1034,7 @@ ) ) ) - (func $__Z12multi_varargiz (; 46 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $__Z12multi_varargiz (; 50 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (if (local.get $3) (loop $while-in @@ -1034,10 +1051,10 @@ ) ) ) - (func $jumpThreadDrop (; 47 ;) (; has Stack IR ;) (result i32) + (func $jumpThreadDrop (; 51 ;) (; has Stack IR ;) (result i32) (call $return_int) ) - (func $dropIgnoredImportInIf (; 48 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $dropIgnoredImportInIf (; 52 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (if (local.get $0) (drop @@ -1047,7 +1064,7 @@ ) ) ) - (func $dropIgnoredImportsInIf (; 49 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $dropIgnoredImportsInIf (; 53 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (drop (if (result i32) (local.get $0) @@ -1060,7 +1077,7 @@ ) ) ) - (func $store_fround (; 50 ;) (; has Stack IR ;) (param $0 i32) + (func $store_fround (; 54 ;) (; has Stack IR ;) (param $0 i32) (f64.store (i32.const 80) (f64.promote_f32 @@ -1070,7 +1087,7 @@ ) ) ) - (func $relocatableAndModules (; 51 ;) (; has Stack IR ;) (result i32) + (func $relocatableAndModules (; 55 ;) (; has Stack IR ;) (result i32) (call_indirect (type $FUNCSIG$v) (i32.const 10) ) @@ -1083,7 +1100,10 @@ (i32.const 30) ) ) - (func $keepAlive (; 52 ;) (; has Stack IR ;) + (func $exported_f32_user (; 56 ;) (; has Stack IR ;) (param $0 i32) (param $1 f32) (param $2 f64) (result f32) + (local.get $1) + ) + (func $keepAlive (; 57 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vi) (i32.const 0) (i32.const 17) @@ -1122,39 +1142,10 @@ ) ) ) - (func $vi (; 53 ;) (; has Stack IR ;) (param $0 i32) + (func $vi (; 58 ;) (; has Stack IR ;) (param $0 i32) (nop) ) - (func $ii (; 54 ;) (; has Stack IR ;) (param $0 i32) (result i32) + (func $ii (; 59 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local.get $0) ) - (func $legalstub$conversions (; 55 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) - (nop) - ) - (func $legalstub$frem_float (; 56 ;) (; has Stack IR ;) (result f64) - (f64.promote_f32 - (f32.demote_f64 - (call $f64-rem - (f64.const 5.5) - (f64.const 1.2000000476837158) - ) - ) - ) - ) - (func $legalstub$fr (; 57 ;) (; has Stack IR ;) (param $0 f64) - (nop) - ) - (func $legalstub$ceiling_32_64 (; 58 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64) - (nop) - ) - (func $legalstub$bitcasts (; 59 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) - (nop) - ) - (func $legalstub$exported_f32_user (; 60 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) - (f64.promote_f32 - (f32.demote_f64 - (local.get $1) - ) - ) - ) ) diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts index 69d1ff2ff..776aa2ba5 100644 --- a/test/unit.fromasm.imprecise.no-opts +++ b/test/unit.fromasm.imprecise.no-opts @@ -37,22 +37,22 @@ (export "pick" (func $exportMe)) (export "doubleCompares" (func $doubleCompares)) (export "intOps" (func $intOps)) - (export "conversions" (func $legalstub$conversions)) + (export "conversions" (func $conversions)) (export "switcher" (func $switcher)) (export "frem" (func $frem)) - (export "frem_float" (func $legalstub$frem_float)) + (export "frem_float" (func $frem_float)) (export "big_uint_div_u" (func $big_uint_div_u)) (export "trapping_sint_div_s" (func $trapping_sint_div_s)) - (export "fr" (func $legalstub$fr)) + (export "fr" (func $fr)) (export "negZero" (func $negZero)) (export "neg" (func $neg)) (export "smallCompare" (func $smallCompare)) (export "cneg_nosemicolon" (func $cneg_nosemicolon)) (export "forLoop" (func $forLoop)) - (export "ceiling_32_64" (func $legalstub$ceiling_32_64)) + (export "ceiling_32_64" (func $ceiling_32_64)) (export "aborts" (func $aborts)) (export "continues" (func $continues)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "bitcasts" (func $bitcasts)) (export "recursiveBlockMerging" (func $recursiveBlockMerging)) (export "lb" (func $lb)) (export "zeroInit" (func $zeroInit)) @@ -81,7 +81,7 @@ (export "store_fround" (func $store_fround)) (export "exportedNumber" (global $exportedNumber)) (export "relocatableAndModules" (func $relocatableAndModules)) - (export "exported_f32_user" (func $legalstub$exported_f32_user)) + (export "exported_f32_user" (func $exported_f32_user)) (export "keepAlive" (func $keepAlive)) (func $big_negative (; 7 ;) (local $temp f64) @@ -2119,52 +2119,4 @@ (local.get $x) ) ) - (func $legalstub$conversions (; 81 ;) (param $0 i32) (param $1 f64) (param $2 f64) - (call $conversions - (local.get $0) - (local.get $1) - (f32.demote_f64 - (local.get $2) - ) - ) - ) - (func $legalstub$frem_float (; 82 ;) (result f64) - (f64.promote_f32 - (call $frem_float) - ) - ) - (func $legalstub$fr (; 83 ;) (param $0 f64) - (call $fr - (f32.demote_f64 - (local.get $0) - ) - ) - ) - (func $legalstub$ceiling_32_64 (; 84 ;) (param $0 f64) (param $1 f64) - (call $ceiling_32_64 - (f32.demote_f64 - (local.get $0) - ) - (local.get $1) - ) - ) - (func $legalstub$bitcasts (; 85 ;) (param $0 i32) (param $1 f64) - (call $bitcasts - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - ) - ) - (func $legalstub$exported_f32_user (; 86 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) - (f64.promote_f32 - (call $exported_f32_user - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - (local.get $2) - ) - ) - ) ) diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts index fb82b572f..216d30d34 100644 --- a/test/unit.fromasm.no-opts +++ b/test/unit.fromasm.no-opts @@ -39,22 +39,22 @@ (export "pick" (func $exportMe)) (export "doubleCompares" (func $doubleCompares)) (export "intOps" (func $intOps)) - (export "conversions" (func $legalstub$conversions)) + (export "conversions" (func $conversions)) (export "switcher" (func $switcher)) (export "frem" (func $frem)) - (export "frem_float" (func $legalstub$frem_float)) + (export "frem_float" (func $frem_float)) (export "big_uint_div_u" (func $big_uint_div_u)) (export "trapping_sint_div_s" (func $trapping_sint_div_s)) - (export "fr" (func $legalstub$fr)) + (export "fr" (func $fr)) (export "negZero" (func $negZero)) (export "neg" (func $neg)) (export "smallCompare" (func $smallCompare)) (export "cneg_nosemicolon" (func $cneg_nosemicolon)) (export "forLoop" (func $forLoop)) - (export "ceiling_32_64" (func $legalstub$ceiling_32_64)) + (export "ceiling_32_64" (func $ceiling_32_64)) (export "aborts" (func $aborts)) (export "continues" (func $continues)) - (export "bitcasts" (func $legalstub$bitcasts)) + (export "bitcasts" (func $bitcasts)) (export "recursiveBlockMerging" (func $recursiveBlockMerging)) (export "lb" (func $lb)) (export "zeroInit" (func $zeroInit)) @@ -83,7 +83,7 @@ (export "store_fround" (func $store_fround)) (export "exportedNumber" (global $exportedNumber)) (export "relocatableAndModules" (func $relocatableAndModules)) - (export "exported_f32_user" (func $legalstub$exported_f32_user)) + (export "exported_f32_user" (func $exported_f32_user)) (export "keepAlive" (func $keepAlive)) (func $big_negative (; 8 ;) (local $temp f64) @@ -2160,52 +2160,4 @@ (local.get $x) ) ) - (func $legalstub$conversions (; 84 ;) (param $0 i32) (param $1 f64) (param $2 f64) - (call $conversions - (local.get $0) - (local.get $1) - (f32.demote_f64 - (local.get $2) - ) - ) - ) - (func $legalstub$frem_float (; 85 ;) (result f64) - (f64.promote_f32 - (call $frem_float) - ) - ) - (func $legalstub$fr (; 86 ;) (param $0 f64) - (call $fr - (f32.demote_f64 - (local.get $0) - ) - ) - ) - (func $legalstub$ceiling_32_64 (; 87 ;) (param $0 f64) (param $1 f64) - (call $ceiling_32_64 - (f32.demote_f64 - (local.get $0) - ) - (local.get $1) - ) - ) - (func $legalstub$bitcasts (; 88 ;) (param $0 i32) (param $1 f64) - (call $bitcasts - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - ) - ) - (func $legalstub$exported_f32_user (; 89 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) - (f64.promote_f32 - (call $exported_f32_user - (local.get $0) - (f32.demote_f64 - (local.get $1) - ) - (local.get $2) - ) - ) - ) ) diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm index 6eedc642a..f8439bc89 100644 --- a/test/wasm-only.fromasm +++ b/test/wasm-only.fromasm @@ -1,19 +1,19 @@ (module + (type $FUNCSIG$ff (func (param f32) (result f32))) (type $FUNCSIG$vi (func (param i32))) (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $FUNCSIG$i (func (result i32))) - (type $legaltype$_fabsf (func (param f64) (result f64))) (import "env" "memory" (memory $memory 256 256)) (data (global.get $__memory_base) "wasm-only.asm.js") (import "env" "table" (table $table 3 3 funcref)) - (elem (global.get $__table_base) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) + (elem (global.get $__table_base) $legalfunc$illegalImport $_fabsf $legalfunc$do_i64) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) - (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) @@ -615,16 +615,7 @@ (local.get $2) ) ) - (func $legalfunc$_fabsf (; 26 ;) (; has Stack IR ;) (param $0 f32) (result f32) - (f32.demote_f64 - (call $legalimport$_fabsf - (f64.promote_f32 - (local.get $0) - ) - ) - ) - ) - (func $legalfunc$do_i64 (; 27 ;) (; has Stack IR ;) (result i64) + (func $legalfunc$do_i64 (; 26 ;) (; has Stack IR ;) (result i64) (i64.or (i64.extend_i32_u (call $legalimport$do_i64) diff --git a/test/wasm-only.fromasm.clamp b/test/wasm-only.fromasm.clamp index 6eedc642a..f8439bc89 100644 --- a/test/wasm-only.fromasm.clamp +++ b/test/wasm-only.fromasm.clamp @@ -1,19 +1,19 @@ (module + (type $FUNCSIG$ff (func (param f32) (result f32))) (type $FUNCSIG$vi (func (param i32))) (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $FUNCSIG$i (func (result i32))) - (type $legaltype$_fabsf (func (param f64) (result f64))) (import "env" "memory" (memory $memory 256 256)) (data (global.get $__memory_base) "wasm-only.asm.js") (import "env" "table" (table $table 3 3 funcref)) - (elem (global.get $__table_base) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) + (elem (global.get $__table_base) $legalfunc$illegalImport $_fabsf $legalfunc$do_i64) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) - (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) @@ -615,16 +615,7 @@ (local.get $2) ) ) - (func $legalfunc$_fabsf (; 26 ;) (; has Stack IR ;) (param $0 f32) (result f32) - (f32.demote_f64 - (call $legalimport$_fabsf - (f64.promote_f32 - (local.get $0) - ) - ) - ) - ) - (func $legalfunc$do_i64 (; 27 ;) (; has Stack IR ;) (result i64) + (func $legalfunc$do_i64 (; 26 ;) (; has Stack IR ;) (result i64) (i64.or (i64.extend_i32_u (call $legalimport$do_i64) diff --git a/test/wasm-only.fromasm.clamp.no-opts b/test/wasm-only.fromasm.clamp.no-opts index e6245391d..1f82cff4b 100644 --- a/test/wasm-only.fromasm.clamp.no-opts +++ b/test/wasm-only.fromasm.clamp.no-opts @@ -7,20 +7,19 @@ (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $FUNCSIG$i (func (result i32))) (type $legaltype$illegalImportResult (func (result i32))) - (type $legaltype$_fabsf (func (param f64) (result f64))) (type $legaltype$do_i64 (func (result i32))) (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table $table 3 3 funcref)) - (elem (global.get $__table_base) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) + (elem (global.get $__table_base) $legalfunc$illegalImport $_fabsf $legalfunc$do_i64) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "abort" (func $abort)) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) - (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $STACKTOP (mut i32) (global.get $STACKTOP$asm2wasm$import)) (export "test64" (func $test64)) @@ -1834,7 +1833,7 @@ ) (func $__emscripten_dceable_type_decls (; 36 ;) (drop - (call $legalfunc$_fabsf + (call $_fabsf (f32.const 0) ) ) @@ -1904,16 +1903,7 @@ ) ) ) - (func $legalfunc$_fabsf (; 41 ;) (param $0 f32) (result f32) - (f32.demote_f64 - (call $legalimport$_fabsf - (f64.promote_f32 - (local.get $0) - ) - ) - ) - ) - (func $legalfunc$do_i64 (; 42 ;) (result i64) + (func $legalfunc$do_i64 (; 41 ;) (result i64) (i64.or (i64.extend_i32_u (call $legalimport$do_i64) diff --git a/test/wasm-only.fromasm.imprecise b/test/wasm-only.fromasm.imprecise index 38206b1bc..d5efe8d23 100644 --- a/test/wasm-only.fromasm.imprecise +++ b/test/wasm-only.fromasm.imprecise @@ -1,17 +1,17 @@ (module + (type $FUNCSIG$ff (func (param f32) (result f32))) (type $FUNCSIG$vi (func (param i32))) (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $FUNCSIG$i (func (result i32))) - (type $legaltype$_fabsf (func (param f64) (result f64))) (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table $table 3 3 funcref)) - (elem (global.get $__table_base) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) + (elem (global.get $__table_base) $legalfunc$illegalImport $_fabsf $legalfunc$do_i64) (import "env" "__table_base" (global $__table_base i32)) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) - (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) @@ -302,16 +302,7 @@ (local.get $2) ) ) - (func $legalfunc$_fabsf (; 20 ;) (; has Stack IR ;) (param $0 f32) (result f32) - (f32.demote_f64 - (call $legalimport$_fabsf - (f64.promote_f32 - (local.get $0) - ) - ) - ) - ) - (func $legalfunc$do_i64 (; 21 ;) (; has Stack IR ;) (result i64) + (func $legalfunc$do_i64 (; 20 ;) (; has Stack IR ;) (result i64) (i64.or (i64.extend_i32_u (call $legalimport$do_i64) diff --git a/test/wasm-only.fromasm.imprecise.no-opts b/test/wasm-only.fromasm.imprecise.no-opts index 6f9f2cbdf..5b189d071 100644 --- a/test/wasm-only.fromasm.imprecise.no-opts +++ b/test/wasm-only.fromasm.imprecise.no-opts @@ -7,20 +7,19 @@ (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $FUNCSIG$i (func (result i32))) (type $legaltype$illegalImportResult (func (result i32))) - (type $legaltype$_fabsf (func (param f64) (result f64))) (type $legaltype$do_i64 (func (result i32))) (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table $table 3 3 funcref)) - (elem (global.get $__table_base) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) + (elem (global.get $__table_base) $legalfunc$illegalImport $_fabsf $legalfunc$do_i64) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "abort" (func $abort)) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) - (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $STACKTOP (mut i32) (global.get $STACKTOP$asm2wasm$import)) (export "test64" (func $test64)) @@ -1669,7 +1668,7 @@ ) (func $__emscripten_dceable_type_decls (; 28 ;) (drop - (call $legalfunc$_fabsf + (call $_fabsf (f32.const 0) ) ) @@ -1739,16 +1738,7 @@ ) ) ) - (func $legalfunc$_fabsf (; 33 ;) (param $0 f32) (result f32) - (f32.demote_f64 - (call $legalimport$_fabsf - (f64.promote_f32 - (local.get $0) - ) - ) - ) - ) - (func $legalfunc$do_i64 (; 34 ;) (result i64) + (func $legalfunc$do_i64 (; 33 ;) (result i64) (i64.or (i64.extend_i32_u (call $legalimport$do_i64) diff --git a/test/wasm-only.fromasm.no-opts b/test/wasm-only.fromasm.no-opts index e6245391d..1f82cff4b 100644 --- a/test/wasm-only.fromasm.no-opts +++ b/test/wasm-only.fromasm.no-opts @@ -7,20 +7,19 @@ (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $FUNCSIG$i (func (result i32))) (type $legaltype$illegalImportResult (func (result i32))) - (type $legaltype$_fabsf (func (param f64) (result f64))) (type $legaltype$do_i64 (func (result i32))) (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table $table 3 3 funcref)) - (elem (global.get $__table_base) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) + (elem (global.get $__table_base) $legalfunc$illegalImport $_fabsf $legalfunc$do_i64) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) + (import "env" "_fabsf" (func $_fabsf (param f32) (result f32))) (import "env" "abort" (func $abort)) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) - (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $STACKTOP (mut i32) (global.get $STACKTOP$asm2wasm$import)) (export "test64" (func $test64)) @@ -1834,7 +1833,7 @@ ) (func $__emscripten_dceable_type_decls (; 36 ;) (drop - (call $legalfunc$_fabsf + (call $_fabsf (f32.const 0) ) ) @@ -1904,16 +1903,7 @@ ) ) ) - (func $legalfunc$_fabsf (; 41 ;) (param $0 f32) (result f32) - (f32.demote_f64 - (call $legalimport$_fabsf - (f64.promote_f32 - (local.get $0) - ) - ) - ) - ) - (func $legalfunc$do_i64 (; 42 ;) (result i64) + (func $legalfunc$do_i64 (; 41 ;) (result i64) (i64.or (i64.extend_i32_u (call $legalimport$do_i64) diff --git a/test/wasm2js/br.2asm.js b/test/wasm2js/br.2asm.js index e8a1f3048..1939b05bd 100644 --- a/test/wasm2js/br.2asm.js +++ b/test/wasm2js/br.2asm.js @@ -577,10 +577,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$7() { - return +$7(); - } - function legalstub$23() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $23(); @@ -607,10 +603,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$39() { - return +$39(); - } - function legalstub$40() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $40(); @@ -637,10 +629,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$45() { - return +$45(); - } - function legalstub$47() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $47(); @@ -675,7 +663,7 @@ function asmFunc(global, env, buffer) { "type_f64": $4, "type_i32_value": $5, "type_i64_value": legalstub$6, - "type_f32_value": legalstub$7, + "type_f32_value": $7, "type_f64_value": $8, "as_block_first": $9, "as_block_mid": $10, @@ -706,13 +694,13 @@ function asmFunc(global, env, buffer) { "as_call_indirect_mid": $36, "as_call_indirect_last": $37, "as_local_set_value": $38, - "as_load_address": legalstub$39, + "as_load_address": $39, "as_loadN_address": legalstub$40, "as_store_address": $41, "as_store_value": $42, "as_storeN_address": $43, "as_storeN_value": $44, - "as_unary_operand": legalstub$45, + "as_unary_operand": $45, "as_binary_left": $46, "as_binary_right": legalstub$47, "as_test_operand": $48, diff --git a/test/wasm2js/br_table.2asm.js b/test/wasm2js/br_table.2asm.js index 8587a25d4..18a67f343 100644 --- a/test/wasm2js/br_table.2asm.js +++ b/test/wasm2js/br_table.2asm.js @@ -50215,10 +50215,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$7() { - return +$7(); - } - function legalstub$30() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $30(); @@ -50245,10 +50241,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$46() { - return +$46(); - } - function legalstub$47() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $47(); @@ -50275,10 +50267,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$52() { - return +$52(); - } - function legalstub$54() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $54(); @@ -50313,7 +50301,7 @@ function asmFunc(global, env, buffer) { "type_f64": $4, "type_i32_value": $5, "type_i64_value": legalstub$6, - "type_f32_value": legalstub$7, + "type_f32_value": $7, "type_f64_value": $8, "empty": $9, "empty_value": $10, @@ -50351,13 +50339,13 @@ function asmFunc(global, env, buffer) { "as_call_indirect_last": $43, "as_call_indirect_func": $44, "as_local_set_value": $45, - "as_load_address": legalstub$46, + "as_load_address": $46, "as_loadN_address": legalstub$47, "as_store_address": $48, "as_store_value": $49, "as_storeN_address": $50, "as_storeN_value": $51, - "as_unary_operand": legalstub$52, + "as_unary_operand": $52, "as_binary_left": $53, "as_binary_right": legalstub$54, "as_test_operand": $55, diff --git a/test/wasm2js/br_table_temp.2asm.js b/test/wasm2js/br_table_temp.2asm.js index 106bef338..51cbc508e 100644 --- a/test/wasm2js/br_table_temp.2asm.js +++ b/test/wasm2js/br_table_temp.2asm.js @@ -50181,10 +50181,6 @@ function asmFunc(global, env, buffer) { return $3_1 | 0; } - function legalstub$7() { - return +$7(); - } - var FUNCTION_TABLE = []; return { "type_i32": $1, @@ -50193,7 +50189,7 @@ function asmFunc(global, env, buffer) { "type_f64": $4, "type_i32_value": $5, "type_i64_value": $6, - "type_f32_value": legalstub$7, + "type_f32_value": $7, "type_f64_value": $8, "empty": $9, "empty_value": $10, diff --git a/test/wasm2js/call.2asm.js b/test/wasm2js/call.2asm.js index 44f54ca14..163e6f87d 100644 --- a/test/wasm2js/call.2asm.js +++ b/test/wasm2js/call.2asm.js @@ -357,10 +357,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$14() { - return +$14(); - } - function legalstub$17() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $17(); @@ -387,10 +383,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$18() { - return +$18(); - } - function legalstub$21() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $21(); @@ -417,10 +409,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$22() { - return +$22(); - } - function legalstub$fac($0, $1) { var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12_1 = 0, $13_1 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2 = 0, $2$hi = 0; i64toi32_i32$0 = 0; @@ -759,15 +747,15 @@ function asmFunc(global, env, buffer) { return { "type_i32": $12, "type_i64": legalstub$13, - "type_f32": legalstub$14, + "type_f32": $14, "type_f64": $15, "type_first_i32": $16, "type_first_i64": legalstub$17, - "type_first_f32": legalstub$18, + "type_first_f32": $18, "type_first_f64": $19, "type_second_i32": $20, "type_second_i64": legalstub$21, - "type_second_f32": legalstub$22, + "type_second_f32": $22, "type_second_f64": $23, "fac": legalstub$fac, "fac_acc": legalstub$fac_acc, diff --git a/test/wasm2js/call_indirect.2asm.js b/test/wasm2js/call_indirect.2asm.js index ee581aeca..fbba86cef 100644 --- a/test/wasm2js/call_indirect.2asm.js +++ b/test/wasm2js/call_indirect.2asm.js @@ -379,10 +379,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$18() { - return +$18(); - } - function legalstub$20() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $20(); @@ -435,10 +431,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$23() { - return +$23(); - } - function legalstub$26() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $26(); @@ -465,10 +457,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$27() { - return +$27(); - } - function legalstub$29($0, $1, $2) { var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $14 = 0, $15 = 0, $4 = 0, $6 = 0, $6$hi = 0, $9$hi = 0, $3 = 0, $3$hi = 0; $4 = $0; @@ -743,16 +731,16 @@ function asmFunc(global, env, buffer) { return { "type_i32": $16, "type_i64": legalstub$17, - "type_f32": legalstub$18, + "type_f32": $18, "type_f64": $19, "type_index": legalstub$20, "type_first_i32": $21, "type_first_i64": legalstub$22, - "type_first_f32": legalstub$23, + "type_first_f32": $23, "type_first_f64": $24, "type_second_i32": $25, "type_second_i64": legalstub$26, - "type_second_f32": legalstub$27, + "type_second_f32": $27, "type_second_f64": $28, "dispatch": legalstub$29, "dispatch_structural": legalstub$30, diff --git a/test/wasm2js/conversions-modified.2asm.js b/test/wasm2js/conversions-modified.2asm.js index bb8392de3..d866d9cdf 100644 --- a/test/wasm2js/conversions-modified.2asm.js +++ b/test/wasm2js/conversions-modified.2asm.js @@ -359,17 +359,9 @@ function asmFunc(global, env, buffer) { return $2(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } - function legalstub$3($0_1) { - return $3(Math_fround($0_1)); - } - - function legalstub$4($0_1) { - return $4(Math_fround($0_1)); - } - function legalstub$7($0_1) { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $7(Math_fround($0_1)); + i64toi32_i32$0 = $7($0_1); i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; $1_1 = i64toi32_i32$0; $1$hi = i64toi32_i32$1; @@ -395,7 +387,7 @@ function asmFunc(global, env, buffer) { function legalstub$8($0_1) { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $8(Math_fround($0_1)); + i64toi32_i32$0 = $8($0_1); i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; $1_1 = i64toi32_i32$0; $1$hi = i64toi32_i32$1; @@ -471,10 +463,6 @@ function asmFunc(global, env, buffer) { return $1_1; } - function legalstub$11($0_1) { - return +$11($0_1); - } - function legalstub$12($0_1, $1_1) { var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $10_1 = 0, $3_1 = 0, $3$hi = 0, $6$hi = 0; i64toi32_i32$0 = 0; @@ -502,7 +490,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $6$hi; i64toi32_i32$3 = $10_1; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - return +$12(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); + return $12(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } function legalstub$14($0_1, $1_1) { @@ -535,10 +523,6 @@ function asmFunc(global, env, buffer) { return $14(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } - function legalstub$15($0_1) { - return +$15($0_1); - } - function legalstub$16($0_1, $1_1) { var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $10_1 = 0, $3_1 = 0, $3$hi = 0, $6$hi = 0; i64toi32_i32$0 = 0; @@ -566,7 +550,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $6$hi; i64toi32_i32$3 = $10_1; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - return +$16(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); + return $16(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } function legalstub$18($0_1, $1_1) { @@ -599,18 +583,6 @@ function asmFunc(global, env, buffer) { return $18(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } - function legalstub$19($0_1) { - return $19(Math_fround($0_1)); - } - - function legalstub$20($0_1) { - return +$20($0_1); - } - - function legalstub$21($0_1) { - return +$21($0_1); - } - function legalstub$22($0_1, $1_1) { var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $10_1 = 0, $3_1 = 0, $3$hi = 0, $6$hi = 0; i64toi32_i32$0 = 0; @@ -641,10 +613,6 @@ function asmFunc(global, env, buffer) { return $22(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } - function legalstub$23($0_1) { - return $23(Math_fround($0_1)); - } - function legalstub$24($0_1) { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $24($0_1); @@ -676,27 +644,27 @@ function asmFunc(global, env, buffer) { "i64_extend_s_i32": legalstub$0, "i64_extend_u_i32": legalstub$1, "i32_wrap_i64": legalstub$2, - "i32_trunc_s_f32": legalstub$3, - "i32_trunc_u_f32": legalstub$4, + "i32_trunc_s_f32": $3, + "i32_trunc_u_f32": $4, "i32_trunc_s_f64": $5, "i32_trunc_u_f64": $6, "i64_trunc_s_f32": legalstub$7, "i64_trunc_u_f32": legalstub$8, "i64_trunc_s_f64": legalstub$9, "i64_trunc_u_f64": legalstub$10, - "f32_convert_s_i32": legalstub$11, + "f32_convert_s_i32": $11, "f32_convert_s_i64": legalstub$12, "f64_convert_s_i32": $13, "f64_convert_s_i64": legalstub$14, - "f32_convert_u_i32": legalstub$15, + "f32_convert_u_i32": $15, "f32_convert_u_i64": legalstub$16, "f64_convert_u_i32": $17, "f64_convert_u_i64": legalstub$18, - "f64_promote_f32": legalstub$19, - "f32_demote_f64": legalstub$20, - "f32_reinterpret_i32": legalstub$21, + "f64_promote_f32": $19, + "f32_demote_f64": $20, + "f32_reinterpret_i32": $21, "f64_reinterpret_i64": legalstub$22, - "i32_reinterpret_f32": legalstub$23, + "i32_reinterpret_f32": $23, "i64_reinterpret_f64": legalstub$24 }; } diff --git a/test/wasm2js/endianness.2asm.js b/test/wasm2js/endianness.2asm.js index 41c829279..3bd0c42a8 100644 --- a/test/wasm2js/endianness.2asm.js +++ b/test/wasm2js/endianness.2asm.js @@ -543,10 +543,6 @@ function asmFunc(global, env, buffer) { return $2; } - function legalstub$14($0) { - return +$14(Math_fround($0)); - } - function legalstub$18($0, $1) { var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12_1 = 0, $13_1 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2 = 0, $2$hi = 0; i64toi32_i32$0 = 0; @@ -700,10 +696,6 @@ function asmFunc(global, env, buffer) { return $2; } - function legalstub$21($0) { - return +$21(Math_fround($0)); - } - var FUNCTION_TABLE = []; function __wasm_grow_memory(pagesToAdd) { pagesToAdd = pagesToAdd | 0; @@ -741,14 +733,14 @@ function asmFunc(global, env, buffer) { "i64_load32_s": legalstub$11, "i64_load32_u": legalstub$12, "i64_load": legalstub$13, - "f32_load": legalstub$14, + "f32_load": $14, "f64_load": $15, "i32_store16": $16, "i32_store": $17, "i64_store16": legalstub$18, "i64_store32": legalstub$19, "i64_store": legalstub$20, - "f32_store": legalstub$21, + "f32_store": $21, "f64_store": $22 }; } diff --git a/test/wasm2js/f32.2asm.js b/test/wasm2js/f32.2asm.js index a6c7d182b..8615d293c 100644 --- a/test/wasm2js/f32.2asm.js +++ b/test/wasm2js/f32.2asm.js @@ -120,62 +120,6 @@ function asmFunc(global, env, buffer) { return Math_fround((wasm2js_scratch_store_i32(0, (wasm2js_scratch_store_f32(x), wasm2js_scratch_load_i32(0)) & 2147483647 | (wasm2js_scratch_store_f32(y), wasm2js_scratch_load_i32(0)) & -2147483648), wasm2js_scratch_load_f32())); } - function legalstub$0($0_1, $1_1) { - return +$0(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$1($0_1, $1_1) { - return +$1(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$2($0_1, $1_1) { - return +$2(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$3($0_1, $1_1) { - return +$3(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$4($0_1) { - return +$4(Math_fround($0_1)); - } - - function legalstub$5($0_1, $1_1) { - return +$5(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$6($0_1, $1_1) { - return +$6(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$7($0_1) { - return +$7(Math_fround($0_1)); - } - - function legalstub$8($0_1) { - return +$8(Math_fround($0_1)); - } - - function legalstub$9($0_1) { - return +$9(Math_fround($0_1)); - } - - function legalstub$10($0_1) { - return +$10(Math_fround($0_1)); - } - - function legalstub$11($0_1) { - return +$11(Math_fround($0_1)); - } - - function legalstub$12($0_1) { - return +$12(Math_fround($0_1)); - } - - function legalstub$13($0_1, $1_1) { - return +$13(Math_fround($0_1), Math_fround($1_1)); - } - function __wasm_nearest_f32(var$0) { var var$1 = Math_fround(0), var$2 = Math_fround(0), wasm2js_f32$0 = Math_fround(0), wasm2js_f32$1 = Math_fround(0), wasm2js_i32$0 = 0; var$1 = Math_fround(Math_floor(var$0)); @@ -200,20 +144,20 @@ function asmFunc(global, env, buffer) { var FUNCTION_TABLE = []; return { - "add": legalstub$0, - "sub": legalstub$1, - "mul": legalstub$2, - "div": legalstub$3, - "sqrt": legalstub$4, - "min": legalstub$5, - "max": legalstub$6, - "ceil": legalstub$7, - "floor": legalstub$8, - "trunc": legalstub$9, - "nearest": legalstub$10, - "abs": legalstub$11, - "neg": legalstub$12, - "copysign": legalstub$13 + "add": $0, + "sub": $1, + "mul": $2, + "div": $3, + "sqrt": $4, + "min": $5, + "max": $6, + "ceil": $7, + "floor": $8, + "trunc": $9, + "nearest": $10, + "abs": $11, + "neg": $12, + "copysign": $13 }; } diff --git a/test/wasm2js/f32_cmp.2asm.js b/test/wasm2js/f32_cmp.2asm.js index bd272335c..671db639d 100644 --- a/test/wasm2js/f32_cmp.2asm.js +++ b/test/wasm2js/f32_cmp.2asm.js @@ -57,38 +57,14 @@ function asmFunc(global, env, buffer) { return x >= y | 0; } - function legalstub$0($0_1, $1_1) { - return $0(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$1($0_1, $1_1) { - return $1(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$2($0_1, $1_1) { - return $2(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$3($0_1, $1_1) { - return $3(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$4($0_1, $1_1) { - return $4(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$5($0_1, $1_1) { - return $5(Math_fround($0_1), Math_fround($1_1)); - } - var FUNCTION_TABLE = []; return { - "eq": legalstub$0, - "ne": legalstub$1, - "lt": legalstub$2, - "le": legalstub$3, - "gt": legalstub$4, - "ge": legalstub$5 + "eq": $0, + "ne": $1, + "lt": $2, + "le": $3, + "gt": $4, + "ge": $5 }; } diff --git a/test/wasm2js/float-ops.2asm.js b/test/wasm2js/float-ops.2asm.js index 4d691213a..ce5149482 100644 --- a/test/wasm2js/float-ops.2asm.js +++ b/test/wasm2js/float-ops.2asm.js @@ -357,90 +357,6 @@ function asmFunc(global, env, buffer) { return ~~i64toi32_i32$0 >>> 0 == (0 | 0) & (i64toi32_i32$1 | 0) == (0 | 0); } - function legalstub$1($0, $1_1) { - return +$1(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$2($0, $1_1) { - return +$2(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$3($0, $1_1) { - return +$3(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$4($0, $1_1) { - return +$4(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$9($0, $1_1) { - return $9(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$10($0, $1_1) { - return $10(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$11($0, $1_1) { - return $11(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$12($0, $1_1) { - return $12(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$13($0, $1_1) { - return $13(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$14($0, $1_1) { - return $14(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$21($0, $1_1) { - return +$21(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$22($0, $1_1) { - return +$22(Math_fround($0), Math_fround($1_1)); - } - - function legalstub$25($0) { - return $25(Math_fround($0)); - } - - function legalstub$26($0) { - return +$26($0); - } - - function legalstub$27($0) { - return +$27(Math_fround($0)); - } - - function legalstub$28($0) { - return +$28(Math_fround($0)); - } - - function legalstub$31($0) { - return +$31(Math_fround($0)); - } - - function legalstub$35($0) { - return +$35($0); - } - - function legalstub$37($0) { - return +$37($0); - } - - function legalstub$39($0) { - return $39(Math_fround($0)); - } - - function legalstub$41($0) { - return $41(Math_fround($0)); - } - function legalstub$43($0, $1_1) { var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $10_1 = 0, $3_1 = 0, $3$hi = 0, $6$hi = 0; i64toi32_i32$0 = 0; @@ -468,7 +384,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $6$hi; i64toi32_i32$3 = $10_1; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - return +$43(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); + return $43(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } function legalstub$44($0, $1_1) { @@ -528,7 +444,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $6$hi; i64toi32_i32$3 = $10_1; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - return +$45(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); + return $45(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } function legalstub$46($0, $1_1) { @@ -561,63 +477,55 @@ function asmFunc(global, env, buffer) { return $46(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } - function legalstub$47($0) { - return $47(Math_fround($0)); - } - - function legalstub$49($0) { - return $49(Math_fround($0)); - } - var FUNCTION_TABLE = []; return { - "f32_add": legalstub$1, - "f32_sub": legalstub$2, - "f32_mul": legalstub$3, - "f32_div": legalstub$4, + "f32_add": $1, + "f32_sub": $2, + "f32_mul": $3, + "f32_div": $4, "f64_add": $5, "f64_sub": $6, "f64_mul": $7, "f64_div": $8, - "f32_eq": legalstub$9, - "f32_ne": legalstub$10, - "f32_ge": legalstub$11, - "f32_gt": legalstub$12, - "f32_le": legalstub$13, - "f32_lt": legalstub$14, + "f32_eq": $9, + "f32_ne": $10, + "f32_ge": $11, + "f32_gt": $12, + "f32_le": $13, + "f32_lt": $14, "f64_eq": $15, "f64_ne": $16, "f64_ge": $17, "f64_gt": $18, "f64_le": $19, "f64_lt": $20, - "f32_min": legalstub$21, - "f32_max": legalstub$22, + "f32_min": $21, + "f32_max": $22, "f64_min": $23, "f64_max": $24, - "f64_promote": legalstub$25, - "f32_demote": legalstub$26, - "f32_floor": legalstub$27, - "f32_ceil": legalstub$28, + "f64_promote": $25, + "f32_demote": $26, + "f32_floor": $27, + "f32_ceil": $28, "f64_floor": $29, "f64_ceil": $30, - "f32_sqrt": legalstub$31, + "f32_sqrt": $31, "f64_sqrt": $32, - "i32_to_f32": legalstub$35, + "i32_to_f32": $35, "i32_to_f64": $36, - "u32_to_f32": legalstub$37, + "u32_to_f32": $37, "u32_to_f64": $38, - "f32_to_i32": legalstub$39, + "f32_to_i32": $39, "f64_to_i32": $40, - "f32_to_u32": legalstub$41, + "f32_to_u32": $41, "f64_to_u32": $42, "i64_to_f32": legalstub$43, "i64_to_f64": legalstub$44, "u64_to_f32": legalstub$45, "u64_to_f64": legalstub$46, - "f32_to_i64": legalstub$47, + "f32_to_i64": $47, "f64_to_i64": $48, - "f32_to_u64": legalstub$49, + "f32_to_u64": $49, "f64_to_u64": $50 }; } diff --git a/test/wasm2js/float_misc.2asm.js b/test/wasm2js/float_misc.2asm.js index 0e4c241e8..8e28dbb96 100644 --- a/test/wasm2js/float_misc.2asm.js +++ b/test/wasm2js/float_misc.2asm.js @@ -229,62 +229,6 @@ function asmFunc(global, env, buffer) { return +Math_max(x, y); } - function legalstub$0($0_1, $1_1) { - return +$0(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$1($0_1, $1_1) { - return +$1(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$2($0_1, $1_1) { - return +$2(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$3($0_1, $1_1) { - return +$3(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$4($0_1) { - return +$4(Math_fround($0_1)); - } - - function legalstub$5($0_1) { - return +$5(Math_fround($0_1)); - } - - function legalstub$6($0_1) { - return +$6(Math_fround($0_1)); - } - - function legalstub$7($0_1, $1_1) { - return +$7(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$8($0_1) { - return +$8(Math_fround($0_1)); - } - - function legalstub$9($0_1) { - return +$9(Math_fround($0_1)); - } - - function legalstub$10($0_1) { - return +$10(Math_fround($0_1)); - } - - function legalstub$11($0_1) { - return +$11(Math_fround($0_1)); - } - - function legalstub$12($0_1, $1_1) { - return +$12(Math_fround($0_1), Math_fround($1_1)); - } - - function legalstub$13($0_1, $1_1) { - return +$13(Math_fround($0_1), Math_fround($1_1)); - } - function __wasm_nearest_f32(var$0) { var var$1 = Math_fround(0), var$2 = Math_fround(0), wasm2js_f32$0 = Math_fround(0), wasm2js_f32$1 = Math_fround(0), wasm2js_i32$0 = 0; var$1 = Math_fround(Math_floor(var$0)); @@ -331,20 +275,20 @@ function asmFunc(global, env, buffer) { var FUNCTION_TABLE = []; return { - "f32_add": legalstub$0, - "f32_sub": legalstub$1, - "f32_mul": legalstub$2, - "f32_div": legalstub$3, - "f32_sqrt": legalstub$4, - "f32_abs": legalstub$5, - "f32_neg": legalstub$6, - "f32_copysign": legalstub$7, - "f32_ceil": legalstub$8, - "f32_floor": legalstub$9, - "f32_trunc": legalstub$10, - "f32_nearest": legalstub$11, - "f32_min": legalstub$12, - "f32_max": legalstub$13, + "f32_add": $0, + "f32_sub": $1, + "f32_mul": $2, + "f32_div": $3, + "f32_sqrt": $4, + "f32_abs": $5, + "f32_neg": $6, + "f32_copysign": $7, + "f32_ceil": $8, + "f32_floor": $9, + "f32_trunc": $10, + "f32_nearest": $11, + "f32_min": $12, + "f32_max": $13, "f64_add": $14, "f64_sub": $15, "f64_mul": $16, diff --git a/test/wasm2js/func.2asm.js b/test/wasm2js/func.2asm.js index c96d4a889..b87622a7d 100644 --- a/test/wasm2js/func.2asm.js +++ b/test/wasm2js/func.2asm.js @@ -450,10 +450,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$25() { - return +$25(); - } - function legalstub$28() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $28(); @@ -480,10 +476,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$29() { - return +$29(); - } - function legalstub$33($0, $1, $2_1, $3) { var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$3 = 0, $21 = 0, $22 = 0, $23_1 = 0, $6 = 0, $6$hi = 0, $9$hi = 0, $10 = 0, $10$hi = 0, $12 = 0, $12$hi = 0, $15$hi = 0, $16 = 0, $16$hi = 0, $4 = 0, $4$hi = 0; i64toi32_i32$0 = 0; @@ -566,10 +558,6 @@ function asmFunc(global, env, buffer) { return $4; } - function legalstub$34($0, $1) { - return +$34(Math_fround($0), Math_fround($1)); - } - function legalstub$37($0, $1, $2_1, $3) { var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$3 = 0, $21 = 0, $22 = 0, $23_1 = 0, $6 = 0, $6$hi = 0, $9$hi = 0, $10 = 0, $10$hi = 0, $12 = 0, $12$hi = 0, $15$hi = 0, $16 = 0, $16$hi = 0, $4 = 0, $4$hi = 0; i64toi32_i32$0 = 0; @@ -652,17 +640,13 @@ function asmFunc(global, env, buffer) { return $4; } - function legalstub$38($0, $1) { - return +$38(Math_fround($0), Math_fround($1)); - } - function legalstub$40($0, $1, $2_1, $3, $4, $5, $6) { - var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $17 = 0, $8 = Math_fround(0), $9 = 0, $11 = 0, $11$hi = 0, $14$hi = 0; - $8 = Math_fround($0); - $9 = $1; + var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $17 = 0, $7 = Math_fround(0), $8 = 0, $10 = 0, $10$hi = 0, $13$hi = 0; + $7 = $0; + $8 = $1; i64toi32_i32$0 = 0; - $11 = $2_1; - $11$hi = i64toi32_i32$0; + $10 = $2_1; + $10$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; i64toi32_i32$2 = $3; i64toi32_i32$1 = 0; @@ -679,13 +663,13 @@ function asmFunc(global, env, buffer) { $17 = i64toi32_i32$2 << i64toi32_i32$4; } } - $14$hi = i64toi32_i32$1; - i64toi32_i32$1 = $11$hi; - i64toi32_i32$0 = $11; - i64toi32_i32$2 = $14$hi; + $13$hi = i64toi32_i32$1; + i64toi32_i32$1 = $10$hi; + i64toi32_i32$0 = $10; + i64toi32_i32$2 = $13$hi; i64toi32_i32$3 = $17; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - return $40($8, $9, i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $4, $5, $6); + return $40($7, $8, i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $4, $5, $6); } function legalstub$44() { @@ -714,10 +698,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$45() { - return +$45(); - } - function legalstub$51() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $51(); @@ -744,10 +724,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$52() { - return +$52(); - } - function legalstub$57() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $57(); @@ -774,10 +750,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$58() { - return +$58(); - } - function legalstub$68() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $68(); @@ -804,50 +776,46 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$69() { - return +$69(); - } - var FUNCTION_TABLE = [complex_sig_3, empty_sig_2, complex_sig_1, complex_sig_3, empty_sig_1]; return { "f": $2, "g": h, "local_first_i32": $23, "local_first_i64": legalstub$24, - "local_first_f32": legalstub$25, + "local_first_f32": $25, "local_first_f64": $26, "local_second_i32": $27, "local_second_i64": legalstub$28, - "local_second_f32": legalstub$29, + "local_second_f32": $29, "local_second_f64": $30, "local_mixed": $31, "param_first_i32": $32, "param_first_i64": legalstub$33, - "param_first_f32": legalstub$34, + "param_first_f32": $34, "param_first_f64": $35, "param_second_i32": $36, "param_second_i64": legalstub$37, - "param_second_f32": legalstub$38, + "param_second_f32": $38, "param_second_f64": $39, "param_mixed": legalstub$40, "empty": $41, "value_void": $42, "value_i32": $43, "value_i64": legalstub$44, - "value_f32": legalstub$45, + "value_f32": $45, "value_f64": $46, "value_block_void": $47, "value_block_i32": $48, "return_empty": $49, "return_i32": $50, "return_i64": legalstub$51, - "return_f32": legalstub$52, + "return_f32": $52, "return_f64": $53, "return_block_i32": $54, "break_empty": $55, "break_i32": $56, "break_i64": legalstub$57, - "break_f32": legalstub$58, + "break_f32": $58, "break_f64": $59, "break_block_i32": $60, "break_br_if_empty": $61, @@ -858,7 +826,7 @@ function asmFunc(global, env, buffer) { "break_br_table_nested_num": $66, "init_local_i32": $67, "init_local_i64": legalstub$68, - "init_local_f32": legalstub$69, + "init_local_f32": $69, "init_local_f64": $70, "signature_explicit_reused": $76, "signature_implicit_reused": $77, diff --git a/test/wasm2js/get_local.2asm.js b/test/wasm2js/get_local.2asm.js index 891a4950e..ddf0c30fa 100644 --- a/test/wasm2js/get_local.2asm.js +++ b/test/wasm2js/get_local.2asm.js @@ -130,10 +130,6 @@ function asmFunc(global, env, buffer) { return $0_1; } - function legalstub$2() { - return +$2(); - } - function legalstub$5($0_1, $1_1) { var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4_1 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; i64toi32_i32$0 = 0; @@ -185,10 +181,6 @@ function asmFunc(global, env, buffer) { return $2_1; } - function legalstub$6($0_1) { - return +$6(Math_fround($0_1)); - } - function legalstub$8($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $14 = 0, $7_1 = 0, $7$hi = 0, $10$hi = 0; i64toi32_i32$0 = 0; @@ -216,7 +208,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $10$hi; i64toi32_i32$3 = $14; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - $8(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, Math_fround($2_1), $3_1, $4_1, $5_1); + $8(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $2_1, $3_1, $4_1, $5_1); } function legalstub$9($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { @@ -246,18 +238,18 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $10$hi; i64toi32_i32$3 = $14; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - return $9(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, Math_fround($2_1), $3_1, $4_1, $5_1); + return $9(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $2_1, $3_1, $4_1, $5_1); } var FUNCTION_TABLE = []; return { "type_local_i32": $0, "type_local_i64": legalstub$1, - "type_local_f32": legalstub$2, + "type_local_f32": $2, "type_local_f64": $3, "type_param_i32": $4, "type_param_i64": legalstub$5, - "type_param_f32": legalstub$6, + "type_param_f32": $6, "type_param_f64": $7, "type_mixed": legalstub$8, "read": legalstub$9 diff --git a/test/wasm2js/loop.2asm.js b/test/wasm2js/loop.2asm.js index 948617604..3ed99264a 100644 --- a/test/wasm2js/loop.2asm.js +++ b/test/wasm2js/loop.2asm.js @@ -445,10 +445,6 @@ function asmFunc(global, env, buffer) { return $2_1; } - function legalstub$18($0, $1_1) { - return +$18(Math_fround($0), Math_fround($1_1)); - } - function _ZN17compiler_builtins3int3mul3Mul3mul17h070e9a1c69faec5bE(var$0, var$0$hi, var$1, var$1$hi) { var i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, var$2 = 0, i64toi32_i32$2 = 0, i64toi32_i32$3 = 0, var$3 = 0, var$4 = 0, var$5 = 0, $21 = 0, $22 = 0, var$6 = 0, $24 = 0, $17_1 = 0, $18_1 = 0, $23 = 0, $29 = 0, $45 = 0, $56$hi = 0, $62$hi = 0; i64toi32_i32$0 = var$1$hi; @@ -565,7 +561,7 @@ function asmFunc(global, env, buffer) { "effects": fx, "while_": legalstub$16, "for_": legalstub$17, - "nesting": legalstub$18 + "nesting": $18 }; } diff --git a/test/wasm2js/select.2asm.js b/test/wasm2js/select.2asm.js index c50a01a47..07de1de95 100644 --- a/test/wasm2js/select.2asm.js +++ b/test/wasm2js/select.2asm.js @@ -159,15 +159,11 @@ function asmFunc(global, env, buffer) { return $5_1; } - function legalstub$2($0_1, $1_1, $2_1) { - return +$2(Math_fround($0_1), Math_fround($1_1), $2_1); - } - var FUNCTION_TABLE = []; return { "select_i32": $0, "select_i64": legalstub$1, - "select_f32": legalstub$2, + "select_f32": $2, "select_f64": $3, "select_trap_l": $4, "select_trap_r": $5 diff --git a/test/wasm2js/set_local.2asm.js b/test/wasm2js/set_local.2asm.js index cbb346aa6..1eba7bcd2 100644 --- a/test/wasm2js/set_local.2asm.js +++ b/test/wasm2js/set_local.2asm.js @@ -137,10 +137,6 @@ function asmFunc(global, env, buffer) { $5(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2); } - function legalstub$6($0_1) { - $6(Math_fround($0_1)); - } - function legalstub$8($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $14 = 0, $7_1 = 0, $7$hi = 0, $10$hi = 0; i64toi32_i32$0 = 0; @@ -168,7 +164,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $10$hi; i64toi32_i32$3 = $14; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - $8(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, Math_fround($2_1), $3_1, $4_1, $5_1); + $8(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $2_1, $3_1, $4_1, $5_1); } function legalstub$9($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { @@ -198,7 +194,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $11$hi; i64toi32_i32$3 = $16; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - i64toi32_i32$2 = $9(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, Math_fround($2_1), $3_1, $4_1, $5_1); + i64toi32_i32$2 = $9(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $2_1, $3_1, $4_1, $5_1); i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; $6_1 = i64toi32_i32$2; $6$hi = i64toi32_i32$0; @@ -230,7 +226,7 @@ function asmFunc(global, env, buffer) { "type_local_f64": $3, "type_param_i32": $4, "type_param_i64": legalstub$5, - "type_param_f32": legalstub$6, + "type_param_f32": $6, "type_param_f64": $7, "type_mixed": legalstub$8, "write": legalstub$9 diff --git a/test/wasm2js/tee_local.2asm.js b/test/wasm2js/tee_local.2asm.js index d41d1b560..50ed49d10 100644 --- a/test/wasm2js/tee_local.2asm.js +++ b/test/wasm2js/tee_local.2asm.js @@ -168,10 +168,6 @@ function asmFunc(global, env, buffer) { return $0_1; } - function legalstub$2() { - return +$2(); - } - function legalstub$5($0_1, $1_1) { var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4_1 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; i64toi32_i32$0 = 0; @@ -223,10 +219,6 @@ function asmFunc(global, env, buffer) { return $2_1; } - function legalstub$6($0_1) { - return +$6(Math_fround($0_1)); - } - function legalstub$8($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $14 = 0, $7_1 = 0, $7$hi = 0, $10$hi = 0; i64toi32_i32$0 = 0; @@ -254,7 +246,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $10$hi; i64toi32_i32$3 = $14; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - $8(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, Math_fround($2_1), $3_1, $4_1, $5_1); + $8(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $2_1, $3_1, $4_1, $5_1); } function legalstub$9($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { @@ -284,7 +276,7 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $11$hi; i64toi32_i32$3 = $16; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - i64toi32_i32$2 = $9(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, Math_fround($2_1), $3_1, $4_1, $5_1); + i64toi32_i32$2 = $9(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $2_1, $3_1, $4_1, $5_1); i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; $6_1 = i64toi32_i32$2; $6$hi = i64toi32_i32$0; @@ -335,18 +327,18 @@ function asmFunc(global, env, buffer) { i64toi32_i32$2 = $10$hi; i64toi32_i32$3 = $14; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2; - return $10(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, Math_fround($2_1), $3_1, $4_1, $5_1); + return $10(i64toi32_i32$0 | i64toi32_i32$3, i64toi32_i32$2, $2_1, $3_1, $4_1, $5_1); } var FUNCTION_TABLE = []; return { "type_local_i32": $0, "type_local_i64": legalstub$1, - "type_local_f32": legalstub$2, + "type_local_f32": $2, "type_local_f64": $3, "type_param_i32": $4, "type_param_i64": legalstub$5, - "type_param_f32": legalstub$6, + "type_param_f32": $6, "type_param_f64": $7, "type_mixed": legalstub$8, "write": legalstub$9, diff --git a/test/wasm2js/traps.2asm.js b/test/wasm2js/traps.2asm.js index c47b738ab..294086f24 100644 --- a/test/wasm2js/traps.2asm.js +++ b/test/wasm2js/traps.2asm.js @@ -1917,17 +1917,9 @@ function asmFunc(global, env, buffer) { return i64toi32_i32$2 | 0; } - function legalstub$0($0_1) { - return $0(Math_fround($0_1)); - } - - function legalstub$1($0_1) { - return $1(Math_fround($0_1)); - } - function legalstub$4($0_1) { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $4(Math_fround($0_1)); + i64toi32_i32$0 = $4($0_1); i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; $1_1 = i64toi32_i32$0; $1$hi = i64toi32_i32$1; @@ -1953,7 +1945,7 @@ function asmFunc(global, env, buffer) { function legalstub$5($0_1) { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $5(Math_fround($0_1)); + i64toi32_i32$0 = $5($0_1); i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; $1_1 = i64toi32_i32$0; $1$hi = i64toi32_i32$1; @@ -2031,8 +2023,8 @@ function asmFunc(global, env, buffer) { var FUNCTION_TABLE = []; return { - "no_dce_i32_trunc_s_f32": legalstub$0, - "no_dce_i32_trunc_u_f32": legalstub$1, + "no_dce_i32_trunc_s_f32": $0, + "no_dce_i32_trunc_u_f32": $1, "no_dce_i32_trunc_s_f64": $2, "no_dce_i32_trunc_u_f64": $3, "no_dce_i64_trunc_s_f32": legalstub$4, @@ -2129,10 +2121,6 @@ function asmFunc(global, env, buffer) { return $1_1; } - function legalstub$2($0_1) { - return +$2($0_1); - } - var FUNCTION_TABLE = []; function __wasm_grow_memory(pagesToAdd) { pagesToAdd = pagesToAdd | 0; @@ -2164,7 +2152,7 @@ function asmFunc(global, env, buffer) { return { "no_dce_i32_load": $0, "no_dce_i64_load": legalstub$1, - "no_dce_f32_load": legalstub$2, + "no_dce_f32_load": $2, "no_dce_f64_load": $3 }; } diff --git a/test/wasm2js/unaligned.2asm.js b/test/wasm2js/unaligned.2asm.js index f15cb0601..51e4bf269 100644 --- a/test/wasm2js/unaligned.2asm.js +++ b/test/wasm2js/unaligned.2asm.js @@ -134,15 +134,11 @@ function asmFunc(global, env, buffer) { return $0_1; } - function legalstub$2() { - return +$2(); - } - var FUNCTION_TABLE = []; return { "i32_load": $0, "i64_load": legalstub$1, - "f32_load": legalstub$2, + "f32_load": $2, "f64_load": $3, "i32_store": $4, "i64_store": $5, diff --git a/test/wasm2js/unreachable.2asm.js b/test/wasm2js/unreachable.2asm.js index bf8193884..074da4558 100644 --- a/test/wasm2js/unreachable.2asm.js +++ b/test/wasm2js/unreachable.2asm.js @@ -326,10 +326,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$41() { - return +$41(); - } - function legalstub$42() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $42(); @@ -356,10 +352,6 @@ function asmFunc(global, env, buffer) { return $0; } - function legalstub$47() { - return +$47(); - } - function legalstub$49() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $49(); @@ -427,13 +419,13 @@ function asmFunc(global, env, buffer) { "as_call_indirect_mid": $38, "as_call_indirect_last": $39, "as_local_set_value": $40, - "as_load_address": legalstub$41, + "as_load_address": $41, "as_loadN_address": legalstub$42, "as_store_address": $43, "as_store_value": $44, "as_storeN_address": $45, "as_storeN_value": $46, - "as_unary_operand": legalstub$47, + "as_unary_operand": $47, "as_binary_left": $48, "as_binary_right": legalstub$49, "as_test_operand": $50, |