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/ra/x86RA.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/x86/ra/x86RA.sml

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

revision 1008, Fri Dec 14 21:01:29 2001 UTC revision 1009, Wed Jan 9 19:44:22 2002 UTC
# Line 251  Line 251 
251          fun isDeadInstr(I.ANNOTATION{i, ...}) = isDeadInstr i          fun isDeadInstr(I.ANNOTATION{i, ...}) = isDeadInstr i
252            | isDeadInstr(I.INSTR(I.MOVE{dst=I.Direct rd, ...})) = isDead rd            | isDeadInstr(I.INSTR(I.MOVE{dst=I.Direct rd, ...})) = isDead rd
253            | isDeadInstr(I.INSTR(I.MOVE{dst=I.MemReg rd, ...})) = isDead rd            | isDeadInstr(I.INSTR(I.MOVE{dst=I.MemReg rd, ...})) = isDead rd
254            | isDeadInstr(I.INSTR(I.COPY{dst=[rd], ...})) = isDead rd            | isDeadInstr(I.COPY{k=CB.GP, dst=[rd], ...}) = isDead rd
255            | isDeadInstr _ = false            | isDeadInstr _ = false
256          fun scan [] = ()          fun scan [] = ()
257            | scan((blknum, CFG.BLOCK{insns, ...})::rest) =            | scan((blknum, CFG.BLOCK{insns, ...})::rest) =
# Line 332  Line 332 
332      (* -------------------------------------------------------------------      (* -------------------------------------------------------------------
333       * Callbacks for floating point K=32       * Callbacks for floating point K=32
334       * -------------------------------------------------------------------*)       * -------------------------------------------------------------------*)
335        fun fcopy{dst, src, tmp} =
336            I.COPY{k=CB.FP, sz=64, dst=dst, src=src, tmp=tmp}
337    
338      fun copyInstrF((rds as [_], rss as [_]), _) =      fun copyInstrF((rds as [_], rss as [_]), _) =
339            I.fcopy{dst=rds, src=rss, tmp=NONE}            fcopy{dst=rds, src=rss, tmp=NONE}
340        | copyInstrF((rds, rss), I.INSTR(I.FCOPY{tmp, ...})) =        | copyInstrF((rds, rss), I.COPY{k=CB.FP, tmp, ...}) =
341            I.fcopy{dst=rds, src=rss, tmp=tmp}            fcopy{dst=rds, src=rss, tmp=tmp}
342        | copyInstrF(x, I.ANNOTATION{i,a}) =        | copyInstrF(x, I.ANNOTATION{i,a}) =
343            I.ANNOTATION{i=copyInstrF(x, i), a=a}            I.ANNOTATION{i=copyInstrF(x, i), a=a}
344    
# Line 358  Line 361 
361          end          end
362         )         )
363    
364     fun spillFcopyTmp S {copy=I.INSTR(I.FCOPY{dst, src, ...}), spillLoc, reg,     fun spillFcopyTmp S {copy=I.COPY{k=CB.FP, dst, src, ...}, spillLoc, reg,
365                          annotations=an} =                          annotations=an} =
366          (floatSpillCnt := !floatSpillCnt + 1;          (floatSpillCnt := !floatSpillCnt + 1;
367           I.fcopy{dst=dst, src=src, tmp=SOME(getFregLoc(S, an, spillLoc))}           fcopy{dst=dst, src=src, tmp=SOME(getFregLoc(S, an, spillLoc))}
368          )          )
369       | spillFcopyTmp S {copy=I.ANNOTATION{i,a}, spillLoc, reg, annotations} =       | spillFcopyTmp S {copy=I.ANNOTATION{i,a}, spillLoc, reg, annotations} =
370          let val i = spillFcopyTmp S {copy=i, spillLoc=spillLoc, reg=reg,          let val i = spillFcopyTmp S {copy=i, spillLoc=spillLoc, reg=reg,
# Line 397  Line 400 
400    
401      fun copyInstrF'((rds as [d], rss as [s]), _) =      fun copyInstrF'((rds as [d], rss as [s]), _) =
402           I.fmove{fsize=I.FP64,src=FMemReg s,dst=FMemReg d}           I.fmove{fsize=I.FP64,src=FMemReg s,dst=FMemReg d}
403        | copyInstrF'((rds, rss), I.INSTR(I.FCOPY{tmp, ...})) =        | copyInstrF'((rds, rss), I.COPY{k=CB.FP, tmp, ...}) =
404           I.fcopy{dst=rds, src=rss, tmp=tmp}           fcopy{dst=rds, src=rss, tmp=tmp}
405        | copyInstrF'(x, I.ANNOTATION{i, a}) =        | copyInstrF'(x, I.ANNOTATION{i, a}) =
406           I.ANNOTATION{i=copyInstrF'(x,i), a=a}           I.ANNOTATION{i=copyInstrF'(x,i), a=a}
407    
# Line 424  Line 427 
427      (* -------------------------------------------------------------------      (* -------------------------------------------------------------------
428       * Integer 8 stuff       * Integer 8 stuff
429       * -------------------------------------------------------------------*)       * -------------------------------------------------------------------*)
430        fun copy{dst, src, tmp} = I.COPY{k=CB.GP, sz=32, dst=dst, src=src, tmp=tmp}
431      fun memToMemMove{dst, src} =      fun memToMemMove{dst, src} =
432          let val tmp = I.C.newReg()          let val tmp = I.C.newReg()
433          in  [I.move{mvOp=I.MOVL,src=src,dst=I.Direct tmp},          in  [I.move{mvOp=I.MOVL,src=src,dst=I.Direct tmp},
# Line 435  Line 439 
439          if CB.sameColor(d,s) then [] else          if CB.sameColor(d,s) then [] else
440          let val dx = CB.registerNum d and sx = CB.registerNum s          let val dx = CB.registerNum d and sx = CB.registerNum s
441          in  case (dx >= 8 andalso dx < 32, sx >= 8 andalso sx < 32) of          in  case (dx >= 8 andalso dx < 32, sx >= 8 andalso sx < 32) of
442               (false, false) => [I.copy{dst=rds, src=rss, tmp=NONE}]               (false, false) => [copy{dst=rds, src=rss, tmp=NONE}]
443             | (true, false) => [I.move{mvOp=I.MOVL,src=I.Direct s,             | (true, false) => [I.move{mvOp=I.MOVL,src=I.Direct s,
444                                        dst=I.MemReg d}]                                        dst=I.MemReg d}]
445             | (false, true) => [I.move{mvOp=I.MOVL,src=I.MemReg s,             | (false, true) => [I.move{mvOp=I.MOVL,src=I.MemReg s,
446                                        dst=I.Direct d}]                                        dst=I.Direct d}]
447             | (true, true) => memToMemMove{src=I.MemReg s, dst=I.MemReg d}             | (true, true) => memToMemMove{src=I.MemReg s, dst=I.MemReg d}
448          end          end
449        | copyInstrR((rds, rss), I.INSTR(I.COPY{tmp, ...})) =        | copyInstrR((rds, rss), I.COPY{k=CB.GP, tmp, ...}) =
450           [I.copy{dst=rds, src=rss, tmp=tmp}]           [copy{dst=rds, src=rss, tmp=tmp}]
451        | copyInstrR(x, I.ANNOTATION{i, a}) =        | copyInstrR(x, I.ANNOTATION{i, a}) =
452            copyInstrR(x, i) (* XXX *)            copyInstrR(x, i) (* XXX *)
453    
# Line 484  Line 488 
488              else [I.move{mvOp=I.MOVL, src=srcLoc, dst=dstLoc}]              else [I.move{mvOp=I.MOVL, src=srcLoc, dst=dstLoc}]
489          end          end
490    
491      fun spillCopyTmp S {copy=I.INSTR(I.COPY{src, dst,...}),      fun spillCopyTmp S {copy=I.COPY{k=CB.GP, src, dst,...},
492                          reg, spillLoc, annotations=an} =                          reg, spillLoc, annotations=an} =
493          (case getRegLoc(S, an, reg, spillLoc) of          (case getRegLoc(S, an, reg, spillLoc) of
494             {opnd=tmp, kind=SPILL_LOC} =>             {opnd=tmp, kind=SPILL_LOC} =>
495              (intSpillCnt := !intSpillCnt + 1;              (intSpillCnt := !intSpillCnt + 1;
496               I.copy{dst=dst, src=src, tmp=SOME tmp}               copy{dst=dst, src=src, tmp=SOME tmp}
497              )              )
498           | _ => error "spillCopyTmp"           | _ => error "spillCopyTmp"
499          )          )

Legend:
Removed from v.1008  
changed lines
  Added in v.1009

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