-
-
Couldn't load subscription status.
- Fork 179
Description
There are many "peephole" optimizations that can be applied by searching for suboptimal patterns of assembly code. There may also be reasons to lint code besides optimization (and besides consistent formatting, which would be its own tool; see #1796).
This would be like optimize.py, but ideally running faster, and not tied to pret's preferred formatting and macros (generalizable to all of GB dev). On the other hand, it should have a way to easily define custom lint rules, so it can recognize project-specific macros and exceptions. (For instance, in pret jmp should be recognized by all relevant patterns as a jump instruction, and the Hungarian h/w/v/s RAM prefixes are relevant for some patterns.)