Skip to content

Instantly share code, notes, and snippets.

@pepyakin
Created February 15, 2018 14:07
Show Gist options
  • Save pepyakin/f3f2e8083cfc0d9f99896bb4429b442d to your computer and use it in GitHub Desktop.
Save pepyakin/f3f2e8083cfc0d9f99896bb4429b442d to your computer and use it in GitHub Desktop.
(module
(import "proxy" "execute_block"
(func $execute_block (param i32 i32) (result i64))
)
(global $ret_hi (mut i32) (i32.const 0))
(global $ret_lo (mut i32) (i32.const 0))
(func (export "returnHi") (result i32) (get_global $ret_hi))
(func (export "returnLo") (result i32) (get_global $ret_lo))
(func $return_wrap (param $result i64) (result i32)
(set_global $ret_hi
(i32.wrap/i64
(i64.shr_u
(get_local $result)
(i64.const 32)
)
)
)
(set_global $ret_lo
(i32.wrap/i64
(get_local $return)
)
)
(get_global $ret_lo)
)
(func (export "execute_block") (param i32 i32) (result i32)
(call $return_wrap
(call $execute_block
(get_local 0)
(get_local 1)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment