X-Git-Url: http://git.joshuawise.com/snipe.git/blobdiff_plain/075222c771a121b12d6f07f39af868ae14cd06a1..c2b45b3681553192a462bcdd376ee7a9bf83eef3:/codegen/codegen.sml?ds=sidebyside 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