diff --git a/tests/expect/tests/call-ret.wast b/tests/expect/tests/call-ret.wast index c59daa3bc7..b26df4a9ac 100644 --- a/tests/expect/tests/call-ret.wast +++ b/tests/expect/tests/call-ret.wast @@ -20,10 +20,10 @@ (type $t18 (func (param i32 i64 i32))) (type $t19 (func (param i32 i64 i32) (result i32))) (type $t20 (func (param i32 i64 i64 i32) (result i32))) + (import "e" "instr_F4" (func $e.instr_F4 (type $t0))) (import "e" "safe_write32_slow_jit" (func $e.safe_write32_slow_jit (type $t16))) (import "e" "safe_read32s_slow_jit" (func $e.safe_read32s_slow_jit (type $t7))) (import "e" "jit_find_cache_entry_in_page" (func $e.jit_find_cache_entry_in_page (type $t16))) - (import "e" "instr_F4" (func $e.instr_F4 (type $t0))) (import "e" "trigger_fault_end_jit" (func $e.trigger_fault_end_jit (type $t0))) (import "e" "m" (memory {normalised output})) (func $f (export "f") (type $t1) (param $p0 i32) @@ -72,234 +72,234 @@ (i32.add (get_local $l8) (i32.const 1))) - (set_local $l9 - (i32.sub - (i32.or - (i32.and - (i32.load - (i32.const 556)) - (i32.const -4096)) - (i32.const 5)) - (i32.load - (i32.const 740)))) - (set_local $l11 - (i32.add - (tee_local $l10 - (i32.sub - (get_local $l4) - (i32.const 4))) - (i32.load - (i32.const 744)))) - (block $B6 - (br_if $B6 - (i32.and - (i32.eq - (i32.and - (tee_local $l12 - (i32.load offset={normalised output} - (i32.shl - (i32.shr_u - (get_local $l11) - (i32.const 12)) - (i32.const 2)))) - (i32.const 4075)) - (i32.const 1)) - (i32.le_s - (i32.and - (get_local $l11) - (i32.const 4095)) - (i32.const 4092)))) - (br_if $B1 - (i32.and - (tee_local $l12 - (call $e.safe_write32_slow_jit - (get_local $l11) - (get_local $l9) - (i32.const 0))) - (i32.const 1)))) - (i32.store align=1 - (i32.xor + (i32.store + (i32.const 560) + (i32.or (i32.and - (get_local $l12) + (i32.load + (i32.const 556)) (i32.const -4096)) - (get_local $l11)) - (get_local $l9)) - (set_local $l4 - (get_local $l10)) - (set_local $l8 - (i32.add - (get_local $l8) - (i32.const 2))) + (i32.const 5))) (i32.store - (i32.const 120) + (i32.const 556) (i32.or (i32.and (i32.load - (i32.const 120)) - (i32.const -2)) - (if $I7 (result i32) - (i32.and - (tee_local $l9 - (i32.load - (i32.const 100))) - (i32.const 1)) - (then - (set_local $l9 - (i32.shr_s - (get_local $l9) - (i32.const 31))) - (i32.lt_u - (i32.xor - (i32.load - (i32.const 112)) - (get_local $l9)) - (i32.xor - (i32.load - (i32.const 104)) - (get_local $l9)))) - (else - (i32.and - (i32.load - (i32.const 120)) - (i32.const 1)))))) + (i32.const 556)) + (i32.const -4096)) + (i32.const 6))) (i32.store - (i32.const 104) + (i32.const 64) (get_local $l0)) - (set_local $l0 - (i32.add - (get_local $l0) - (i32.const 1))) (i32.store - (i32.const 112) - (get_local $l0)) - (i64.store - (i32.const 96) - (i64.const 9706626088991)) - (i32.const 0) - (set_local $l9 - (i32.add - (get_local $l4) - (i32.load - (i32.const 744)))) - (block $B8 - (br_if $B8 - (i32.and - (i32.eq - (i32.and - (tee_local $l10 - (i32.load offset={normalised output} - (i32.shl - (i32.shr_u - (get_local $l9) - (i32.const 12)) - (i32.const 2)))) - (i32.const 4041)) - (i32.const 1)) - (i32.le_s - (i32.and - (get_local $l9) - (i32.const 4095)) - (i32.const 4092)))) - (br_if $B1 - (i32.and - (tee_local $l10 - (call $e.safe_read32s_slow_jit - (get_local $l9) - (i32.const 7))) - (i32.const 1)))) - (i32.load align=1 - (i32.xor - (i32.and - (get_local $l10) - (i32.const -4096)) - (get_local $l9))) + (i32.const 68) + (get_local $l1)) + (i32.store + (i32.const 72) + (get_local $l2)) + (i32.store + (i32.const 76) + (get_local $l3)) + (i32.store + (i32.const 80) + (get_local $l4)) + (i32.store + (i32.const 84) + (get_local $l5)) + (i32.store + (i32.const 88) + (get_local $l6)) + (i32.store + (i32.const 92) + (get_local $l7)) + (call $e.instr_F4) + (set_local $l0 + (i32.load + (i32.const 64))) + (set_local $l1 + (i32.load + (i32.const 68))) + (set_local $l2 + (i32.load + (i32.const 72))) + (set_local $l3 + (i32.load + (i32.const 76))) (set_local $l4 - (i32.add - (get_local $l4) - (i32.const 4))) - (i32.load - (i32.const 740)) - (i32.add) - (i32.store offset=556) - (br_if $L2 - (i32.ge_s - (tee_local $p0 - (call $e.jit_find_cache_entry_in_page - (i32.load - (i32.const 556)) - (i32.const 899) - (i32.const 3))) - (i32.const 0))) + (i32.load + (i32.const 80))) + (set_local $l5 + (i32.load + (i32.const 84))) + (set_local $l6 + (i32.load + (i32.const 88))) + (set_local $l7 + (i32.load + (i32.const 92))) (br $B0)) (set_local $l8 (i32.add (get_local $l8) (i32.const 1))) - (i32.store - (i32.const 560) - (i32.or + (set_local $l9 + (i32.sub + (i32.or + (i32.and + (i32.load + (i32.const 556)) + (i32.const -4096)) + (i32.const 5)) + (i32.load + (i32.const 740)))) + (set_local $l11 + (i32.add + (tee_local $l10 + (i32.sub + (get_local $l4) + (i32.const 4))) + (i32.load + (i32.const 744)))) + (block $B6 + (br_if $B6 (i32.and - (i32.load - (i32.const 556)) + (i32.eq + (i32.and + (tee_local $l12 + (i32.load offset={normalised output} + (i32.shl + (i32.shr_u + (get_local $l11) + (i32.const 12)) + (i32.const 2)))) + (i32.const 4075)) + (i32.const 1)) + (i32.le_s + (i32.and + (get_local $l11) + (i32.const 4095)) + (i32.const 4092)))) + (br_if $B1 + (i32.and + (tee_local $l12 + (call $e.safe_write32_slow_jit + (get_local $l11) + (get_local $l9) + (i32.const 0))) + (i32.const 1)))) + (i32.store align=1 + (i32.xor + (i32.and + (get_local $l12) (i32.const -4096)) - (i32.const 5))) + (get_local $l11)) + (get_local $l9)) + (set_local $l4 + (get_local $l10)) + (set_local $l8 + (i32.add + (get_local $l8) + (i32.const 2))) (i32.store - (i32.const 556) + (i32.const 120) (i32.or (i32.and (i32.load - (i32.const 556)) - (i32.const -4096)) - (i32.const 6))) + (i32.const 120)) + (i32.const -2)) + (if $I7 (result i32) + (i32.and + (tee_local $l9 + (i32.load + (i32.const 100))) + (i32.const 1)) + (then + (set_local $l9 + (i32.shr_s + (get_local $l9) + (i32.const 31))) + (i32.lt_u + (i32.xor + (i32.load + (i32.const 112)) + (get_local $l9)) + (i32.xor + (i32.load + (i32.const 104)) + (get_local $l9)))) + (else + (i32.and + (i32.load + (i32.const 120)) + (i32.const 1)))))) (i32.store - (i32.const 64) + (i32.const 104) (get_local $l0)) - (i32.store - (i32.const 68) - (get_local $l1)) - (i32.store - (i32.const 72) - (get_local $l2)) - (i32.store - (i32.const 76) - (get_local $l3)) - (i32.store - (i32.const 80) - (get_local $l4)) - (i32.store - (i32.const 84) - (get_local $l5)) - (i32.store - (i32.const 88) - (get_local $l6)) - (i32.store - (i32.const 92) - (get_local $l7)) - (call $e.instr_F4) (set_local $l0 - (i32.load - (i32.const 64))) - (set_local $l1 - (i32.load - (i32.const 68))) - (set_local $l2 - (i32.load - (i32.const 72))) - (set_local $l3 - (i32.load - (i32.const 76))) + (i32.add + (get_local $l0) + (i32.const 1))) + (i32.store + (i32.const 112) + (get_local $l0)) + (i64.store + (i32.const 96) + (i64.const 9706626088991)) + (i32.const 0) + (set_local $l9 + (i32.add + (get_local $l4) + (i32.load + (i32.const 744)))) + (block $B8 + (br_if $B8 + (i32.and + (i32.eq + (i32.and + (tee_local $l10 + (i32.load offset={normalised output} + (i32.shl + (i32.shr_u + (get_local $l9) + (i32.const 12)) + (i32.const 2)))) + (i32.const 4041)) + (i32.const 1)) + (i32.le_s + (i32.and + (get_local $l9) + (i32.const 4095)) + (i32.const 4092)))) + (br_if $B1 + (i32.and + (tee_local $l10 + (call $e.safe_read32s_slow_jit + (get_local $l9) + (i32.const 7))) + (i32.const 1)))) + (i32.load align=1 + (i32.xor + (i32.and + (get_local $l10) + (i32.const -4096)) + (get_local $l9))) (set_local $l4 - (i32.load - (i32.const 80))) - (set_local $l5 - (i32.load - (i32.const 84))) - (set_local $l6 - (i32.load - (i32.const 88))) - (set_local $l7 - (i32.load - (i32.const 92))) + (i32.add + (get_local $l4) + (i32.const 4))) + (i32.load + (i32.const 740)) + (i32.add) + (i32.store offset=556) + (br_if $L2 + (i32.ge_s + (tee_local $p0 + (call $e.jit_find_cache_entry_in_page + (i32.load + (i32.const 556)) + (i32.const 899) + (i32.const 3))) + (i32.const 0))) (br $B0)) (unreachable))) (i32.store diff --git a/tests/expect/tests/indirect-call.wast b/tests/expect/tests/indirect-call.wast index 0f48efdc73..d0ebcee8e8 100644 --- a/tests/expect/tests/indirect-call.wast +++ b/tests/expect/tests/indirect-call.wast @@ -20,11 +20,11 @@ (type $t18 (func (param i32 i64 i32))) (type $t19 (func (param i32 i64 i32) (result i32))) (type $t20 (func (param i32 i64 i64 i32) (result i32))) - (import "e" "instr_F4" (func $e.instr_F4 (type $t0))) (import "e" "trigger_gp_jit" (func $e.trigger_gp_jit (type $t2))) (import "e" "safe_read32s_slow_jit" (func $e.safe_read32s_slow_jit (type $t7))) (import "e" "safe_write32_slow_jit" (func $e.safe_write32_slow_jit (type $t16))) (import "e" "jit_find_cache_entry_in_page" (func $e.jit_find_cache_entry_in_page (type $t16))) + (import "e" "instr_F4" (func $e.instr_F4 (type $t0))) (import "e" "trigger_fault_end_jit" (func $e.trigger_fault_end_jit (type $t0))) (import "e" "m" (memory {normalised output})) (func $f (export "f") (type $t1) (param $p0 i32) @@ -68,196 +68,196 @@ (br_if $B4 (i32.eq (get_local $p0) - (i32.const 1)))) + (i32.const 0)))) (set_local $l8 (i32.add (get_local $l8) (i32.const 1))) - (i32.store - (i32.const 560) - (i32.or + (get_local $l0) + (if $I6 + (i32.load8_u + (i32.const 727)) + (then + (call $e.trigger_gp_jit + (i32.const 0) + (i32.const 0)) + (br $B1))) + (i32.load + (i32.const 748)) + (i32.add) + (set_local $l9) + (block $B7 + (br_if $B7 (i32.and - (i32.load - (i32.const 556)) - (i32.const -4096)) - (i32.const 2))) - (i32.store - (i32.const 556) - (i32.or + (i32.eq + (i32.and + (tee_local $l10 + (i32.load offset={normalised output} + (i32.shl + (i32.shr_u + (get_local $l9) + (i32.const 12)) + (i32.const 2)))) + (i32.const 4041)) + (i32.const 1)) + (i32.le_s + (i32.and + (get_local $l9) + (i32.const 4095)) + (i32.const 4092)))) + (br_if $B1 (i32.and - (i32.load - (i32.const 556)) + (tee_local $l10 + (call $e.safe_read32s_slow_jit + (get_local $l9) + (i32.const 0))) + (i32.const 1)))) + (set_local $l9 + (i32.add + (i32.load align=1 + (i32.xor + (i32.and + (get_local $l10) + (i32.const -4096)) + (get_local $l9))) + (i32.load + (i32.const 740)))) + (set_local $l10 + (i32.sub + (i32.or + (i32.and + (i32.load + (i32.const 556)) + (i32.const -4096)) + (i32.const 2)) + (i32.load + (i32.const 740)))) + (set_local $l12 + (i32.add + (tee_local $l11 + (i32.sub + (get_local $l4) + (i32.const 4))) + (i32.load + (i32.const 744)))) + (block $B8 + (br_if $B8 + (i32.and + (i32.eq + (i32.and + (tee_local $l13 + (i32.load offset={normalised output} + (i32.shl + (i32.shr_u + (get_local $l12) + (i32.const 12)) + (i32.const 2)))) + (i32.const 4075)) + (i32.const 1)) + (i32.le_s + (i32.and + (get_local $l12) + (i32.const 4095)) + (i32.const 4092)))) + (br_if $B1 + (i32.and + (tee_local $l13 + (call $e.safe_write32_slow_jit + (get_local $l12) + (get_local $l10) + (i32.const 0))) + (i32.const 1)))) + (i32.store align=1 + (i32.xor + (i32.and + (get_local $l13) (i32.const -4096)) - (i32.const 3))) - (i32.store - (i32.const 64) - (get_local $l0)) - (i32.store - (i32.const 68) - (get_local $l1)) - (i32.store - (i32.const 72) - (get_local $l2)) - (i32.store - (i32.const 76) - (get_local $l3)) - (i32.store - (i32.const 80) - (get_local $l4)) - (i32.store - (i32.const 84) - (get_local $l5)) - (i32.store - (i32.const 88) - (get_local $l6)) - (i32.store - (i32.const 92) - (get_local $l7)) - (call $e.instr_F4) - (set_local $l0 - (i32.load - (i32.const 64))) - (set_local $l1 - (i32.load - (i32.const 68))) - (set_local $l2 - (i32.load - (i32.const 72))) - (set_local $l3 - (i32.load - (i32.const 76))) + (get_local $l12)) + (get_local $l10)) (set_local $l4 - (i32.load - (i32.const 80))) - (set_local $l5 - (i32.load - (i32.const 84))) - (set_local $l6 - (i32.load - (i32.const 88))) - (set_local $l7 - (i32.load - (i32.const 92))) + (get_local $l11)) + (i32.store offset=556 + (i32.const 0) + (get_local $l9)) + (br_if $L2 + (i32.ge_s + (tee_local $p0 + (call $e.jit_find_cache_entry_in_page + (i32.load + (i32.const 556)) + (i32.const 899) + (i32.const 3))) + (i32.const 0))) (br $B0)) (set_local $l8 (i32.add (get_local $l8) (i32.const 1))) - (get_local $l0) - (if $I6 - (i32.load8_u - (i32.const 727)) - (then - (call $e.trigger_gp_jit - (i32.const 0) - (i32.const 0)) - (br $B1))) - (i32.load - (i32.const 748)) - (i32.add) - (set_local $l9) - (block $B7 - (br_if $B7 + (i32.store + (i32.const 560) + (i32.or (i32.and - (i32.eq - (i32.and - (tee_local $l10 - (i32.load offset={normalised output} - (i32.shl - (i32.shr_u - (get_local $l9) - (i32.const 12)) - (i32.const 2)))) - (i32.const 4041)) - (i32.const 1)) - (i32.le_s - (i32.and - (get_local $l9) - (i32.const 4095)) - (i32.const 4092)))) - (br_if $B1 - (i32.and - (tee_local $l10 - (call $e.safe_read32s_slow_jit - (get_local $l9) - (i32.const 0))) - (i32.const 1)))) - (set_local $l9 - (i32.add - (i32.load align=1 - (i32.xor - (i32.and - (get_local $l10) - (i32.const -4096)) - (get_local $l9))) - (i32.load - (i32.const 740)))) - (set_local $l10 - (i32.sub - (i32.or - (i32.and - (i32.load - (i32.const 556)) - (i32.const -4096)) - (i32.const 2)) - (i32.load - (i32.const 740)))) - (set_local $l12 - (i32.add - (tee_local $l11 - (i32.sub - (get_local $l4) - (i32.const 4))) - (i32.load - (i32.const 744)))) - (block $B8 - (br_if $B8 - (i32.and - (i32.eq - (i32.and - (tee_local $l13 - (i32.load offset={normalised output} - (i32.shl - (i32.shr_u - (get_local $l12) - (i32.const 12)) - (i32.const 2)))) - (i32.const 4075)) - (i32.const 1)) - (i32.le_s - (i32.and - (get_local $l12) - (i32.const 4095)) - (i32.const 4092)))) - (br_if $B1 - (i32.and - (tee_local $l13 - (call $e.safe_write32_slow_jit - (get_local $l12) - (get_local $l10) - (i32.const 0))) - (i32.const 1)))) - (i32.store align=1 - (i32.xor + (i32.load + (i32.const 556)) + (i32.const -4096)) + (i32.const 2))) + (i32.store + (i32.const 556) + (i32.or (i32.and - (get_local $l13) + (i32.load + (i32.const 556)) (i32.const -4096)) - (get_local $l12)) - (get_local $l10)) + (i32.const 3))) + (i32.store + (i32.const 64) + (get_local $l0)) + (i32.store + (i32.const 68) + (get_local $l1)) + (i32.store + (i32.const 72) + (get_local $l2)) + (i32.store + (i32.const 76) + (get_local $l3)) + (i32.store + (i32.const 80) + (get_local $l4)) + (i32.store + (i32.const 84) + (get_local $l5)) + (i32.store + (i32.const 88) + (get_local $l6)) + (i32.store + (i32.const 92) + (get_local $l7)) + (call $e.instr_F4) + (set_local $l0 + (i32.load + (i32.const 64))) + (set_local $l1 + (i32.load + (i32.const 68))) + (set_local $l2 + (i32.load + (i32.const 72))) + (set_local $l3 + (i32.load + (i32.const 76))) (set_local $l4 - (get_local $l11)) - (i32.store offset=556 - (i32.const 0) - (get_local $l9)) - (br_if $L2 - (i32.ge_s - (tee_local $p0 - (call $e.jit_find_cache_entry_in_page - (i32.load - (i32.const 556)) - (i32.const 899) - (i32.const 3))) - (i32.const 0))) + (i32.load + (i32.const 80))) + (set_local $l5 + (i32.load + (i32.const 84))) + (set_local $l6 + (i32.load + (i32.const 88))) + (set_local $l7 + (i32.load + (i32.const 92))) (br $B0)) (unreachable))) (i32.store diff --git a/tests/expect/tests/sti.wast b/tests/expect/tests/sti.wast index 47f284d150..59a4177721 100644 --- a/tests/expect/tests/sti.wast +++ b/tests/expect/tests/sti.wast @@ -67,7 +67,7 @@ (br_if $B4 (i32.eq (get_local $p0) - (i32.const 1)))) + (i32.const 0)))) (set_local $l8 (i32.add (get_local $l8)