Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/tree-il/tree-il-pp.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/tree-il/tree-il-pp.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2663, Fri May 30 18:02:41 2014 UTC revision 2690, Fri Aug 29 15:41:22 2014 UTC
# Line 49  Line 49 
49              | toS (IL.E_Apply(f, args), l) = MathFuns.toString f :: argsToS (",","(", args, ")", l)              | toS (IL.E_Apply(f, args), l) = MathFuns.toString f :: argsToS (",","(", args, ")", l)
50              | toS (IL.E_Cons(ty, args), l) =              | toS (IL.E_Cons(ty, args), l) =
51                  "<" :: Ty.toString ty :: ">" :: argsToS (",","{", args, "}", l)                  "<" :: Ty.toString ty :: ">" :: argsToS (",","{", args, "}", l)
52              | toS (IL.E_LoadVec(tyNew, tyOrig, arg, offset), l) =              | toS (IL.E_Mux(A,nSize,oSize, pieces, args),l) =
53                      "LdVec<" :: itos tyNew :: ":" :: itos tyOrig :: ">("                      "Mux<" ::itos nSize :: ":" :: itos oSize ::"[>\t ]"::argsToS (",","(", args, ")", l)
54                        :: argsToS (",", "(", [arg, offset], ")", l)  
55              | toS (IL.E_mkVec(tyNew, tyOrig, pieces, args), l) =let  
56                  val m = argsToS (",\n\t","(", args, ")", l)              | toS (IL.E_LoadArr(A,tyNew, tyOrig, arg, offset), l) =
57                  in                          "LdArr<" :: itos tyNew :: ":" :: itos tyOrig :: ">("
                   "mkVec<" ::itos tyNew :: ":" :: itos tyOrig ::  
                   ">\n\t" :: m  
                 end  
            | toS (IL.E_LoadVecAligned(tyNew, tyOrig, arg, offset), l) =  
                       "LdVecAligned<" :: itos tyNew :: ":" :: itos tyOrig :: ">("  
58                            :: argsToS (",", "(", [arg, offset], ")", l)                            :: argsToS (",", "(", [arg, offset], ")", l)
             | toS (IL.E_mkVecAligned(tyNew, tyOrig, pieces, args), l) =let  
                           val m = argsToS (",\n\t","(", args, ")", l)  
                           in  
                           "mkVec<" ::itos tyNew :: ":" :: itos tyOrig ::  
                               ">\n\t" :: m  
                               end  
59            in            in
60              String.concat (toS (e, []))              String.concat (toS (e, []))
61            end            end
62    
63    
64      fun argsToString (prefix, es) = String.concat[      fun argsToString (prefix, es) = String.concat[
65              prefix, "(", String.concatWith "," (List.map expToString es), ")"              prefix, "(", String.concatWith "," (List.map expToString es), ")"
66            ]            ]
# Line 120  Line 110 
110                    List.app (fn s => prln(out, ["// ", s, "\n"])) text                    List.app (fn s => prln(out, ["// ", s, "\n"])) text
111                  end                  end
112              | IL.S_Assign([], e) => prln(out, [expToString e, ";\n"])              | IL.S_Assign([], e) => prln(out, [expToString e, ";\n"])
113              | IL.S_Assign([x], e) => prln(out, [Var.name x, " = ", expToString e, ";\n"])              | IL.S_Assign([x], e) => prln(out, [Var.name x, "=Assign= ", expToString e, ";\n"])
114              | IL.S_Assign(x::xs, e) => (              | IL.S_Assign(x::xs, e) => (
115                  prln(out, ["(", Var.name x]);                  prln(out, ["(", Var.name x]);
116                  List.app (fn x => prl(out, [",", Var.name x])) xs;                  List.app (fn x => prl(out, [",", Var.name x])) xs;
# Line 147  Line 137 
137              | IL.S_New(strand, args) =>              | IL.S_New(strand, args) =>
138                  prln (out, [argsToString("new "^Atom.toString strand, args), ";\n"])                  prln (out, [argsToString("new "^Atom.toString strand, args), ";\n"])
139              | IL.S_Save([x], rhs) =>              | IL.S_Save([x], rhs) =>
140                  prln (out, [IL.stateVarToString x, " = ", expToString rhs, ";\n"])                  prln (out, [IL.stateVarToString x, " =Save= ", expToString rhs, ";\n"])
141              | IL.S_Save(x::xs, e) => (              | IL.S_Save(x::xs, e) => (
142                  prln(out, ["(", IL.stateVarToString x]);                  prln(out, ["(", IL.stateVarToString x]);
143                  List.app (fn x => prl(out, [",", IL.stateVarToString x])) xs;                  List.app (fn x => prl(out, [",", IL.stateVarToString x])) xs;
# Line 172  Line 162 
162              | IL.S_Active => prln (out, ["active;\n"])              | IL.S_Active => prln (out, ["active;\n"])
163              | IL.S_Stabilize => prln (out, ["stabilize;\n"])              | IL.S_Stabilize => prln (out, ["stabilize;\n"])
164              | IL.S_Die => prln (out, ["die;\n"])              | IL.S_Die => prln (out, ["die;\n"])
165                | IL.S_StoreVec(x,A,nSize, oSize, pieces, args) =>
166                       prln(out, "StoreVectoArr1<" ::expToString x:: " = "::itos nSize :: ":" :: itos oSize ::[">\n\t" ])
167            (* end case *))            (* end case *))
168    
169      fun statement (outS, stm) = ppStm((outS, 0), stm)      fun statement (outS, stm) = ppStm((outS, 0), stm)

Legend:
Removed from v.2663  
changed lines
  Added in v.2690

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0