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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/mid-to-low/mk-low-ir.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/mid-to-low/mk-low-ir.sml

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

revision 3890, Sat May 21 15:15:55 2016 UTC revision 3891, Sat May 21 16:19:41 2016 UTC
# Line 155  Line 155 
155            vecSum (avail, vecIX, vecMul (avail, vecIX, a, b))            vecSum (avail, vecIX, vecMul (avail, vecIX, a, b))
156    
157      fun tensorIndex (avail, mapp, arg, []) = arg      fun tensorIndex (avail, mapp, arg, []) = arg
158        | tensorIndex (avail, mapp, arg, ix) =        | tensorIndex (avail, mapp, arg, [ix]) = let
159              val Ty.TensorTy[d] = V.ty arg
160              in
161            add (            add (
162              avail, "r", Ty.realTy,              avail, "r", Ty.realTy,
163              IR.OP(Op.TensorIndex(V.ty arg, List.map (fn id => lookupMu(mapp, id)) ix), [arg]))                IR.OP(Op.VIndex(d, lookupMu(mapp, ix)), [arg]))
164              end
165      fun tensorIndexIX (avail, arg, []) = arg        | tensorIndex (avail, mapp, arg, ixs) =
       | tensorIndexIX (avail, arg, ix) =  
166            add (            add (
167              avail, "r", Ty.realTy,              avail, "r", Ty.realTy,
168              IR.OP(Op.TensorIndex(V.ty arg, ix), [arg]))              IR.OP(Op.TensorIndex(V.ty arg, List.map (fn ix => lookupMu(mapp, ix)) ixs), [arg]))
169    
170        fun tensorIndexIX (avail, arg, []) = arg
171          | tensorIndexIX (avail, arg, [ix]) = let
172              val Ty.TensorTy[d] = V.ty arg
173              in
174                add (avail, "r", Ty.realTy, IR.OP(Op.VIndex(d, ix), [arg]))
175              end
176          | tensorIndexIX (avail, arg, ixs) =
177              add (avail, "r", Ty.realTy, IR.OP(Op.TensorIndex(V.ty arg, ixs), [arg]))
178    
179      fun evalDelta (mapp, i, j) = let      fun evalDelta (mapp, i, j) = let
180            val i' = lookupMu (mapp, i)            val i' = lookupMu (mapp, i)

Legend:
Removed from v.3890  
changed lines
  Added in v.3891

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