Created
May 13, 2012 18:53
-
-
Save Blecki/2689729 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Peephole optimization definitions | |
| // Simple assign-back | |
| SET A, B / SET B, A => SET A, B; | |
| // Stack assign-back | |
| SET "PUSH", A / SET A, "PEEK" => SET "PUSH", A; | |
| // Preserve-pop | |
| SET "PUSH", A / ADD "SP", "0x0001" => ; | |
| // Register flip add | |
| SET B, A / SET A, "POP" / ADD A, B => ADD A, "POP"; | |
| // Push temp | |
| SET "J", A / SET "PUSH", "J" => SET "PUSH", A; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment