sway icon indicating copy to clipboard operation
sway copied to clipboard

[asmgen] generate code for stack argument access differently

Open vaivaswatha opened this issue 4 months ago • 1 comments

To save excess arguments on the stack, previously we would

  1. store the argument using SW with an immediate offset basing from locals-base register. This limits the offset to 12 bits.
  2. 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

vaivaswatha avatar Oct 17 '24 02:10 vaivaswatha