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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/tree-il/lowOp-to-treeOp.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/tree-il/lowOp-to-treeOp.sml

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

revision 2829, Wed Nov 12 23:24:38 2014 UTC revision 2830, Tue Nov 18 17:48:05 2014 UTC
# Line 24  Line 24 
24      (*assignment, store-statement*)      (*assignment, store-statement*)
25      fun mkStmt(lhs,lhsKind,origrator,isFill,oSize,A,splitTy,ops)= (case origrator      fun mkStmt(lhs,lhsKind,origrator,isFill,oSize,A,splitTy,ops)= (case origrator
26          of SrcOp.sumVec _ => Dst.S_Assign([lhs], addSca ops)          of SrcOp.sumVec _ => Dst.S_Assign([lhs], addSca ops)
         | SrcOp.dotVec _  => Dst.S_Assign([lhs], addSca ops)  
27          | _               => (case lhsKind          | _               => (case lhsKind
28              of TreeIL.VK_Local  =>  Dst.S_Assign([lhs], Dst.E_Mux(A,isFill,oSize,splitTy,ops))              of TreeIL.VK_Local  =>  Dst.S_Assign([lhs], Dst.E_Mux(A,isFill,oSize,splitTy,ops))
29              | _ => Dst.S_StoreVec(Dst.E_Var lhs,0,A,isFill,oSize,Ty.TensorTy[oSize],splitTy, ops)              | _ => Dst.S_StoreVec(Dst.E_Var lhs,0,A,isFill,oSize,Ty.TensorTy[oSize],splitTy, ops)
# Line 36  Line 35 
35      (**************************************)      (**************************************)
36      (*creates a load when it is not a local variable *)      (*creates a load when it is not a local variable *)
37      fun getArg(lhsKind,t,count,aligned, nSize, oSize,offset)=let      fun getArg(lhsKind,t,count,aligned, nSize, oSize,offset)=let
38          fun getExp (Dst.E_Var a) =(case (DstV.kind a,DstV.ty a)          fun getExp (Dst.E_Var a) =(case (DstV.kind a)
39              of (TreeIL.VK_Local, Ty.TensorTy [n]) =>              of TreeIL.VK_Local =>t
                     if (n=nSize) then t  
                     else raise Fail (String.concat[" Looking for size ", Int.toString nSize," found ", Int.toString n])  
40              | _  => Dst.E_LoadArr(aligned, nSize,oSize,t, Dst.E_Lit(Literal.Int offset))              | _  => Dst.E_LoadArr(aligned, nSize,oSize,t, Dst.E_Lit(Literal.Int offset))
41              (*end case*))              (*end case*))
42             | getExp(Dst.E_State _)=t
43          | getExp (Dst.E_Mux(_,_,_,_,ops))= List.nth(ops,count)          | getExp (Dst.E_Mux(_,_,_,_,ops))= List.nth(ops,count)
44          | getExp a1 = raise Fail("Arg is not Mux or Var"^Dst.toString a1)          | getExp a1 = raise Fail("Arg to vector op is not Mux or Var. Found: "^Dst.toString a1)
45      in      in
46          getExp t          getExp t
47      end      end

Legend:
Removed from v.2829  
changed lines
  Added in v.2830

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