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

SCM Repository

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

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

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

revision 641, Thu Mar 17 18:00:15 2011 UTC revision 642, Thu Mar 17 20:46:04 2011 UTC
# Line 176  Line 176 
176     *     *
177     * the address is given by     * the address is given by
178     *     *
179     *    base + i_1 + N_2 * (i_2 + N_3 * (... + N_d * i_d) ...))     *    base + i_1 + N_1 * (i_2 + N_2 * (... + N_{d-1} * i_d) ...))
180     *     *
181     * where     * where
182     *    base    -- base address of the image data     *    base    -- base address of the image data
# Line 188  Line 188 
188     * elements.     * elements.
189     *)     *)
190      fun expandVoxelAddress (result, info, img::ix1::indices) = let      fun expandVoxelAddress (result, info, img::ix1::indices) = let
191            val ImageInfo.ImgInfo{dim, ty=(d, rTy), sizes=_::sizes, ...} = info            val ImageInfo.ImgInfo{dim, ty=(d, rTy), sizes=sizes, ...} = info
192              val sizes = List.take (sizes, List.length sizes - 1)
193          (* generate the address computation code in reverse order *)          (* generate the address computation code in reverse order *)
194            fun gen (d, [n], [ix]) = let            fun gen (d, [n], [ix]) = let
195                  val n' = DstIL.Var.new ("n" ^ Int.toString d, DstTy.intTy)                  val n' = DstIL.Var.new ("n" ^ Int.toString d, DstTy.intTy)

Legend:
Removed from v.641  
changed lines
  Added in v.642

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