Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/alpha/ra/alphaRewrite.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/alpha/ra/alphaRewrite.sml

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

revision 900, Tue Aug 14 15:10:12 2001 UTC revision 901, Tue Aug 14 19:21:17 2001 UTC
# Line 7  Line 7 
7    structure I=Instr    structure I=Instr
8    structure C=I.C    structure C=I.C
9    structure CB=CellsBasis    structure CB=CellsBasis
10      structure CS=CB.CellSet
11    
12    fun rewriteUse(instr, rs, rt) = let    fun rewriteUse(instr, rs, rt) = let
13      fun match r = CB.sameColor(r,rs)      fun match r = CB.sameColor(r,rs)
# Line 53  Line 54 
54         if match b then I.JMPL({r=r, b=rt, d=d}, labs) else instr         if match b then I.JMPL({r=r, b=rt, d=d}, labs) else instr
55       | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>       | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>
56           I.JSR{r=r, b=replace b, d=d, defs=defs,           I.JSR{r=r, b=replace b, d=d, defs=defs,
57                 uses=C.CellSet.map {from=rs,to=rt} uses, cutsTo=cutsTo, mem=mem}                 uses=CS.map {from=rs,to=rt} uses, cutsTo=cutsTo, mem=mem}
58       | I.BSR{r, lab, defs, uses, cutsTo, mem} =>       | I.BSR{r, lab, defs, uses, cutsTo, mem} =>
59           I.BSR{r=r, lab=lab, defs=defs,           I.BSR{r=r, lab=lab, defs=defs,
60                 uses=C.CellSet.map {from=rs,to=rt} uses, cutsTo=cutsTo, mem=mem}                 uses=CS.map {from=rs,to=rt} uses, cutsTo=cutsTo, mem=mem}
61       | I.RET{r,b,d} => I.RET{r=r, b=replace b, d=d}       | I.RET{r,b,d} => I.RET{r=r, b=replace b, d=d}
62       | I.BRANCH{b=I.BR, ...} => instr       | I.BRANCH{b=I.BR, ...} => instr
63       | I.BRANCH{b, r, lab} => if match r then I.BRANCH{b=b, r=rt, lab=lab}       | I.BRANCH{b, r, lab} => if match r then I.BRANCH{b=b, r=rt, lab=lab}
# Line 68  Line 69 
69       | I.COPY{dst, src, tmp, impl} =>       | I.COPY{dst, src, tmp, impl} =>
70           I.COPY{dst=dst, src=map replace src, tmp=tmp, impl=impl}           I.COPY{dst=dst, src=map replace src, tmp=tmp, impl=impl}
71       | I.CALL_PAL{code, def, use } =>       | I.CALL_PAL{code, def, use } =>
72           I.CALL_PAL{code=code, def=def, use=C.CellSet.map {from=rs,to=rt} use}           I.CALL_PAL{code=code, def=def, use=CS.map {from=rs,to=rt} use}
73       | I.PSEUDOARITH{oper, ra, rb, rc, tmps} =>       | I.PSEUDOARITH{oper, ra, rb, rc, tmps} =>
74           I.PSEUDOARITH{oper=oper, ra=replace ra, rb=rwOperand rb, rc=rc,           I.PSEUDOARITH{oper=oper, ra=replace ra, rb=rwOperand rb, rc=rc,
75                         tmps=tmps}                         tmps=tmps}
# Line 107  Line 108 
108           I.FCMOVE{oper=oper,fa=replace fa,fb=replace fb,fc=replace fc}           I.FCMOVE{oper=oper,fa=replace fa,fb=replace fb,fc=replace fc}
109       | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>       | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>
110           I.JSR{r=r, b=b, d=d, defs=defs,           I.JSR{r=r, b=b, d=d, defs=defs,
111                 uses=C.CellSet.map {from=fs,to=ft} uses, cutsTo=cutsTo, mem=mem}                 uses=CS.map {from=fs,to=ft} uses, cutsTo=cutsTo, mem=mem}
112       | I.BSR{r, lab, defs, uses, cutsTo, mem} =>       | I.BSR{r, lab, defs, uses, cutsTo, mem} =>
113           I.BSR{r=r, lab=lab, defs=defs,           I.BSR{r=r, lab=lab, defs=defs,
114                 uses=C.CellSet.map {from=fs,to=ft} uses, cutsTo=cutsTo, mem=mem}                 uses=CS.map {from=fs,to=ft} uses, cutsTo=cutsTo, mem=mem}
115       | I.ANNOTATION{i,a} =>       | I.ANNOTATION{i,a} =>
116           I.ANNOTATION{i=frewriteUse(i,fs,ft),           I.ANNOTATION{i=frewriteUse(i,fs,ft),
117                        a=case a of                        a=case a of
# Line 136  Line 137 
137       | I.JMPL({r, b, d}, labs) =>       | I.JMPL({r, b, d}, labs) =>
138         if match r then I.JMPL({r=rt, b=b, d=d}, labs) else instr         if match r then I.JMPL({r=rt, b=b, d=d}, labs) else instr
139       | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>       | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>
140           I.JSR{r=rewrite r, b=b, d=d, defs=C.CellSet.map {from=rs,to=rt} defs,           I.JSR{r=rewrite r, b=b, d=d, defs=CS.map {from=rs,to=rt} defs,
141                 uses=uses, cutsTo=cutsTo, mem=mem}                 uses=uses, cutsTo=cutsTo, mem=mem}
142       | I.BSR{r, lab, defs, uses, cutsTo, mem} =>       | I.BSR{r, lab, defs, uses, cutsTo, mem} =>
143           I.BSR{r=rewrite r, lab=lab, defs=C.CellSet.map {from=rs,to=rt} defs,           I.BSR{r=rewrite r, lab=lab, defs=CS.map {from=rs,to=rt} defs,
144                 uses=uses, cutsTo=cutsTo, mem=mem}                 uses=uses, cutsTo=cutsTo, mem=mem}
145       | I.RET{r, b, d} => I.RET{r=rewrite r, b=b, d=d}       | I.RET{r, b, d} => I.RET{r=rewrite r, b=b, d=d}
146       | I.BRANCH{b=I.BR, r, lab} =>       | I.BRANCH{b=I.BR, r, lab} =>
# Line 152  Line 153 
153       | I.COPY{dst, src, impl, tmp} =>       | I.COPY{dst, src, impl, tmp} =>
154          I.COPY{dst=map rewrite dst, src=src, tmp=ea tmp, impl=impl}          I.COPY{dst=map rewrite dst, src=src, tmp=ea tmp, impl=impl}
155       | I.CALL_PAL{code, def, use} =>       | I.CALL_PAL{code, def, use} =>
156           I.CALL_PAL{code=code, def=C.CellSet.map {from=rs,to=rt} def, use=use}           I.CALL_PAL{code=code, def=CS.map {from=rs,to=rt} def, use=use}
157       | I.PSEUDOARITH{oper, ra, rb, rc, tmps} =>       | I.PSEUDOARITH{oper, ra, rb, rc, tmps} =>
158           I.PSEUDOARITH{oper=oper, ra=ra, rb=rb, rc=rewrite rc,           I.PSEUDOARITH{oper=oper, ra=ra, rb=rb, rc=rewrite rc,
159                         tmps=C.CellSet.map {from=rs,to=rt} tmps}                         tmps=CS.map {from=rs,to=rt} tmps}
160       | I.ANNOTATION{i,a} =>       | I.ANNOTATION{i,a} =>
161           I.ANNOTATION{i=rewriteDef(i,rs,rt),           I.ANNOTATION{i=rewriteDef(i,rs,rt),
162                          a=case a of                          a=case a of
# Line 186  Line 187 
187          I.FCOPY{dst=map rewrite dst, src=src, tmp=ea tmp, impl=impl}          I.FCOPY{dst=map rewrite dst, src=src, tmp=ea tmp, impl=impl}
188       | I.FCMOVE{oper,fa,fb,fc} => I.FCMOVE{oper=oper,fa=fa,fb=fb,fc=rewrite fc}       | I.FCMOVE{oper,fa,fb,fc} => I.FCMOVE{oper=oper,fa=fa,fb=fb,fc=rewrite fc}
189       | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>       | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>
190          I.JSR{r=r, b=b, d=d, defs=C.CellSet.map {from=fs,to=ft} defs,          I.JSR{r=r, b=b, d=d, defs=CS.map {from=fs,to=ft} defs,
191                uses=uses, cutsTo=cutsTo, mem=mem}                uses=uses, cutsTo=cutsTo, mem=mem}
192       | I.BSR{r, lab, defs, uses, cutsTo, mem} =>       | I.BSR{r, lab, defs, uses, cutsTo, mem} =>
193          I.BSR{r=r, lab=lab, defs=C.CellSet.map {from=fs,to=ft} defs,          I.BSR{r=r, lab=lab, defs=CS.map {from=fs,to=ft} defs,
194                uses=uses, cutsTo=cutsTo, mem=mem}                uses=uses, cutsTo=cutsTo, mem=mem}
195       | I.PSEUDOARITH{oper, ra, rb, rc, tmps} =>       | I.PSEUDOARITH{oper, ra, rb, rc, tmps} =>
196           I.PSEUDOARITH{oper=oper, ra=ra, rb=rb, rc=rc,           I.PSEUDOARITH{oper=oper, ra=ra, rb=rb, rc=rc,
197                         tmps=C.CellSet.map {from=fs,to=ft} tmps}                         tmps=CS.map {from=fs,to=ft} tmps}
198       | I.ANNOTATION{i,a} =>       | I.ANNOTATION{i,a} =>
199           I.ANNOTATION{i=frewriteDef(i,fs,ft),           I.ANNOTATION{i=frewriteDef(i,fs,ft),
200                          a=case a of                          a=case a of

Legend:
Removed from v.900  
changed lines
  Added in v.901

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