Created
May 3, 2010 19:02
-
-
Save stephenroller/388458 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
@optimization([('LDC', "$A", 2, WILD), | |
('LD', "$B", 0, SP), | |
('LDA', SP, 1, SP), | |
('MUL', "$A", "$B", "$A")]) | |
def times_two(nodes, A, B): | |
nodes[0].remove() | |
nodes[1].inst5 = ('LD', A, 0, SP, 'get A off of stack') | |
nodes[3].inst5 = ('ADD', A, A, A, 'A * 2') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My lisp envy got the best of me.