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

Diff of /sml/trunk/src/MLRISC/sparc/instructions/sparcProps.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 2  Line 2 
2  struct  struct
3    structure I = SparcInstr    structure I = SparcInstr
4    structure C = I.C    structure C = I.C
5      structure LE = I.LabelExp
6    
7    exception NegateConditional    exception NegateConditional
8    
# Line 118  Line 119 
119    
120    val immedRange = {lo= ~4096, hi = 4095}    val immedRange = {lo= ~4096, hi = 4095}
121    
122    fun loadImmed{immed,t} = I.ARITH{a=I.OR,r=0,i=I.IMMED immed,d=t}    fun loadImmed{immed,t} =
123          I.ARITH{a=I.OR,r=0,i=
124                  if #lo immedRange <= immed andalso immed <= #hi immedRange
125                  then I.IMMED immed else I.LAB(LE.INT immed),d=t}
126      fun loadOperand{opn, t} = I.ARITH{a=I.OR,r=0,i=opn, d=t}
127    
128    fun moveInstr(I.COPY _)  = true    fun moveInstr(I.COPY _)  = true
129      | moveInstr(I.FCOPY _) = true      | moveInstr(I.FCOPY _) = true
# Line 185  Line 190 
190          | I.Ticc{r,i,...} => oper(i,[],[r])          | I.Ticc{r,i,...} => oper(i,[],[r])
191          | I.RDY{d,...} => ([d],[])          | I.RDY{d,...} => ([d],[])
192          | I.WRY{r,i,...} => oper(i,[],[r])          | I.WRY{r,i,...} => oper(i,[],[r])
193            | I.ANNOTATION{a=C.DEF_USE{cellkind=C.GP,defs,uses}, i, ...} =>
194              let val (d,u) = defUseR i in (defs@d, u@uses) end
195          | I.ANNOTATION{a, i, ...} => defUseR i          | I.ANNOTATION{a, i, ...} => defUseR i
196          | _ => ([],[])          | _ => ([],[])
197      end      end
# Line 203  Line 210 
210        | I.FMOVfcc{r,d,...} => ([d],[r,d])        | I.FMOVfcc{r,d,...} => ([d],[r,d])
211        | I.FCOPY{src,dst,tmp=SOME(I.FDirect r),...} => (r::dst,src)        | I.FCOPY{src,dst,tmp=SOME(I.FDirect r),...} => (r::dst,src)
212        | I.FCOPY{src,dst,...} => (dst,src)        | I.FCOPY{src,dst,...} => (dst,src)
213          | I.ANNOTATION{a=C.DEF_USE{cellkind=C.FP,defs,uses}, i, ...} =>
214            let val (d,u) = defUseF i in (defs@d, u@uses) end
215        | I.ANNOTATION{a, i, ...} => defUseF i        | I.ANNOTATION{a, i, ...} => defUseF i
216        | _ => ([],[])        | _ => ([],[])
217    
# Line 217  Line 226 
226         let val (i,an) = getAnnotations i in (i,a::an) end         let val (i,an) = getAnnotations i in (i,a::an) end
227      | getAnnotations i = (i,[])      | getAnnotations i = (i,[])
228    fun annotate(i,a) = I.ANNOTATION{i=i,a=a}    fun annotate(i,a) = I.ANNOTATION{i=i,a=a}
229    
230      (*========================================================================
231       *  Replicate an instruction
232       *========================================================================*)
233      fun replicate(I.ANNOTATION{i,a}) = I.ANNOTATION{i=replicate i,a=a}
234        | replicate(I.COPY{tmp=SOME _, dst, src, impl}) =
235            I.COPY{tmp=SOME(I.Direct(C.newReg())), dst=dst, src=src, impl=ref NONE}
236        | replicate(I.FCOPY{tmp=SOME _, dst, src, impl}) =
237            I.FCOPY{tmp=SOME(I.FDirect(C.newFreg())),
238                    dst=dst, src=src, impl=ref NONE}
239        | replicate i = i
240  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