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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/mid-to-low/helper.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/mid-to-low/helper.sml

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

revision 3196, Fri May 29 18:42:37 2015 UTC revision 3262, Thu Sep 24 14:43:53 2015 UTC
# Line 55  Line 55 
55              (b,code)              (b,code)
56          end          end
57    
   
   
58      (* mkINt:int->Var*LowIL.ASSGN list      (* mkINt:int->Var*LowIL.ASSGN list
59      *)      *)
60      fun mkInt n=let      fun mkInt n=let
# Line 86  Line 84 
84      fun assgn(opss,args,pre,ty)=let      fun assgn(opss,args,pre,ty)=let
85          val a=DstIL.Var.new(pre ,ty)          val a=DstIL.Var.new(pre ,ty)
86          val code=DstIL.ASSGN (a,DstIL.OP(opss,args))          val code=DstIL.ASSGN (a,DstIL.OP(opss,args))
87          val _ =testp[LowToS.toStringAll(ty,code)]          val _ =(String.concat[LowToS.toStringAll(ty,code)])
88    
89          in          in
90              (a,[code])              (a,[code])
91          end          end
# Line 104  Line 103 
103      * ->Var*LowIL.ASSGN list      * ->Var*LowIL.ASSGN list
104      * Index Tensor at specific indices to give a scalar result      * Index Tensor at specific indices to give a scalar result
105      *)      *)
106      fun indexTensor(_,(_,_,args,id, [],ty)) =      fun indexTensor(_,(_,_,args,id, [],ty)) = (List.nth(args,id),[])
107          (List.nth(args,id),[])        | indexTensor(_,(_,_,_,_, [_,_,_],DstTy.TensorTy [_,_,_,_] )) = raise Fail "uneven"
108        | indexTensor(mapp,(lhs,params,args,id,ix,ty))= let        | indexTensor(mapp,(lhs,params,args,id,ix,ty))= let
109          val nU=List.nth(args,id)          val nU=List.nth(args,id)
110          val ixx=(List.map (fn (e1)=> mapIndex(e1,mapp)) ix)          val ixx=(List.map (fn (e1)=> mapIndex(e1,mapp)) ix)

Legend:
Removed from v.3196  
changed lines
  Added in v.3262

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