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

SCM Repository

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

Diff of /branches/vis12/src/compiler/simplify/simple.sml

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

revision 511, Tue Feb 8 17:01:43 2011 UTC revision 1116, Thu May 5 04:49:02 2011 UTC
# Line 18  Line 18 
18      datatype program = Program of {      datatype program = Program of {
19          globals : var list,          globals : var list,
20          globalInit : block,          globalInit : block,
21          strands : strand list          strands : strand list,
22          (* initialization *)          init : init                     (* block evaluates any vars used in init *)
23          }
24    
25        and init = Initially of {
26            isArray : bool,
27            rangeInit : block,
28            iters : {param : var, lo : var, hi : var} list,
29            create : create
30          }
31    
32        and create = C_Create of {
33            argInit : block,
34            name : Atom.atom,
35            args : var list
36          }
37    
38        and iter = I_Range of {
39            rangeInit : block,
40            param : var,
41            lo : var,
42            hi : var
43        }        }
44    
45      and strand = Strand of {      and strand = Strand of {
# Line 35  Line 55 
55      and block = Block of stmt list      and block = Block of stmt list
56    
57      and stmt      and stmt
58        = S_Assign of var * exp        = S_Var of var                            (* introduce an uninitialized local variable. *)
59                                                    (* These stmts are needed for the results of *)
60                                                    (* conditional expressions *)
61          | S_Assign of var * exp
62        | S_IfThenElse of var * block * block        | S_IfThenElse of var * block * block
63        | S_New of Atom.atom * var list        | S_New of Atom.atom * var list
64        | S_Die        | S_Die
# Line 49  Line 72 
72        | E_Cons of var list        | E_Cons of var list
73        | E_Slice of var * var option list * Types.ty     (* tensor slicing *)        | E_Slice of var * var option list * Types.ty     (* tensor slicing *)
74        | E_Input of Types.ty * string * var option        | E_Input of Types.ty * string * var option
75        | E_Field of FieldDef.field_def        | E_LoadImage of ImageInfo.info * var
       | E_LoadImage of ImageInfo.info  
   
     and create = C_Create of {  
         argInit : block,  
         name : Atom.atom,  
         args : var list  
       }  
   
     and iter = I_Range of {  
         rangeInit : block,  
         param : var,  
         lo : var,  
         hi : var  
       }  
76    
77      fun typeOf (E_Var x) = Var.monoTypeOf x      fun typeOf (E_Var x) = Var.monoTypeOf x
78        | typeOf (E_Lit lit) = (case lit        | typeOf (E_Lit lit) = (case lit
# Line 86  Line 95 
95        | typeOf (E_Cons[]) = raise Fail "impossible empty E_Cons"        | typeOf (E_Cons[]) = raise Fail "impossible empty E_Cons"
96        | typeOf (E_Slice(_, _, ty)) = ty        | typeOf (E_Slice(_, _, ty)) = ty
97        | typeOf (E_Input(ty, _, _)) = ty        | typeOf (E_Input(ty, _, _)) = ty
98        | typeOf (E_Field _) = raise Fail "FIXME: E_Field"        | typeOf (E_LoadImage(ImageInfo.ImgInfo{dim, ty=(dd, _), ...}, _)) =
99        | typeOf (E_LoadImage _) = raise Fail "FIXME: E_LoadImage"            Types.T_Image{
100                  dim = Types.DimConst dim,
101                  shape = Types.Shape(List.map Types.DimConst dd)
102                }
103    
104    end    end

Legend:
Removed from v.511  
changed lines
  Added in v.1116

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