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

Diff of /sml/trunk/src/MLRISC/ppc/instructions/ppcProps.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 4  Line 4 
4    structure C = I.C    structure C = I.C
5    structure T = I.T    structure T = I.T
6    structure LE = I.LabelExp    structure LE = I.LabelExp
7      structure CB = CellsBasis
8    
9    exception NegateConditional    exception NegateConditional
10    
# Line 14  Line 15 
15    datatype target = LABELLED of Label.label | FALLTHROUGH | ESCAPES    datatype target = LABELLED of Label.label | FALLTHROUGH | ESCAPES
16    
17    (* This stupid architecture doesn't really have a dedicated zero register *)    (* This stupid architecture doesn't really have a dedicated zero register *)
18    fun zeroR() = C.Reg C.GP 0    fun zeroR() = C.Reg CB.GP 0
19    
20    fun instrKind(I.BC _) = IK_JUMP    fun instrKind(I.BC _) = IK_JUMP
21      | instrKind(I.BCLR _) = IK_JUMP      | instrKind(I.BCLR _) = IK_JUMP
22      | instrKind(I.B _) = IK_JUMP      | instrKind(I.B _) = IK_JUMP
23      | instrKind(I.ARITHI{oper=I.ORI, rt, ra, im=I.ImmedOp 0}) =      | instrKind(I.ARITHI{oper=I.ORI, rt, ra, im=I.ImmedOp 0}) =
24           if C.registerId rt = 0 andalso C.registerId ra = 0 then IK_NOP           if CB.registerId rt = 0 andalso CB.registerId ra = 0 then IK_NOP
25           else IK_INSTR           else IK_INSTR
26      | instrKind(I.COPY _) = IK_COPY      | instrKind(I.COPY _) = IK_COPY
27      | instrKind(I.FCOPY _) = IK_COPY      | instrKind(I.FCOPY _) = IK_COPY
# Line 84  Line 85 
85    
86    fun negateConditional _ = error "negateConditional"    fun negateConditional _ = error "negateConditional"
87    
88    fun hashOpn(I.RegOp r) = C.hashCell r    fun hashOpn(I.RegOp r) = CB.hashCell r
89      | hashOpn(I.ImmedOp i) = Word.fromInt i      | hashOpn(I.ImmedOp i) = Word.fromInt i
90      | hashOpn(I.LabelOp l) = I.LabelExp.hash l      | hashOpn(I.LabelOp l) = I.LabelExp.hash l
91    fun eqOpn(I.RegOp a,I.RegOp b) = C.sameColor(a,b)    fun eqOpn(I.RegOp a,I.RegOp b) = CB.sameColor(a,b)
92      | eqOpn(I.ImmedOp a,I.ImmedOp b) = a = b      | eqOpn(I.ImmedOp a,I.ImmedOp b) = a = b
93      | eqOpn(I.LabelOp a,I.LabelOp b) = I.LabelExp.==(a,b)      | eqOpn(I.LabelOp a,I.LabelOp b) = I.LabelExp.==(a,b)
94      | eqOpn _ = false      | eqOpn _ = false
# Line 118  Line 119 
119             | SOME(I.Direct r) => (r::dst, src)             | SOME(I.Direct r) => (r::dst, src)
120          (* | SOME(I.Displace{base, disp}) => (dst, base::src) *)          (* | SOME(I.Displace{base, disp}) => (dst, base::src) *)
121           (*esac*))           (*esac*))
122       | I.ANNOTATION{a=C.DEF_USE{cellkind=C.GP,defs,uses}, i, ...} =>       | I.ANNOTATION{a=CB.DEF_USE{cellkind=CB.GP,defs,uses}, i, ...} =>
123         let val (d,u) = defUseR i in (defs@d, u@uses) end         let val (d,u) = defUseR i in (defs@d, u@uses) end
124       | I.ANNOTATION{a, i, ...} => defUseR i       | I.ANNOTATION{a, i, ...} => defUseR i
125       | _ => ([], [])       | _ => ([], [])
# Line 138  Line 139 
139            of SOME(I.FDirect f) => (f::dst, src)            of SOME(I.FDirect f) => (f::dst, src)
140             | _ => (dst, src)             | _ => (dst, src)
141           (*esac*))           (*esac*))
142       | I.ANNOTATION{a=C.DEF_USE{cellkind=C.FP,defs,uses}, i, ...} =>       | I.ANNOTATION{a=CB.DEF_USE{cellkind=CB.FP,defs,uses}, i, ...} =>
143         let val (d,u) = defUseF i in (defs@d, u@uses) end         let val (d,u) = defUseF i in (defs@d, u@uses) end
144       | I.ANNOTATION{a, i, ...} => defUseF i       | I.ANNOTATION{a, i, ...} => defUseF i
145       | _ => ([], [])       | _ => ([], [])
# Line 146  Line 147 
147    
148    fun defUseCC instr = error "defUseCC: not implemented"    fun defUseCC instr = error "defUseCC: not implemented"
149    
150    fun defUse C.GP = defUseR    fun defUse CB.GP = defUseR
151      | defUse C.FP = defUseF      | defUse CB.FP = defUseF
152      | defUse C.CC = defUseCC      | defUse CB.CC = defUseCC
153      | defUse _ = error "defUse"      | defUse _ = error "defUse"
154    
155    (*========================================================================    (*========================================================================

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