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

SCM Repository

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

Diff of /branches/pure-cfg/src/compiler/cl-target/tree-to-cl.sml

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

revision 1668, Sun Dec 4 10:13:05 2011 UTC revision 1669, Sun Dec 4 10:42:01 2011 UTC
# Line 100  Line 100 
100              | IL.VK_Local => CL.mkVar(lookup(env, x))              | IL.VK_Local => CL.mkVar(lookup(env, x))
101            (* end case *))            (* end case *))
102    
   
   
103    (* matrix indexing *)    (* matrix indexing *)
104      fun matIndex (m, ix, jx) =      fun matIndex (m, ix, jx) = CL.mkSelect(CL.mkSubscript(m, ix), concat["s",jx])
               CL.mkSelect(CL.mkSubscript(m, ix), concat["s",jx])  
105    
106    (* translate a state-variable use *)    (* translate a state-variable use *)
107      fun trStateVar (IL.SV{name, ...}) = CL.mkIndirect(CL.mkVar "selfIn", name)      fun trStateVar (IL.SV{name, ...}) = CL.mkIndirect(CL.mkVar "selfIn", name)
# Line 342  Line 339 
339    
340      fun trAssign (env, lhs, rhs) = trSet (env, trLHSVar (env, lhs), rhs)      fun trAssign (env, lhs, rhs) = trSet (env, trLHSVar (env, lhs), rhs)
341    
   
342      fun trMultiAssign (env, lhs, IL.E_Op(rator, args)) = (case (lhs, rator, args)      fun trMultiAssign (env, lhs, IL.E_Op(rator, args)) = (case (lhs, rator, args)
343             of ([vals, vecs], Op.EigenVecs2x2, [m]) => let             of ([vals, vecs], Op.EigenVecs2x2, [m]) => let
344                  val (m, stms) = expToVar (env, CL.T_Named(RN.matTy(2,2)), "m", m)                  val (m, stms) = expToVar (env, CL.T_Named(RN.matTy(2,2)), "m", m)
# Line 423  Line 419 
419                        CL.mkDecl(                        CL.mkDecl(
420                          CL.T_Named RN.statusTy, sts,                          CL.T_Named RN.statusTy, sts,
421                          SOME(CL.I_Exp(CL.E_Apply(inputFn, [                          SOME(CL.I_Exp(CL.E_Apply(inputFn, [
422                          CL.E_Str name, CL.mkUnOp(CL.%&, CL.mkIndirect(CL.mkVar (RN.globalsVarName), lhs)), CL.mkBool hasDflt                              CL.mkStr name,
423                                CL.mkUnOp(CL.%&, CL.mkIndirect(CL.mkVar RN.globalsVarName, lhs)),
424                                CL.mkBool hasDflt
425                        ]))))                        ]))))
426                      ]                      ]
427                    in                    in

Legend:
Removed from v.1668  
changed lines
  Added in v.1669

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