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

SCM Repository

[diderot] Diff of /branches/ein16/src/compiler/high-il/normalize-ein.sml
ViewVC logotype

Diff of /branches/ein16/src/compiler/high-il/normalize-ein.sml

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

revision 3604, Tue Jan 19 01:24:00 2016 UTC revision 3678, Mon Feb 15 19:36:00 2016 UTC
# Line 158  Line 158 
158              |  _                        => setDiv(rewrite e1, rewrite e2)              |  _                        => setDiv(rewrite e1, rewrite e2)
159              (*end case*))              (*end case*))
160              (*************Algebraic Rewrites Opn **************)              (*************Algebraic Rewrites Opn **************)
161    (*
162    | E.Opn(E.Add,[E.Sum([(E.V 4,0,2)],E.Opn(E.Prod,[E.Tensor(0,[E.V 4,E.V 0]), E.Tensor(1,[E.V 4,E.V 1])])),E.Opn(E.Prod,[E.Tensor(2,[]),
163    E.Sum([(E.V 8,0,2)],E.Opn(E.Prod,[E.Tensor(0,[E.V 8,E.V 0]), E.Tensor(4,[E.V 8,E.V 1])]))])]) => let
164    val a = E.Tensor(0,[E.V 2,E.V 0])
165    val b = E.Tensor(1,[E.V 2,E.V 1])
166    val c = E.Tensor(4,[E.V 2,E.V 1])
167    val s = E.Tensor(2,[])
168    val add = E.Opn(E.Add,[b,E.Opn(E.Prod,[s,c])])
169    val prod= E.Sum([(E.V 2,0,2)],E.Opn(E.Prod,[a,add]))
170    val _ =print(String.concat["\nMatched"])
171    in prod end
172    *)
173          | E.Opn(E.Add,es)          => let          | E.Opn(E.Add,es)          => let
174              val (change,body')= mkAdd(List.map rewrite es)              val (change,body')= mkAdd(List.map rewrite es)
175              in if (change=1) then ( changed:=true;body') else body' end              in if (change=1) then ( changed:=true;body') else body' end

Legend:
Removed from v.3604  
changed lines
  Added in v.3678

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