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 731, Fri Nov 10 22:57:45 2000 UTC revision 744, Fri Dec 8 04:11:42 2000 UTC
# Line 102  Line 102 
102       | hashOpn(I.ImmedLabel le) = LE.hash le + 0w123       | hashOpn(I.ImmedLabel le) = LE.hash le + 0w123
103       | hashOpn(I.Relative i) = Word.fromInt i + 0w1232       | hashOpn(I.Relative i) = Word.fromInt i + 0w1232
104       | hashOpn(I.LabelEA le) = LE.hash le + 0w44444       | hashOpn(I.LabelEA le) = LE.hash le + 0w44444
105       | hashOpn(I.Direct r)  = Word.fromInt r       | hashOpn(I.Direct r)  = C.hashCell r
106       | hashOpn(I.MemReg r)  = Word.fromInt r + 0w2123       | hashOpn(I.MemReg r)  = C.hashCell r + 0w2123
107       | hashOpn(I.ST f) = Word.fromInt f + 0w88       | hashOpn(I.ST f) = C.hashCell f + 0w88
108       | hashOpn(I.FPR f) = Word.fromInt f + 0w881       | hashOpn(I.FPR f) = C.hashCell f + 0w881
109       | hashOpn(I.FDirect f) = Word.fromInt f + 0w31245       | hashOpn(I.FDirect f) = C.hashCell f + 0w31245
110       | hashOpn(I.Displace {base, disp, ...}) =       | hashOpn(I.Displace {base, disp, ...}) =
111           hashOpn disp + Word.fromInt base           hashOpn disp + C.hashCell base
112       | hashOpn(I.Indexed {base, index, scale, disp, ...}) =       | hashOpn(I.Indexed {base, index, scale, disp, ...}) =
113           Word.fromInt index + Word.fromInt scale + hashOpn disp           C.hashCell index + Word.fromInt scale + hashOpn disp
114     fun eqOpn(I.Immed a,I.Immed b) = a = b     fun eqOpn(I.Immed a,I.Immed b) = a = b
115       | eqOpn(I.ImmedLabel a,I.ImmedLabel b) = LE.==(a,b)       | eqOpn(I.ImmedLabel a,I.ImmedLabel b) = LE.==(a,b)
116       | eqOpn(I.Relative a,I.Relative b) = a = b       | eqOpn(I.Relative a,I.Relative b) = a = b
117       | eqOpn(I.LabelEA a,I.LabelEA b) = LE.==(a,b)       | eqOpn(I.LabelEA a,I.LabelEA b) = LE.==(a,b)
118       | eqOpn(I.Direct a,I.Direct b) = a = b       | eqOpn(I.Direct a,I.Direct b) = C.sameColor(a,b)
119       | eqOpn(I.MemReg a,I.MemReg b) = a = b       | eqOpn(I.MemReg a,I.MemReg b) = C.sameColor(a,b)
120       | eqOpn(I.FDirect a,I.FDirect b) = a = b       | eqOpn(I.FDirect a,I.FDirect b) = C.sameColor(a,b)
121       | eqOpn(I.ST a,I.ST b) = a = b       | eqOpn(I.ST a,I.ST b) = C.sameColor(a,b)
122       | eqOpn(I.FPR a,I.FPR b) = a = b       | eqOpn(I.FPR a,I.FPR b) = C.sameColor(a,b)
123       | 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,...}) =
124            a = c andalso eqOpn(b,d)            C.sameColor(a,c) andalso eqOpn(b,d)
125       | eqOpn(I.Indexed{base=a,index=b,scale=c,disp=d,...},       | eqOpn(I.Indexed{base=a,index=b,scale=c,disp=d,...},
126               I.Indexed{base=e,index=f,scale=g,disp=h,...}) =               I.Indexed{base=e,index=f,scale=g,disp=h,...}) =
127            b = f andalso c = g andalso a = e andalso eqOpn(d,h)            C.sameColor(b,f) andalso c = g
128              andalso sameCellOption(a,e) andalso eqOpn(d,h)
129       | eqOpn _ = false       | eqOpn _ = false
130       and sameCellOption(NONE, NONE) = true
131         | sameCellOption(SOME x, SOME y) = C.sameColor(x,y)
132         | sameCellOption _ = false
133    
134   (*========================================================================   (*========================================================================
135    *  Definition and use (for register allocation mainly)    *  Definition and use (for register allocation mainly)
# Line 165  Line 169 
169      case instr      case instr
170       of I.JMP(opnd, _)        => ([], operandUse opnd)       of I.JMP(opnd, _)        => ([], operandUse opnd)
171        | I.JCC{opnd, ...}      => ([], operandUse opnd)        | I.JCC{opnd, ...}      => ([], operandUse opnd)
172        | I.CALL(opnd,defs,uses,_)=> (#1 defs, operandAcc(opnd, #1 uses))        | I.CALL(opnd,defs,uses,_)=>
173               (C.getReg defs, operandAcc(opnd, C.getReg uses))
174        | I.MOVE{src, dst=I.Direct r, ...} => ([r], operandUse src)        | I.MOVE{src, dst=I.Direct r, ...} => ([r], operandUse src)
175        | I.MOVE{src, dst=I.MemReg r, ...} => ([r], operandUse src)        | I.MOVE{src, dst=I.MemReg r, ...} => ([r], operandUse src)
176        | I.MOVE{src, dst, ...} => ([], operandAcc(dst, operandUse src))        | I.MOVE{src, dst, ...} => ([], operandAcc(dst, operandUse src))
# Line 174  Line 179 
179          | I.TESTL arg | I.TESTW arg | I.TESTB arg ) => cmptest arg          | I.TESTL arg | I.TESTW arg | I.TESTB arg ) => cmptest arg
180        | I.BITOP{lsrc, rsrc, ...} => cmptest{lsrc=lsrc,rsrc=rsrc}        | I.BITOP{lsrc, rsrc, ...} => cmptest{lsrc=lsrc,rsrc=rsrc}
181        | 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,...} =>
182             if rs=rd then ([rd],[]) else ([rd],[rs,rd])             if C.sameColor(rs,rd) then ([rd],[]) else ([rd],[rs,rd])
183        | I.BINARY{src,dst,...} =>        | I.BINARY{src,dst,...} =>
184             (operandDef dst, operandAcc(src, operandUse dst))             (operandDef dst, operandAcc(src, operandUse dst))
185        | I.ENTER _             => ([C.esp, C.ebp], [C.esp, C.ebp])        | I.ENTER _             => ([C.esp, C.ebp], [C.esp, C.ebp])
# Line 255  Line 260 
260        | I.FLDS opnd             => ([], operand opnd)        | I.FLDS opnd             => ([], operand opnd)
261        | I.FUCOM opnd            => ([], operand opnd)        | I.FUCOM opnd            => ([], operand opnd)
262        | I.FUCOMP opnd           => ([], operand opnd)        | I.FUCOMP opnd           => ([], operand opnd)
263        | I.CALL(_, defs, uses,_) => (#2 defs, #2 uses)        | I.CALL(_, defs, uses,_) => (C.getFreg defs, C.getFreg uses)
264        | I.FBINARY{dst, src, ...}=> (operand dst, operand dst @ operand src)        | I.FBINARY{dst, src, ...}=> (operand dst, operand dst @ operand src)
265        | I.FCOPY{dst, src, tmp=SOME(I.FDirect f), ...}  => (f::dst, src)        | I.FCOPY{dst, src, tmp=SOME(I.FDirect f), ...}  => (f::dst, src)
266        | I.FCOPY{dst, src, tmp=SOME(I.FPR f), ...}  => (f::dst, src)        | I.FCOPY{dst, src, tmp=SOME(I.FPR f), ...}  => (f::dst, src)

Legend:
Removed from v.731  
changed lines
  Added in v.744

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