]> Joshua Wise's Git repositories - snipe.git/blobdiff - codegen/codegen.sml
woo it generated some code
[snipe.git] / codegen / codegen.sml
index aad17706ccf41f312e0bc2e99bec6d7ff82e36de..81819054f033d5a1d2d66fde840e62c8e6942511 100644 (file)
@@ -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
This page took 0.020995 seconds and 4 git commands to generate.