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/Doc/cells.html
ViewVC logotype

View of /sml/trunk/src/MLRISC/Doc/cells.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 499 - (download) (as text) (annotate)
Tue Dec 7 15:44:50 1999 UTC (20 years, 3 months ago) by monnier
File size: 6336 byte(s)
This commit was generated by cvs2svn to compensate for changes in r498,
which included commits to RCS files with non-trunk default branches.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.07 [en] (X11; I; Linux 2.2.7 i686) [Netscape]">
</HEAD>
<BODY bgcolor="#FFFFFF">

<CENTER>
<H1>
<FONT COLOR="#aa0000">Cells</FONT></H1></CENTER>

MLRISC uses
the <em> CELLS </em> interface to define all readable/writable resources
in a machine architecture,  or <em> cells </em> 
The types defined herein are:
<ul>
 <li> <tt> cellkind </tt> -- different classes of cells are assigned
   difference cellkinds.  The following cellkinds should be present
   <ul>
     <li> <tt> GP </tt> -- general purpose registers.
     <li> <tt> FP </tt> -- floating point registers.
     <li> <tt> CC </tt> -- condition code registers.
   </ul>
   In addition, the cellkinds <tt> MEM </tt> and <tt>CTRL </tt>
   should also be defined.  These are used for representing
   memory based data dependence and control dependence.
   <ul>
     <li> <tt> MEM </tt> -- memory 
     <li> <tt> CTRL </tt> -- control dependence
   </ul> 
 <li> <tt> regmap </tt> -- <a href="regmap.html"> register map </a>
 <li> <tt> cellset </tt> -- 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.
</ul>

These core definitions are defined in the
signature <a href="../instructions/cells.sig" target=code> CELLS_BASIS </a>:
<pre>
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
</pre>

<ul>
  <li><tt>cellkinds</tt> -- this is a list of all the cellkinds defined in the
architecture
  <li><tt>cellkindToString</tt> -- this function maps a cellkind into its name
  <li><tt>firstPseudo</tt> -- MLRISC numbered physical resources
   in the architecture from 0 to firstPseudo-1.  
   This is the first usable virtual register number.
  <li><tt>Reg</tt> -- This function maps the <em>i</em>th physical
   resource of a particular cellkind to its internal encoding used by MLRISC.
   Note that all resources in MLRISC are named uniquely.
  <li><tt>GPReg</tt> -- abbreviation for <tt> Reg GP</tt> 
  <li><tt>FPReg</tt> -- abbreviation for <tt> Reg FP</tt> 
  <li> <tt>cellRange</tt> -- this returns a range <tt> {low, high}</tt>
   when given a cellkind, with denotes the range of physical resources
  <li> <tt> newCell</tt>  -- This function returns a new virtual register 
   of a particular cellkind.
  <li> <tt>newReg</tt> -- abbreviation as <tt>newCell GP</tt>
  <li> <tt>newFreg</tt> -- abbreviation as <tt>newCell FP</tt>
  <li> <tt> cellKind </tt>  -- When given a cell number, this returns its
    cellkind.  Note that this feature is not enabled by default.
  <li> <tt>updateCellKind</tt> -- updates the cellkind of a cell.
  <li> <tt>numCell</tt> -- returns the number of virtual cells allocated for one cellkind.
  <li> <tt> maxCell </tt> --  returns the next virtual cell id.
  <li> <tt> newVar </tt>  -- given a cell id, return a new cell id of
     the same cellkind.
  <li> <tt> regmap </tt> -- This function returns a new empty regmap
  <li> <tt> lookup </tt> -- This converts a regmap into a lookup function.
  <li> <tt> reset  </tt> -- This function resets all counters associated
with all virtual cells.
</ul>

<pre>
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
</pre>

<ul> 
  <li> <tt>toString</tt> -- convert a cell id of a certain cellkind into
its assembly name.
  <li> <tt>stackptrR</tt> -- the cell id of the stack pointer register. 
  <li> <tt>asmTmpR</tt> -- the cell id of the assembly temporary 
  <li> <tt>fasmTmp</tt> -- the cell id of the floating point temporary
  <li> <tt>zeroReg</tt> -- given the cellkind, returns the cell id of the
   source that always hold the value of zero, if there is any. 
  <li> <tt>empty</tt> -- an empty cellset
  <li> <tt>addCell</tt> -- inserts a cell into a cellset
  <li> <tt>rmvCell</tt> -- remove a cell from a cellset
  <li> <tt>addReg</tt> -- abbreviation for <tt> addCell GP </tt>
  <li> <tt>rmvReg</tt> -- abbreviation for <tt> rmvCell GP </tt> 
  <li> <tt>addFreg</tt> -- abbreviation for <tt> addCell FP </tt>
  <li> <tt>rmvFreg</tt> -- abbreviation for <tt> rmvCell FP </tt> 
  <li> <tt>getCell</tt> -- lookup all cells of a particular cellkind from
the cellset
  <li> <tt>updateCell</tt> -- replace all cells of a particular cellkind
from the cellset. 
   <li> <tt>cellsetToString</tt> -- pretty print a cellset 
   <li> <tt>cellsetToString'</tt> -- pretty print a cellset, but first
apply a regmap function.
   <li> <tt>cellsetToCells</tt> -- convert a cellset into list form.
</ul>

<HR>

</BODY>
</HTML>

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