lynn/chibicc

Optimizations suggestions

neauoire opened this issue · 0 comments

I love looking at the resulting tal code from my little C programs, I've been trying to compile a 6502 assembler for uxn. When writing uxntal I have this tool called uxnli that does simple graph reduction and finds little optimizations, it found a couple of things, here's a few highlights:

  • STH2kr LDA -> LDAkr STHr
  • SWP ORA, ORA doesn't need a specific order
  • DUP2 LDA -> LDAk
  • #10 SFT -> DUP ADD
  • #0002 ADD2 -> INC2 INC2
  • #ffff NEQ2 -> INC2 ORA

Keep up the good work! xneko really made my day.