Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/ppc/ra/ppcRegAlloc.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/ppc/ra/ppcRegAlloc.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 233 - (view) (download)

1 : monnier 233 functor PPCRegAlloc(structure I : INSTRUCTIONS where C = PPCCells
2 :     structure P : INSN_PROPERTIES where I = I
3 :     structure F : FLOWGRAPH where I = I and P = P
4 :     structure Asm : EMITTER_NEW where I = I and P = P) :
5 :     sig
6 :     functor IntRa (structure RaUser : RA_USER_PARAMS
7 :     where I = I
8 :     where type B.name = F.B.name) : sig
9 :     datatype mode = REGISTER_ALLOCATION | COPY_PROPAGATION
10 :     val ra : mode -> F.cluster -> F.cluster
11 :     end
12 :     functor FloatRa (structure RaUser : RA_USER_PARAMS
13 :     where I = I
14 :     where type B.name = F.B.name) : sig
15 :     datatype mode = REGISTER_ALLOCATION | COPY_PROPAGATION
16 :     val ra : mode -> F.cluster -> F.cluster
17 :     end
18 :     end=
19 :     struct
20 :    
21 :     structure C=I.C
22 :    
23 :     (* liveness analysis for general purpose registers *)
24 :     structure RegLiveness =
25 :     Liveness(structure Flowgraph=F
26 :     structure Instruction=I
27 :     val defUse = P.defUse C.GP
28 :     fun regSet c = #1 (c:PPCCells.cellset)
29 :     fun cellset((_,f,c),r) = (r,f,c))
30 :    
31 :    
32 :     functor IntRa =
33 :     RegAllocator
34 :     (structure RaArch = struct
35 :     structure InsnProps = P
36 :     structure AsmEmitter = Asm
37 :     structure I = I
38 :     structure Liveness=RegLiveness
39 :    
40 :     val defUse = P.defUse C.GP
41 :     val firstPseudoR = 32
42 :     val maxPseudoR = PPCCells.maxCell
43 :     val numRegs = PPCCells.numCell PPCCells.GP
44 :     fun regSet c = #1 (c:PPCCells.cellset)
45 :     end)
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 :     fun regSet c = #2 (c:PPCCells.cellset)
53 :     fun cellset((r,_,c),f) = (r,f,c))
54 :    
55 :     functor FloatRa =
56 :     RegAllocator
57 :     (structure RaArch = struct
58 :     structure InsnProps = P
59 :     structure AsmEmitter = Asm
60 :     structure I = I
61 :     structure Liveness=FregLiveness
62 :    
63 :     val defUse = P.defUse C.FP
64 :     val firstPseudoR = 32
65 :     val maxPseudoR = PPCCells.maxCell
66 :     val numRegs = PPCCells.numCell PPCCells.FP
67 :     fun regSet c = #2 (c:PPCCells.cellset)
68 :     end)
69 :     end
70 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0