Skip to content

Pattern for (or possibility of) tuple.set ? #7448

Answered by tlively
JaimeGensler asked this question in Q&A
Discussion options

You must be logged in to vote

The problem with tuples and tuple instructions is that they don't exist in the underlying WebAssembly, so Binaryen's binary writer has to do a complicated lowering involving scratch locals to emit them. Because of this complexity, there's a high bar for adding new tuple instructions. The best reason for adding a new tuple instruction would be if it allowed us to emit better WebAssembly for common patterns.

I'm assuming that tuple.set would take an immediate index, a tuple operand, and the replacement value, and would return the modified tuple. The higher the replaced index is, the better the code generated from tuple.set would be compared to reconstructing the whole tuple, but when replac…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JaimeGensler
Comment options

@tlively
Comment options

Answer selected by JaimeGensler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants