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

Diff of /sml/trunk/src/MLRISC/x86/instructions/x86Props.sml

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

revision 815, Fri May 4 05:09:10 2001 UTC revision 889, Thu Jul 19 20:35:20 2001 UTC
# Line 9  Line 9 
9    structure C = I.C    structure C = I.C
10    structure LE = I.LabelExp    structure LE = I.LabelExp
11    structure T = I.T    structure T = I.T
12      structure CB = CellsBasis
13    
14    exception NegateConditional    exception NegateConditional
15    
# Line 105  Line 106 
106       | hashOpn(I.ImmedLabel le) = LE.hash le + 0w123       | hashOpn(I.ImmedLabel le) = LE.hash le + 0w123
107       | hashOpn(I.Relative i) = Word.fromInt i + 0w1232       | hashOpn(I.Relative i) = Word.fromInt i + 0w1232
108       | hashOpn(I.LabelEA le) = LE.hash le + 0w44444       | hashOpn(I.LabelEA le) = LE.hash le + 0w44444
109       | hashOpn(I.Direct r)  = C.hashCell r       | hashOpn(I.Direct r)  = CB.hashCell r
110       | hashOpn(I.MemReg r)  = C.hashCell r + 0w2123       | hashOpn(I.MemReg r)  = CB.hashCell r + 0w2123
111       | hashOpn(I.ST f) = C.hashCell f + 0w88       | hashOpn(I.ST f) = CB.hashCell f + 0w88
112       | hashOpn(I.FPR f) = C.hashCell f + 0w881       | hashOpn(I.FPR f) = CB.hashCell f + 0w881
113       | hashOpn(I.FDirect f) = C.hashCell f + 0w31245       | hashOpn(I.FDirect f) = CB.hashCell f + 0w31245
114       | hashOpn(I.Displace {base, disp, ...}) =       | hashOpn(I.Displace {base, disp, ...}) =
115           hashOpn disp + C.hashCell base           hashOpn disp + CB.hashCell base
116       | hashOpn(I.Indexed {base, index, scale, disp, ...}) =       | hashOpn(I.Indexed {base, index, scale, disp, ...}) =
117           C.hashCell index + Word.fromInt scale + hashOpn disp           CB.hashCell index + Word.fromInt scale + hashOpn disp
118     fun eqOpn(I.Immed a,I.Immed b) = a = b     fun eqOpn(I.Immed a,I.Immed b) = a = b
119       | eqOpn(I.ImmedLabel a,I.ImmedLabel b) = LE.==(a,b)       | eqOpn(I.ImmedLabel a,I.ImmedLabel b) = LE.==(a,b)
120       | eqOpn(I.Relative a,I.Relative b) = a = b       | eqOpn(I.Relative a,I.Relative b) = a = b
121       | eqOpn(I.LabelEA a,I.LabelEA b) = LE.==(a,b)       | eqOpn(I.LabelEA a,I.LabelEA b) = LE.==(a,b)
122       | eqOpn(I.Direct a,I.Direct b) = C.sameColor(a,b)       | eqOpn(I.Direct a,I.Direct b) = CB.sameColor(a,b)
123       | eqOpn(I.MemReg a,I.MemReg b) = C.sameColor(a,b)       | eqOpn(I.MemReg a,I.MemReg b) = CB.sameColor(a,b)
124       | eqOpn(I.FDirect a,I.FDirect b) = C.sameColor(a,b)       | eqOpn(I.FDirect a,I.FDirect b) = CB.sameColor(a,b)
125       | eqOpn(I.ST a,I.ST b) = C.sameColor(a,b)       | eqOpn(I.ST a,I.ST b) = CB.sameColor(a,b)
126       | eqOpn(I.FPR a,I.FPR b) = C.sameColor(a,b)       | eqOpn(I.FPR a,I.FPR b) = CB.sameColor(a,b)
127       | eqOpn(I.Displace{base=a,disp=b,...},I.Displace{base=c,disp=d,...}) =       | eqOpn(I.Displace{base=a,disp=b,...},I.Displace{base=c,disp=d,...}) =
128            C.sameColor(a,c) andalso eqOpn(b,d)            CB.sameColor(a,c) andalso eqOpn(b,d)
129       | eqOpn(I.Indexed{base=a,index=b,scale=c,disp=d,...},       | eqOpn(I.Indexed{base=a,index=b,scale=c,disp=d,...},
130               I.Indexed{base=e,index=f,scale=g,disp=h,...}) =               I.Indexed{base=e,index=f,scale=g,disp=h,...}) =
131            C.sameColor(b,f) andalso c = g            CB.sameColor(b,f) andalso c = g
132            andalso sameCellOption(a,e) andalso eqOpn(d,h)            andalso sameCellOption(a,e) andalso eqOpn(d,h)
133       | eqOpn _ = false       | eqOpn _ = false
134     and sameCellOption(NONE, NONE) = true     and sameCellOption(NONE, NONE) = true
135       | sameCellOption(SOME x, SOME y) = C.sameColor(x,y)       | sameCellOption(SOME x, SOME y) = CB.sameColor(x,y)
136       | sameCellOption _ = false       | sameCellOption _ = false
137    
138   (*========================================================================   (*========================================================================
# Line 183  Line 184 
184          | I.TESTL arg | I.TESTW arg | I.TESTB arg ) => cmptest arg          | I.TESTL arg | I.TESTW arg | I.TESTB arg ) => cmptest arg
185        | I.BITOP{lsrc, rsrc, ...} => cmptest{lsrc=lsrc,rsrc=rsrc}        | I.BITOP{lsrc, rsrc, ...} => cmptest{lsrc=lsrc,rsrc=rsrc}
186        | I.BINARY{binOp=I.XORL,src=I.Direct rs,dst=I.Direct rd,...} =>        | I.BINARY{binOp=I.XORL,src=I.Direct rs,dst=I.Direct rd,...} =>
187             if C.sameColor(rs,rd) then ([rd],[]) else ([rd],[rs,rd])             if CB.sameColor(rs,rd) then ([rd],[]) else ([rd],[rs,rd])
188        | I.BINARY{src,dst,...} =>        | I.BINARY{src,dst,...} =>
189             (operandDef dst, operandAcc(src, operandUse dst))             (operandDef dst, operandAcc(src, operandUse dst))
190        | I.CMPXCHG{src, dst, ...} =>        | I.CMPXCHG{src, dst, ...} =>
# Line 233  Line 234 
234           * do potentially it may define *and* use           * do potentially it may define *and* use
235           *)           *)
236        | I.CMOV{src,dst,...} => ([dst], operandAcc(src, [dst]))        | I.CMOV{src,dst,...} => ([dst], operandAcc(src, [dst]))
237        | I.ANNOTATION{a=C.DEF_USE{cellkind=C.GP,defs,uses}, i, ...} =>        | I.ANNOTATION{a=CB.DEF_USE{cellkind=CB.GP,defs,uses}, i, ...} =>
238          let val (d,u) = defUseR i in (defs@d, u@uses) end          let val (d,u) = defUseR i in (defs@d, u@uses) end
239        | I.ANNOTATION{a, i, ...} => defUseR i        | I.ANNOTATION{a, i, ...} => defUseR i
240        | _                     => ([], [])        | _                     => ([], [])
# Line 281  Line 282 
282        | I.FIBINOP{lsrc, rsrc, dst, ...} => fbinop(lsrc, rsrc, dst)        | I.FIBINOP{lsrc, rsrc, dst, ...} => fbinop(lsrc, rsrc, dst)
283        | I.FUNOP{src, dst, ...} => (operand dst, operand src)        | I.FUNOP{src, dst, ...} => (operand dst, operand src)
284    
285        | I.ANNOTATION{a=C.DEF_USE{cellkind=C.FP,defs,uses}, i, ...} =>        | I.ANNOTATION{a=CB.DEF_USE{cellkind=CB.FP,defs,uses}, i, ...} =>
286          let val (d,u) = defUseF i in (defs@d, u@uses) end          let val (d,u) = defUseF i in (defs@d, u@uses) end
287        | I.ANNOTATION{a, i, ...} => defUseF i        | I.ANNOTATION{a, i, ...} => defUseF i
288        | _  => ([], [])        | _  => ([], [])
289    end    end
290    
291    fun defUse C.GP = defUseR    fun defUse CB.GP = defUseR
292      | defUse C.FP = defUseF      | defUse CB.FP = defUseF
293      | defUse _ = error "defUse"      | defUse _ = error "defUse"
294    
295    (*========================================================================    (*========================================================================

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

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