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

SCM Repository

[smlnj] Annotation of /MLRISC/releases/release-110.60/instructions/cells.sig
ViewVC logotype

Annotation of /MLRISC/releases/release-110.60/instructions/cells.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2203 - (view) (download) (as text)

1 : monnier 411 (*
2 : leunga 744 * This updated signature describes the abstractions on ``cells'', which
3 :     * denote storage cells in the machine architecture.
4 : monnier 245 *
5 : leunga 744 * Allen Leung (12/2/00)
6 :     *)
7 : george 889
8 :    
9 : leunga 744 (*
10 :     * Things that are architecture specific.
11 :     *)
12 : george 889 signature CELLS = sig
13 : leunga 744
14 : george 889 val cellkinds : CellsBasis.cellkind list
15 :     (* list of all the cellkinds *)
16 : monnier 245
17 : george 889 val firstPseudo : CellsBasis.cell_id
18 :     (* first pseudo register *)
19 :    
20 :     val cellkindDesc : CellsBasis.cellkind -> CellsBasis.cellkindDesc
21 :     (* find descriptor *)
22 : monnier 245
23 : george 889 val cellRange : CellsBasis.cellkind -> {low:int, high:int}
24 :     (* given a cellkind returns its encoding range *)
25 : leunga 775
26 : george 889 val Reg : CellsBasis.cellkind -> (CellsBasis.register_num -> CellsBasis.cell)
27 :     (* Returns the nth physical register of the given kind,
28 :     * 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.
30 :     * NOTE: this function returns the same cell for the
31 :     * same argument every time. See also the function cloneCell below
32 :     *)
33 : monnier 245
34 : george 889 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 *)
42 : monnier 245
43 : george 889 val Cell : CellsBasis.cellkind -> (CellsBasis.register_id -> CellsBasis.cell)
44 :     (* Same as Reg but we take the id instead.
45 :     * So, registerNum(Reg k r) = r, and
46 :     * registerId(Cell k id) = id
47 :     *)
48 : monnier 245
49 : george 889 val GPReg : int -> CellsBasis.cell (* abbreviation for Reg GP *)
50 :     val FPReg : int -> CellsBasis.cell (* abbreviation for Reg FP *)
51 : monnier 245
52 : leunga 744 (*
53 :     * Generate a new cell for a virtual register. The new cell
54 :     * is a pseudo register that is distinct from any other registers.
55 :     * IMPORTANT: if you are using newCell, it is important to
56 :     * partially apply it first to get a function. Then uses this
57 :     * function generate new cells. The first application takes
58 :     * time.
59 :     *)
60 : george 889 val newCell : CellsBasis.cellkind -> ('a -> CellsBasis.cell)
61 :     val newReg : 'a -> CellsBasis.cell (* abbreviation for newCell GP *)
62 :     val newFreg : 'a -> CellsBasis.cell (* abbreviation for newCell FP *)
63 : leunga 744
64 : george 889 val newDedicatedCell : CellsBasis.cellkind -> ('a -> CellsBasis.cell)
65 : george 823
66 : george 889 (* lookup the number of virtual registers in a CellsBasis.cellkind *)
67 :     val numCell : CellsBasis.cellkind -> (unit -> int)
68 : monnier 411
69 :     (* the next virtual register name *)
70 : george 889 val maxCell : unit -> CellsBasis.cell_id
71 : monnier 411
72 : leunga 744 (* Given a cell c, create a new pseudo register that has the same
73 :     * cellkind as c, and a new property list initialized
74 :     * with the contents of c's properity list.
75 : monnier 411 * Note: the numCell kind is NOT updated!
76 :     *)
77 : george 889 val newVar : CellsBasis.cell -> CellsBasis.cell
78 : monnier 411
79 : leunga 744 (* This is the same as above, except that if the original
80 :     * cell is colored, then the new cell has the same color.
81 :     * Note that it is possible to have two cells (or more) with
82 :     * the same physical color. In these cases they can be used
83 :     * to denote the same register, but they have different identities,
84 :     * and different property lists. This may be useful for
85 :     * representing the same register used in different situations.
86 :     * See the function Reg above.
87 :     *)
88 : george 889 val cloneCell : CellsBasis.cell -> CellsBasis.cell
89 : monnier 411
90 : leunga 744 (* Reset all counters. *)
91 :     val reset : unit -> unit
92 : monnier 411
93 : jhr 900 (* Abbreviations for cellsets *)
94 :     type cellset = CellsBasis.CellSet.cellset
95 : leunga 657
96 : jhr 900 val empty : cellset
97 :     val getReg : cellset -> CellsBasis.cell list
98 :     val addReg : CellsBasis.cell * cellset -> cellset
99 :     val rmvReg : CellsBasis.cell * cellset -> cellset
100 :     val getFreg : cellset -> CellsBasis.cell list
101 :     val addFreg : CellsBasis.cell * cellset -> cellset
102 :     val rmvFreg : CellsBasis.cell * cellset -> cellset
103 : monnier 245
104 : jhr 900 val getCellsByKind : CellsBasis.cellkind -> cellset -> CellsBasis.cell list
105 :     val updateCellsByKind : CellsBasis.cellkind
106 :     -> cellset * CellsBasis.cell list
107 :     -> cellset
108 : monnier 411
109 : leunga 744 (* Return a register that is always zero on the architecture,
110 :     * if one exists. IMPORTANT: each call returns the same cell.
111 :     * See also cloneCell above.
112 :     *)
113 : george 889 val zeroReg : CellsBasis.cellkind -> CellsBasis.cell option
114 : leunga 744
115 : george 889 val defaultValues : CellsBasis.cellkind -> (CellsBasis.register_id * int) list
116 : monnier 411
117 : george 889 val stackptrR : CellsBasis.cell (* stack pointer register *)
118 :     val asmTmpR : CellsBasis.cell (* assembly temporary *)
119 :     val fasmTmp : CellsBasis.cell (* floating point temporary *)
120 : monnier 411 end
121 : leunga 744
122 : george 889
123 :    

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