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/branches/primop-branch/src/compiler/CodeGen/alpha32/alpha32CG.sml
ViewVC logotype

Annotation of /sml/branches/primop-branch/src/compiler/CodeGen/alpha32/alpha32CG.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1372 - (view) (download)

1 : monnier 429 (*
2 :     * Alpha32 specific backend
3 : monnier 247 *)
4 : monnier 429 structure Alpha32CG =
5 :     MachineGen
6 :     ( structure I = Alpha32Instr
7 : george 1033 structure T = Alpha32MLTree
8 : monnier 429 structure MachSpec = Alpha32Spec
9 : george 984 structure ClientPseudoOps = Alpha32ClientPseudoOps
10 : monnier 429 structure PseudoOps = Alpha32PseudoOps
11 : blume 773 structure Ext = SMLNJMLTreeExt(* generic extension *)
12 : monnier 429 structure CpsRegs = Alpha32CpsRegs
13 : monnier 475 structure InsnProps = Alpha32Props
14 : monnier 429 structure Asm = Alpha32AsmEmitter
15 : george 555 structure Shuffle = Alpha32Shuffle
16 : george 909
17 : blume 773 structure CCalls = DummyCCallsFn (Alpha32MLTree)
18 : george 823 structure OmitFramePtr = struct
19 :     exception NotImplemented
20 : george 909 structure CFG=Alpha32CFG
21 : george 823 structure I=Alpha32Instr
22 :     val vfp = CpsRegs.vfp
23 :     fun omitframeptr _ = raise NotImplemented
24 :     end
25 : george 1009 structure CB = CellsBasis
26 : george 823
27 : blume 773
28 : monnier 429 structure MLTreeComp=
29 :     Alpha(structure AlphaInstr = Alpha32Instr
30 :     structure AlphaMLTree = Alpha32MLTree
31 :     structure PseudoInstrs = Alpha32PseudoInstrs
32 : george 555 structure ExtensionComp = SMLNJMLTreeExtComp
33 :     (structure I = Alpha32Instr
34 :     structure T = Alpha32MLTree
35 : george 909 structure CFG = Alpha32CFG
36 : george 984 structure TS = Alpha32MLTreeStream
37 : george 555 )
38 : monnier 429 val mode32bit = true (* simulate 32 bit mode *)
39 :     val multCost = ref 8 (* just guessing *)
40 :     val useMultByConst = ref false (* just guessing *)
41 : leunga 583 val byteWordLoadStores = ref false
42 : george 546 val SMLNJfloatingPoint = true (* must be true for SML/NJ *)
43 : monnier 429 )
44 : monnier 247
45 : leunga 657 structure Jumps =
46 : monnier 429 AlphaJumps(structure Instr=Alpha32Instr
47 : george 984 structure Shuffle=Alpha32Shuffle
48 :     structure MLTreeEval=Alpha32MLTreeEval)
49 : monnier 247
50 : monnier 429 structure BackPatch =
51 : george 909 BBSched2(structure CFG=Alpha32CFG
52 : leunga 657 structure Jumps = Jumps
53 : george 1124 structure Props = Alpha32Props
54 : monnier 429 structure Emitter = Alpha32MCEmitter)
55 : monnier 247
56 : monnier 429 structure RA =
57 : leunga 744 RISC_RA
58 : monnier 429 (structure I = Alpha32Instr
59 : george 1033 structure CFG = Alpha32CFG
60 : monnier 429 structure InsnProps = InsnProps
61 :     structure Rewrite = AlphaRewrite(Alpha32Instr)
62 : george 1033 structure SpillInstr= AlphaSpillInstr(Alpha32Instr)
63 : monnier 429 structure Asm = Alpha32AsmEmitter
64 : leunga 744 structure SpillHeur = ChaitinSpillHeur
65 :     structure Spill = RASpill(structure InsnProps = InsnProps
66 :     structure Asm = Alpha32AsmEmitter)
67 : monnier 247
68 : leunga 744 val sp = I.C.stackptrR
69 : monnier 498 val spill = CPSRegions.spill
70 : monnier 247
71 : leunga 744 structure SpillTable = SpillTable(Alpha32Spec)
72 :    
73 :     val architecture = Alpha32Spec.architecture
74 :    
75 : george 1033 datatype spillOperandKind = SPILL_LOC | CONST_VAL
76 :     type spill_info = unit
77 : leunga 744
78 : george 1033 fun beforeRA _ = SpillTable.spillInit()
79 :    
80 : monnier 469 fun pure _ = false
81 :    
82 : monnier 429 (* make copies *)
83 : leunga 744 structure Int =
84 :     struct
85 :     val avail = Alpha32CpsRegs.availR
86 :     val dedicated = Alpha32CpsRegs.dedicatedR
87 : monnier 247
88 : george 1033 fun mkDisp loc = T.LI(T.I.fromInt (32, SpillTable.getRegLoc loc))
89 : monnier 247
90 : george 1033 fun spillLoc{info, an, cell, id} =
91 :     {opnd=I.Displace{base=sp, disp=mkDisp(RAGraph.FRAME id), mem=spill},
92 :     kind=SPILL_LOC}
93 : monnier 247
94 : leunga 796 val mode = RACore.NO_OPTIMIZATION
95 : leunga 744 end
96 :    
97 :     structure Float =
98 :     struct
99 :     val avail = Alpha32CpsRegs.availF
100 :     val dedicated = Alpha32CpsRegs.dedicatedF
101 :    
102 : george 1033 fun mkDisp loc = T.LI(T.I.fromInt (32, SpillTable.getFregLoc loc))
103 :     fun spillLoc(S, an, loc) =
104 :     I.Displace{base=sp, disp=mkDisp(RAGraph.FRAME loc), mem=spill}
105 : leunga 744
106 : leunga 796 val mode = RACore.NO_OPTIMIZATION
107 : leunga 744 end
108 : monnier 429 )
109 :     )

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