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

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/CodeGen/hppa/hppaCG.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/CodeGen/hppa/hppaCG.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 410, Fri Sep 3 00:25:03 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 1  Line 1 
1  functor HppaCG(structure Emitter : EMITTER_NEW  functor HppaCG(structure Emitter : INSTRUCTION_EMITTER
2                   where P = HppaPseudoOps                   where P = HppaPseudoOps
3                   and I = HppaInstr) : MACHINE_GEN =                   and I = HppaInstr
4                     and S.B = HppaMLTree.BNames) : MACHINE_GEN =
5  struct  struct
6    structure I = HppaInstr    structure I = HppaInstr
7    structure C = HppaCells    structure C = HppaCells
# Line 17  Line 18 
18    structure HppaRewrite = HppaRewrite(HppaInstr)    structure HppaRewrite = HppaRewrite(HppaInstr)
19    
20    (* properties of instruction set *)    (* properties of instruction set *)
21    structure P =    structure P = HppaProps(I)
     HppaProps(structure HppaInstr = I  
               structure Shuffle = HppaShuffle)  
22    
23      structure FreqProps = FreqProps(P)
24    
25    (* Label backpatching and basic block scheduling *)    (* Label backpatching and basic block scheduling *)
26    structure BBSched =    structure BBSched =
27      BBSched2(structure Flowgraph = F      SpanDependencyResolution
28                (structure Flowgraph = F
29                 structure Emitter = Emitter
30               structure Jumps =               structure Jumps =
31                 HppaJumps(structure Instr=HppaInstr                 HppaJumps(structure Instr=HppaInstr
32                           structure Shuffle=HppaShuffle)                           structure Shuffle=HppaShuffle)
33               structure Emitter = Emitter)               structure DelaySlot = HppaDelaySlots(structure I = I
34                                                      structure P = P)
35    (* flow graph pretty printing routine *)               structure Props = P
36    structure PrintFlowGraph =              )
37       PrintFlowGraphFn (structure FlowGraph = F  
38                         structure Emitter   = Asm)    val intSpillCnt = Ctrl.getCounter "ra-int-spills"
39      val floatSpillCnt = Ctrl.getCounter "ra-float-spills"
40    val intSpillCnt = Ctrl.getInt "ra-int-spills"    val intReloadCnt = Ctrl.getCounter "ra-int-reloads"
41    val floatSpillCnt = Ctrl.getInt "ra-float-spills"    val floatReloadCnt = Ctrl.getCounter "ra-float-reloads"
   val intReloadCnt = Ctrl.getInt "ra-int-reloads"  
   val floatReloadCnt = Ctrl.getInt "ra-float-reloads"  
42    
43    (* register allocation *)    (* register allocation *)
44    structure RegAllocation :    structure RegAllocation :
# Line 88  Line 88 
88            end            end
89    
90      fun mvInstr(rd,rs) = I.ARITH{a=I.OR, r1=rs, r2=0, t=rd}      fun mvInstr(rd,rs) = I.ARITH{a=I.OR, r1=rs, r2=0, t=rd}
91      fun fmvInstr(fd,fs) = I.FUNARY{fu=I.FCPY, f=fs, t=fd}      fun fmvInstr(fd,fs) = I.FUNARY{fu=I.FCPY_D, f=fs, t=fd}
92    
93      fun spillInit () =      fun spillInit () =
94        (spillOffset := initialSpillOffset;        (spillOffset := initialSpillOffset;
# Line 183  Line 183 
183           end           end
184      end      end
185    
186      structure GR = GetReg(val nRegs = 32 val available = R.availR)      structure GR = GetReg(val first=0 val nRegs = 32 val available = R.availR)
187      structure FR = GetReg(val nRegs = 32 val available = R.availF)      structure FR = GetReg(val first=32 val nRegs = 32 val available = R.availF)
188    
189      structure HppaRa =      structure HppaRa =
190        HppaRegAlloc(structure P = P        HppaRegAlloc(structure P = P
# Line 244  Line 244 
244    
245    (* primitives for generation of HPPA instruction flowgraphs *)    (* primitives for generation of HPPA instruction flowgraphs *)
246    structure FlowGraphGen =    structure FlowGraphGen =
247       FlowGraphGen(structure Flowgraph = F       ClusterGen(structure Flowgraph = F
248                    structure InsnProps = P                    structure InsnProps = P
249                    structure MLTree = HppaMLTree                    structure MLTree = HppaMLTree
250                    structure Stream = Emitter.S
251                    val optimize = optimizerHook                    val optimize = optimizerHook
252                    val output = BBSched.bbsched o RegAllocation.ra)                    val output = BBSched.bbsched o RegAllocation.ra)
253    
# Line 262  Line 263 
263    structure MLTreeGen =    structure MLTreeGen =
264       MLRiscGen(structure MachineSpec=HppaSpec       MLRiscGen(structure MachineSpec=HppaSpec
265                 structure MLTreeComp=                 structure MLTreeComp=
266                   Hppa(structure Flowgen=FlowGraphGen                   Hppa(structure HppaInstr = HppaInstr
267                        structure HppaInstr = HppaInstr                        structure Stream = HppaStream
268                        structure HppaMLTree = HppaMLTree                        structure HppaMLTree = HppaMLTree
269                        structure MilliCode=HppaMillicode                        structure MilliCode=HppaMillicode
270                        structure LabelComp=HppaLabelComp)                        structure LabelComp=HppaLabelComp
271                          val costOfMultiply = ref 7
272                          val costOfDivision = ref 7
273                         )
274                   structure Flowgen=FlowGraphGen
275                 structure Cells=HppaCells                 structure Cells=HppaCells
276                 structure C=HppaCpsRegs                 structure C=HppaCpsRegs
277                 structure PseudoOp=HppaPseudoOps)                 structure PseudoOp=HppaPseudoOps)
# Line 278  Line 283 
283    
284  (*  (*
285   * $Log: hppaCG.sml,v $   * $Log: hppaCG.sml,v $
  * Revision 1.9  1999/03/22 19:30:39  george  
  *   Changes to conform to new MLRISC Control  
  *  
286   * Revision 1.8  1999/03/22 17:22:25  george   * Revision 1.8  1999/03/22 17:22:25  george
287   *   Changes to support new GC API   *   Changes to support new GC API
288   *   *

Legend:
Removed from v.410  
changed lines
  Added in v.411

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