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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/cxx-util/tree-to-cxx.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/cxx-util/tree-to-cxx.sml

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

revision 4276, Tue Jul 26 18:19:23 2016 UTC revision 4277, Tue Jul 26 18:33:21 2016 UTC
# Line 165  Line 165 
165                 * to generate the constructor application for TensorRef!                 * to generate the constructor application for TensorRef!
166                 *)                 *)
167              | (Op.TensorRef shp, [a]) => CL.mkCons(RN.tensorRefTy shp, [a])              | (Op.TensorRef shp, [a]) => CL.mkCons(RN.tensorRefTy shp, [a])
             | (Op.EigenVals2x2, [a]) => raise Fail "FIXME: EigenVals2x2"  
             | (Op.EigenVals3x3, [a]) => raise Fail "FIXME: EigenVals3x3"  
168              | (Op.Select(ty, i), [a]) => raise Fail "FIXME: Select"              | (Op.Select(ty, i), [a]) => raise Fail "FIXME: Select"
169    (* FIXME: if this is a sequence of tensors, then the result should be a TensorRef *)
170              | (Op.Subscript ty, [a, b]) => CL.mkSubscript(a, b)              | (Op.Subscript ty, [a, b]) => CL.mkSubscript(a, b)
171              | (Op.MkDynamic(ty, n), [a]) => CL.mkCons(dynseqTy(env, ty), [mkInt n, a])              | (Op.MkDynamic(ty, n), [a]) => CL.mkCons(dynseqTy(env, ty), [mkInt n, a])
172  (* FIXME: eventually we should do some kind of liveness analysis to enable in situ operations *)  (* FIXME: eventually we should do some kind of liveness analysis to enable in situ operations *)
# Line 274  Line 273 
273                   of IR.E_Op(Op.VToInt(w, _), [a]) =>                   of IR.E_Op(Op.VToInt(w, _), [a]) =>
274                        CL.mkCall (RN.vtoi w, [lhs, trExp(env, a)]) :: stms                        CL.mkCall (RN.vtoi w, [lhs, trExp(env, a)]) :: stms
275                    | IR.E_Op(Op.TensorCopy shp, [a]) => CL.mkAssign(lhs, trExp (env, a)) :: stms                    | IR.E_Op(Op.TensorCopy shp, [a]) => CL.mkAssign(lhs, trExp (env, a)) :: stms
276                      | IR.E_Op(Op.EigenVals2x2, [a]) =>
277                          CL.mkCall("eigenvals", [trExp (env, a), lhs]) :: stms
278                      | IR.E_Op(Op.EigenVals3x3, [a]) =>
279                          CL.mkCall("eigenvals", [trExp (env, a), lhs]) :: stms
280                    | IR.E_Pack({wid, ...}, args) =>                    | IR.E_Pack({wid, ...}, args) =>
281                        CL.mkCall (RN.vpack wid, lhs :: List.map (fn e => trExp(env, e)) args) :: stms                        CL.mkCall (RN.vpack wid, lhs :: List.map (fn e => trExp(env, e)) args) :: stms
282                    | IR.E_Cons(args, _) => let                    | IR.E_Cons(args, _) => let
# Line 307  Line 310 
310                    ]                    ]
311  *)  *)
312                | IR.E_Op(Op.TensorCopy shp, [a]) => CL.mkDeclInit(ty, lhs, trExp(env, a)) :: stms                | IR.E_Op(Op.TensorCopy shp, [a]) => CL.mkDeclInit(ty, lhs, trExp(env, a)) :: stms
313                  | IR.E_Op(Op.EigenVals2x2, [a]) =>
314                      CL.mkDecl(ty, lhs, NONE) ::
315                      CL.mkCall("eigenvals", [trExp (env, a), CL.mkVar lhs]) :: stms
316                  | IR.E_Op(Op.EigenVals3x3, [a]) =>
317                      CL.mkDecl(ty, lhs, NONE) ::
318                      CL.mkCall("eigenvals", [trExp (env, a), CL.mkVar lhs]) :: stms
319                | IR.E_Pack({wid, ...}, args) =>                | IR.E_Pack({wid, ...}, args) =>
320                    CL.mkCall (RN.vpack wid, CL.mkVar lhs :: List.map (fn e => trExp(env, e)) args) ::                    CL.mkCall (RN.vpack wid, CL.mkVar lhs :: List.map (fn e => trExp(env, e)) args) ::
321                    CL.mkDecl(ty, lhs, NONE) :: stms                    CL.mkDecl(ty, lhs, NONE) :: stms
# Line 329  Line 338 
338    
339      fun trMultiAssign (env, lhs, IR.E_Op(rator, args)) = (case (lhs, rator, args)      fun trMultiAssign (env, lhs, IR.E_Op(rator, args)) = (case (lhs, rator, args)
340             of ([vals, vecs], Op.EigenVecs2x2, [exp]) =>             of ([vals, vecs], Op.EigenVecs2x2, [exp]) =>
341                  mkDiderotCall("eigenvecs", [trExp (env, exp), vals, vecs])                  CL.mkCall("eigenvecs", [trExp (env, exp), vals, vecs])
342              | ([vals, vecs], Op.EigenVecs3x3, [exp]) =>              | ([vals, vecs], Op.EigenVecs3x3, [exp]) =>
343                  mkDiderotCall("eigenvecs", [trExp (env, exp), vals, vecs])                  CL.mkCall("eigenvecs", [trExp (env, exp), vals, vecs])
344              | _ => raise Fail "bogus multi-assignment"              | _ => raise Fail "bogus multi-assignment"
345            (* end case *))            (* end case *))
346        | trMultiAssign (env, lhs, rhs) = raise Fail "bogus multi-assignment"        | trMultiAssign (env, lhs, rhs) = raise Fail "bogus multi-assignment"

Legend:
Removed from v.4276  
changed lines
  Added in v.4277

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