| 1 |
(* hppaRegAlloc.sml --- hppa integer and floating register allocator |
| 2 |
* |
| 3 |
* COPYRIGHT (c) 1996 AT&T Bell Laboratories. |
| 4 |
* |
| 5 |
*) |
| 6 |
|
| 7 |
(* Integer and floating register allocators are a partial application |
| 8 |
* of a curried functor. |
| 9 |
*) |
| 10 |
|
| 11 |
functor HppaRegAlloc(structure I : INSTRUCTIONS where C = HppaCells |
| 12 |
structure P : INSN_PROPERTIES where I = I |
| 13 |
structure F : FLOWGRAPH where I = I and P = P |
| 14 |
structure Asm : INSTRUCTION_EMITTER where I = I and P = P) : |
| 15 |
sig |
| 16 |
functor IntRa (structure RaUser : RA_USER_PARAMS |
| 17 |
where I = I |
| 18 |
where type B.name = F.B.name) : RA |
| 19 |
functor FloatRa (structure RaUser : RA_USER_PARAMS |
| 20 |
where I = I |
| 21 |
where type B.name = F.B.name) : RA |
| 22 |
end= |
| 23 |
struct |
| 24 |
|
| 25 |
structure C=I.C |
| 26 |
|
| 27 |
(* liveness analysis for general purpose registers *) |
| 28 |
structure RegLiveness = |
| 29 |
Liveness(structure Flowgraph=F |
| 30 |
structure Instruction=I |
| 31 |
val defUse = P.defUse C.GP |
| 32 |
val regSet = C.getCell C.GP |
| 33 |
val cellset = C.updateCell C.GP) |
| 34 |
|
| 35 |
|
| 36 |
functor IntRa = |
| 37 |
RegAllocator |
| 38 |
(structure RaArch = struct |
| 39 |
structure InsnProps = P |
| 40 |
structure AsmEmitter = Asm |
| 41 |
structure I = I |
| 42 |
structure Liveness=RegLiveness |
| 43 |
|
| 44 |
val defUse = P.defUse C.GP |
| 45 |
val firstPseudoR = 32 |
| 46 |
val maxPseudoR = C.maxCell |
| 47 |
val numRegs = C.numCell C.GP |
| 48 |
val regSet = C.getCell C.GP |
| 49 |
end) |
| 50 |
|
| 51 |
(* liveness analysis for floating point registers *) |
| 52 |
structure FregLiveness = |
| 53 |
Liveness(structure Flowgraph=F |
| 54 |
structure Instruction=I |
| 55 |
val defUse = P.defUse C.FP |
| 56 |
val regSet = C.getCell C.FP |
| 57 |
val cellset = C.updateCell C.FP) |
| 58 |
|
| 59 |
functor FloatRa = |
| 60 |
RegAllocator |
| 61 |
(structure RaArch = struct |
| 62 |
structure InsnProps = P |
| 63 |
structure AsmEmitter = Asm |
| 64 |
structure I = I |
| 65 |
structure Liveness=FregLiveness |
| 66 |
|
| 67 |
val defUse = P.defUse C.FP |
| 68 |
val firstPseudoR = 64 |
| 69 |
val maxPseudoR = C.maxCell |
| 70 |
val numRegs = HppaCells.numCell C.FP |
| 71 |
val regSet = C.getCell C.FP |
| 72 |
end) |
| 73 |
end |
| 74 |
|