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/instructions/alphaProps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/alpha/instructions/alphaProps.sml

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

revision 656, Fri Jun 9 03:39:04 2000 UTC revision 657, Fri Jun 9 05:20:54 2000 UTC
# Line 73  Line 73 
73      fun jump label = I.BRANCH{b=I.BR,r=31,lab=label}      fun jump label = I.BRANCH{b=I.BR,r=31,lab=label}
74    
75      val immedRange = {lo= ~32768, hi = 32768}      val immedRange = {lo= ~32768, hi = 32768}
76      fun loadImmed{immed,t} = I.LDA{r=t,b=31,d=I.IMMop immed}      fun loadImmed{immed,t} =
77            I.LDA{r=t,b=31,
78                  d=if #lo immedRange <= immed andalso immed <= #hi immedRange
79                  then I.IMMop immed else I.LABop(LE.INT immed)}
80        fun loadOperand{opn,t} = I.LDA{r=t,b=31,d=opn}
81    
82      fun setTargets(I.BRANCH{b=I.BR,r=31,...},[L]) = I.BRANCH{b=I.BR,r=31,lab=L}      fun setTargets(I.BRANCH{b=I.BR,r=31,...},[L]) = I.BRANCH{b=I.BR,r=31,lab=L}
83        | setTargets(I.BRANCH{b,r,...},[F,T])  = I.BRANCH{b=b,r=r,lab=T}        | setTargets(I.BRANCH{b,r,...},[F,T])  = I.BRANCH{b=b,r=r,lab=T}
# Line 165  Line 169 
169           | I.TRAPB      => trap([],[])           | I.TRAPB      => trap([],[])
170           (* macro *)           (* macro *)
171           | I.CALL_PAL{def,use, ...} => (def, use)           | I.CALL_PAL{def,use, ...} => (def, use)
172             | I.ANNOTATION{a=C.DEF_USE{cellkind=C.GP,defs,uses}, i, ...} =>
173               let val (d,u) = defUseR i in (defs@d, u@uses) end
174           | I.ANNOTATION{a, i, ...} => defUseR i           | I.ANNOTATION{a, i, ...} => defUseR i
175           | _            => ([],[])           | _            => ([],[])
176        end        end
# Line 185  Line 191 
191        | I.FCOPY{dst, src, ...}                  => (dst, src)        | I.FCOPY{dst, src, ...}                  => (dst, src)
192        | I.JSR{defs,uses, ...}        => (#2 defs,#2 uses)        | I.JSR{defs,uses, ...}        => (#2 defs,#2 uses)
193        | I.BSR{defs,uses, ...}        => (#2 defs,#2 uses)        | I.BSR{defs,uses, ...}        => (#2 defs,#2 uses)
194          | I.ANNOTATION{a=C.DEF_USE{cellkind=C.FP,defs,uses}, i, ...} =>
195            let val (d,u) = defUseF i in (defs@d, u@uses) end
196        | I.ANNOTATION{a, i, ...} => defUseF i        | I.ANNOTATION{a, i, ...} => defUseF i
197        | _ => ([],[])        | _ => ([],[])
198    
# Line 199  Line 207 
207           let val (i,an) = getAnnotations i in (i,a::an) end           let val (i,an) = getAnnotations i in (i,a::an) end
208        | getAnnotations i = (i,[])        | getAnnotations i = (i,[])
209      fun annotate(i,a) = I.ANNOTATION{i=i,a=a}      fun annotate(i,a) = I.ANNOTATION{i=i,a=a}
210    
211      (*========================================================================
212       *  Replicate an instruction
213       *========================================================================*)
214      fun replicate(I.ANNOTATION{i,a}) = I.ANNOTATION{i=replicate i,a=a}
215        | replicate(I.COPY{tmp=SOME _, dst, src, impl}) =
216            I.COPY{tmp=SOME(I.Direct(C.newReg())), dst=dst, src=src, impl=ref NONE}
217        | replicate(I.FCOPY{tmp=SOME _, dst, src, impl}) =
218            I.FCOPY{tmp=SOME(I.FDirect(C.newFreg())),
219                    dst=dst, src=src, impl=ref NONE}
220        | replicate i = i
221  end  end

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

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