Debian Codegraph @

lib/mlrisc-lib/MLRISC/x86/ra/x86RegAlloc.sml

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