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 2794, Tue Nov 4 20:04:14 2014 UTC revision 2795, Tue Nov 4 21:58:11 2014 UTC
# Line 85  Line 85 
85        | S_Active        | S_Active
86        | S_Stabilize        | S_Stabilize
87        | S_Die        | S_Die
88        | S_StoreVec of exp * bool*int *int * Ty.ty* exp list        | S_StoreVec of exp * bool*bool *int * Ty.ty*Ty.ty* exp list (*Vector->Array*)
89              (*lhs var, isAligned, newSize,origSize,pieces, Operations, isArr*)              (*lhs var, isAligned, isFill,origSize of lastVector,original Tensor ,pieces, args*)
90        | S_Cons of var * Ty.ty *Ty.ty * exp list (* Cons->Array  ,var,OriginalType,pieceSizes *)        | S_Cons of var *int * exp list (*real ->Array*)
91                (* size n, exp arguments*)
92    
93    
94      and exp      and exp
# Line 96  Line 97 
97        | E_Lit of Literal.literal        | E_Lit of Literal.literal
98        | E_Op of Op.rator * exp list        | E_Op of Op.rator * exp list
99        | E_Apply of MathFuns.name * exp list        | E_Apply of MathFuns.name * exp list
100        | E_Cons of Ty.ty*int*  exp list   (*Cons->Vector , vector size used for ops, int:not used size)*)        | E_Cons of int*int*  exp list   (*Reals->Vector size n, origSize,exp arguments*)
101        | E_LoadArr of bool*int * int * exp * exp        | E_LoadArr of bool*int * int * exp * exp
102          (*aligned, newVecSize,originalVecSize, addr, offset *)          (*aligned, newVecSize,originalVecSize, addr, offset *)
103        | E_LoadVec of bool*int * int * exp * exp        | E_Mux of bool*bool*int * Ty.ty*exp list
104        | E_Mux of bool*int *int * Ty.ty*exp list              (*alighed, isFill,originalsize of vectorop, pieces, args*)
105              (*wraps around vector arguments, gets turned into S_storeVec if used by SAVE*)              (*wraps around vector operations*)
106        | E_Holder of var * var list  (*array, to vector var list , used for matrices*)        | E_Holder of var * var list  (*array, to vector var list , used for matrices*)
107    
108    
# Line 195  Line 196 
196      fun varTys(x,y)=if Ty.same(x,y) then String.concat[" TySame: ",Ty.toString x," "]      fun varTys(x,y)=if Ty.same(x,y) then String.concat[" TySame: ",Ty.toString x," "]
197              else String.concat["\t rTy: ",Ty.toString x," \t mty: ",Ty.toString y," "]              else String.concat["\t rTy: ",Ty.toString x," \t mty: ",Ty.toString y," "]
198    
199   fun varToString x=String.concat([" Var: ",Var.name x])(*, " Kind: ",kindToString (Var.kind x),varTys(Var.rTy x,Var.mTy x)])*)   fun varToString x=String.concat([" Var: ",Var.name x, " Kind: ",kindToString (Var.kind x),varTys(Var.rTy x,Var.mTy x)])
200    
201    
202     fun preBool(pre, true)=pre
203     | preBool(_,false)=""
204    
205      fun toString(E_LoadArr(_,nSize,oSize, arg, offset)) = String.concat[" LDArray<",iTos nSize ,      fun toString(E_LoadArr(_,nSize,oSize, arg, offset)) = String.concat[" LDArray<",iTos nSize ,
206              ":",iTos  oSize, ">", "( ", toString arg, ",", toString offset, ")"]              ":",iTos  oSize, ">", "( ", toString arg, ",", toString offset, ")"]
207       |  toString(E_LoadVec(_,nSize,oSize, arg, offset)) = String.concat[" LDVec<",iTos nSize ,       | toString (E_Op(rator, args)) = String.concat["OP_",Op.toString rator,"\n\t(",
208              ":",iTos  oSize, ">", "( ", toString arg, ",", toString offset, ")"]          String.concatWith",\n\t" (List.map toString args),")"]
209       | toString (E_Op(rator, args)) = String.concat["OP",Op.toString rator,"(",       | toString (E_Cons(nSize, oSize,args)) =String.concat ["ConsExp:", Int.toString nSize,Int.toString oSize, "(",
         String.concatWith"," (List.map toString args),")"]  
      | toString (E_Cons(ty, sizeO,args)) =String.concat ["ConsExp:", Ty.toString ty,Int.toString sizeO, "(",  
210          String.concatWith"," (List.map toString args),")"]          String.concatWith"," (List.map toString args),")"]
211       | toString (E_State x) = "StateVar"^stateVarToString x       | toString (E_State x) = "StateVar"^stateVarToString x
212       | toString (E_Var x) = varToString x       | toString (E_Var x) = varToString x
213       | toString (E_Lit lit) = Literal.toString lit       | toString (E_Lit lit) = Literal.toString lit
214       | toString(E_Apply(mathfn, args))=String.concat["Apply (",       | toString(E_Apply(mathfn, args))=String.concat["Apply (",
215          String.concatWith"," (List.map toString args),")"]          String.concatWith"," (List.map toString args),")"]
216       | toString(E_Mux(_,nSize,oSize,pieces,args)) =  String.concat["Mux",iTos nSize,"|",iTos oSize,"@ [",       | toString(E_Mux(_,isFill,oSize,pieces,args)) =  String.concat["Mux",preBool("isFilled", isFill),"|",iTos oSize,"@ [",
217          Ty.toString pieces ,"]",(String.concatWith "," (List.map toString args))]          Ty.toString pieces ,"]",(String.concatWith "," (List.map toString args))]
218           | toString(E_Holder(v,vs))= String.concat(["{Holder_for_ArrVar : ",Var.name  v, " Rest :"]@ (List.map Var.name vs)@["}"])           | toString(E_Holder(v,vs))= String.concat(["{Holder_for_ArrVar : ",Var.name  v, " Rest :"]@ (List.map Var.name vs)@["}"])
219    
220    
221      fun toStringS(S_Assign( [v],e))=String.concat["Assignments : ",Var.name v,"=",toString e]      fun toStringS(S_Assign( [v],e))=String.concat["Assignments : ",Var.name v,"=",toString e]
222          | toStringS(S_Assign( _,e))=String.concat ["Assignments : -multiple =",toString e]          | toStringS(S_Assign( _,e))=String.concat ["Assignments : -multiple =",toString e]
223          | toStringS(  S_Comment _ )=String.concat["Comment"]          | toStringS(  S_Comment _ )=String.concat["Comment"]
# Line 228  Line 232 
232          | toStringS(S_Active  )=String.concat["active"]          | toStringS(S_Active  )=String.concat["active"]
233          | toStringS( S_Stabilize  )=String.concat["stablize"]          | toStringS( S_Stabilize  )=String.concat["stablize"]
234          | toStringS( S_Die  )=String.concat["die"]          | toStringS( S_Die  )=String.concat["die"]
235          | toStringS(S_StoreVec(x,_,tyNew, tyOrig,pieces,args)) =let          | toStringS(S_StoreVec(x,A,f, tyOrig,ty,pieces,args)) =let
236              val a= String.concatWith "," (List.map toString args)              val a= String.concatWith "," (List.map toString args)
237              in              in
238                  String.concat["Statment Store: ",toString x,  "=",iTos tyNew,"|",iTos tyOrig,"@ [",                  String.concat["STMT ",toString x,  "= STORE",preBool("_aligned_",A),preBool("_filled_",f),"|",iTos tyOrig,Ty.toString ty,"@ [",
239                  Ty.toString pieces ,"]",a]                  Ty.toString pieces ,"]",a]
240              end              end
241           | toStringS (S_Cons(x,_,ty, args)) = String.concat ["ConsStmt:", Var.name x,kindToString(Var.kind x), "=",Ty.toString ty, "(",           | toStringS (S_Cons(x,oSize, args)) = String.concat ["ConsStmt:", Var.name x,kindToString(Var.kind x), "=",iTos oSize, "(",
242           String.concatWith"," (List.map toString args),")"]           String.concatWith"," (List.map toString args),")"]
243    
244        fun toStringSs e=String.concat(List.map toStringS e)
245    
246        end        end

Legend:
Removed from v.2794  
changed lines
  Added in v.2795

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