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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/high-to-mid/split-einHtM.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/high-to-mid/split-einHtM.sml

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

revision 2552, Fri Feb 28 19:03:27 2014 UTC revision 2553, Sun Mar 2 19:53:33 2014 UTC
# Line 263  Line 263 
263  fun handleSumProd(params, ind,sx,list1,args)=let  fun handleSumProd(params, ind,sx,list1,args)=let
264      val id=ref (length params)      val id=ref (length params)
265      val n=length ind      val n=length ind
266        val m=print (String.concat["\n In Sum Prod", "n",Int.toString(n)])
267    
268    
269    
270      fun g(lft,[],_)=(1,lft)      fun g(lft,[],_)=(1,lft) (*lft-outer index*)
271          | g(lft,(E.V s,0,ub)::es,n')=if(s=n') then g(lft@[ub],es,n'+1) else (0,[])          | g(lft,(E.V s,0,ub)::es,n')=if(s=n') then (print "match";g(lft@[ub],es,n'+1)) else (0,[])
272          | g _ =(0,[])          | g _ =(0,[]) (*Can't be split, weird bound*)
273    
274      val (c,index')= g([],sx,n)      val (c,index')= g([],sx,n)
275    
# Line 304  Line 305 
305          | E.Prod(E.Img _  :: _)=>notDone          | E.Prod(E.Img _  :: _)=>notDone
306          | E.Neg(E.Neg e)=> gen e          | E.Neg(E.Neg e)=> gen e
307          | E.Neg e=>  handleNeg(params, index,e,args)          | E.Neg e=>  handleNeg(params, index,e,args)
308          | E.Add a => handleAdd(params, index,a,args)  | E.Add a => (print "Add";handleAdd(params, index,a,args))
309          | E.Sub(E.Sub(a,b),E.Sub(c,d))=> gen(E.Sub(E.Add[a,d],E.Add[b,c]))          | E.Sub(E.Sub(a,b),E.Sub(c,d))=> gen(E.Sub(E.Add[a,d],E.Add[b,c]))
310          | E.Sub(E.Sub(a,b),e2)=>gen (E.Sub(a,E.Add[b,e2]))          | E.Sub(E.Sub(a,b),e2)=>gen (E.Sub(a,E.Add[b,e2]))
311          | E.Sub(e1,E.Sub(c,d))=>gen(E.Add([E.Sub(e1,c),d]))          | E.Sub(e1,E.Sub(c,d))=>gen(E.Add([E.Sub(e1,c),d]))
312          | E.Sub(e1,e2)=>handleSub(params, index,e1,e2,args)  | E.Sub(e1,e2)=>(print "SUB";handleSub(params, index,e1,e2,args))
313          | E.Div(E.Div(a,b),E.Div(c,d))=> gen(E.Div(E.Prod[a,d],E.Prod[b,c]))          | E.Div(E.Div(a,b),E.Div(c,d))=> gen(E.Div(E.Prod[a,d],E.Prod[b,c]))
314          | E.Div(E.Div(a,b),c)=> gen(E.Div(a, E.Prod[b,c]))          | E.Div(E.Div(a,b),c)=> gen(E.Div(a, E.Prod[b,c]))
315          | E.Div(a,E.Div(b,c))=> gen(E.Div(E.Prod[a,c],b))          | E.Div(a,E.Div(b,c))=> gen(E.Div(E.Prod[a,c],b))
316          | E.Div(e1,e2)=>handleDiv(params, index,e1,e2,args)          | E.Div(e1,e2)=>handleDiv(params, index,e1,e2,args)
317          | E.Prod e=> handleProd(params, index,e,args)  | E.Prod e=> (print "PROD ";handleProd(params, index,e,args))
318    
319          | E.Sum(_,E.Prod(E.Img _ :: _ ))=>notDone          | E.Sum(_,E.Prod(E.Img _ :: _ ))=>notDone
320          | E.Sum(sx,E.Prod e)=> handleSumProd(params, index,sx,e,args)  | E.Sum(sx,E.Prod e)=>(print "CAT"; handleSumProd(params, index,sx,e,args))
321    
322    
323          | _=> notDone          | _=> notDone

Legend:
Removed from v.2552  
changed lines
  Added in v.2553

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