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 682, Thu Mar 24 00:08:08 2011 UTC revision 683, Thu Mar 24 00:42:27 2011 UTC
# Line 63  Line 63 
63        | cvtTy T_Real = !RN.gRealTy        | cvtTy T_Real = !RN.gRealTy
64        | cvtTy (T_Vec n) = CL.T_Named(RN.vecTy n)        | cvtTy (T_Vec n) = CL.T_Named(RN.vecTy n)
65        | cvtTy (T_IVec n) = CL.T_Named(RN.ivecTy n)        | cvtTy (T_IVec n) = CL.T_Named(RN.ivecTy n)
66          | cvtTy (T_Mat(n,m)) = CL.T_Named(RN.matTy(n,m))
67        | cvtTy (T_Image(n, _)) = CL.T_Ptr(CL.T_Named(RN.imageTy n))        | cvtTy (T_Image(n, _)) = CL.T_Ptr(CL.T_Named(RN.imageTy n))
68        | cvtTy (T_Ptr ty) = CL.T_Ptr(CL.T_Num ty)        | cvtTy (T_Ptr ty) = CL.T_Ptr(CL.T_Num ty)
69    
# Line 295  Line 296 
296          fun normalize (E(e, T_Vec n)) = E(CL.E_Apply(RN.normalize n, [e]), T_Vec n)          fun normalize (E(e, T_Vec n)) = E(CL.E_Apply(RN.normalize n, [e]), T_Vec n)
297            | normalize _ = raise Fail "invalid argument to length"            | normalize _ = raise Fail "invalid argument to length"
298    
299          (* matrix operations *)
300            fun trace (E(e, T_Mat(n,m))) = if (n = m) andalso (1 < n) andalso (m <= 4)
301                  then E(CL.E_Apply(RN.trace n, [e]), T_Real)
302                  else raise Fail "invalid matrix argument for trace"
303              | trace _ = raise Fail "invalid argument to trace"
304    
305        (* comparisons *)        (* comparisons *)
306          local          local
307            fun checkTys (ty1, ty2) =            fun checkTys (ty1, ty2) =

Legend:
Removed from v.682  
changed lines
  Added in v.683

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