Permalink
Browse files

Fix shr, shl and arsh functions to use const as arg

also fix makefile
  • Loading branch information...
root
root committed Jun 26, 2011
1 parent 3eca253 commit 32967672e1cf29a8af6717570d3c28db0ad00435
Showing with 7 additions and 4 deletions.
  1. +1 −1 MiniJavaBackend/Makefile
  2. +6 −3 MiniJavaBackend/tree/MaxMunch.java
View
@@ -1,7 +1,7 @@
all: grammar java prog
grammar:
- cd ../ && ./sablecc MiniJavaAluno/grammar.sablecc
+ cd ../ && ./sablecc MiniJavaBackend/grammar.sablecc
java:
javac ./x86/*.java
@@ -198,13 +198,16 @@ private Rest maxMunch(BINOP e){
defineRest("or `d0, `s0", r, Rest.OPER);
break;
case BINOP.LSHIFT:
- defineRest("shl `d0, `s0", r, Rest.OPER);
+ r.src = null;
+ defineRest("shl `d0, " + ((CONST)e.right).value, r, Rest.OPER);
break;
case BINOP.RSHIFT:
- defineRest("shr `d0, `s0", r, Rest.OPER);
+ r.src = null;
+ defineRest("shr `d0, " + ((CONST)e.right).value, r, Rest.OPER);
break;
case BINOP.ARSHIFT:
- defineRest("arsh `d0, `s0", r, Rest.OPER);
+ r.src = null;
+ defineRest("arsh `d0, " + ((CONST)e.right).value, r, Rest.OPER);
break;
case BINOP.XOR:
defineRest("xor `d0, `s0", r, Rest.OPER);

0 comments on commit 3296767

Please sign in to comment.