]> Joshua Wise's Git repositories - snipe.git/commitdiff
Propagate strings through the blarg backend.
authorJoshua Wise <jwise@andrew.cmu.edu>
Sat, 10 Jul 2010 04:38:00 +0000 (00:38 -0400)
committerJoshua Wise <jwise@andrew.cmu.edu>
Sat, 10 Jul 2010 04:38:00 +0000 (00:38 -0400)
codegen/blarg.sml
codegen/codegen.sml
codegen/liveness.sml
codegen/solidify.sml

index c350b9d4886e5911d06b5498b28afb59dc73f78c..cdd4a1bfbd4b22d038d6ba2440f4e6b71065ec68 100644 (file)
@@ -19,6 +19,7 @@ sig
     MOVLIT of oper * word |
     MOVSYM of oper * Symbol.symbol |
     MOVLBL of oper * Label.label |
+    MOVSTR of oper * Stringref.stringref |
     LDR of oper * oper |
     STO of oper * oper |
     MOV of oper * oper |
@@ -76,6 +77,7 @@ struct
     MOVLIT of oper * word |
     MOVSYM of oper * Symbol.symbol |
     MOVLBL of oper * Label.label |
+    MOVSTR of oper * Stringref.stringref |
     LDR of oper * oper |
     STO of oper * oper |
     MOV of oper * oper |
@@ -204,6 +206,7 @@ struct
   fun pp_insn pr (MOVLIT (d, w)) = "\tmov"^pr^" "^(pp_oper d)^", #0x"^(Word.toString w)^"\n"
     | pp_insn pr (MOVSYM (d, s)) = "\tmov"^pr^" "^(pp_oper d)^", #"^(Symbol.name s)^"\n"
     | pp_insn pr (MOVLBL (d, l)) = "\tmov"^pr^" "^(pp_oper d)^", #"^(Label.name l)^"\n"
+    | pp_insn pr (MOVSTR (d, s)) = "\tmov"^pr^" "^(pp_oper d)^", #"^(Stringref.name s)^"\n"
     | pp_insn pr (LDR (d, s)) = "\tldr"^pr^" "^(pp_oper d)^", ["^(pp_oper s)^"]\n"
     | pp_insn pr (STO (d, s)) = "\tsto"^pr^" ["^(pp_oper d)^"], "^(pp_oper s)^"\n"
     | pp_insn pr (MOV (d, s)) = "\tmov"^pr^" "^(pp_oper d)^", "^(pp_oper s)^"\n"
index de8fa1e7867f5fcc851a1bfb924bb9975ef31c4e..29707a8489d9b37dc0994b2b4dd3750079577374 100644 (file)
@@ -60,6 +60,7 @@ struct
    * 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))]
+    | 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))]
index 6a7d89b5f65bfbf1c53e0b8054da92dabcddee4c..df411bbf1441fb93f5643bafb34fbc62e2e88cd6 100644 (file)
@@ -106,6 +106,7 @@ struct
         | gendef (n, X.INSN(X.NV, _))          = ([SUCC (n+1)])
         | gendef (n, X.INSN(_, X.MOVLIT(dest, _))) = (defhit dest @ [SUCC(n+1), ISMOVE])
         | gendef (n, X.INSN(_, X.MOVSYM(dest, sym))) = (defhit dest @ [SUCC(n+1), ISMOVE])
+        | gendef (n, X.INSN(_, X.MOVSTR(dest, str))) = (defhit dest @ [SUCC(n+1), ISMOVE])
         | gendef (n, X.INSN(X.AL, X.MOVLBL(X.REG X.PC, l))) = ([SUCC (findlabel l)])
         | gendef (n, X.INSN(_, X.MOVLBL(X.REG X.PC, l))) = ([SUCC (n+1), SUCC (findlabel l)])
         | gendef (n, X.INSN(_, X.MOVLBL(_, _))) = raise ErrorMsg.InternalError "MOVLBL with target neq PC"
index a2622e122b54e21c47638ab8e780f80b7d9b4b0f..db3cceae6c53cd9592250ce235bf5c32c466d600 100644 (file)
@@ -183,6 +183,11 @@ struct
             (if isspilled op1
              then spill (op1, spillreg1)
              else [])
+        | transform (X.INSN (pred, X.MOVSTR (op1, w))) =
+            [ X.INSN (pred, X.MOVSTR (real_op1 op1, w)) ] @
+            (if isspilled op1
+             then spill (op1, spillreg1)
+             else [])
         | transform (X.INSN (pred, X.MOVLBL (op1, w))) =
             [ X.INSN (pred, X.MOVLBL (real_op1 op1, w)) ] @
             (if isspilled op1
This page took 0.029101 seconds and 4 git commands to generate.