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.sml
ViewVC logotype

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

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

revision 2636, Tue May 27 16:18:36 2014 UTC revision 2637, Wed May 28 05:20:45 2014 UTC
# Line 13  Line 13 
13      structure OpOld = LowOps(* TreeOps*)      structure OpOld = LowOps(* TreeOps*)
14      structure Op = TreeOps      structure Op = TreeOps
15      structure Ty = TreeILTypes      structure Ty = TreeILTypes
16      structure Cfn=Cfn      structure setTyfn=TreeFunc
17        structure  OprSet=setTyfn.OprSet
18        structure  TySet=setTyfn.TySet
19    
20    
21    
22    
23    
 (*  
     datatype operator = LD | MKVEC | OP of Op.rator  
 *)  
24    
25      datatype program = Program of {      datatype program = Program of {
26          props : StrandUtil.program_prop list,          props : StrandUtil.program_prop list,
27  (*  
28          types : ?? list,          types : Ty.ty list,
29          oprations : operation list,          oprations : setTyfn.oprator list,
30  *)  
31          globals : var list,          globals : var list,
32          inputInit : block,          inputInit : block,
33          globalInit : block,          globalInit : block,
# Line 60  Line 63 
63          body : block            (* method body *)          body : block            (* method body *)
64        }        }
65    
66        and subblock = Pink of {
67            locals : var list,
68            types:  TySet.set,
69            opr:  OprSet.set,
70            body : stm list
71          }
72      and block = Block of {      and block = Block of {
73          locals : var list,          locals : var list,
74          body : stm list          body : stm list
# Line 89  Line 98 
98        | E_Apply of MathFuns.name * exp list        | E_Apply of MathFuns.name * exp list
99        | E_Cons of Ty.ty * exp list        | E_Cons of Ty.ty * exp list
100        | E_LoadVec of int * int * exp * exp   (*Type:NativeVecTy newVec,  originalVec, addr, offset *)        | E_LoadVec of int * int * exp * exp   (*Type:NativeVecTy newVec,  originalVec, addr, offset *)
101          | E_FillVec of int * int * exp * exp   (*Type:NativeVecTy newVec,  originalVec, addr, offset *)
102          | E_SliceVec of int * int * exp * exp   (*Type:NativeVecTy newVec,  originalVec, addr, offset *)
103        | E_mkVec   of int *int  *Ty.ty* exp list   (*vec length,  originalVec,Type:vectorLength(list),  list of ops*)        | E_mkVec   of int *int  *Ty.ty* exp list   (*vec length,  originalVec,Type:vectorLength(list),  list of ops*)
104        | E_Cfn of Cfn.rator  
105    
106      and var = V of {      and var = V of {
107          name : string,                  (* name (should be unique) *)          name : string,                  (* name (should be unique) *)
# Line 103  Line 114 
114        = VK_Global                       (* global variable *)        = VK_Global                       (* global variable *)
115        | VK_Local                        (* includes strand parameters *)        | VK_Local                        (* includes strand parameters *)
116    
117    
118    
119    
120      structure Var : sig      structure Var : sig
121    
122          val new : string * var_kind * Ty.ty -> var          val new : string * var_kind * Ty.ty -> var
# Line 156  Line 170 
170    
171      fun stateVarToString (SV{name, ...}) = "self." ^ name      fun stateVarToString (SV{name, ...}) = "self." ^ name
172    
173    
174        fun q m=Int.toString(m)
175    
176        fun toString(E_LoadVec(tyNew, tyOrig, arg, offset)) = String.concat["LDVec<",q tyNew ,
177            ":",q  tyOrig, ">", "(", toString arg, ",", toString offset, ")"]
178         | toString(E_mkVec(tyNew, tyOrig,pieces,args)) =let
179            val a=String.concatWith "," (List.map toString args)
180            in
181                String.concat["mkVec:",q tyNew,"|",q tyOrig,"[",
182                Ty.toString pieces ,"]\n\t",a]
183            end
184         | toString (E_Op(rator, args)) = String.concat[Op.toString rator,"(",
185            String.concatWith"," (List.map toString args),")"]
186         | toString (E_Cons(ty, args)) =String.concat ["Cons:", Ty.toString ty, "(",
187            String.concatWith"," (List.map toString args),")"]
188         | toString (E_State x) = "State"
189         | toString (E_Var x) = Var.name x
190         | toString (E_Lit lit) = Literal.toString lit
191         | toString(E_FillVec(tyNew, tyOrig, arg, offset))=String.concat["FillVec<",
192             q tyNew ,":",q  tyOrig, ">", "(", toString arg, ",", toString offset, ")"]
193        | toString(E_SliceVec(tyNew, tyOrig, arg, offset)) = String.concat["SliceVec<",
194                 q tyNew ,":",q  tyOrig, ">", "(", toString arg, ",", toString offset, ")"]
195    
196    end    end

Legend:
Removed from v.2636  
changed lines
  Added in v.2637

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