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

SCM Repository

[diderot] Diff of /trunk/src/compiler/simplify/simple.sml
ViewVC logotype

Diff of /trunk/src/compiler/simplify/simple.sml

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

revision 2635, Mon May 26 14:06:39 2014 UTC revision 2636, Tue May 27 16:18:36 2014 UTC
# Line 27  Line 27 
27        }        }
28    
29      datatype program = Program of {      datatype program = Program of {
30            props : StrandUtil.program_prop list,
31            inputs : (var * SimpleTypes.ty Inputs.input) list,
32          globals : var list,          globals : var list,
33          globalInit : block,          globalInit : block,
34          funcs : func list,          funcs : func list,
# Line 93  Line 95 
95        | E_Apply of var * var list * ty                          (* user-defined function *)        | E_Apply of var * var list * ty                          (* user-defined function *)
96        | E_Prim of AST.var * meta_arg list * var list * ty       (* Diderot builtin *)        | E_Prim of AST.var * meta_arg list * var list * ty       (* Diderot builtin *)
97        | E_Cons of var list        | E_Cons of var list
98          | E_Seq of var list
99        | E_Slice of var * var option list * ty                   (* tensor slicing *)        | E_Slice of var * var option list * ty                   (* tensor slicing *)
100        | E_Coerce of {srcTy : ty, dstTy : ty, x : var}        | E_Coerce of {srcTy : ty, dstTy : ty, x : var}
101        | E_Input of ty * string * string option * var option        | E_LoadImage of ty * string * ImageInfo.info
       | E_LoadImage of ImageInfo.info * var  
102    
103      fun typeOf (E_Var(V{ty, ...})) = ty      fun typeOf (E_Var(V{ty, ...})) = ty
104        | typeOf (E_Lit lit) = (case lit        | typeOf (E_Lit lit) = (case lit
# Line 120  Line 122 
122                    ])                    ])
123              (* end case *)              (* end case *)
124            end            end
125          | typeOf (E_Seq[]) = raise Fail "empty sequence not supported yet"
126          | typeOf (E_Seq(V{ty, ...}::xs)) = let
127              val d = List.length xs + 1
128              in
129                SimpleTypes.T_Sequence(ty, d)
130              end
131        | typeOf (E_Slice(_, _, ty)) = ty        | typeOf (E_Slice(_, _, ty)) = ty
132        | typeOf (E_Input(ty, _, _, _)) = ty        | typeOf (E_Coerce{dstTy, ...}) = dstTy
133        | typeOf (E_LoadImage(ImageInfo.ImgInfo{dim, ty=(dd, _), ...}, _)) =        | typeOf (E_LoadImage(ty, _, _)) = ty
           SimpleTypes.T_Image{dim = dim, shape = dd}  
134    
135    end    end

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

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