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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/c-util/tree-to-c-fn.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/c-util/tree-to-c-fn.sml

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

revision 1939, Mon Jul 2 21:11:07 2012 UTC revision 1945, Fri Jul 6 14:54:21 2012 UTC
# Line 155  Line 155 
155                  if (1 < m) andalso (m <= 4) andalso (m = n) andalso (n = p)                  if (1 < m) andalso (m <= 4) andalso (m = n) andalso (n = p)
156                    then CL.E_Apply(N.mulMatMat(m,n,p), args)                    then CL.E_Apply(N.mulMatMat(m,n,p), args)
157                    else raise Fail "unsupported matrix-matrix multiply"                    else raise Fail "unsupported matrix-matrix multiply"
158                | (Op.ColonMul(Ty.TensorTy dd1, Ty.TensorTy dd2), args) =>
159                    CL.E_Apply(N.colonMul(dd1, dd2), args)
160              | (Op.Cross, args) => CL.E_Apply(N.cross(), args)              | (Op.Cross, args) => CL.E_Apply(N.cross(), args)
161              | (Op.Norm(Ty.TensorTy[n]), args) => CL.E_Apply(N.length n, args)              | (Op.Norm(Ty.TensorTy[n]), args) => CL.E_Apply(N.length n, args)
162              | (Op.Norm(Ty.TensorTy[m,n]), args) => CL.E_Apply(N.normMat(m,n), args)              | (Op.Norm(Ty.TensorTy[m,n]), args) => CL.E_Apply(N.normMat(m,n), args)
# Line 355  Line 357 
357                  if (1 < m) andalso (m <= 4) andalso (m = n) andalso (n = p)                  if (1 < m) andalso (m <= 4) andalso (m = n) andalso (n = p)
358                    then [CL.mkCall(N.mulTen3Vec(m,n,p), lhs :: trExps(env, args))]                    then [CL.mkCall(N.mulTen3Vec(m,n,p), lhs :: trExps(env, args))]
359                    else raise Fail "unsupported tensor-vector multiply"                    else raise Fail "unsupported tensor-vector multiply"
360                | IL.E_Op(Op.ColonMul(Ty.TensorTy dd1, Ty.TensorTy dd2), args) =>
361                    [CL.mkCall(N.colonMul(dd1, dd2), lhs :: trExps(env, args))]
362              | IL.E_Op(Op.EigenVals2x2, [m]) => let              | IL.E_Op(Op.EigenVals2x2, [m]) => let
363                  val (m, stms) = expToVar (env, CL.T_Named(N.matTy(2,2)), "m", m)                  val (m, stms) = expToVar (env, CL.T_Named(N.matTy(2,2)), "m", m)
364                  in                  in
# Line 437  Line 441 
441                  end                  end
442              | IL.E_State x => (case IL.StateVar.ty x              | IL.E_State x => (case IL.StateVar.ty x
443                   of Ty.TensorTy[n,m] => [CL.mkCall(N.copyMat(n,m), [lhs, VarToC.rvalueStateVar x])]                   of Ty.TensorTy[n,m] => [CL.mkCall(N.copyMat(n,m), [lhs, VarToC.rvalueStateVar x])]
444                    | Ty.TensorTy[n,m,l] => [CL.mkCall(N.copyTen(n,m,l), [lhs, VarToC.rvalueStateVar x])]                    | Ty.TensorTy[n,m,l] => [CL.mkCall(N.copyTen3(n,m,l), [lhs, VarToC.rvalueStateVar x])]
445                    | _ => [CL.mkAssign(lhs, VarToC.rvalueStateVar x)]                    | _ => [CL.mkAssign(lhs, VarToC.rvalueStateVar x)]
446                  (* end case *))                  (* end case *))
447              | IL.E_Var x => (case IL.Var.ty x              | IL.E_Var x => (case IL.Var.ty x
448                   of Ty.TensorTy[n,m] => [CL.mkCall(N.copyMat(n,m), [lhs, VarToC.rvalueVar(env, x)])]                   of Ty.TensorTy[n,m] => [CL.mkCall(N.copyMat(n,m), [lhs, VarToC.rvalueVar(env, x)])]
449                    | Ty.TensorTy[n,m,l] => [CL.mkCall(N.copyTen(n,m,l), [lhs, VarToC.rvalueVar(env, x)])]                    | Ty.TensorTy[n,m,l] => [CL.mkCall(N.copyTen3(n,m,l), [lhs, VarToC.rvalueVar(env, x)])]
450                    | _ => [CL.mkAssign(lhs, VarToC.rvalueVar(env, x))]                    | _ => [CL.mkAssign(lhs, VarToC.rvalueVar(env, x))]
451                  (* end case *))                  (* end case *))
452              | _ => [CL.mkAssign(lhs, trExp(env, rhs))]              | _ => [CL.mkAssign(lhs, trExp(env, rhs))]

Legend:
Removed from v.1939  
changed lines
  Added in v.1945

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