]> Joshua Wise's Git repositories - snipe.git/blobdiff - codegen/codegen.sml
Fix up for MLton build.
[snipe.git] / codegen / codegen.sml
index de8fa1e7867f5fcc851a1bfb924bb9975ef31c4e..804dee55108edf2cfcafea80e66e4880fefce845 100644 (file)
@@ -59,7 +59,8 @@ struct
    * generates instructions to achieve d <- e
    * d must be TEMP(t) or REG(r)
    *)
-  and munch_exp d (T.CONST n) = [X.INSN (X.AL, X.MOVLIT(d, Word.fromLarge n))]
+  and munch_exp d (T.CONST n) = [X.INSN (X.AL, X.MOVLIT(d, Word.fromLarge (Word32.toLarge n)))]
+    | munch_exp d (T.STRING s) = [X.INSN (X.AL, X.MOVSTR(d, s))]
     | munch_exp d (T.NULLPTR) = [X.INSN (X.AL, X.MOVLIT(d, 0w0))]
     | munch_exp d (T.TEMP(t)) = [X.INSN (X.AL, X.MOV(d, X.TEMP t))]
     | munch_exp d (T.ARG(0)) = [X.INSN (X.AL, X.MOV(d, X.REG X.R0))]
@@ -283,7 +284,7 @@ struct
   (* munch_stm : T.stm -> X.insn list *)
   (* munch_stm stm generates code to execute stm *)
   and munch_stm (T.MOVE (T.TEMP t1, T.TEMP t2)) = [X.INSN (X.AL, X.MOV(X.TEMP t1, X.TEMP t2))]
-    | munch_stm (T.MOVE (T.TEMP t, T.CONST n)) = [X.INSN (X.AL, X.MOVLIT(X.TEMP t, Word.fromLarge n))]
+    | munch_stm (T.MOVE (T.TEMP t, T.CONST n)) = [X.INSN (X.AL, X.MOVLIT(X.TEMP t, Word.fromLarge (Word32.toLarge n)))]
     | munch_stm (T.MOVE (T.TEMP t, a as T.ARG (an))) =
         let
           val i = munch_exp (X.TEMP t) a
This page took 0.023454 seconds and 4 git commands to generate.