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/x86/ra/x86Rewrite.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/x86/ra/x86Rewrite.sml

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

revision 730, Fri Nov 10 14:04:49 2000 UTC revision 731, Fri Nov 10 22:57:45 2000 UTC
# Line 70  Line 70 
70       | I.FLDT opnd => I.FLDT(operand opnd)       | I.FLDT opnd => I.FLDT(operand opnd)
71       | I.FLDL opnd => I.FLDL(operand opnd)       | I.FLDL opnd => I.FLDL(operand opnd)
72       | I.FLDS opnd => I.FLDS(operand opnd)       | I.FLDS opnd => I.FLDS(operand opnd)
73         | I.FUCOM opnd => I.FUCOM(operand opnd)
74         | I.FUCOMP opnd => I.FUCOMP(operand opnd)
75       | I.FENV{fenvOp,opnd} => I.FENV{fenvOp=fenvOp, opnd=operand opnd}       | I.FENV{fenvOp,opnd} => I.FENV{fenvOp=fenvOp, opnd=operand opnd}
76       | I.FBINARY{binOp, src, dst} =>       | I.FBINARY{binOp, src, dst} =>
77          I.FBINARY{binOp=binOp, src=operand src, dst=dst}          I.FBINARY{binOp=binOp, src=operand src, dst=dst}
78       | I.FIBINARY{binOp, src} =>       | I.FIBINARY{binOp, src} =>
79          I.FIBINARY{binOp=binOp, src=operand src}          I.FIBINARY{binOp=binOp, src=operand src}
80    
81           (* Pseudo floating point instructions *)
82         | I.FMOVE{fsize,src,dst} =>
83            I.FMOVE{fsize=fsize,src=operand src,dst=operand dst}
84         | I.FILOAD{isize,ea,dst} =>
85            I.FILOAD{isize=isize,ea=operand ea,dst=operand dst}
86         | I.FBINOP{fsize,binOp,lsrc,rsrc,dst} =>
87            I.FBINOP{fsize=fsize,binOp=binOp,
88                     lsrc=operand lsrc,rsrc=operand rsrc,dst=operand dst}
89         | I.FIBINOP{isize,binOp,lsrc,rsrc,dst} =>
90            I.FIBINOP{isize=isize,binOp=binOp,
91                      lsrc=operand lsrc,rsrc=operand rsrc,dst=operand dst}
92         | I.FUNOP{fsize,unOp,src,dst} =>
93            I.FUNOP{fsize=fsize,unOp=unOp,src=operand src,dst=operand dst}
94         | I.FCMP{fsize,lsrc,rsrc} =>
95            I.FCMP{fsize=fsize,lsrc=operand lsrc,rsrc=operand rsrc}
96    
97       | I.CMOV{cond, src, dst} => I.CMOV{cond=cond, src=operand src, dst=dst}       | I.CMOV{cond, src, dst} => I.CMOV{cond=cond, src=operand src, dst=dst}
98       | I.ANNOTATION{i,a}=>       | I.ANNOTATION{i,a}=>
99          I.ANNOTATION{i=rewriteUse(mapr,i,rs,rt),          I.ANNOTATION{i=rewriteUse(mapr,i,rs,rt),
# Line 116  Line 135 
135    fun frewriteUse(mapr : I.C.cell -> I.C.cell, instr, fs, ft) = let    fun frewriteUse(mapr : I.C.cell -> I.C.cell, instr, fs, ft) = let
136      fun foperand(opnd as I.FDirect f) =      fun foperand(opnd as I.FDirect f) =
137           if f=fs then I.FDirect ft else opnd           if f=fs then I.FDirect ft else opnd
138          | foperand(opnd as I.FPR f) =
139             if f=fs then I.FPR ft else opnd
140        | foperand opnd = opnd        | foperand opnd = opnd
141    
142      fun replace f = if mapr f=fs then ft else f      fun replace f = if mapr f=fs then ft else f
# Line 128  Line 149 
149           I.CALL(opnd, defs, (ur, map replace uf, uc), mem)           I.CALL(opnd, defs, (ur, map replace uf, uc), mem)
150       | I.FBINARY{binOp, src, dst} =>       | I.FBINARY{binOp, src, dst} =>
151           I.FBINARY{binOp=binOp, src=foperand src, dst=foperand dst}           I.FBINARY{binOp=binOp, src=foperand src, dst=foperand dst}
152         | I.FUCOM opnd => I.FUCOM(foperand opnd)
153         | I.FUCOMP opnd => I.FUCOMP(foperand opnd)
154    
155           (* Pseudo floating point instructions *)
156         | I.FMOVE{fsize,dst,src} =>
157            I.FMOVE{fsize=fsize,dst=dst,src=foperand src}
158         | I.FBINOP{fsize,binOp,lsrc,rsrc,dst} =>
159            I.FBINOP{fsize=fsize,binOp=binOp,
160                     lsrc=foperand lsrc,rsrc=foperand rsrc,dst=dst}
161         | I.FIBINOP{isize,binOp,lsrc,rsrc,dst} =>
162            I.FIBINOP{isize=isize,binOp=binOp,
163                      lsrc=foperand lsrc,rsrc=foperand rsrc,dst=dst}
164         | I.FUNOP{fsize,unOp,src,dst} =>
165            I.FUNOP{fsize=fsize,unOp=unOp,src=foperand src,dst=dst}
166         | I.FCMP{fsize,lsrc,rsrc} =>
167            I.FCMP{fsize=fsize,lsrc=foperand lsrc,rsrc=foperand rsrc}
168    
169       | I.ANNOTATION{i,a}=>       | I.ANNOTATION{i,a}=>
170           I.ANNOTATION{i=frewriteUse(mapr,i,fs,ft),           I.ANNOTATION{i=frewriteUse(mapr,i,fs,ft),
171                          a=case a of                          a=case a of
# Line 141  Line 179 
179    fun frewriteDef(mapr : I.C.cell -> I.C.cell, instr, fs, ft) = let    fun frewriteDef(mapr : I.C.cell -> I.C.cell, instr, fs, ft) = let
180      fun foperand(opnd as I.FDirect r) =      fun foperand(opnd as I.FDirect r) =
181           if r=fs then I.FDirect ft else opnd           if r=fs then I.FDirect ft else opnd
182          | foperand(opnd as I.FPR r) =
183             if r=fs then I.FPR ft else opnd
184        | foperand opnd = opnd        | foperand opnd = opnd
185      fun replace f = if mapr f = fs then ft else f      fun replace f = if mapr f = fs then ft else f
186    in    in
# Line 154  Line 194 
194       | I.CALL(opnd, (dr,df,dc), uses, mem) =>       | I.CALL(opnd, (dr,df,dc), uses, mem) =>
195           I.CALL(opnd, (dr, map replace df, dc), uses, mem)           I.CALL(opnd, (dr, map replace df, dc), uses, mem)
196       | I.FBINARY{binOp, src, dst} => I.FBINARY{binOp=binOp, src=src, dst=foperand dst}       | I.FBINARY{binOp, src, dst} => I.FBINARY{binOp=binOp, src=src, dst=foperand dst}
197    
198           (* Pseudo floating point instructions *)
199         | I.FMOVE{fsize,src,dst} =>
200            I.FMOVE{fsize=fsize,src=src,dst=foperand dst}
201         | I.FILOAD{isize,ea,dst} =>
202            I.FILOAD{isize=isize,ea=ea,dst=foperand dst}
203         | I.FBINOP{fsize,binOp,lsrc,rsrc,dst} =>
204            I.FBINOP{fsize=fsize,binOp=binOp,lsrc=lsrc,rsrc=rsrc,dst=foperand dst}
205         | I.FIBINOP{isize,binOp,lsrc,rsrc,dst} =>
206            I.FIBINOP{isize=isize,binOp=binOp,lsrc=lsrc,rsrc=rsrc,dst=foperand dst}
207         | I.FUNOP{fsize,unOp,src,dst} =>
208            I.FUNOP{fsize=fsize,unOp=unOp,src=src,dst=foperand dst}
209    
210       | I.ANNOTATION{i,a}=>       | I.ANNOTATION{i,a}=>
211           I.ANNOTATION{i=frewriteDef(mapr,i,fs,ft),           I.ANNOTATION{i=frewriteDef(mapr,i,fs,ft),
212                          a=case a of                          a=case a of

Legend:
Removed from v.730  
changed lines
  Added in v.731

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