| 1 |
(* |
| 2 |
* A simple round robin based register allocator. |
| 3 |
* Now with the ability to get register pairs. |
| 4 |
* -- Allen |
| 5 |
*) |
| 6 |
signature GETREG = |
| 7 |
sig |
| 8 |
exception GetReg |
| 9 |
|
| 10 |
(* get a register, unconstrained but with optional preference *) |
| 11 |
(* if sub(proh,r) = stamp that means the register is prohibited *) |
| 12 |
val getreg : {pref:int list, stamp:int, proh:int Array.array} -> int |
| 13 |
|
| 14 |
(* get a register pair, must be an even/odd pair, returns the |
| 15 |
* even register (i.e. the smaller one) |
| 16 |
*) |
| 17 |
val getpair : {pref:int list, stamp:int, proh:int Array.array} -> int |
| 18 |
|
| 19 |
(* reset the state *) |
| 20 |
val reset : unit -> unit |
| 21 |
end |