diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-12-15 14:24:27 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-12-15 14:24:27 -0800 |
commit | 5cced1f88657b628f55cc48c486f85f772001472 (patch) | |
tree | fb9a9e53db8837daa19ca2a048b743dbd3beddab | |
parent | 03e1465919fe68416fc4b4e19a14f96456578002 (diff) | |
download | binaryen-5cced1f88657b628f55cc48c486f85f772001472.tar.gz binaryen-5cced1f88657b628f55cc48c486f85f772001472.tar.bz2 binaryen-5cced1f88657b628f55cc48c486f85f772001472.zip |
fix stack popping in s2wasm
-rw-r--r-- | src/s2wasm.h | 88 | ||||
-rw-r--r-- | test/dot_s/basics.wast | 20 | ||||
-rw-r--r-- | test/dot_s/cfg-stackify.wast | 70 | ||||
-rw-r--r-- | test/dot_s/comparisons_f32.wast | 24 | ||||
-rw-r--r-- | test/dot_s/comparisons_f64.wast | 24 | ||||
-rw-r--r-- | test/dot_s/comparisons_i32.wast | 20 | ||||
-rw-r--r-- | test/dot_s/comparisons_i64.wast | 20 | ||||
-rw-r--r-- | test/dot_s/dead-vreg.wast | 18 | ||||
-rw-r--r-- | test/dot_s/f32.wast | 14 | ||||
-rw-r--r-- | test/dot_s/f64.wast | 14 | ||||
-rw-r--r-- | test/dot_s/func.wast | 2 | ||||
-rw-r--r-- | test/dot_s/i32.wast | 26 | ||||
-rw-r--r-- | test/dot_s/i64.wast | 26 | ||||
-rw-r--r-- | test/dot_s/legalize.wast | 12 | ||||
-rw-r--r-- | test/dot_s/load-store-i1.wast | 12 | ||||
-rw-r--r-- | test/dot_s/phi.wast | 8 | ||||
-rw-r--r-- | test/dot_s/reg-stackify.wast | 10 | ||||
-rw-r--r-- | test/dot_s/signext-zeroext.wast | 16 | ||||
-rw-r--r-- | test/dot_s/store-results.wast | 8 | ||||
-rw-r--r-- | test/dot_s/switch.wast | 4 | ||||
-rw-r--r-- | test/dot_s/varargs.wast | 16 |
21 files changed, 242 insertions, 210 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index 759dcf44a..9a0ab69c5 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -111,6 +111,12 @@ private: return cashew::IString(str.c_str(), false); } + void skipToSep() { + while (*s && !isspace(*s) && *s != ',' && *s != ')') { + s++; + } + } + Name getStrToSep() { std::string str; while (*s && !isspace(*s) && *s != ',' && *s != ')') { @@ -345,17 +351,42 @@ private: //std::cerr << "pop " << ret << '\n'; return ret; }; - auto getInput = [&]() { - //dump("getinput"); - if (match("$pop")) { - while (isdigit(*s)) s++; - return pop(); - } else { - auto curr = allocator.alloc<GetLocal>(); - curr->name = getStrToSep(); - curr->type = localTypes[curr->name]; - return (Expression*)curr; + auto getNumInputs = [&]() { + int ret = 1; + char *t = s; + while (*t != '\n') { + if (*t == ',') ret++; + t++; } + return ret; + }; + auto getInputs = [&](int num) { + // we may have $pop, $0, $pop, $1 etc., which are getlocals + // interleaved with stack pops, and the stack pops must be done in + // *reverse* order, i.e., that input should turn into + // lastpop, getlocal(0), firstpop, getlocal(1) + std::vector<Expression*> inputs; // TODO: optimize (if .s format doesn't change) + inputs.resize(num); + for (int i = 0; i < num; i++) { + if (match("$pop")) { + skipToSep(); + inputs[i] = nullptr; + } else { + auto curr = allocator.alloc<GetLocal>(); + curr->name = getStrToSep(); + curr->type = localTypes[curr->name]; + inputs[i] = curr; + } + if (*s == ')') s++; // tolerate 0(argument) syntax, where we started at the 'a' + if (i < num - 1) skipComma(); + } + for (int i = num-1; i >= 0; i--) { + if (inputs[i] == nullptr) inputs[i] = pop(); + } + return inputs; + }; + auto getInput = [&]() { + return getInputs(1)[0]; }; auto setOutput = [&](Expression* curr, Name assign) { if (assign.isNull() || assign.str[1] == 'd') { // discard @@ -375,9 +406,9 @@ private: skipComma(); auto curr = allocator.alloc<Binary>(); curr->op = op; - curr->right = getInput(); - skipComma(); - curr->left = getInput(); + auto inputs = getInputs(2); + curr->left = inputs[0]; + curr->right = inputs[1]; curr->finalize(); assert(curr->type == type); setOutput(curr, assign); @@ -417,7 +448,6 @@ private: curr->align = curr->bytes; // XXX mustMatch("("); curr->ptr = getInput(); - mustMatch(")"); setOutput(curr, assign); }; auto makeStore = [&](WasmType type) { @@ -426,26 +456,23 @@ private: curr->type = type; int32_t bytes = getInt(); curr->bytes = bytes > 0 ? bytes : getWasmTypeSize(type); + curr->align = curr->bytes; // XXX Name assign = getAssign(); curr->offset = getInt(); - curr->align = curr->bytes; // XXX mustMatch("("); - curr->ptr = getInput(); - mustMatch(")"); - skipComma(); - curr->value = getInput(); + auto inputs = getInputs(2); + curr->ptr = inputs[0]; + curr->value = inputs[1]; setOutput(curr, assign); }; auto makeSelect = [&](WasmType type) { Name assign = getAssign(); skipComma(); auto curr = allocator.alloc<Select>(); - curr->condition = getInput(); - skipComma(); - curr->ifTrue = getInput(); - skipComma(); - curr->ifFalse = getInput(); - skipComma(); + auto inputs = getInputs(3); + curr->condition = inputs[0]; + curr->ifTrue = inputs[1]; + curr->ifFalse = inputs[2]; curr->type = type; setOutput(curr, assign); }; @@ -477,9 +504,14 @@ private: } } curr->type = type; - while (1) { - if (!skipComma()) break; - curr->operands.push_back(getInput()); + skipWhitespace(); + if (*s == ',') { + skipComma(); + int num = getNumInputs(); + auto inputs = getInputs(num); + for (int i = 0; i < num; i++) { + curr->operands.push_back(inputs[i]); + } } std::reverse(curr->operands.begin(), curr->operands.end()); setOutput(curr, assign); diff --git a/test/dot_s/basics.wast b/test/dot_s/basics.wast index 1a6af338c..7c7e43ec3 100644 --- a/test/dot_s/basics.wast +++ b/test/dot_s/basics.wast @@ -13,20 +13,20 @@ (br_if (i32.ne (i32.sub + (get_local $$0) (i32.and (i32.add + (get_local $$0) (i32.shr_u (i32.shr_s - (i32.const 31) (get_local $$0) + (i32.const 31) ) (i32.const 30) ) - (get_local $$0) ) (i32.const -4) ) - (get_local $$0) ) (i32.const 1) ) @@ -36,19 +36,19 @@ (block (set_local $$0 (i32.add - (get_local $$0) (i32.gt_s - (i32.const 10) (get_local $$0) + (i32.const 10) ) + (get_local $$0) ) ) (block $BB0_3 (br_if (i32.ne (i32.rem_s - (i32.const 5) (get_local $$0) + (i32.const 5) ) (i32.const 3) ) @@ -56,19 +56,19 @@ ) (set_local $$0 (i32.add - (get_local $$0) (i32.rem_s - (i32.const 111) (get_local $$0) + (i32.const 111) ) + (get_local $$0) ) ) ) (br_if (i32.eq (i32.rem_s - (i32.const 7) (get_local $$0) + (i32.const 7) ) (i32.const 0) ) @@ -80,8 +80,8 @@ ) (set_local $$0 (i32.add - (i32.const -12) (get_local $$0) + (i32.const -12) ) ) ) diff --git a/test/dot_s/cfg-stackify.wast b/test/dot_s/cfg-stackify.wast index 84440a122..2f6034844 100644 --- a/test/dot_s/cfg-stackify.wast +++ b/test/dot_s/cfg-stackify.wast @@ -36,14 +36,14 @@ (block (set_local $$1 (i32.add - (i32.const 1) (get_local $$1) + (i32.const 1) ) ) (br_if (i32.ge_s - (get_local $$0) (get_local $$1) + (get_local $$0) ) $BB0_3 ) @@ -66,14 +66,14 @@ (block (set_local $$1 (i32.add - (i32.const 1) (get_local $$1) + (i32.const 1) ) ) (br_if (i32.ge_s - (get_local $$0) (get_local $$1) + (get_local $$0) ) $BB1_3 ) @@ -91,8 +91,8 @@ (block $BB2_2 (br_if (i32.lt_s - (i32.const 1) (get_local $$1) + (i32.const 1) ) $BB2_2 ) @@ -109,14 +109,14 @@ ) (set_local $$1 (i32.add - (i32.const -1) (get_local $$1) + (i32.const -1) ) ) (set_local $$0 (i32.add - (i32.const 8) (get_local $$0) + (i32.const 8) ) ) (br_if @@ -296,8 +296,8 @@ ) (br_if (i32.eq - (i32.const 0) (get_local $$1) + (i32.const 0) ) $BB8_1 ) @@ -494,23 +494,23 @@ (block $BB13_4 (br_if (i32.gt_s - (i32.const 3) (get_local $$0) + (i32.const 3) ) $BB13_4 ) (block $BB13_3 (br_if (i32.eq - (i32.const 0) (get_local $$0) + (i32.const 0) ) $BB13_3 ) (br_if (i32.ne - (i32.const 2) (get_local $$0) + (i32.const 2) ) $BB13_7 ) @@ -519,15 +519,15 @@ ) (br_if (i32.eq - (i32.const 4) (get_local $$0) + (i32.const 4) ) $BB13_8 ) (br_if (i32.ne - (i32.const 622) (get_local $$0) + (i32.const 622) ) $BB13_7 ) @@ -562,8 +562,8 @@ (br_if (i32.eq (i32.and - (get_local $$2) (get_local $$0) + (get_local $$2) ) (i32.const 0) ) @@ -571,11 +571,11 @@ ) (br_if (i32.and + (get_local $$1) (i32.store align=4 (get_local $$3) (get_local $$2) ) - (get_local $$1) ) $BB14_1 ) @@ -618,8 +618,8 @@ (br_if (i32.eq (i32.and - (get_local $$3) (get_local $$0) + (get_local $$3) ) (i32.const 0) ) @@ -631,14 +631,14 @@ ) (set_local $$4 (i32.and - (get_local $$3) (get_local $$1) + (get_local $$3) ) ) (br_if (i32.eq - (i32.const 0) (get_local $$4) + (i32.const 0) ) $BB15_5 ) @@ -695,8 +695,8 @@ (block $BB16_4 (br_if (i32.and - (get_local $$3) (get_local $$0) + (get_local $$3) ) $BB16_4 ) @@ -706,8 +706,8 @@ ) (br_if (i32.and - (get_local $$3) (get_local $$1) + (get_local $$3) ) $BB16_1 ) @@ -723,8 +723,8 @@ ) (br_if (i32.and - (get_local $$3) (get_local $$1) + (get_local $$3) ) $BB16_1 ) @@ -748,15 +748,15 @@ (block $BB17_3 (br_if (i32.eq - (i32.const 0) (get_local $$0) + (i32.const 0) ) $BB17_3 ) (br_if (i32.eq - (i32.const 0) (get_local $$0) + (i32.const 0) ) $BB17_1 ) @@ -799,8 +799,8 @@ (br_if (i32.eq (i32.and - (get_local $$1) (call_import $a) + (get_local $$1) ) (i32.const 0) ) @@ -816,8 +816,8 @@ (br_if (i32.eq (i32.and - (get_local $$1) (call_import $a) + (get_local $$1) ) (i32.const 0) ) @@ -829,8 +829,8 @@ ) (br_if (i32.and - (get_local $$1) (call_import $a) + (get_local $$1) ) $BB18_2 ) @@ -842,8 +842,8 @@ ) (br_if (i32.and - (get_local $$1) (call_import $a) + (get_local $$1) ) $BB18_2 ) @@ -908,8 +908,8 @@ ) (br_if (i32.gt_u - (i32.const 4) (get_local $$2) + (i32.const 4) ) $BB19_1 ) @@ -992,8 +992,8 @@ ) (br_if (i32.eq - (i32.const 0) (get_local $$0) + (i32.const 0) ) $BB20_7 ) @@ -1034,22 +1034,22 @@ (block $BB21_4 (br_if (i32.gt_s - (i32.const 103) (get_local $$1) + (i32.const 103) ) $BB21_4 ) (br_if (i32.eq - (i32.const 42) (get_local $$1) + (i32.const 42) ) $BB21_7 ) (br_if (i32.eq - (i32.const 76) (get_local $$1) + (i32.const 76) ) $BB21_7 ) @@ -1057,15 +1057,15 @@ ) (br_if (i32.eq - (i32.const 108) (get_local $$1) + (i32.const 108) ) $BB21_7 ) (br_if (i32.eq - (i32.const 104) (get_local $$1) + (i32.const 104) ) $BB21_7 ) @@ -1074,8 +1074,8 @@ ) (set_local $$0 (i32.add - (i32.const 1) (get_local $$0) + (i32.const 1) ) ) (br $BB21_1) diff --git a/test/dot_s/comparisons_f32.wast b/test/dot_s/comparisons_f32.wast index 75e3af9e5..5b00f7e60 100644 --- a/test/dot_s/comparisons_f32.wast +++ b/test/dot_s/comparisons_f32.wast @@ -55,8 +55,8 @@ (block (br $fake_return_waka123 (f32.eq - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -67,8 +67,8 @@ (block (br $fake_return_waka123 (f32.ne - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -79,8 +79,8 @@ (block (br $fake_return_waka123 (f32.lt - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -91,8 +91,8 @@ (block (br $fake_return_waka123 (f32.le - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -103,8 +103,8 @@ (block (br $fake_return_waka123 (f32.gt - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -115,8 +115,8 @@ (block (br $fake_return_waka123 (f32.ge - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -128,8 +128,8 @@ (br $fake_return_waka123 (i32.or (f32.eq - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f32.ne @@ -152,8 +152,8 @@ (br $fake_return_waka123 (i32.and (f32.ne - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.and (f32.eq @@ -176,8 +176,8 @@ (br $fake_return_waka123 (i32.or (f32.lt - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f32.ne @@ -200,8 +200,8 @@ (br $fake_return_waka123 (i32.or (f32.le - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f32.ne @@ -224,8 +224,8 @@ (br $fake_return_waka123 (i32.or (f32.gt - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f32.ne @@ -248,8 +248,8 @@ (br $fake_return_waka123 (i32.or (f32.ge - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f32.ne diff --git a/test/dot_s/comparisons_f64.wast b/test/dot_s/comparisons_f64.wast index 487d1f298..8f01136b0 100644 --- a/test/dot_s/comparisons_f64.wast +++ b/test/dot_s/comparisons_f64.wast @@ -55,8 +55,8 @@ (block (br $fake_return_waka123 (f64.eq - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -67,8 +67,8 @@ (block (br $fake_return_waka123 (f64.ne - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -79,8 +79,8 @@ (block (br $fake_return_waka123 (f64.lt - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -91,8 +91,8 @@ (block (br $fake_return_waka123 (f64.le - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -103,8 +103,8 @@ (block (br $fake_return_waka123 (f64.gt - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -115,8 +115,8 @@ (block (br $fake_return_waka123 (f64.ge - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -128,8 +128,8 @@ (br $fake_return_waka123 (i32.or (f64.eq - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f64.ne @@ -152,8 +152,8 @@ (br $fake_return_waka123 (i32.and (f64.ne - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.and (f64.eq @@ -176,8 +176,8 @@ (br $fake_return_waka123 (i32.or (f64.lt - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f64.ne @@ -200,8 +200,8 @@ (br $fake_return_waka123 (i32.or (f64.le - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f64.ne @@ -224,8 +224,8 @@ (br $fake_return_waka123 (i32.or (f64.gt - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f64.ne @@ -248,8 +248,8 @@ (br $fake_return_waka123 (i32.or (f64.ge - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.or (f64.ne diff --git a/test/dot_s/comparisons_i32.wast b/test/dot_s/comparisons_i32.wast index 84eed3086..f759d5a6a 100644 --- a/test/dot_s/comparisons_i32.wast +++ b/test/dot_s/comparisons_i32.wast @@ -15,8 +15,8 @@ (block (br $fake_return_waka123 (i32.eq - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -27,8 +27,8 @@ (block (br $fake_return_waka123 (i32.ne - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -39,8 +39,8 @@ (block (br $fake_return_waka123 (i32.lt_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -51,8 +51,8 @@ (block (br $fake_return_waka123 (i32.le_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -63,8 +63,8 @@ (block (br $fake_return_waka123 (i32.lt_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -75,8 +75,8 @@ (block (br $fake_return_waka123 (i32.le_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -87,8 +87,8 @@ (block (br $fake_return_waka123 (i32.gt_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -99,8 +99,8 @@ (block (br $fake_return_waka123 (i32.ge_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -111,8 +111,8 @@ (block (br $fake_return_waka123 (i32.gt_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -123,8 +123,8 @@ (block (br $fake_return_waka123 (i32.ge_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) diff --git a/test/dot_s/comparisons_i64.wast b/test/dot_s/comparisons_i64.wast index c14dca3c8..35479ecc2 100644 --- a/test/dot_s/comparisons_i64.wast +++ b/test/dot_s/comparisons_i64.wast @@ -15,8 +15,8 @@ (block (br $fake_return_waka123 (i64.eq - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -27,8 +27,8 @@ (block (br $fake_return_waka123 (i64.ne - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -39,8 +39,8 @@ (block (br $fake_return_waka123 (i64.lt_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -51,8 +51,8 @@ (block (br $fake_return_waka123 (i64.le_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -63,8 +63,8 @@ (block (br $fake_return_waka123 (i64.lt_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -75,8 +75,8 @@ (block (br $fake_return_waka123 (i64.le_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -87,8 +87,8 @@ (block (br $fake_return_waka123 (i64.gt_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -99,8 +99,8 @@ (block (br $fake_return_waka123 (i64.ge_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -111,8 +111,8 @@ (block (br $fake_return_waka123 (i64.gt_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -123,8 +123,8 @@ (block (br $fake_return_waka123 (i64.ge_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) diff --git a/test/dot_s/dead-vreg.wast b/test/dot_s/dead-vreg.wast index b5559e1ed..3445f5800 100644 --- a/test/dot_s/dead-vreg.wast +++ b/test/dot_s/dead-vreg.wast @@ -17,15 +17,15 @@ (block $BB0_5 (br_if (i32.lt_s - (get_local $$4) (get_local $$2) + (get_local $$4) ) $BB0_5 ) (set_local $$3 (i32.shl - (i32.const 2) (get_local $$1) + (i32.const 2) ) ) (set_local $$5 @@ -48,8 +48,8 @@ (block $BB0_4 (br_if (i32.lt_s - (get_local $$4) (get_local $$1) + (get_local $$4) ) $BB0_4 ) @@ -57,8 +57,8 @@ (block (set_local $$9 (i32.add - (i32.const -1) (get_local $$9) + (i32.const -1) ) ) (i32.store align=4 @@ -67,14 +67,14 @@ ) (set_local $$8 (i32.add - (i32.const 4) (get_local $$8) + (i32.const 4) ) ) (set_local $$7 (i32.add - (get_local $$6) (get_local $$7) + (get_local $$6) ) ) (br_if @@ -86,20 +86,20 @@ ) (set_local $$6 (i32.add - (get_local $$4) (get_local $$6) + (get_local $$4) ) ) (set_local $$0 (i32.add - (get_local $$3) (get_local $$0) + (get_local $$3) ) ) (br_if (i32.ne - (get_local $$2) (get_local $$6) + (get_local $$2) ) $BB0_2 ) diff --git a/test/dot_s/f32.wast b/test/dot_s/f32.wast index 21141a396..fa4f87de8 100644 --- a/test/dot_s/f32.wast +++ b/test/dot_s/f32.wast @@ -22,8 +22,8 @@ (block (br $fake_return_waka123 (f32.add - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -34,8 +34,8 @@ (block (br $fake_return_waka123 (f32.sub - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -46,8 +46,8 @@ (block (br $fake_return_waka123 (f32.mul - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -58,8 +58,8 @@ (block (br $fake_return_waka123 (f32.div - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -92,8 +92,8 @@ (block (br $fake_return_waka123 (f32.copysign - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -170,8 +170,8 @@ (block (br $fake_return_waka123 (f32.min - (f32.const 0) (get_local $$0) + (f32.const 0) ) ) ) @@ -182,8 +182,8 @@ (block (br $fake_return_waka123 (f32.max - (f32.const 0) (get_local $$0) + (f32.const 0) ) ) ) diff --git a/test/dot_s/f64.wast b/test/dot_s/f64.wast index 20866426f..afb3ca9df 100644 --- a/test/dot_s/f64.wast +++ b/test/dot_s/f64.wast @@ -22,8 +22,8 @@ (block (br $fake_return_waka123 (f64.add - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -34,8 +34,8 @@ (block (br $fake_return_waka123 (f64.sub - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -46,8 +46,8 @@ (block (br $fake_return_waka123 (f64.mul - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -58,8 +58,8 @@ (block (br $fake_return_waka123 (f64.div - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -92,8 +92,8 @@ (block (br $fake_return_waka123 (f64.copysign - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -170,8 +170,8 @@ (block (br $fake_return_waka123 (f64.min - (f64.const 0) (get_local $$0) + (f64.const 0) ) ) ) @@ -182,8 +182,8 @@ (block (br $fake_return_waka123 (f64.max - (f64.const 0) (get_local $$0) + (f64.const 0) ) ) ) diff --git a/test/dot_s/func.wast b/test/dot_s/func.wast index d0f20d61c..ffb938022 100644 --- a/test/dot_s/func.wast +++ b/test/dot_s/func.wast @@ -49,8 +49,8 @@ (br_if (i32.eq (i32.and - (get_local $$1) (get_local $$0) + (get_local $$1) ) (i32.const 0) ) diff --git a/test/dot_s/i32.wast b/test/dot_s/i32.wast index 827ba8725..a1a690730 100644 --- a/test/dot_s/i32.wast +++ b/test/dot_s/i32.wast @@ -23,8 +23,8 @@ (block (br $fake_return_waka123 (i32.add - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -35,8 +35,8 @@ (block (br $fake_return_waka123 (i32.sub - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -47,8 +47,8 @@ (block (br $fake_return_waka123 (i32.mul - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -59,8 +59,8 @@ (block (br $fake_return_waka123 (i32.div_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -71,8 +71,8 @@ (block (br $fake_return_waka123 (i32.div_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -83,8 +83,8 @@ (block (br $fake_return_waka123 (i32.rem_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -95,8 +95,8 @@ (block (br $fake_return_waka123 (i32.rem_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -107,8 +107,8 @@ (block (br $fake_return_waka123 (i32.and - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -119,8 +119,8 @@ (block (br $fake_return_waka123 (i32.or - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -131,8 +131,8 @@ (block (br $fake_return_waka123 (i32.xor - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -143,8 +143,8 @@ (block (br $fake_return_waka123 (i32.shl - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -155,8 +155,8 @@ (block (br $fake_return_waka123 (i32.shr_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -167,8 +167,8 @@ (block (br $fake_return_waka123 (i32.shr_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) diff --git a/test/dot_s/i64.wast b/test/dot_s/i64.wast index a3befb718..cc52a53b6 100644 --- a/test/dot_s/i64.wast +++ b/test/dot_s/i64.wast @@ -23,8 +23,8 @@ (block (br $fake_return_waka123 (i64.add - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -35,8 +35,8 @@ (block (br $fake_return_waka123 (i64.sub - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -47,8 +47,8 @@ (block (br $fake_return_waka123 (i64.mul - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -59,8 +59,8 @@ (block (br $fake_return_waka123 (i64.div_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -71,8 +71,8 @@ (block (br $fake_return_waka123 (i64.div_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -83,8 +83,8 @@ (block (br $fake_return_waka123 (i64.rem_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -95,8 +95,8 @@ (block (br $fake_return_waka123 (i64.rem_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -107,8 +107,8 @@ (block (br $fake_return_waka123 (i64.and - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -119,8 +119,8 @@ (block (br $fake_return_waka123 (i64.or - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -131,8 +131,8 @@ (block (br $fake_return_waka123 (i64.xor - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -143,8 +143,8 @@ (block (br $fake_return_waka123 (i64.shl - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -155,8 +155,8 @@ (block (br $fake_return_waka123 (i64.shr_u - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) @@ -167,8 +167,8 @@ (block (br $fake_return_waka123 (i64.shr_s - (get_local $$1) (get_local $$0) + (get_local $$1) ) ) ) diff --git a/test/dot_s/legalize.wast b/test/dot_s/legalize.wast index 97ba128ab..761d87ed4 100644 --- a/test/dot_s/legalize.wast +++ b/test/dot_s/legalize.wast @@ -10,11 +10,11 @@ (block (br $fake_return_waka123 (i32.shl + (get_local $$0) (i32.and - (i32.const 7) (get_local $$1) + (i32.const 7) ) - (get_local $$0) ) ) ) @@ -25,11 +25,11 @@ (block (br $fake_return_waka123 (i64.shl + (get_local $$0) (i64.and - (i64.const 9007199254740991) (get_local $$1) + (i64.const 9007199254740991) ) - (get_local $$0) ) ) ) @@ -44,11 +44,11 @@ ) (br $fake_return_waka123 (i64.shr_s - (get_local $$1) (i64.shl - (get_local $$1) (get_local $$0) + (get_local $$1) ) + (get_local $$1) ) ) ) diff --git a/test/dot_s/load-store-i1.wast b/test/dot_s/load-store-i1.wast index c8728f0ce..7acb8faea 100644 --- a/test/dot_s/load-store-i1.wast +++ b/test/dot_s/load-store-i1.wast @@ -26,13 +26,13 @@ ) (br $fake_return_waka123 (i32.shr_s - (get_local $$1) (i32.shl - (get_local $$1) (i32.load align=8 (get_local $$0) ) + (get_local $$1) ) + (get_local $$1) ) ) ) @@ -58,13 +58,13 @@ ) (br $fake_return_waka123 (i64.shr_s - (get_local $$1) (i64.shl - (get_local $$1) (i64.load align=8 (get_local $$0) ) + (get_local $$1) ) + (get_local $$1) ) ) ) @@ -76,8 +76,8 @@ (i32.store align=8 (get_local $$0) (i32.and - (i32.const 1) (get_local $$1) + (i32.const 1) ) ) (br $fake_return_waka123) @@ -90,8 +90,8 @@ (i64.store align=8 (get_local $$0) (i64.and - (i64.const 1) (get_local $$1) + (i64.const 1) ) ) (br $fake_return_waka123) diff --git a/test/dot_s/phi.wast b/test/dot_s/phi.wast index 896aad133..2fb0ddf1e 100644 --- a/test/dot_s/phi.wast +++ b/test/dot_s/phi.wast @@ -8,15 +8,15 @@ (block $BB0_2 (br_if (i32.gt_s - (i32.const -1) (get_local $$0) + (i32.const -1) ) $BB0_2 ) (set_local $$0 (i32.div_s - (i32.const 3) (get_local $$0) + (i32.const 3) ) ) ) @@ -50,8 +50,8 @@ (block (set_local $$5 (i32.add - (get_local $$2) (get_local $$5) + (get_local $$2) ) ) (set_local $$1 @@ -65,8 +65,8 @@ ) (br_if (i32.lt_s - (get_local $$0) (get_local $$5) + (get_local $$0) ) $BB1_1 ) diff --git a/test/dot_s/reg-stackify.wast b/test/dot_s/reg-stackify.wast index cb9b720d9..74d3d94b5 100644 --- a/test/dot_s/reg-stackify.wast +++ b/test/dot_s/reg-stackify.wast @@ -81,29 +81,29 @@ (block $BB4_2 (br_if (i32.ne - (get_local $$4) (i32.xor (i32.xor (i32.lt_s - (get_local $$4) (get_local $$0) + (get_local $$4) ) (i32.lt_s - (get_local $$5) (get_local $$1) + (get_local $$5) ) ) (i32.xor (i32.lt_s - (get_local $$4) (get_local $$2) + (get_local $$4) ) (i32.lt_s - (get_local $$5) (get_local $$3) + (get_local $$5) ) ) ) + (get_local $$4) ) $BB4_2 ) diff --git a/test/dot_s/signext-zeroext.wast b/test/dot_s/signext-zeroext.wast index 4db88e8ea..ddd3e85af 100644 --- a/test/dot_s/signext-zeroext.wast +++ b/test/dot_s/signext-zeroext.wast @@ -13,11 +13,11 @@ ) (br $fake_return_waka123 (i32.shr_s - (get_local $$1) (i32.shl - (get_local $$1) (get_local $$0) + (get_local $$1) ) + (get_local $$1) ) ) ) @@ -28,8 +28,8 @@ (block (br $fake_return_waka123 (i32.and - (i32.const 255) (get_local $$0) + (i32.const 255) ) ) ) @@ -41,8 +41,8 @@ (br $fake_return_waka123 (call $z2s_func (i32.and - (i32.const 255) (get_local $$0) + (i32.const 255) ) ) ) @@ -58,19 +58,19 @@ ) (br $fake_return_waka123 (i32.shr_s - (get_local $$1) (i32.shl - (get_local $$1) (call $s2z_func (i32.shr_s - (get_local $$1) (i32.shl - (get_local $$1) (get_local $$0) + (get_local $$1) ) + (get_local $$1) ) ) + (get_local $$1) ) + (get_local $$1) ) ) ) diff --git a/test/dot_s/store-results.wast b/test/dot_s/store-results.wast index 190e18a92..c0d6ce905 100644 --- a/test/dot_s/store-results.wast +++ b/test/dot_s/store-results.wast @@ -34,14 +34,14 @@ ) (set_local $$1 (i32.add - (i32.const 1) (get_local $$1) + (i32.const 1) ) ) (br_if (i32.ne - (i32.const 256) (get_local $$1) + (i32.const 256) ) $BB1_1 ) @@ -70,14 +70,14 @@ ) (set_local $$1 (f32.add - (f32.const 1) (get_local $$1) + (f32.const 1) ) ) (br_if (f32.ne - (f32.const 256) (get_local $$1) + (f32.const 256) ) $BB2_1 ) diff --git a/test/dot_s/switch.wast b/test/dot_s/switch.wast index 23d276092..0e7f8f03d 100644 --- a/test/dot_s/switch.wast +++ b/test/dot_s/switch.wast @@ -14,8 +14,8 @@ (block $BB0_8 (br_if (i32.gt_u - (i32.const 23) (get_local $$0) + (i32.const 23) ) $BB0_8 ) @@ -57,8 +57,8 @@ (block $BB1_8 (br_if (i64.gt_u - (i64.const 23) (get_local $$0) + (i64.const 23) ) $BB1_8 ) diff --git a/test/dot_s/varargs.wast b/test/dot_s/varargs.wast index 3b455386e..c4e7e50b0 100644 --- a/test/dot_s/varargs.wast +++ b/test/dot_s/varargs.wast @@ -39,8 +39,8 @@ (i32.store align=4 (get_local $$0) (i32.add - (i32.const 4) (get_local $$1) + (i32.const 4) ) ) (br $fake_return_waka123 @@ -69,8 +69,8 @@ (i32.store align=4 (get_local $$0) (i32.add - (i32.const 4) (get_local $$1) + (i32.const 4) ) ) (br $fake_return_waka123 @@ -106,8 +106,8 @@ (i32.store align=4 (get_local $$1) (i32.add - (get_local $$3) (get_local $$2) + (get_local $$3) ) ) ) @@ -119,17 +119,17 @@ (i32.store align=4 (get_local $$1) (i32.add - (i32.const 16) (get_local $$2) + (i32.const 16) ) ) (i64.store align=8 - (i64.load align=8 - (get_local $$4) - ) (i32.add - (get_local $$3) (get_local $$0) + (get_local $$3) + ) + (i64.load align=8 + (get_local $$4) ) ) (i64.store align=8 |