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 683, Wed Jul 5 00:42:19 2000 UTC revision 731, Fri Nov 10 22:57:45 2000 UTC
# Line 36  Line 36 
36      | moveInstr(I.FCOPY _) = true      | moveInstr(I.FCOPY _) = true
37      | moveInstr(I.MOVE{mvOp=I.MOVL, src=I.Direct _, dst=I.MemReg _, ...}) = true      | moveInstr(I.MOVE{mvOp=I.MOVL, src=I.Direct _, dst=I.MemReg _, ...}) = true
38      | moveInstr(I.MOVE{mvOp=I.MOVL, src=I.MemReg _, dst=I.Direct _, ...}) = true      | moveInstr(I.MOVE{mvOp=I.MOVL, src=I.MemReg _, dst=I.Direct _, ...}) = true
39        | moveInstr(I.FMOVE{fsize=I.FP64,src=I.FPR _,dst=I.FPR _, ...}) = true
40        | moveInstr(I.FMOVE{fsize=I.FP64,src=I.FPR _,dst=I.FDirect _, ...}) = true
41        | moveInstr(I.FMOVE{fsize=I.FP64,src=I.FDirect _,dst=I.FPR _, ...}) = true
42        | moveInstr(I.FMOVE{fsize=I.FP64,src=I.FDirect _,dst=I.FDirect _, ...}) = true
43      | moveInstr(I.ANNOTATION{i,...}) = moveInstr i      | moveInstr(I.ANNOTATION{i,...}) = moveInstr i
44      | moveInstr _ = false      | moveInstr _ = false
45    
# Line 47  Line 51 
51    *========================================================================*)    *========================================================================*)
52    fun moveTmpR(I.COPY{tmp=SOME(I.Direct r), ...}) = SOME r    fun moveTmpR(I.COPY{tmp=SOME(I.Direct r), ...}) = SOME r
53      | moveTmpR(I.FCOPY{tmp=SOME(I.FDirect f), ...}) = SOME f      | moveTmpR(I.FCOPY{tmp=SOME(I.FDirect f), ...}) = SOME f
54        | moveTmpR(I.FCOPY{tmp=SOME(I.FPR f), ...}) = SOME f
55      | moveTmpR(I.ANNOTATION{i,...}) = moveTmpR i      | moveTmpR(I.ANNOTATION{i,...}) = moveTmpR i
56      | moveTmpR _ = NONE      | moveTmpR _ = NONE
57    
# Line 54  Line 59 
59      | moveDstSrc(I.FCOPY{src, dst, ...}) = (dst, src)      | moveDstSrc(I.FCOPY{src, dst, ...}) = (dst, src)
60      | moveDstSrc(I.MOVE{src=I.Direct rs, dst=I.MemReg rd, ...}) = ([rd], [rs])      | moveDstSrc(I.MOVE{src=I.Direct rs, dst=I.MemReg rd, ...}) = ([rd], [rs])
61      | moveDstSrc(I.MOVE{src=I.MemReg rs, dst=I.Direct rd, ...}) = ([rd], [rs])      | moveDstSrc(I.MOVE{src=I.MemReg rs, dst=I.Direct rd, ...}) = ([rd], [rs])
62        | moveDstSrc(I.FMOVE{src=I.FPR rs, dst=I.FPR rd, ...}) = ([rd], [rs])
63        | moveDstSrc(I.FMOVE{src=I.FDirect rs, dst=I.FPR rd, ...}) = ([rd], [rs])
64        | moveDstSrc(I.FMOVE{src=I.FPR rs, dst=I.FDirect rd, ...}) = ([rd], [rs])
65        | moveDstSrc(I.FMOVE{src=I.FDirect rs, dst=I.FDirect rd, ...}) = ([rd], [rs])
66      | moveDstSrc(I.ANNOTATION{i,...}) = moveDstSrc i      | moveDstSrc(I.ANNOTATION{i,...}) = moveDstSrc i
67      | moveDstSrc _ = error "moveDstSrc"      | moveDstSrc _ = error "moveDstSrc"
68    
# Line 96  Line 105 
105       | hashOpn(I.Direct r)  = Word.fromInt r       | hashOpn(I.Direct r)  = Word.fromInt r
106       | hashOpn(I.MemReg r)  = Word.fromInt r + 0w2123       | hashOpn(I.MemReg r)  = Word.fromInt r + 0w2123
107       | hashOpn(I.ST f) = Word.fromInt f + 0w88       | hashOpn(I.ST f) = Word.fromInt f + 0w88
108       | hashOpn(I.FDirect f) = Word.fromInt f + 0w8888       | hashOpn(I.FPR f) = Word.fromInt f + 0w881
109         | hashOpn(I.FDirect f) = Word.fromInt f + 0w31245
110       | hashOpn(I.Displace {base, disp, ...}) =       | hashOpn(I.Displace {base, disp, ...}) =
111           hashOpn disp + Word.fromInt base           hashOpn disp + Word.fromInt base
112       | hashOpn(I.Indexed {base, index, scale, disp, ...}) =       | hashOpn(I.Indexed {base, index, scale, disp, ...}) =
# Line 107  Line 117 
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) = a = b
119       | eqOpn(I.MemReg a,I.MemReg b) = a = b       | eqOpn(I.MemReg a,I.MemReg b) = a = b
      | eqOpn(I.ST a,I.ST b) = a = b  
120       | eqOpn(I.FDirect a,I.FDirect b) = a = b       | eqOpn(I.FDirect a,I.FDirect b) = a = b
121         | eqOpn(I.ST a,I.ST b) = a = b
122         | eqOpn(I.FPR a,I.FPR b) = 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)            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,...},
# Line 131  Line 142 
142    
143      fun operandUse opnd = operandAcc(opnd, [])      fun operandUse opnd = operandAcc(opnd, [])
144    
145        fun operandUse2(src1, src2) = ([], operandAcc(src1, operandUse src2))
146        fun operandUse3(x, y, z) = ([], operandAcc(x, operandAcc(y, operandUse y)))
147    
148      fun operandDef(I.Direct r) = [r]      fun operandDef(I.Direct r) = [r]
149        | operandDef(I.MemReg r) = [r]        | operandDef(I.MemReg r) = [r]
150        | operandDef _ = []        | operandDef _ = []
# Line 191  Line 205 
205        | I.FIBINARY{src, ...}  => ([], operandUse src)        | I.FIBINARY{src, ...}  => ([], operandUse src)
206        | I.FENV{opnd, ...}     => ([], operandUse opnd)        | I.FENV{opnd, ...}     => ([], operandUse opnd)
207        | I.FNSTSW              => ([C.eax], [])        | I.FNSTSW              => ([C.eax], [])
208          | I.FUCOM opnd          => float opnd
209          | I.FUCOMP opnd         => float opnd
210    
211          | I.FMOVE{src, dst, ...} => operandUse2(src, dst)
212          | I.FILOAD{ea, dst, ...} => operandUse2(ea, dst)
213          | I.FCMP{lsrc, rsrc, ...} => operandUse2(lsrc, rsrc)
214          | I.FBINOP{lsrc, rsrc, dst, ...} => operandUse3(lsrc, rsrc, dst)
215          | I.FIBINOP{lsrc, rsrc, dst, ...} => operandUse3(lsrc, rsrc, dst)
216          | I.FUNOP{src, dst, ...} => operandUse2(src, dst)
217    
218        | I.SAHF                => ([], [C.eax])        | I.SAHF                => ([], [C.eax])
219          (* This sets the low order byte,          (* This sets the low order byte,
220           * do potentially it may define *and* use           * do potentially it may define *and* use
# Line 204  Line 228 
228    
229    fun defUseF instr = let    fun defUseF instr = let
230      fun operand(I.FDirect f) = [f]      fun operand(I.FDirect f) = [f]
231          | operand(I.FPR f) = [f]
232        | operand _ = []        | operand _ = []
233    
234        fun operandAcc(I.FDirect f, acc) = f::acc
235          | operandAcc(I.FPR f, acc) = f::acc
236          | operandAcc(_ , acc) = acc
237    
238        fun fbinop(lsrc, rsrc, dst) =
239        let val def = operand dst
240            val use = operandAcc(lsrc, operand rsrc)
241        in  (def, use)
242        end
243    
244        val fcmpTmp = [C.ST 0]
245    
246    in    in
247      case instr      case instr
248       of I.FSTPT opnd            => (operand opnd, [])       of I.FSTPT opnd            => (operand opnd, [])
# Line 215  Line 253 
253        | I.FLDT opnd             => ([], operand opnd)        | I.FLDT opnd             => ([], operand opnd)
254        | I.FLDL opnd             => ([], operand opnd)        | I.FLDL opnd             => ([], operand opnd)
255        | I.FLDS opnd             => ([], operand opnd)        | I.FLDS opnd             => ([], operand opnd)
256          | I.FUCOM opnd            => ([], operand opnd)
257          | I.FUCOMP opnd           => ([], operand opnd)
258        | I.CALL(_, defs, uses,_) => (#2 defs, #2 uses)        | I.CALL(_, defs, uses,_) => (#2 defs, #2 uses)
259        | I.FBINARY{dst, src, ...}=> (operand dst, operand dst @ operand src)        | I.FBINARY{dst, src, ...}=> (operand dst, operand dst @ operand src)
260        | I.FCOPY{dst, src, tmp=SOME(I.FDirect f), ...}  => (f::dst, src)        | I.FCOPY{dst, src, tmp=SOME(I.FDirect f), ...}  => (f::dst, src)
261          | I.FCOPY{dst, src, tmp=SOME(I.FPR f), ...}  => (f::dst, src)
262        | I.FCOPY{dst, src, ...}  => (dst, src)        | I.FCOPY{dst, src, ...}  => (dst, src)
263    
264          | I.FMOVE{src, dst, ...} => (operand dst, operand src)
265          | I.FILOAD{ea, dst, ...} => (operand dst, [])
266          | I.FCMP{lsrc, rsrc, ...} => (fcmpTmp, operandAcc(lsrc, operand rsrc))
267          | I.FBINOP{lsrc, rsrc, dst, ...} => fbinop(lsrc, rsrc, dst)
268          | I.FIBINOP{lsrc, rsrc, dst, ...} => fbinop(lsrc, rsrc, dst)
269          | I.FUNOP{src, dst, ...} => (operand dst, operand src)
270    
271        | I.ANNOTATION{a=C.DEF_USE{cellkind=C.FP,defs,uses}, i, ...} =>        | I.ANNOTATION{a=C.DEF_USE{cellkind=C.FP,defs,uses}, i, ...} =>
272          let val (d,u) = defUseF i in (defs@d, u@uses) end          let val (d,u) = defUseF i in (defs@d, u@uses) end
273        | I.ANNOTATION{a, i, ...} => defUseF i        | I.ANNOTATION{a, i, ...} => defUseF i

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

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