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/step3.sml
ViewVC logotype

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

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

revision 2627, Sat May 17 00:44:22 2014 UTC revision 2628, Wed May 21 04:02:06 2014 UTC
# Line 26  Line 26 
26      else d s      else d s
27    
28    
   
29  (*Get kernel and Image bindings*)  (*Get kernel and Image bindings*)
30  fun getKernel x  = (case SrcIL.Var.binding x  fun getKernel x  = (case SrcIL.Var.binding x
31      of SrcIL.VB_RHS(SrcIL.OP(SrcOp.Kernel(h, _),_))=> h      of SrcIL.VB_RHS(SrcIL.OP(SrcOp.Kernel(h, _),_))=> h
# Line 51  Line 50 
50          (a,[code])          (a,[code])
51      end      end
52    
   
 fun mkInt n= aaV(DstOp.C n,[],"Int",Sca)  
53  (*  (*
54    fun mkInt n= aaV(DstOp.C n,[],"Int",Sca)
55    *)
56  fun mkInt n=let  fun mkInt n=let
57      val a=DstIL.Var.new("Int" ,Sca)      val a=DstIL.Var.new("Int" ,Sca)
58      val code=DstIL.ASSGN (a,DstIL.LIT(Literal.Int n))      val code=DstIL.ASSGN (a,DstIL.LIT(Literal.Int n))
# Line 65  Line 64 
64          (a,[code])          (a,[code])
65      end      end
66    
67  *)  fun mkInt2 n=let
68    val a=DstIL.Var.new("Int" ,Sca)
69    val code=DstIL.ASSGN (a,DstIL.LIT( n))
70    val _ =(case testing
71    of 0=> 1
72    | _ => (print(tS.toStringAll(Sca,code));1)
73    (*end case*))
74    in
75    (a,[code])
76    end
77    
78    
79    
80    
81    
82  (*mk Multiple, Add Ids on list1*)  (*mk Multiple, Add Ids on list1*)
# Line 101  Line 112 
112      |_=> err"NONE Tensor Param")      |_=> err"NONE Tensor Param")
113    
114    
115  fun mkSca(mapp,(id,ix,(params,args)))= let  (*Just added Index options*)
116    fun mkSca(mapp,(id, [],(params,args)))=let
117          val nU=List.nth(args,id)
118         in
119            (nU,[])
120        end
121      | mkSca(mapp,(id, [ix],(params,args)))=let
122        val nU=List.nth(args,id)
123        val ix'=mapIndex(ix,mapp)
124        val argTy=getTensorTy(params,id)
125        in
126            aaV(DstOp.Index(argTy, ix'),[nU],"S-Index-"^Int.toString(id),Sca)
127        end
128    
129      | mkSca(mapp,(id,ix,(params,args)))= let
130      val nU=List.nth(args,id)      val nU=List.nth(args,id)
131      val ix'=DstTy.indexTy(List.map (fn (e1)=> mapIndex(e1,mapp)) ix)      val ix'=DstTy.indexTy(List.map (fn (e1)=> mapIndex(e1,mapp)) ix)
132      val argTy=getTensorTy(params,id)      val argTy=getTensorTy(params,id)

Legend:
Removed from v.2627  
changed lines
  Added in v.2628

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