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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/high-to-mid/coord-space-transform.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/high-to-mid/coord-space-transform.sml

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

revision 3735, Fri Apr 8 15:01:28 2016 UTC revision 3754, Thu Apr 14 22:45:39 2016 UTC
# Line 44  Line 44 
44    
45      fun assign (x, rator, args) = (x, IR.OP(rator, args))      fun assign (x, rator, args) = (x, IR.OP(rator, args))
46      fun assignEin (x, rator, args) = ((x, IR.EINAPP(rator, args)))      fun assignEin (x, rator, args) = ((x, IR.EINAPP(rator, args)))
47    
48      fun incUse (IR.V{useCnt, ...}) = (useCnt := !useCnt + 1)      fun incUse (IR.V{useCnt, ...}) = (useCnt := !useCnt + 1)
49    
50      (*getTys:int->ty*int list *int list      (*getTys:int->ty*int list *int list
51      *Returns types based on field dimension      *Returns types based on field dimension
52      * Really, just done literally so that 1-d fields pass the type-checker      * Really, just done literally so that 1-d fields pass the type-checker
# Line 62  Line 64 
64            val mty = Ty.TensorTy pty            val mty = Ty.TensorTy pty
65            val rty = Ty.TensorTy fty            val rty = Ty.TensorTy fty
66            val M = AvailRHS.addAssign (avail, "Mtransform", mty, IR.OP(Op.Transform info, [img]))            val M = AvailRHS.addAssign (avail, "Mtransform", mty, IR.OP(Op.Transform info, [img]))
   
67        val (mulOp, addOp) = if (dim = 1)        val (mulOp, addOp) = if (dim = 1)
68                  then (Mk.mulRR, Mk.addRR)                  then (Mk.mulRR, Mk.addRR)
69                  else (Mk.innerTT([dim, dim], [dim]), Mk.addTT[dim])                  else (Mk.innerTT([dim, dim], [dim]), Mk.addTT[dim])
         val _ = incUse M  
70            val x0 = AvailRHS.addAssign (avail, "imagespaceM", rty, IR.EINAPP(mulOp, [M, pos]))   (*Image-Space position*)            val x0 = AvailRHS.addAssign (avail, "imagespaceM", rty, IR.EINAPP(mulOp, [M, pos]))   (*Image-Space position*)
71          (*  val x0 = AvailRHS.addAssign (avail, "x0M", rty, IR.OP((Op.Translate info, [M])))    (*Image-Space position*)*)          (*  val x0 = AvailRHS.addAssign (avail, "x0M", rty, IR.OP((Op.Translate info, [M])))    (*Image-Space position*)*)
72            val T = AvailRHS.addAssign (avail, "Ttranslate", rty, IR.OP(Op.Translate info, [img]))            val T = AvailRHS.addAssign (avail, "Ttranslate", rty, IR.OP(Op.Translate info, [img]))
73        val x = AvailRHS.addAssign (avail, "imagespaceT", rty, IR.EINAPP(addOp, [x0, T]))        val x = AvailRHS.addAssign (avail, "imagespaceT", rty, IR.EINAPP(addOp, [x0, T]))
74           (* val x = AvailRHS.addAssign (avail, "aaa", rty, IR.OP(Op.Floor dim, [x0, T]))*)           (* val x = AvailRHS.addAssign (avail, "aaa", rty, IR.OP(Op.Floor dim, [x0, T]))*)
     val _ = incUse x0  
     val _ = incUse T  
75            in            in
76                incUse M; incUse x0; incUse T;
77              (M, x)              (M, x)
78            end            end
79    

Legend:
Removed from v.3735  
changed lines
  Added in v.3754

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