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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/high-to-mid/probe.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/high-to-mid/probe.sml

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

revision 547, Thu Feb 17 14:57:07 2011 UTC revision 548, Thu Feb 17 22:41:53 2011 UTC
# Line 108  Line 108 
108    
109    (* generate code for probing the field (D^k (v * h)) at pos *)    (* generate code for probing the field (D^k (v * h)) at pos *)
110      fun expand {result, img, v, h, k, pos} = let      fun expand {result, img, v, h, k, pos} = let
111            val ImageInfo.ImgInfo{dim, ty=([], ty), ...} = v            val ImageInfo.ImgInfo{dim, ty=([], rTy), ...} = v
112            val s = Kernel.support h            val s = Kernel.support h
113            val vecsTy = DstTy.VecTy(2*s) (* vectors of coefficients cover support of kernel *)            val vecsTy = DstTy.VecTy(2*s) (* vectors of coefficients cover support of kernel *)
114            val vecDimTy = DstTy.VecTy dim            val vecDimTy = DstTy.VecTy dim
# Line 118  Line 118 
118            val nd = DstV.new ("nd", vecDimTy)            val nd = DstV.new ("nd", vecDimTy)
119            val n = DstV.new ("n", DstTy.IVecTy dim)            val n = DstV.new ("n", DstTy.IVecTy dim)
120            val transformCode = [            val transformCode = [
121                    assign(x, DstOp.PosToImgSpace dim, [img, pos]),                    assign(x, DstOp.PosToImgSpace v, [img, pos]),
122                    assign(nd, DstOp.Floor dim, [x]),                    assign(nd, DstOp.Floor dim, [x]),
123                    assign(f, DstOp.Sub vecDimTy, [x, nd]),                    assign(f, DstOp.Sub vecDimTy, [x, nd]),
124                    assign(n, DstOp.TruncToInt dim, [nd])                    assign(n, DstOp.TruncToInt dim, [nd])
# Line 198  Line 198 
198                                (indices, code)                                (indices, code)
199                              end                              end
200                        val (indices, indicesCode) = computeIndices (0, offsets)                        val (indices, indicesCode) = computeIndices (0, offsets)
201                        val a = DstV.new ("a", DstTy.AddrTy)                        val a = DstV.new ("a", DstTy.AddrTy v)
202                        in                        in
203                          indicesCode @ [                          indicesCode @ [
204                              assign(a, DstOp.VoxelAddress dim, img::indices),                              assign(a, DstOp.VoxelAddress v, img::indices),
205                              assign(vox, DstOp.LoadVoxels(ty, 2*s), [a])                              assign(vox, DstOp.LoadVoxels(v, 2*s), [a])
206                            ] @ code                            ] @ code
207                        end                        end
208                  in                  in

Legend:
Removed from v.547  
changed lines
  Added in v.548

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