SCM Repository
Annotation of /sml/trunk/src/MLRISC/sparc/ra/sparcRegAlloc.sml
Parent Directory
|
Revision Log
Revision 651 - (view) (download)
1 : | monnier | 247 | (* sparcRegAlloc.sml --- sparc 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 SparcRegAlloc(structure I : INSTRUCTIONS where C = SparcCells | ||
12 : | structure P : INSN_PROPERTIES where I = I | ||
13 : | structure F : FLOWGRAPH where I = I | ||
14 : | monnier | 411 | structure Asm : INSTRUCTION_EMITTER where I = I and P=F.P |
15 : | monnier | 247 | ) : |
16 : | sig | ||
17 : | monnier | 411 | structure I : INSTRUCTIONS |
18 : | monnier | 247 | functor IntRa (structure RaUser : RA_USER_PARAMS |
19 : | monnier | 411 | where I = I and B = F.B) : RA |
20 : | monnier | 247 | functor FloatRa (structure RaUser : RA_USER_PARAMS |
21 : | monnier | 411 | where I = I and B = F.B) : RA |
22 : | end= | ||
23 : | monnier | 247 | struct |
24 : | |||
25 : | monnier | 411 | structure I = I |
26 : | monnier | 247 | structure C=I.C |
27 : | |||
28 : | (* liveness analysis for general purpose registers *) | ||
29 : | structure RegLiveness = | ||
30 : | Liveness(structure Flowgraph=F | ||
31 : | structure Instruction=I | ||
32 : | val defUse = P.defUse C.GP | ||
33 : | monnier | 411 | val regSet = C.getCell C.GP |
34 : | val cellset = C.updateCell C.GP) | ||
35 : | monnier | 247 | |
36 : | |||
37 : | functor IntRa = | ||
38 : | RegAllocator | ||
39 : | (structure RaArch = struct | ||
40 : | structure InsnProps = P | ||
41 : | structure AsmEmitter = Asm | ||
42 : | structure I = I | ||
43 : | structure Liveness=RegLiveness | ||
44 : | |||
45 : | val defUse = P.defUse C.GP | ||
46 : | val firstPseudoR = 32 | ||
47 : | val maxPseudoR = SparcCells.maxCell | ||
48 : | val numRegs = SparcCells.numCell SparcCells.GP | ||
49 : | monnier | 411 | val regSet = C.getCell C.GP |
50 : | monnier | 247 | end) |
51 : | |||
52 : | (* liveness analysis for floating point registers *) | ||
53 : | structure FregLiveness = | ||
54 : | Liveness(structure Flowgraph=F | ||
55 : | structure Instruction=I | ||
56 : | val defUse = P.defUse C.FP | ||
57 : | monnier | 411 | val regSet = C.getCell C.FP |
58 : | val cellset = C.updateCell C.FP) | ||
59 : | monnier | 247 | |
60 : | functor FloatRa = | ||
61 : | RegAllocator | ||
62 : | (structure RaArch = struct | ||
63 : | structure InsnProps = P | ||
64 : | structure AsmEmitter = Asm | ||
65 : | structure I = I | ||
66 : | structure Liveness=FregLiveness | ||
67 : | |||
68 : | val defUse = P.defUse C.FP | ||
69 : | monnier | 411 | val firstPseudoR = 64 |
70 : | monnier | 247 | val maxPseudoR = SparcCells.maxCell |
71 : | val numRegs = SparcCells.numCell SparcCells.FP | ||
72 : | monnier | 411 | val regSet = C.getCell C.FP |
73 : | monnier | 247 | end) |
74 : | end | ||
75 : |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |