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 888, Thu Jul 19 20:24:21 2001 UTC revision 889, Thu Jul 19 20:35:20 2001 UTC
# Line 9  Line 9 
9      structure I = AlphaInstr      structure I = AlphaInstr
10      structure C = I.C      structure C = I.C
11      structure LE = I.LabelExp      structure LE = I.LabelExp
12        structure CB = CellsBasis
13    
14      exception NegateConditional      exception NegateConditional
15    
16      fun error msg = MLRiscErrorMsg.impossible ("alphaProps."^msg)      fun error msg = MLRiscErrorMsg.impossible ("alphaProps."^msg)
17    
18      val zeroR = Option.valOf(C.zeroReg C.GP)      val zeroR = Option.valOf(C.zeroReg CB.GP)
19    
20      datatype kind = IK_JUMP | IK_NOP | IK_INSTR | IK_COPY | IK_CALL      datatype kind = IK_JUMP | IK_NOP | IK_INSTR | IK_COPY | IK_CALL
21                    | IK_CALL_WITH_CUTS | IK_PHI | IK_SOURCE | IK_SINK                    | IK_CALL_WITH_CUTS | IK_PHI | IK_SOURCE | IK_SINK
# Line 83  Line 84 
84                then I.IMMop immed else I.LABop(I.T.LI(I.T.I.fromInt(64,immed)))}                then I.IMMop immed else I.LABop(I.T.LI(I.T.I.fromInt(64,immed)))}
85      fun loadOperand{opn,t} = I.LDA{r=t,b=zeroR,d=opn}      fun loadOperand{opn,t} = I.LDA{r=t,b=zeroR,d=opn}
86    
87      fun setTargets(I.BRANCH{b=I.BR,r as C.CELL{id=31,...}, ...},[L]) =      fun setTargets(I.BRANCH{b=I.BR,r as CB.CELL{id=31,...}, ...},[L]) =
88               I.BRANCH{b=I.BR,r=r,lab=L}               I.BRANCH{b=I.BR,r=r,lab=L}
89        | 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}
90        | setTargets(I.FBRANCH{b,f,...},[F,T]) = I.FBRANCH{b=b,f=f,lab=T}        | setTargets(I.FBRANCH{b,f,...},[F,T]) = I.FBRANCH{b=b,f=f,lab=T}
# Line 119  Line 120 
120     (*========================================================================     (*========================================================================
121      *  Equality and hashing for operands      *  Equality and hashing for operands
122      *========================================================================*)      *========================================================================*)
123     fun hashOpn(I.REGop r) = C.hashCell r     fun hashOpn(I.REGop r) = CB.hashCell r
124       | hashOpn(I.IMMop i) = Word.fromInt i       | hashOpn(I.IMMop i) = Word.fromInt i
125       | hashOpn(I.HILABop l) = I.LabelExp.hash l       | hashOpn(I.HILABop l) = I.LabelExp.hash l
126       | hashOpn(I.LOLABop l) = I.LabelExp.hash l       | hashOpn(I.LOLABop l) = I.LabelExp.hash l
127       | hashOpn(I.LABop l) = I.LabelExp.hash l       | hashOpn(I.LABop l) = I.LabelExp.hash l
128    
129     fun eqOpn(I.REGop a,I.REGop b) = C.sameColor(a,b)     fun eqOpn(I.REGop a,I.REGop b) = CB.sameColor(a,b)
130       | eqOpn(I.IMMop a,I.IMMop b) = a = b       | eqOpn(I.IMMop a,I.IMMop b) = a = b
131       | eqOpn(I.HILABop a,I.HILABop b) = I.LabelExp.==(a,b)       | eqOpn(I.HILABop a,I.HILABop b) = I.LabelExp.==(a,b)
132       | eqOpn(I.LOLABop a,I.LOLABop b) = I.LabelExp.==(a,b)       | eqOpn(I.LOLABop a,I.LOLABop b) = I.LabelExp.==(a,b)
# Line 174  Line 175 
175           | I.TRAPB      => trap([],[])           | I.TRAPB      => trap([],[])
176           (* macro *)           (* macro *)
177           | I.CALL_PAL{def,use, ...} => (C.getReg def, C.getReg use)           | I.CALL_PAL{def,use, ...} => (C.getReg def, C.getReg use)
178           | I.ANNOTATION{a=C.DEF_USE{cellkind=C.GP,defs,uses}, i, ...} =>           | I.ANNOTATION{a=CB.DEF_USE{cellkind=CB.GP,defs,uses}, i, ...} =>
179             let val (d,u) = defUseR i in (defs@d, u@uses) end             let val (d,u) = defUseR i in (defs@d, u@uses) end
180           | I.ANNOTATION{a, i, ...} => defUseR i           | I.ANNOTATION{a, i, ...} => defUseR i
181           | _            => ([],[])           | _            => ([],[])
# Line 196  Line 197 
197        | I.FCOPY{dst, src, ...}                  => (dst, src)        | I.FCOPY{dst, src, ...}                  => (dst, src)
198        | I.JSR{defs,uses, ...}        => (C.getFreg defs,C.getFreg uses)        | I.JSR{defs,uses, ...}        => (C.getFreg defs,C.getFreg uses)
199        | I.BSR{defs,uses, ...}        => (C.getFreg defs,C.getFreg uses)        | I.BSR{defs,uses, ...}        => (C.getFreg defs,C.getFreg uses)
200        | I.ANNOTATION{a=C.DEF_USE{cellkind=C.FP,defs,uses}, i, ...} =>        | I.ANNOTATION{a=CB.DEF_USE{cellkind=CB.FP,defs,uses}, i, ...} =>
201          let val (d,u) = defUseF i in (defs@d, u@uses) end          let val (d,u) = defUseF i in (defs@d, u@uses) end
202        | I.ANNOTATION{a, i, ...} => defUseF i        | I.ANNOTATION{a, i, ...} => defUseF i
203        | _ => ([],[])        | _ => ([],[])
204    
205      fun defUse C.GP = defUseR      fun defUse CB.GP = defUseR
206        | defUse C.FP = defUseF        | defUse CB.FP = defUseF
207        | defUse _ = error "defUse"        | defUse _ = error "defUse"
208    
209      (*=======================================================================      (*=======================================================================

Legend:
Removed from v.888  
changed lines
  Added in v.889

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