Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add operations for packing and unpacking two i32s into a i64 #12

Open
codefromthecrypt opened this issue Oct 27, 2022 · 0 comments
Open

Comments

@codefromthecrypt
Copy link
Contributor

ABIs sometimes target 1.0 which doesn't support multiple returns, and employs a trick to pack two results into one. When writing tests in wat, it is helpful to be able to use shift operations vs doing these by hand.

ex. this is manual

  (global $eof i64 (i64.const 4294967296)) ;; `1<<32|0`

Preferably

  (global $eof i64 (i64.shl (i64.const 1) (i64.const 32)))

To fully implement both ways (ex unpacking) implies #4 i64.extend_i32_u i32.wrap_i64 i64.shr_u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant