Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/ra/ra.sig
ViewVC logotype

View of /sml/trunk/src/MLRISC/ra/ra.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 576 - (download) (as text) (annotate)
Fri Mar 10 07:27:16 2000 UTC (19 years, 5 months ago) by leunga
File size: 2111 byte(s)

More assembly output problems involving the indexed addressing mode
on the x86 have been found and corrected. Thanks to Fermin Reig for the
fix.

The interface and implementation of the register allocator have been changed
slightly to accommodate the possibility to skip the register allocation
phases completely and go directly to memory allocation.  This is needed
for C-- use.

This fix only affects the x86 assembly output.
(*
 * The interface to the new register allocator.
 *
 * -- Allen
 *)
signature RA =
sig

   structure I : INSTRUCTIONS
   structure C : CELLS
   structure F : RA_FLOWGRAPH 
      sharing F.I = I
      sharing I.C = C

   type getreg = { pref  : C.cell list,
                   stamp : int, 
                   proh  : int Array.array
                 } -> C.cell

   type mode = word

   (*
    * Optimizations/options:
    * Or them together
    *)
   val NO_OPTIMIZATION      : mode
   val DEAD_COPY_ELIM       : mode
   val BIASED_SELECTION     : mode
   val SPILL_COLORING       : mode
   val SPILL_COALESCING     : mode
   val SPILL_PROPAGATION    : mode
   val COPY_PROPAGATION     : mode
   val HAS_PARALLEL_COPIES  : mode 
       (* The above MUST be used when spill coloring is used and
        * you have parallel copies in the program. Otherwise, phathom
        * problems involving copy temporaries may appear.
        *)

   (*
    * Perform register allocation.
    *
    * spillProh is a list of register ranges (inclusive) that cannot be spilled.
    *
    *)
   type raClient = 
   { cellkind     : C.cellkind,             (* kind of register *)
     spillProh    : (C.cell * C.cell) list, (* don't spill these (ranges) *)
     memRegs      : (C.cell * C.cell) list, (* ranges of memory registers *)
     K            : int,                    (* number of colors *)
     dedicated    : bool Array.array,       (* dedicated registers *)
     getreg       : getreg,                 (* how to find a color *)
     copyInstr    : F.Spill.copyInstr,      (* how to make a copy *)
     spill        : F.Spill.spill,          (* spill callback *)
     spillSrc     : F.Spill.spillSrc,       (* spill callback *)
     spillCopyTmp : F.Spill.spillCopyTmp,   (* spill callback *)
     reload       : F.Spill.reload,         (* reload callback *)
     reloadDst    : F.Spill.reloadDst,      (* reload callback *)
     renameSrc    : F.Spill.renameSrc,      (* rename callback *)
     mode         : mode                    (* mode *)
   } 

   val ra : raClient list -> F.flowgraph -> F.flowgraph

end

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