X-Git-Url: http://git.joshuawise.com/snipe.git/blobdiff_plain/4a34fbf0834d02dd913bf872e45b3285aafce641..de034162d9af50e6bfb454f4de67213d856137c4:/codegen/codegen.sml diff --git a/codegen/codegen.sml b/codegen/codegen.sml index aad1770..8181905 100644 --- a/codegen/codegen.sml +++ b/codegen/codegen.sml @@ -125,9 +125,9 @@ struct (*| munch_exp d (T.BINOP(T.SUB, e1, T.CONST n)) = binophit_c d X.SUB e1 n | munch_exp d (T.BINOP(T.SUB, e1, T.TEMP t)) = binophit_t d X.SUB e1 t*) | munch_exp d (T.BINOP(T.SUB, e1, e2)) = binophit d X.SUB e1 e2 - | munch_exp d (T.BINOP(T.MUL, _, _)) = raise ErrorMsg.InternalError "MUL does not exist on blargcpu" - | munch_exp d (T.BINOP(T.DIV, _, _)) = raise ErrorMsg.InternalError "DIV does not exist on blargcpu" - | munch_exp d (T.BINOP(T.MOD, _, _)) = raise ErrorMsg.InternalError "MOD does not exist on blargcpu" + | munch_exp d (T.BINOP(T.MUL, e1, e2)) = munch_exp d (T.CALL (Symbol.symbol "__blarg_mul", [e1, e2])) + | munch_exp d (T.BINOP(T.DIV, e1, e2)) = munch_exp d (T.CALL (Symbol.symbol "__blarg_div", [e1, e2])) + | munch_exp d (T.BINOP(T.MOD, e1, e2)) = munch_exp d (T.CALL (Symbol.symbol "__blarg_mod", [e1, e2])) | munch_exp d (T.BINOP(T.LSH, e1, e2)) = binophit d X.SHL e1 e2 | munch_exp d (T.BINOP(T.RSH, e1, e2)) = binophit d X.SHR e1 e2 | munch_exp d (T.BINOP(T.BITAND, e1, e2)) = binophit d X.AND e1 e2