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

Reverse the order of stack inputs for the store instructions. #165

Closed
fredericomba opened this issue Apr 18, 2023 · 3 comments
Closed

Reverse the order of stack inputs for the store instructions. #165

fredericomba opened this issue Apr 18, 2023 · 3 comments

Comments

@fredericomba
Copy link

The stack store instructions take arguments like this: [pointer, value]. However, if the arguments were in the order [value, pointer], it would be easier to use the store instructions with long data structures on the stack. Of course, making this change would break backwards compatibility, so a "reverse" or "swap" instruction that reverses the last two values on the stack could address this.

I can't elaborate on this point right now, but if you also faced this, you'll probably know what I'm talking about.

@yfzhe
Copy link

yfzhe commented Apr 25, 2023

With the multi-value feature, you don't need the "reserve" or "swap" instruction but rather implement it as a function by yourself.

See: https://github.com/WebAssembly/multi-value/blob/master/proposals/multi-value/Overview.md#functions-with-multiple-return-values

@eqrion
Copy link
Contributor

eqrion commented Jun 16, 2023

Changes to wasm must follow this process document, and generally starts as an issue on the WebAssembly/design repository, not in this repository.

We can't break backwards compatibility, so changing stack operand order is a non-starter. However stack manipulation instructions have been actively discussed before.

@tlively
Copy link
Member

tlively commented Jun 16, 2023

I think we can close this as a duplicate of WebAssembly/design#1381.

@tlively tlively closed this as completed Jun 16, 2023
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

4 participants