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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/c-target/c-target.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/c-target/c-target.sml

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

revision 806, Tue Apr 12 14:07:55 2011 UTC revision 812, Tue Apr 12 18:01:07 2011 UTC
# Line 308  Line 308 
308          fun dot (E(e1, T_Vec n1), E(e2, T_Vec n2)) = E(CL.E_Apply(RN.dot n1, [e1, e2]), T_Real)          fun dot (E(e1, T_Vec n1), E(e2, T_Vec n2)) = E(CL.E_Apply(RN.dot n1, [e1, e2]), T_Real)
309            | dot _ = raise Fail "invalid argument to dot"            | dot _ = raise Fail "invalid argument to dot"
310    
311            fun mulVecMat (E(vec, T_Vec m), E(mat, T_Mat(m', n))) =
312                  if (1 < m) andalso (m < 4) andalso (m = m') andalso (m = n)
313                    then E(CL.E_Apply(RN.mulVecMat(m,n), [vec, mat]), T_Vec n)
314                    else raise Fail "unsupported vector-matrix multiply"
315              | mulVecMat _ = raise Fail "invalid argument to mulVecMat"
316    
317            fun mulMatVec (E(mat, T_Mat(m, n)), E(vec, T_Vec n')) =
318                  if (1 < m) andalso (m < 4) andalso (m = n) andalso (n = n')
319                    then E(CL.E_Apply(RN.mulMatVec(m,n), [mat, vec]), T_Vec n)
320                    else raise Fail "unsupported matrix-vector multiply"
321              | mulMatVec _ = raise Fail "invalid argument to mulMatVec"
322    
323            fun mulMatMat (E(mat1, T_Mat(m, n)), E(mat2, T_Mat(n', p))) =
324                  if (1 < m) andalso (m < 4) andalso (m = n) andalso (n = p)
325                    then E(CL.E_Apply(RN.mulMatMat(m,n,p), [mat1, mat2]), T_Mat(m, p))
326                    else raise Fail "unsupported matrix-matrix multiply"
327              | mulMatMat _ = raise Fail "invalid argument to mulMatMat"
328    
329          fun cross (E(e1, T_Vec 3), E(e2, T_Vec 3)) = E(CL.E_Apply(RN.cross(), [e1, e2]), T_Vec 3)          fun cross (E(e1, T_Vec 3), E(e2, T_Vec 3)) = E(CL.E_Apply(RN.cross(), [e1, e2]), T_Vec 3)
330            | cross _ = raise Fail "invalid argument to cross"            | cross _ = raise Fail "invalid argument to cross"
331    

Legend:
Removed from v.806  
changed lines
  Added in v.812

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