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/branches/idlbasis-devel/src/MLRISC/alpha/ra/alphaRewrite.sml
ViewVC logotype

Diff of /sml/branches/idlbasis-devel/src/MLRISC/alpha/ra/alphaRewrite.sml

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

revision 624, Fri Apr 21 03:06:21 2000 UTC revision 657, Fri Jun 9 05:20:54 2000 UTC
# Line 5  Line 5 
5    
6  functor AlphaRewrite(Instr : ALPHAINSTR) = struct  functor AlphaRewrite(Instr : ALPHAINSTR) = struct
7    structure I=Instr    structure I=Instr
8      structure C=I.C
9    
10    fun rewriteUse(mapr : I.C.cell -> I.C.cell, instr, rs, rt) = let    fun rewriteUse(mapr : I.C.cell -> I.C.cell, instr, rs, rt) = let
11      fun isRegOp (opnd as I.REGop r) = mapr r=rs      fun isRegOp (opnd as I.REGop r) = mapr r=rs
# Line 63  Line 64 
64           I.COPY{dst=dst, src=map replace src, tmp=tmp, impl=impl}           I.COPY{dst=dst, src=map replace src, tmp=tmp, impl=impl}
65       | I.CALL_PAL{code, def, use } =>       | I.CALL_PAL{code, def, use } =>
66           I.CALL_PAL{code=code, def=def, use=map replace use}           I.CALL_PAL{code=code, def=def, use=map replace use}
67       | I.ANNOTATION{i,a} => I.ANNOTATION{i=rewriteUse(mapr,i,rs,rt),a=a}       | I.PSEUDOARITH{oper, ra, rb, rc, tmps} =>
68             I.PSEUDOARITH{oper=oper, ra=replace ra, rb=rwOperand rb, rc=rc,
69                           tmps=tmps}
70         | I.ANNOTATION{i,a} =>
71               I.ANNOTATION{i=rewriteUse(mapr,i,rs,rt),
72                            a=case a of
73                               C.DEF_USE{cellkind=C.GP,defs,uses} =>
74                                 C.DEF_USE{cellkind=C.GP,defs=defs,
75                                           uses=map replace uses}
76                              | _ => a}
77       | _ => instr       | _ => instr
78    end    end
79    
# Line 93  Line 103 
103           I.JSR{r=r, b=b, d=d, defs=defs, uses=(i, map replace f), mem=mem}           I.JSR{r=r, b=b, d=d, defs=defs, uses=(i, map replace f), mem=mem}
104       | I.BSR{r, lab, defs, uses=(i,f), mem} =>       | I.BSR{r, lab, defs, uses=(i,f), mem} =>
105           I.BSR{r=r, lab=lab, defs=defs, uses=(i, map replace f), mem=mem}           I.BSR{r=r, lab=lab, defs=defs, uses=(i, map replace f), mem=mem}
106       | I.ANNOTATION{i,a} => I.ANNOTATION{i=frewriteUse(mapr,i,fs,ft),a=a}       | I.ANNOTATION{i,a} =>
107             I.ANNOTATION{i=frewriteUse(mapr,i,fs,ft),
108                          a=case a of
109                             C.DEF_USE{cellkind=C.FP,defs,uses} =>
110                               C.DEF_USE{cellkind=C.FP,defs=defs,
111                                         uses=map replace uses}
112                            | _ => a}
113    
114       | _ => instr       | _ => instr
115    end    end
116    
# Line 127  Line 144 
144          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}
145       | I.CALL_PAL{code, def, use } =>       | I.CALL_PAL{code, def, use } =>
146           I.CALL_PAL{code=code, def=map rewrite def, use=use}           I.CALL_PAL{code=code, def=map rewrite def, use=use}
147       | I.ANNOTATION{i,a} => I.ANNOTATION{i=rewriteDef(mapr,i,rs,rt),a=a}       | I.PSEUDOARITH{oper, ra, rb, rc, tmps=(i,f)} =>
148             I.PSEUDOARITH{oper=oper, ra=ra, rb=rb, rc=rewrite rc,
149                           tmps=(map rewrite i,f)}
150         | I.ANNOTATION{i,a} =>
151             I.ANNOTATION{i=rewriteDef(mapr,i,rs,rt),
152                            a=case a of
153                               C.DEF_USE{cellkind=C.GP,defs,uses} =>
154                                 C.DEF_USE{cellkind=C.GP,uses=uses,
155                                           defs=map rewrite defs}
156                              | _ => a}
157       | _ => instr       | _ => instr
158    end    end
159    
# Line 153  Line 179 
179          I.JSR{r=r, b=b, d=d, defs=(i, map rewrite f), uses=uses, mem=mem}          I.JSR{r=r, b=b, d=d, defs=(i, map rewrite f), uses=uses, mem=mem}
180       | I.BSR{r, lab, defs=(i,f), uses, mem} =>       | I.BSR{r, lab, defs=(i,f), uses, mem} =>
181          I.BSR{r=r, lab=lab, defs=(i, map rewrite f), uses=uses, mem=mem}          I.BSR{r=r, lab=lab, defs=(i, map rewrite f), uses=uses, mem=mem}
182         | I.PSEUDOARITH{oper, ra, rb, rc, tmps=(i,f)} =>
183       | I.ANNOTATION{i,a} => I.ANNOTATION{i=frewriteDef(mapr,i,fs,ft),a=a}           I.PSEUDOARITH{oper=oper, ra=ra, rb=rb, rc=rc, tmps=(i,map rewrite f)}
184         | I.ANNOTATION{i,a} =>
185             I.ANNOTATION{i=frewriteDef(mapr,i,fs,ft),
186                            a=case a of
187                               C.DEF_USE{cellkind=C.FP,defs,uses} =>
188                                 C.DEF_USE{cellkind=C.FP,uses=uses,
189                                           defs=map rewrite defs}
190                              | _ => a}
191       | _  => instr       | _  => instr
192    end    end
193  end  end

Legend:
Removed from v.624  
changed lines
  Added in v.657

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