diff --git a/tests/compiler/std/pointer.optimized.wat b/tests/compiler/std/pointer.optimized.wat index 5552f428..f5f98e4b 100644 --- a/tests/compiler/std/pointer.optimized.wat +++ b/tests/compiler/std/pointer.optimized.wat @@ -1,9 +1,13 @@ (module (type $iiiiv (func (param i32 i32 i32 i32))) + (type $iiv (func (param i32 i32))) + (type $iiiv (func (param i32 i32 i32))) (type $iifv (func (param i32 i32 f32))) (type $iif (func (param i32 i32) (result f32))) (type $v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$vii (func (param i32 i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $std/pointer/one (mut i32) (i32.const 0)) (global $std/pointer/two (mut i32) (i32.const 0)) @@ -18,7 +22,1762 @@ (func $std/pointer/Pointer#constructor (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (get_local $0) ) - (func $std/pointer/Pointer#set (; 2 ;) (; has Stack IR ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) + (func $~lib/internal/memory/memset (; 2 ;) (; has Stack IR ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (i32.store8 + (get_local $0) + (i32.const 0) + ) + (i32.store8 + (i32.sub + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (i32.const 1) + ) + (i32.const 0) + ) + (i32.store8 + (i32.add + (get_local $0) + (i32.const 1) + ) + (i32.const 0) + ) + (i32.store8 + (i32.add + (get_local $0) + (i32.const 2) + ) + (i32.const 0) + ) + (i32.store8 + (i32.sub + (get_local $1) + (i32.const 2) + ) + (i32.const 0) + ) + (i32.store8 + (i32.sub + (get_local $1) + (i32.const 3) + ) + (i32.const 0) + ) + (i32.store8 + (i32.add + (get_local $0) + (i32.const 3) + ) + (i32.const 0) + ) + (i32.store8 + (i32.sub + (get_local $1) + (i32.const 4) + ) + (i32.const 0) + ) + ) + (func $~lib/internal/memory/memcpy (; 3 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (loop $continue|0 + (if + (tee_local $3 + (if (result i32) + (get_local $2) + (i32.and + (get_local $1) + (i32.const 3) + ) + (get_local $2) + ) + ) + (block + (set_local $0 + (i32.add + (tee_local $4 + (get_local $0) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + (if + (i32.eqz + (i32.and + (get_local $0) + (i32.const 3) + ) + ) + (block + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 16) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 12) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|1) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 4) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (i32.store16 + (get_local $0) + (i32.load16_u + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 2) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (block + (set_local $3 + (get_local $1) + ) + (i32.store8 + (get_local $0) + (i32.load8_u + (get_local $1) + ) + ) + ) + ) + (return) + ) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 32) + ) + (block $break|2 + (block $case2|2 + (block $case1|2 + (if + (i32.ne + (tee_local $3 + (i32.and + (get_local $0) + (i32.const 3) + ) + ) + (i32.const 1) + ) + (block + (br_if $case1|2 + (i32.eq + (get_local $3) + (i32.const 2) + ) + ) + (br_if $case2|2 + (i32.eq + (get_local $3) + (i32.const 3) + ) + ) + (br $break|2) + ) + ) + (set_local $5 + (i32.load + (get_local $1) + ) + ) + (i32.store8 + (get_local $0) + (i32.load8_u + (tee_local $3 + (get_local $1) + ) + ) + ) + (set_local $0 + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $1) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $4 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 3) + ) + ) + (loop $continue|3 + (if + (i32.ge_u + (get_local $2) + (i32.const 17) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $5) + (i32.const 24) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (tee_local $5 + (i32.load + (i32.add + (get_local $1) + (i32.const 5) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $5) + (i32.const 24) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 9) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (tee_local $5 + (i32.load + (i32.add + (get_local $1) + (i32.const 13) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|3) + ) + ) + ) + (br $break|2) + ) + (set_local $5 + (i32.load + (get_local $1) + ) + ) + (i32.store8 + (get_local $0) + (i32.load8_u + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $4 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 2) + ) + ) + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 18) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $5) + (i32.const 16) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (tee_local $5 + (i32.load + (i32.add + (get_local $1) + (i32.const 6) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $5) + (i32.const 16) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 10) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (tee_local $5 + (i32.load + (i32.add + (get_local $1) + (i32.const 14) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|4) + ) + ) + ) + (br $break|2) + ) + (set_local $5 + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $4 + (get_local $0) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $continue|5 + (if + (i32.ge_u + (get_local $2) + (i32.const 19) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $5) + (i32.const 8) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 3) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (tee_local $5 + (i32.load + (i32.add + (get_local $1) + (i32.const 7) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $5) + (i32.const 8) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 11) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (tee_local $5 + (i32.load + (i32.add + (get_local $1) + (i32.const 15) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 16) + ) + (block + (i32.store8 + (get_local $0) + (i32.load8_u + (tee_local $3 + (get_local $1) + ) + ) + ) + (set_local $0 + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $1) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $4 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (i32.store8 + (get_local $0) + (i32.load8_u + (tee_local $3 + (get_local $1) + ) + ) + ) + (set_local $0 + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $1) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $4 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (i32.store8 + (get_local $0) + (i32.load8_u + (tee_local $3 + (get_local $1) + ) + ) + ) + (set_local $0 + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $1) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + ) + (i32.store8 + (get_local $3) + (i32.load8_u + (tee_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $4 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (i32.store8 + (get_local $0) + (i32.load8_u + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $4 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (block + (set_local $3 + (get_local $1) + ) + (i32.store8 + (get_local $0) + (i32.load8_u + (get_local $1) + ) + ) + ) + ) + ) + (func $~lib/internal/memory/memmove (; 4 ;) (; has Stack IR ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (set_local $2 + (i32.const 8) + ) + (if + (i32.eq + (get_local $0) + (get_local $1) + ) + (return) + ) + (if + (i32.eqz + (tee_local $3 + (i32.le_u + (i32.add + (get_local $1) + (i32.const 8) + ) + (get_local $0) + ) + ) + ) + (set_local $3 + (i32.le_u + (i32.add + (get_local $0) + (i32.const 8) + ) + (get_local $1) + ) + ) + ) + (if + (get_local $3) + (block + (call $~lib/internal/memory/memcpy + (get_local $0) + (get_local $1) + (i32.const 8) + ) + (return) + ) + ) + (if + (i32.lt_u + (get_local $0) + (get_local $1) + ) + (block + (if + (i32.eq + (i32.and + (get_local $1) + (i32.const 7) + ) + (i32.and + (get_local $0) + (i32.const 7) + ) + ) + (block + (loop $continue|0 + (if + (i32.and + (get_local $0) + (i32.const 7) + ) + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (tee_local $4 + (get_local $0) + ) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + (br $continue|0) + ) + ) + ) + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (i64.store + (get_local $0) + (i64.load + (get_local $1) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + (br $continue|1) + ) + ) + ) + ) + ) + (loop $continue|2 + (if + (get_local $2) + (block + (set_local $0 + (i32.add + (tee_local $3 + (tee_local $4 + (get_local $0) + ) + ) + (i32.const 1) + ) + ) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $4) + (i32.load8_u + (get_local $3) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|2) + ) + ) + ) + ) + (block + (if + (i32.eq + (i32.and + (get_local $1) + (i32.const 7) + ) + (i32.and + (get_local $0) + (i32.const 7) + ) + ) + (block + (loop $continue|3 + (if + (i32.and + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 7) + ) + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|3) + ) + ) + ) + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (i64.store + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + ) + (i64.load + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + (loop $continue|5 + (if + (get_local $2) + (block + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|5) + ) + ) + ) + ) + ) + ) + (func $std/pointer/Pointer#set:value (; 5 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) + (if + (get_local $1) + (call $~lib/internal/memory/memmove + (get_local $0) + (get_local $1) + ) + (call $~lib/internal/memory/memset + (get_local $0) + ) + ) + ) + (func $std/pointer/Pointer#set (; 6 ;) (; has Stack IR ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) (f32.store (i32.add (get_local $0) @@ -30,7 +1789,7 @@ (get_local $2) ) ) - (func $std/pointer/Pointer#get (; 3 ;) (; has Stack IR ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) + (func $std/pointer/Pointer#get (; 7 ;) (; has Stack IR ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (f32.load (i32.add (get_local $0) @@ -41,7 +1800,13 @@ ) ) ) - (func $start (; 4 ;) (; has Stack IR ;) (type $v) + (func $std/pointer/Pointer#set:value (; 8 ;) (; has Stack IR ;) (type $FUNCSIG$vi) (param $0 i32) + (f32.store + (get_local $0) + (f32.const 1.399999976158142) + ) + ) + (func $start (; 9 ;) (; has Stack IR ;) (type $v) (set_global $std/pointer/one (call $std/pointer/Pointer#constructor (i32.const 8) @@ -61,7 +1826,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 66) + (i32.const 79) (i32.const 0) ) (unreachable) @@ -76,7 +1841,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 67) + (i32.const 80) (i32.const 0) ) (unreachable) @@ -101,7 +1866,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 71) + (i32.const 84) (i32.const 0) ) (unreachable) @@ -118,7 +1883,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 72) + (i32.const 85) (i32.const 0) ) (unreachable) @@ -139,7 +1904,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 75) + (i32.const 88) (i32.const 0) ) (unreachable) @@ -160,7 +1925,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 78) + (i32.const 91) (i32.const 0) ) (unreachable) @@ -175,7 +1940,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 80) + (i32.const 93) (i32.const 0) ) (unreachable) @@ -199,7 +1964,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 82) + (i32.const 95) (i32.const 0) ) (unreachable) @@ -214,7 +1979,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 83) + (i32.const 96) (i32.const 0) ) (unreachable) @@ -229,7 +1994,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 85) + (i32.const 98) (i32.const 0) ) (unreachable) @@ -256,7 +2021,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 88) + (i32.const 101) (i32.const 0) ) (unreachable) @@ -273,7 +2038,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 89) + (i32.const 102) (i32.const 0) ) (unreachable) @@ -290,7 +2055,60 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 90) + (i32.const 103) + (i32.const 0) + ) + (unreachable) + ) + ) + (call $std/pointer/Pointer#set:value + (get_global $std/pointer/one) + (get_global $std/pointer/two) + ) + (if + (i32.eq + (get_global $std/pointer/one) + (get_global $std/pointer/two) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 106) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.ne + (i32.load + (get_global $std/pointer/one) + ) + (i32.const 1) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 107) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.ne + (i32.load offset=4 + (get_global $std/pointer/one) + ) + (i32.const 2) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 108) (i32.const 0) ) (unreachable) @@ -323,7 +2141,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 96) + (i32.const 114) (i32.const 0) ) (unreachable) @@ -341,7 +2159,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 97) + (i32.const 115) (i32.const 0) ) (unreachable) @@ -358,7 +2176,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 99) + (i32.const 117) (i32.const 0) ) (unreachable) @@ -378,7 +2196,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 100) + (i32.const 118) (i32.const 0) ) (unreachable) @@ -395,7 +2213,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 102) + (i32.const 120) (i32.const 0) ) (unreachable) @@ -412,7 +2230,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 103) + (i32.const 121) (i32.const 0) ) (unreachable) @@ -437,7 +2255,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 106) + (i32.const 124) (i32.const 0) ) (unreachable) @@ -457,7 +2275,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 107) + (i32.const 125) (i32.const 0) ) (unreachable) @@ -474,7 +2292,44 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 108) + (i32.const 126) + (i32.const 0) + ) + (unreachable) + ) + ) + (call $std/pointer/Pointer#set:value + (get_global $std/pointer/buf) + ) + (if + (f32.ne + (f32.load + (get_global $std/pointer/buf) + ) + (f32.const 1.399999976158142) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 129) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (f32.ne + (f32.load + (i32.const 0) + ) + (f32.const 1.399999976158142) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 130) (i32.const 0) ) (unreachable) diff --git a/tests/compiler/std/pointer.ts b/tests/compiler/std/pointer.ts index 404a6e51..bece2e18 100644 --- a/tests/compiler/std/pointer.ts +++ b/tests/compiler/std/pointer.ts @@ -19,6 +19,19 @@ class Pointer { } } + @inline set value(value: T) { + if (isReference()) { + if (isManaged()) ERROR("Unsafe unmanaged set of a managed object"); + if (value === null) { + memory.fill(changetype(this), 0, offsetof()); + } else { + memory.copy(changetype(this), changetype(value), offsetof()); + } + } else { + store(changetype(this), value); + } + } + // FIXME: in general, inlining any of the following always yields a block. one could argue that // this helps debuggability, or that it is unnecessary overhead due to the simplicity of the // functions. a compromise could be to inline a block consisting of a single 'return' as is, @@ -89,6 +102,11 @@ assert(two.offset == 8); assert(two.value.key == 1); assert(two.value.val == 2); +one.value = two.value; +assert(one.offset != two.offset); +assert(one.value.key == 1); +assert(one.value.val == 2); + var buf = new Pointer(0); buf[0] = 1.1; buf[1] = 1.2; @@ -106,3 +124,7 @@ buf.set(2, 1.3); assert(buf[2] == 1.3); assert(buf.get(2) == 1.3); assert(load(8) == 1.3); + +buf.value = 1.4; +assert(buf.value == 1.4); +assert(load(0) == 1.4); diff --git a/tests/compiler/std/pointer.untouched.wat b/tests/compiler/std/pointer.untouched.wat index 56381130..90b099e7 100644 --- a/tests/compiler/std/pointer.untouched.wat +++ b/tests/compiler/std/pointer.untouched.wat @@ -1,8 +1,11 @@ (module (type $iii (func (param i32 i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) + (type $iiv (func (param i32 i32))) + (type $iiiv (func (param i32 i32 i32))) (type $iifv (func (param i32 i32 f32))) (type $iif (func (param i32 i32) (result f32))) + (type $ifv (func (param i32 f32))) (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $std/pointer/one (mut i32) (i32.const 0)) @@ -19,10 +22,2515 @@ (func $std/pointer/Pointer#constructor (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (get_local $1) ) - (func $std/pointer/Pointer#constructor (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/memory/memset (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i64) + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (i32.store8 + (get_local $0) + (get_local $1) + ) + (i32.store8 + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 1) + ) + (get_local $1) + ) + (if + (i32.le_u + (get_local $2) + (i32.const 2) + ) + (return) + ) + (i32.store8 + (i32.add + (get_local $0) + (i32.const 1) + ) + (get_local $1) + ) + (i32.store8 + (i32.add + (get_local $0) + (i32.const 2) + ) + (get_local $1) + ) + (i32.store8 + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 2) + ) + (get_local $1) + ) + (i32.store8 + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 3) + ) + (get_local $1) + ) + (if + (i32.le_u + (get_local $2) + (i32.const 6) + ) + (return) + ) + (i32.store8 + (i32.add + (get_local $0) + (i32.const 3) + ) + (get_local $1) + ) + (i32.store8 + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 4) + ) + (get_local $1) + ) + (if + (i32.le_u + (get_local $2) + (i32.const 8) + ) + (return) + ) + (set_local $3 + (i32.and + (i32.sub + (i32.const 0) + (get_local $0) + ) + (i32.const 3) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (get_local $3) + ) + ) + (set_local $2 + (i32.and + (get_local $2) + (i32.const -4) + ) + ) + (set_local $4 + (i32.mul + (i32.div_u + (i32.const -1) + (i32.const 255) + ) + (i32.and + (get_local $1) + (i32.const 255) + ) + ) + ) + (i32.store + (get_local $0) + (get_local $4) + ) + (i32.store + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 4) + ) + (get_local $4) + ) + (if + (i32.le_u + (get_local $2) + (i32.const 8) + ) + (return) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (get_local $4) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (get_local $4) + ) + (i32.store + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 12) + ) + (get_local $4) + ) + (i32.store + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 8) + ) + (get_local $4) + ) + (if + (i32.le_u + (get_local $2) + (i32.const 24) + ) + (return) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (get_local $4) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 16) + ) + (get_local $4) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 20) + ) + (get_local $4) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 24) + ) + (get_local $4) + ) + (i32.store + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 28) + ) + (get_local $4) + ) + (i32.store + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 24) + ) + (get_local $4) + ) + (i32.store + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 20) + ) + (get_local $4) + ) + (i32.store + (i32.sub + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 16) + ) + (get_local $4) + ) + (set_local $3 + (i32.add + (i32.const 24) + (i32.and + (get_local $0) + (i32.const 4) + ) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (get_local $3) + ) + ) + (set_local $5 + (i64.or + (i64.extend_u/i32 + (get_local $4) + ) + (i64.shl + (i64.extend_u/i32 + (get_local $4) + ) + (i64.const 32) + ) + ) + ) + (block $break|0 + (loop $continue|0 + (if + (i32.ge_u + (get_local $2) + (i32.const 32) + ) + (block + (block + (i64.store + (get_local $0) + (get_local $5) + ) + (i64.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (get_local $5) + ) + (i64.store + (i32.add + (get_local $0) + (i32.const 16) + ) + (get_local $5) + ) + (i64.store + (i32.add + (get_local $0) + (i32.const 24) + ) + (get_local $5) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 32) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 32) + ) + ) + ) + (br $continue|0) + ) + ) + ) + ) + ) + (func $~lib/internal/memory/memcpy (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (block $break|0 + (loop $continue|0 + (if + (if (result i32) + (get_local $2) + (i32.and + (get_local $1) + (i32.const 3) + ) + (get_local $2) + ) + (block + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (br $continue|0) + ) + ) + ) + ) + (if + (i32.eq + (i32.and + (get_local $0) + (i32.const 3) + ) + (i32.const 0) + ) + (block + (block $break|1 + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 16) + ) + (block + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 12) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 4) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (i32.store16 + (get_local $0) + (i32.load16_u + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 2) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + (return) + ) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 32) + ) + (block $break|2 + (block $case2|2 + (block $case1|2 + (block $case0|2 + (set_local $5 + (i32.and + (get_local $0) + (i32.const 3) + ) + ) + (br_if $case0|2 + (i32.eq + (get_local $5) + (i32.const 1) + ) + ) + (br_if $case1|2 + (i32.eq + (get_local $5) + (i32.const 2) + ) + ) + (br_if $case2|2 + (i32.eq + (get_local $5) + (i32.const 3) + ) + ) + (br $break|2) + ) + (block + (set_local $3 + (i32.load + (get_local $1) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 3) + ) + ) + (block $break|3 + (loop $continue|3 + (if + (i32.ge_u + (get_local $2) + (i32.const 17) + ) + (block + (block + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (get_local $4) + (i32.const 8) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 5) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 24) + ) + (i32.shl + (get_local $3) + (i32.const 8) + ) + ) + ) + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 9) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (get_local $4) + (i32.const 8) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 13) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 24) + ) + (i32.shl + (get_local $3) + (i32.const 8) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + ) + (br $continue|3) + ) + ) + ) + ) + (br $break|2) + ) + ) + (block + (set_local $3 + (i32.load + (get_local $1) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 2) + ) + ) + (block $break|4 + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 18) + ) + (block + (block + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (get_local $4) + (i32.const 16) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 6) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 16) + ) + (i32.shl + (get_local $3) + (i32.const 16) + ) + ) + ) + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 10) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (get_local $4) + (i32.const 16) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 14) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 16) + ) + (i32.shl + (get_local $3) + (i32.const 16) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + (br $break|2) + ) + ) + (block + (set_local $3 + (i32.load + (get_local $1) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (block $break|5 + (loop $continue|5 + (if + (i32.ge_u + (get_local $2) + (i32.const 19) + ) + (block + (block + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 3) + ) + ) + ) + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (get_local $4) + (i32.const 24) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 7) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 8) + ) + (i32.shl + (get_local $3) + (i32.const 24) + ) + ) + ) + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 11) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (get_local $4) + (i32.const 24) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 15) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 8) + ) + (i32.shl + (get_local $3) + (i32.const 24) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + ) + (br $continue|5) + ) + ) + ) + ) + (br $break|2) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 16) + ) + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (func $~lib/internal/memory/memmove (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (if + (i32.eq + (get_local $0) + (get_local $1) + ) + (return) + ) + (if + (if (result i32) + (tee_local $3 + (i32.le_u + (i32.add + (get_local $1) + (get_local $2) + ) + (get_local $0) + ) + ) + (get_local $3) + (i32.le_u + (i32.add + (get_local $0) + (get_local $2) + ) + (get_local $1) + ) + ) + (block + (call $~lib/internal/memory/memcpy + (get_local $0) + (get_local $1) + (get_local $2) + ) + (return) + ) + ) + (if + (i32.lt_u + (get_local $0) + (get_local $1) + ) + (block + (if + (i32.eq + (i32.and + (get_local $1) + (i32.const 7) + ) + (i32.and + (get_local $0) + (i32.const 7) + ) + ) + (block + (block $break|0 + (loop $continue|0 + (if + (i32.and + (get_local $0) + (i32.const 7) + ) + (block + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (i32.store8 + (block (result i32) + (set_local $3 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (get_local $3) + ) + (i32.load8_u + (block (result i32) + (set_local $3 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (get_local $3) + ) + ) + ) + ) + (br $continue|0) + ) + ) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (block + (i64.store + (get_local $0) + (i64.load + (get_local $1) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + (br $continue|1) + ) + ) + ) + ) + ) + ) + (block $break|2 + (loop $continue|2 + (if + (get_local $2) + (block + (block + (i32.store8 + (block (result i32) + (set_local $3 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (get_local $3) + ) + (i32.load8_u + (block (result i32) + (set_local $3 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (br $continue|2) + ) + ) + ) + ) + ) + (block + (if + (i32.eq + (i32.and + (get_local $1) + (i32.const 7) + ) + (i32.and + (get_local $0) + (i32.const 7) + ) + ) + (block + (block $break|3 + (loop $continue|3 + (if + (i32.and + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 7) + ) + (block + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + ) + (br $continue|3) + ) + ) + ) + ) + (block $break|4 + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (block + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + (i64.store + (i32.add + (get_local $0) + (get_local $2) + ) + (i64.load + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + ) + (block $break|5 + (loop $continue|5 + (if + (get_local $2) + (block + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|5) + ) + ) + ) + ) + ) + ) + ) + (func $std/pointer/Pointer#set:value (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (if + (i32.eq + (get_local $1) + (i32.const 0) + ) + (block $~lib/memory/memory.fill|inlined.0 + (set_local $2 + (i32.const 0) + ) + (set_local $3 + (i32.const 8) + ) + (call $~lib/internal/memory/memset + (get_local $0) + (get_local $2) + (get_local $3) + ) + ) + (block $~lib/memory/memory.copy|inlined.0 + (set_local $3 + (i32.const 8) + ) + (call $~lib/internal/memory/memmove + (get_local $0) + (get_local $1) + (get_local $3) + ) + ) + ) + ) + (func $std/pointer/Pointer#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (get_local $1) ) - (func $std/pointer/Pointer#set (; 3 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) + (func $std/pointer/Pointer#set (; 7 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) (f32.store (i32.add (get_local $0) @@ -34,7 +2542,7 @@ (get_local $2) ) ) - (func $std/pointer/Pointer#get (; 4 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) + (func $std/pointer/Pointer#get (; 8 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (f32.load (i32.add (get_local $0) @@ -45,7 +2553,13 @@ ) ) ) - (func $start (; 5 ;) (type $v) + (func $std/pointer/Pointer#set:value (; 9 ;) (type $ifv) (param $0 i32) (param $1 f32) + (f32.store + (get_local $0) + (get_local $1) + ) + ) + (func $start (; 10 ;) (type $v) (local $0 i32) (local $1 i32) (local $2 f32) @@ -77,7 +2591,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 66) + (i32.const 79) (i32.const 0) ) (unreachable) @@ -99,7 +2613,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 67) + (i32.const 80) (i32.const 0) ) (unreachable) @@ -147,7 +2661,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 71) + (i32.const 84) (i32.const 0) ) (unreachable) @@ -173,7 +2687,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 72) + (i32.const 85) (i32.const 0) ) (unreachable) @@ -209,7 +2723,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 75) + (i32.const 88) (i32.const 0) ) (unreachable) @@ -245,7 +2759,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 78) + (i32.const 91) (i32.const 0) ) (unreachable) @@ -267,7 +2781,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 80) + (i32.const 93) (i32.const 0) ) (unreachable) @@ -300,7 +2814,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 82) + (i32.const 95) (i32.const 0) ) (unreachable) @@ -322,7 +2836,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 83) + (i32.const 96) (i32.const 0) ) (unreachable) @@ -344,7 +2858,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 85) + (i32.const 98) (i32.const 0) ) (unreachable) @@ -388,7 +2902,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 88) + (i32.const 101) (i32.const 0) ) (unreachable) @@ -414,7 +2928,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 89) + (i32.const 102) (i32.const 0) ) (unreachable) @@ -440,7 +2954,97 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 90) + (i32.const 103) + (i32.const 0) + ) + (unreachable) + ) + ) + (call $std/pointer/Pointer#set:value + (get_global $std/pointer/one) + (block $std/pointer/Pointer#get:value|inlined.6 (result i32) + (set_local $0 + (get_global $std/pointer/two) + ) + (br $std/pointer/Pointer#get:value|inlined.6 + (get_local $0) + ) + ) + ) + (if + (i32.eqz + (i32.ne + (block $std/pointer/Pointer#get:offset|inlined.8 (result i32) + (set_local $0 + (get_global $std/pointer/one) + ) + (get_local $0) + ) + (block $std/pointer/Pointer#get:offset|inlined.9 (result i32) + (set_local $0 + (get_global $std/pointer/two) + ) + (get_local $0) + ) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 106) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.eqz + (i32.eq + (i32.load + (block $std/pointer/Pointer#get:value|inlined.7 (result i32) + (set_local $0 + (get_global $std/pointer/one) + ) + (br $std/pointer/Pointer#get:value|inlined.7 + (get_local $0) + ) + ) + ) + (i32.const 1) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 107) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.eqz + (i32.eq + (i32.load offset=4 + (block $std/pointer/Pointer#get:value|inlined.8 (result i32) + (set_local $0 + (get_global $std/pointer/one) + ) + (br $std/pointer/Pointer#get:value|inlined.8 + (get_local $0) + ) + ) + ) + (i32.const 2) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 108) (i32.const 0) ) (unreachable) @@ -476,7 +3080,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 96) + (i32.const 114) (i32.const 0) ) (unreachable) @@ -496,7 +3100,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 97) + (i32.const 115) (i32.const 0) ) (unreachable) @@ -529,7 +3133,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 99) + (i32.const 117) (i32.const 0) ) (unreachable) @@ -562,7 +3166,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 100) + (i32.const 118) (i32.const 0) ) (unreachable) @@ -581,7 +3185,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 102) + (i32.const 120) (i32.const 0) ) (unreachable) @@ -600,7 +3204,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 103) + (i32.const 121) (i32.const 0) ) (unreachable) @@ -641,7 +3245,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 106) + (i32.const 124) (i32.const 0) ) (unreachable) @@ -674,7 +3278,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 107) + (i32.const 125) (i32.const 0) ) (unreachable) @@ -693,7 +3297,56 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 108) + (i32.const 126) + (i32.const 0) + ) + (unreachable) + ) + ) + (call $std/pointer/Pointer#set:value + (get_global $std/pointer/buf) + (f32.const 1.399999976158142) + ) + (if + (i32.eqz + (f32.eq + (block $std/pointer/Pointer#get:value|inlined.0 (result f32) + (set_local $0 + (get_global $std/pointer/buf) + ) + (br $std/pointer/Pointer#get:value|inlined.0 + (f32.load + (get_local $0) + ) + ) + ) + (f32.const 1.399999976158142) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 129) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.eqz + (f32.eq + (f32.load + (i32.const 0) + ) + (f32.const 1.399999976158142) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 130) (i32.const 0) ) (unreachable)