Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

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

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

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)
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]))