|
|
Cells
MLRISC uses
the CELLS
interface to define all readable/writable resources
in a machine architecture, or cells
The types defined herein are:
- cellkind -- different classes of cells are assigned
difference cellkinds. The following cellkinds should be present
- GP -- general purpose registers.
- FP -- floating point registers.
- CC -- condition code registers.
In addition, the cellkinds MEM and CTRL
should also be defined. These are used for representing
memory based data dependence and control dependence.
- MEM -- memory
- CTRL -- control dependence
- regmap -- register map
- cellset -- a cellset represent a set of cells. This
type can be used to denote live-in/live-out information. Cellsets are
implemented as immutable abstract types.
These core definitions are defined in the following signature
signature CELLS_BASIS =
sig
eqtype cellkind
type cell = int
type regmap = cell Intmap.intmap
exception Cells
val cellkinds : cellkind list
val cellkindToString : cellkind -> string
val firstPseudo : cell
val Reg : cellkind -> int -> cell
val GPReg : int -> cell
val FPReg : int -> cell
val cellRange : cellkind -> {low:int, high:int}
val newCell : cellkind -> 'a -> cell
val cellKind : cell -> cellkind
val updateCellKind : cell * cellkind -> unit
val numCell : cellkind -> unit -> int
val maxCell : unit -> cell
val newReg : 'a -> cell
val newFreg : 'a -> cell
val newVar : cell -> cell
val regmap : unit -> regmap
val lookup : regmap -> cell -> cell
val reset : unit -> unit
end
- cellkinds -- this is a list of all the cellkinds defined in the
architecture
- cellkindToString -- this function maps a cellkind into its name
- firstPseudo -- MLRISC numbered physical resources
in the architecture from 0 to firstPseudo-1.
This is the first usable virtual register number.
- Reg -- This function maps the th physical
resource of a particular cellkind to its internal encoding used by MLRISC.
Note that all resources in MLRISC are named uniquely.
- GPReg -- abbreviation for Reg GP
- FPReg -- abbreviation for Reg FP
- cellRange -- this returns a range \sml{{low, high}}
when given a cellkind, with denotes the range of physical resources
- newCell -- This function returns a new virtual register
of a particular cellkind.
- newReg -- abbreviation as newCell GP
- newFreg -- abbreviation as newCell FP
- cellKind -- When given a cell number, this returns its
cellkind. Note that this feature is not enabled by default.
- updateCellKind -- updates the cellkind of a cell.
- numCell -- returns the number of virtual cells allocated for one cellkind.
- maxCell -- returns the next virtual cell id.
- newVar -- given a cell id, return a new cell id of
the same cellkind.
- regmap -- This function returns a new empty regmap
- lookup -- This converts a regmap into a lookup function.
- reset -- This function resets all counters associated
with all virtual cells.
signature CELLS = sig
include CELLS_BASIS
val GP : cellkind
val FP : cellkind
val CC : cellkind
val MEM : cellkind
val CTRL : cellkind
val toString : cellkind -> cell -> string
val stackptrR : cell
val asmTmpR : cell
val fasmTmp : cell
val zeroReg : cellkind -> cell option
type cellset
val empty : cellset
val addCell : cellkind -> cell * cellset -> cellset
val rmvCell : cellkind -> cell * cellset -> cellset
val addReg : cell * cellset -> cellset
val rmvReg : cell * cellset -> cellset
val addFreg : cell * cellset -> cellset
val rmvFreg : cell * cellset -> cellset
val getCell : cellkind -> cellset -> cell list
val updateCell : cellkind -> cellset * cell list -> cellset
val cellsetToString : cellset -> string
val cellsetToString' : (cell -> cell) -> cellset -> string
val cellsetToCells : cellset -> cell list
end
- toString -- convert a cell id of a certain cellkind into
its assembly name.
- stackptrR -- the cell id of the stack pointer register.
- asmTmpR -- the cell id of the assembly temporary
- fasmTmp -- the cell id of the floating point temporary
- zeroReg -- given the cellkind, returns the cell id of the
source that always hold the value of zero, if there is any.
- empty -- an empty cellset
- addCell -- inserts a cell into a cellset
- rmvCell -- remove a cell from a cellset
- addReg -- abbreviation for addCell GP
- rmvReg -- abbreviation for rmvCell GP
- addFreg -- abbreviation for addCell FP
- rmvFreg -- abbreviation for rmvCell FP
- getCell -- lookup all cells of a particular cellkind from
the cellset
- updateCell -- replace all cells of a particular cellkind
from the cellset.
- cellsetToString -- pretty print a cellset
- cellsetToString' -- pretty print a cellset, but first
apply a regmap function.
- cellsetToCells -- convert a cellset into list form.
|
|
Generated by
mltex2html
|
Last modified: Mon Jun 8 14:18:05 UTC 2009 by buildd@vernadsky
|
|