sway
sway copied to clipboard
[asmgen] generate code for stack argument access differently
To save excess arguments on the stack, previously we would
- store the argument using SW with an immediate offset basing from locals-base register. This limits the offset to 12 bits.
- Store the offset to the first excess argument to the last ARG register so that callee can access these.
This PR reverses the order. It stores the offset to the last ARG register first. Then the store of argument to the stack slot can be made without requiring large immediate offsets, basing just on the last ARG register.
Fixes #6646