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/instructions/cells.sig
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/instructions/cells.sig

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

revision 888, Thu Jul 19 20:24:21 2001 UTC revision 889, Thu Jul 19 20:35:20 2001 UTC
# Line 4  Line 4 
4   *   *
5   * Allen Leung (12/2/00)   * Allen Leung (12/2/00)
6   *)   *)
7    
8    
9  (*  (*
10   * Things that are architecture specific.   * Things that are architecture specific.
11   *)   *)
12  signature CELLS_COMMON =  signature CELLS = sig
 sig  
    include CELLS_BASIS  
    structure CellsBasis : CELLS_BASIS = CellsBasis  
          sharing type cellkind     = CellsBasis.cellkind  
              and type cellkindDesc = CellsBasis.cellkindDesc  
              and type cellkindInfo = CellsBasis.cellkindInfo  
              and type cell         = CellsBasis.cell  
              and type HashTable.hash_table = CellsBasis.HashTable.hash_table  
              and type ColorTable.hash_table = CellsBasis.ColorTable.hash_table  
          sharing SortedCells = CellsBasis.SortedCells  
13    
14     exception Cells     val cellkinds : CellsBasis.cellkind list
15       (* list of all the cellkinds *)
16    
17     val cellkinds : cellkind list  (* list of all the cellkinds *)     val firstPseudo : CellsBasis.cell_id
18       (* first pseudo register *)
19    
20       val cellkindDesc : CellsBasis.cellkind -> CellsBasis.cellkindDesc
21       (* find descriptor *)
22    
23        (*     val cellRange : CellsBasis.cellkind -> {low:int, high:int}
        * For internal use only.  
        *)  
    val firstPseudo : cell_id      (* first pseudo register *)  
    val cellkindDesc : cellkind -> cellkindDesc (* find descriptor *)  
 (*   val cellCounter  : int ref *)  
   
24         (* given a cellkind returns its encoding range *)         (* given a cellkind returns its encoding range *)
    val cellRange : cellkind -> {low:int, high:int}  
25    
26       val Reg   : CellsBasis.cellkind -> (CellsBasis.register_num -> CellsBasis.cell)
27         (* Returns the nth physical register of the given kind,         (* Returns the nth physical register of the given kind,
28          * raises Cells if there are no physical register of the given number.          * raises Cells if there are no physical register of the given number.
29          * Also raises Cells if the given number if outside of the range.          * Also raises Cells if the given number if outside of the range.
30          * NOTE: this function returns the same cell for the          * NOTE: this function returns the same cell for the
31          * same argument every time.   See also the function cloneCell below          * same argument every time.   See also the function cloneCell below
32          *)          *)
    val Reg   : cellkind -> (register_num -> cell)  
33    
34       val Regs  :
35         CellsBasis.cellkind ->
36            {from : CellsBasis.register_num,
37             to   : CellsBasis.register_num,
38             step : int
39             } ->
40                CellsBasis.cell list
41         (* return a list of cells *)         (* return a list of cells *)
    val Regs  : cellkind -> {from:register_num, to:register_num, step:int} ->  
                  cell list  
42    
43       val Cell  : CellsBasis.cellkind -> (CellsBasis.register_id -> CellsBasis.cell)
44         (* Same as Reg but we take the id instead.         (* Same as Reg but we take the id instead.
45          * So, registerNum(Reg k r) = r, and          * So, registerNum(Reg k r) = r, and
46          *     registerId(Cell k id) = id          *     registerId(Cell k id) = id
47          *)          *)
    val Cell  : cellkind -> (register_id -> cell)  
48    
49     val GPReg : int -> cell (* abbreviation for Reg GP *)     val GPReg : int -> CellsBasis.cell (* abbreviation for Reg GP *)
50     val FPReg : int -> cell (* abbreviation for Reg FP *)     val FPReg : int -> CellsBasis.cell (* abbreviation for Reg FP *)
51    
52         (*         (*
53          * Generate a new cell for a virtual register.  The new cell          * Generate a new cell for a virtual register.  The new cell
# Line 63  Line 57 
57          * function generate new cells.  The first application takes          * function generate new cells.  The first application takes
58          * time.          * time.
59          *)          *)
60     val newCell   : cellkind -> ('a -> cell)     val newCell   : CellsBasis.cellkind -> ('a -> CellsBasis.cell)
61     val newReg    : 'a -> cell  (* abbreviation for newCell GP *)     val newReg    : 'a -> CellsBasis.cell  (* abbreviation for newCell GP *)
62     val newFreg   : 'a -> cell  (* abbreviation for newCell FP *)     val newFreg   : 'a -> CellsBasis.cell  (* abbreviation for newCell FP *)
63    
64     val newDedicatedCell : cellkind -> ('a -> cell)     val newDedicatedCell : CellsBasis.cellkind -> ('a -> CellsBasis.cell)
65    
66         (* lookup the number of virtual registers in a cellkind *)         (* lookup the number of virtual registers in a CellsBasis.cellkind *)
67     val numCell   : cellkind -> (unit -> int)     val numCell   : CellsBasis.cellkind -> (unit -> int)
68    
69         (* the next virtual register name *)         (* the next virtual register name *)
70     val maxCell   : unit -> cell_id     val maxCell   : unit -> CellsBasis.cell_id
71    
72         (* Given a cell c, create a new pseudo register that has the same         (* Given a cell c, create a new pseudo register that has the same
73          * cellkind as c, and a new property list initialized          * cellkind as c, and a new property list initialized
74          * with the contents of c's properity list.          * with the contents of c's properity list.
75          * Note: the numCell kind is NOT updated!          * Note: the numCell kind is NOT updated!
76          *)          *)
77     val newVar : cell -> cell     val newVar : CellsBasis.cell -> CellsBasis.cell
78    
79         (* This is the same as above, except that if the original         (* This is the same as above, except that if the original
80          * cell is colored, then the new cell has the same color.          * cell is colored, then the new cell has the same color.
# Line 91  Line 85 
85          * representing the same register used in different situations.          * representing the same register used in different situations.
86          * See the function Reg above.          * See the function Reg above.
87          *)          *)
88     val cloneCell : cell -> cell     val cloneCell : CellsBasis.cell -> CellsBasis.cell
89    
90         (* Reset all counters. *)         (* Reset all counters. *)
91     val reset     : unit -> unit     val reset     : unit -> unit
# Line 104  Line 98 
98        type cellset        type cellset
99        (* cellset functions *)        (* cellset functions *)
100        val empty      : cellset        val empty      : cellset
101        val add        : cell * cellset -> cellset        val add    : CellsBasis.cell * cellset -> cellset
102        val rmv        : cell * cellset -> cellset        val rmv    : CellsBasis.cell * cellset -> cellset
103        val get        : cellkind -> cellset -> cell list        val get    : CellsBasis.cellkind -> cellset -> CellsBasis.cell list
104        val update     : cellkind -> cellset * cell list -> cellset        val update : CellsBasis.cellkind -> cellset * CellsBasis.cell list -> cellset
105        val map        : {from:cell,to:cell} -> cellset -> cellset        val map    : {from:CellsBasis.cell, to:CellsBasis.cell} -> cellset -> cellset
106    
107        (* convert cellset into a list of cells *)        (* convert cellset into a list of cells *)
108        val toCellList : cellset -> cell list        val toCellList : cellset -> CellsBasis.cell list
109    
110        (* pretty printing *)        (* pretty printing *)
111        val toString   : cellset -> string        val toString   : cellset -> string
# Line 121  Line 115 
115     type cellset = CellSet.cellset     type cellset = CellSet.cellset
116    
117     val empty      : cellset     val empty      : cellset
118     val getReg     : cellset -> cell list     val getReg     : cellset -> CellsBasis.cell list
119     val addReg     : cell * cellset -> cellset     val addReg     : CellsBasis.cell * cellset -> cellset
120     val rmvReg     : cell * cellset -> cellset     val rmvReg     : CellsBasis.cell * cellset -> cellset
121     val getFreg    : cellset -> cell list     val getFreg    : cellset -> CellsBasis.cell list
122     val addFreg    : cell * cellset -> cellset     val addFreg    : CellsBasis.cell * cellset -> cellset
123     val rmvFreg    : cell * cellset -> cellset     val rmvFreg    : CellsBasis.cell * cellset -> cellset
124    
125         (* Return a register that is always zero on the architecture,         (* Return a register that is always zero on the architecture,
126          * if one exists.  IMPORTANT: each call returns the same cell.          * if one exists.  IMPORTANT: each call returns the same cell.
127          * See also cloneCell above.          * See also cloneCell above.
128          *)          *)
129     val zeroReg    : cellkind -> cell option     val zeroReg    : CellsBasis.cellkind -> CellsBasis.cell option
130    
131     val defaultValues : cellkind -> (register_id * int) list     val defaultValues : CellsBasis.cellkind -> (CellsBasis.register_id * int) list
132    
133       val stackptrR     : CellsBasis.cell (* stack pointer register *)
134       val asmTmpR       : CellsBasis.cell (* assembly temporary *)
135       val fasmTmp       : CellsBasis.cell (* floating point temporary *)
136  end  end
137    
138  (*  
139   * This is the abstract interface of cells.  
  *)  
 signature CELLS =  
 sig  
    include CELLS_COMMON  
    val stackptrR     : cell (* stack pointer register *)  
    val asmTmpR       : cell (* assembly temporary *)  
    val fasmTmp       : cell (* floating point temporary *)  
 end  

Legend:
Removed from v.888  
changed lines
  Added in v.889

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