source: Deliverables/D2.2/8051/src/ASM/MIPS.mli @ 486

Last change on this file since 486 was 486, checked in by ayache, 8 years ago

Deliverable D2.2

File size: 2.6 KB
RevLine 
[486]1
2include Arch.S
3
4(*
5(* Adapted from Pottier's PP compiler *)
6
7(** This module defines the physical registers of the MIPS processor
8    and their conventional use. *)
9
10(* This is the size of a machine word in bytes. *)
11
12val word: int32
13
14(* This is the type of hardware registers. *)
15
16type register
17
18val equal:  register -> register -> bool
19(* Names *)
20val print:  register -> string
21(* Number *)
22val print2: register -> string
23
24(* A list of the registers used for passing function parameters. *)
25
26val parameters: register list
27
28(* The register used for returning function results. *)
29
30val result: register
31
32(* The return address register. It is best thought of as a register
33   that is used to pass a parameter (namely, the return address). *)
34
35val ra: register
36
37(* The zero register always holds the value 0. Although it is a
38   special register, it is considered allocatable; see module [Zero]
39   for an explanation. *)
40
41val zero: register
42
43(* Sets of hardware registers. *)
44
45module RegisterSet : sig
46  include Set.S with type elt = register
47  val disjoint: t -> t -> bool
48  val of_list: elt list -> t
49end
50
51(* Maps over hardware registers. *)
52
53module RegisterMap : sig
54
55  include Map.S with type key = register
56
57  (* [lift f s] turns the set [s] into a map where every element [x]
58     is mapped to [f x]. *)
59
60  val lift: (key -> 'a) -> RegisterSet.t -> 'a t
61
62end
63
64(* A set of all allocatable hardware registers, that is, of all
65   registers that are available for use by the register allocator --
66   as opposed to reserved for some fixed use. *)
67
68val allocatable: RegisterSet.t
69
70(* A set of all allocatable ``caller-saved'' hardware registers, that
71   is, of all allocatable registers that might be overwritten during a
72   function call. This includes the so-called ``caller-saved temporary
73   registers'' [$t0-$t9] as well as the registers used to implement
74   the calling convention, namely [$a0-$a3], [$v0], and [$ra]. *)
75
76val caller_saved: RegisterSet.t
77
78(* A set of all allocatable ``callee-saved'' hardware registers, that
79   is, of all allocatable registers that must be preserved by function
80   calls. *)
81
82val callee_saved: RegisterSet.t
83
84(* Two non-allocatable registers, reserved for transferring spilled
85   pseudo-registers to and from the stack. *)
86
87val st0: register
88val st1: register
89
90(* The stack pointer register. *)
91
92val sp: register
93
94(* The global pointer register. *)
95
96val gp_mips: register
97val gp_gnu: register
98
99(* A set of all registers that are used in the code that we generate.
100   This includes all allocatable registers, plus the four special
101   registers mentioned above. *)
102
103val registers: RegisterSet.t
104
105*)
Note: See TracBrowser for help on using the repository browser.