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

SCM Repository

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

Diff of /trunk/src/compiler/mid-to-low/mid-to-low.sml

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

revision 459, Wed Oct 27 12:54:03 2010 UTC revision 460, Wed Oct 27 16:11:13 2010 UTC
# Line 24  Line 24 
24      fun rename (env : var_env, x) = (case VTbl.find env x      fun rename (env : var_env, x) = (case VTbl.find env x
25             of SOME x' => x'             of SOME x' => x'
26              | NONE => let              | NONE => let
27                  val x' = DstIL.Var.new (SrcIL.Var.name x)                  val x' = DstIL.Var.new (SrcIL.Var.name x, SrcIL.Var.ty x)
28                  in                  in
29                    VTbl.insert env (x, x');                    VTbl.insert env (x, x');
30                    x'                    x'
# Line 39  Line 39 
39     *    h       -- the kernel     *    h       -- the kernel
40     *    k       -- the derivative of the kernel to evaluate     *    k       -- the derivative of the kernel to evaluate
41     *)     *)
42      fun expandKernel (result, d, h, k) = let      fun expandEvalKernel (result, d, h, k) = let
43            val {isCont, segs} = Kernel.curve (h, k)            val {isCont, segs} = Kernel.curve (h, k)
44            in            in
45    raise Fail "unimplemented"
46            end            end
47    
48    (* compute the load address for a given set of voxels indices *)    (* compute the load address for a given set of voxels indices *)
49      fun expandVoxelAddress (result, info) = ??      fun expandVoxelAddress (result, info) = raise Fail "unimplemented"
50    
51      fun expandOp (env, y, rator, args) = let      fun expandOp (env, y, rator, args) = let
52            fun assign rator' =            fun assign rator' =
# Line 71  Line 72 
72                | SrcOp.Pow => assign (DstOp.Pow)                | SrcOp.Pow => assign (DstOp.Pow)
73                | SrcOp.Dot d => assign (DstOp.Dot d)                | SrcOp.Dot d => assign (DstOp.Dot d)
74                | SrcOp.Cross => assign (DstOp.Cross)                | SrcOp.Cross => assign (DstOp.Cross)
75                | SrcOp.Select ty => assign (DstOp.Select ty) * int                | SrcOp.Select(ty, i)=> assign (DstOp.Select(ty, i))
76                | SrcOp.Norm d => assign (DstOp.Norm d)                | SrcOp.Norm d => assign (DstOp.Norm d)
77                | SrcOp.Scale d => assign (DstOp.Scale d)                | SrcOp.Scale d => assign (DstOp.Scale d)
78                | SrcOp.InvScale d => assign (DstOp.InvScale d)                | SrcOp.InvScale d => assign (DstOp.InvScale d)
# Line 86  Line 87 
87                | SrcOp.FloorToInt d => assign (DstOp.FloorToInt d)                | SrcOp.FloorToInt d => assign (DstOp.FloorToInt d)
88                | SrcOp.VoxelAddress info => expandVoxelAddress (y, info)                | SrcOp.VoxelAddress info => expandVoxelAddress (y, info)
89                | SrcOp.LoadVoxels(rty, d) => assign (DstOp.LoadVoxels(rty, d))                | SrcOp.LoadVoxels(rty, d) => assign (DstOp.LoadVoxels(rty, d))
90                | SrcOp.Transform info => assign (DstOp.Transform info)                | SrcOp.PosToImgSpace info => assign (DstOp.PosToImgSpace info)
91                  | SrcOp.GradToWorldSpace info => assign (DstOp.GradToWorldSpace info)
92                | SrcOp.EvalKernel(d, h, k) => expandEvalKernel(y, d, h, k)                | SrcOp.EvalKernel(d, h, k) => expandEvalKernel(y, d, h, k)
93                | SrcOp.LoadImage info => assign (DstOp.LoadImage info)                | SrcOp.LoadImage info => assign (DstOp.LoadImage info)
94                | SrcOp.Inside info => assign (DstOp.Inside info)                | SrcOp.Inside info => assign (DstOp.Inside info)
95                | SrcOp.Input(ty, name) => assign (DstOp.Input(ty, name))                | SrcOp.Input(ty, name) => assign (DstOp.Input(ty, name))
96                | SrcOp.InputWithDefault(ty, name) => assign (DstOp.InputWithDefault(ty, name))                | SrcOp.InputWithDefault(ty, name) => assign (DstOp.InputWithDefault(ty, name))
               | _ => raise Fail("unexpected " ^ SrcOp.toString rator)  
97              (* end case *)              (* end case *)
98            end            end
99    

Legend:
Removed from v.459  
changed lines
  Added in v.460

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