Displaying 1 result from an estimated 1 matches for "lda_stack".
Did you mean:
  db_stack
  
2016 Feb 13
4
Register spilling fix for experimental 6502 backend
...eral reg class, so a spilled Acc can
be reloaded as a General.
Previously, the RA would fail because it would spill X, but it couldn't reload
X into an Acc.
Now, with the patch, the DAG compiles into this:
  # store X to stack
  STX_stack [0]
  # transfer A to X
  TAX
  # load A from stack
  LDA_stack [0]
  # now that A and X are swapped, we can subtract!
  SUBidx A, X
It works, but I'm not sure if I used the best approach. If you're familiar with
the RA, feel free to look at the patch and leave feedback.
- Nolan