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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/mid-to-low/mid-to-low.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/mid-to-low/mid-to-low.sml

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

revision 430, Mon Oct 18 22:26:52 2010 UTC revision 431, Mon Oct 18 22:27:21 2010 UTC
# Line 38  Line 38 
38    (* compute the load address for a given set of voxels indices *)    (* compute the load address for a given set of voxels indices *)
39      fun computeVoxelAddress (info, vec) = ??      fun computeVoxelAddress (info, vec) = ??
40    
41        fun expandOp (env, y, rator, args) = let
42              fun assign rator' =
43                    [(y, DstIL.OP(rator', renameList(env, args)))]
44              in
45                case rator
46                 of SrcOp.Add ty =>
47                  | SrcOp.Sub ty =>
48                  | SrcOp.Mul ty =>
49                  | SrcOp.Div ty =>
50                  | SrcOp.Neg ty =>
51                  | SrcOp.LT ty =>
52                  | SrcOp.LTE ty =>
53                  | SrcOp.EQ ty =>
54                  | SrcOp.NEQ ty =>
55                  | SrcOp.GT ty =>
56                  | SrcOp.GTE ty =>
57                  | SrcOp.Not =>
58                  | SrcOp.Max =>
59                  | SrcOp.Min =>
60                  | SrcOp.Sin =>
61                  | SrcOp.Cos =>
62                  | SrcOp.Pow =>
63                  | SrcOp.Dot d =>
64                  | SrcOp.Cross =>
65                  | SrcOp.Select ty =>  * int
66                  | SrcOp.Norm d =>
67                  | SrcOp.Scale d =>
68                  | SrcOp.InvScale d =>
69                  | SrcOp.CL =>
70                  | SrcOp.PrincipleEvec ty =>
71                  | SrcOp.Subscript ty =>
72                  | SrcOp.Floor d =>
73                  | SrcOp.IntToReal =>
74                  | SrcOp.TruncToInt d =>
75                  | SrcOp.RoundToInt d =>
76                  | SrcOp.CeilToInt d =>
77                  | SrcOp.FloorToInt d =>
78                  | SrcOp.VoxelAddress info =>
79                  | SrcOp.LoadVoxels(rty, d) =>
80                  | SrcOp.Transform info =>
81                  | SrcOp.EvalKernel(d, h, k) =>
82                  | SrcOp.LoadImage info =>
83                  | SrcOp.Inside info =>
84                  | SrcOp.Input(ty, name) =>
85                  | SrcOp.InputWithDefault(ty, name) =>
86                  | _ => raise Fail("unexpected " ^ SrcOp.toString rator)
87                (* end case *)
88              end
89    
90    (* expand a SrcIL assignment to a list of DstIL assignments *)    (* expand a SrcIL assignment to a list of DstIL assignments *)
91      fun expand (env, (y, rhs)) = let      fun expand (env, (y, rhs)) = let
92            val y' = rename (env, y)            val y' = rename (env, y)

Legend:
Removed from v.430  
changed lines
  Added in v.431

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