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

Annotation of /sml/trunk/src/compiler/CodeGen/alpha32/alpha32CG.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 475 - (view) (download)
Original Path: sml/branches/SMLNJ/src/compiler/CodeGen/alpha32/alpha32CG.sml

1 : monnier 429 (*
2 :     * Alpha32 specific backend
3 : monnier 247 *)
4 : monnier 429 structure Alpha32CG =
5 :     MachineGen
6 :     ( structure I = Alpha32Instr
7 :     structure MachSpec = Alpha32Spec
8 :     structure PseudoOps = Alpha32PseudoOps
9 :     structure CpsRegs = Alpha32CpsRegs
10 : monnier 475 structure InsnProps = Alpha32Props
11 : monnier 429 structure Asm = Alpha32AsmEmitter
12 : monnier 247
13 : monnier 429 structure MLTreeComp=
14 :     Alpha(structure AlphaInstr = Alpha32Instr
15 :     structure AlphaMLTree = Alpha32MLTree
16 :     structure PseudoInstrs = Alpha32PseudoInstrs
17 :     val mode32bit = true (* simulate 32 bit mode *)
18 :     val multCost = ref 8 (* just guessing *)
19 :     val useMultByConst = ref false (* just guessing *)
20 :     )
21 : monnier 247
22 : monnier 429 structure Alpha32Jumps =
23 :     AlphaJumps(structure Instr=Alpha32Instr
24 :     structure Shuffle=Alpha32Shuffle)
25 : monnier 247
26 : monnier 429 structure BackPatch =
27 :     BBSched2(structure Flowgraph = Alpha32FlowGraph
28 :     structure Jumps = Alpha32Jumps
29 :     structure Emitter = Alpha32MCEmitter)
30 : monnier 247
31 : monnier 429 structure RA =
32 : monnier 475 RegAlloc
33 : monnier 429 (structure I = Alpha32Instr
34 :     structure MachSpec = Alpha32Spec
35 :     structure Flowgraph = Alpha32FlowGraph
36 :     structure CpsRegs = Alpha32CpsRegs
37 :     structure InsnProps = InsnProps
38 :     structure Rewrite = AlphaRewrite(Alpha32Instr)
39 :     structure Asm = Alpha32AsmEmitter
40 : monnier 247
41 : monnier 429 val sp = I.C.stackptrR
42 :     val stack = I.Region.stack
43 : monnier 247
44 : monnier 469 fun pure _ = false
45 :    
46 : monnier 429 (* make copies *)
47 :     fun copyR((rds as [_], rss as [_]), _) =
48 :     I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=NONE}
49 :     | copyR((rds, rss), I.COPY{tmp, ...}) =
50 :     I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=tmp}
51 :     fun copyF((fds as [_], fss as [_]), _) =
52 :     I.FCOPY{dst=fds, src=fss, impl=ref NONE, tmp=NONE}
53 :     | copyF((fds, fss), I.FCOPY{tmp, ...}) =
54 :     I.FCOPY{dst=fds, src=fss, impl=ref NONE, tmp=tmp}
55 : monnier 247
56 : monnier 429 (* spill copy temp *)
57 :     fun spillCopyTmp(I.COPY{tmp,dst,src,impl},loc) =
58 :     I.COPY{tmp=SOME(I.Displace{base=sp, disp=loc}),
59 :     dst=dst,src=src,impl=impl}
60 :     fun spillFcopyTmp(I.FCOPY{tmp,dst,src,impl},loc) =
61 :     I.FCOPY{tmp=SOME(I.Displace{base=sp, disp=loc}),
62 :     dst=dst,src=src,impl=impl}
63 : monnier 247
64 : monnier 429 (* spill register *)
65 :     fun spillInstrR(r,offset) =
66 :     [I.STORE{stOp=I.STL, b=sp, d=I.IMMop offset, r=r, mem=stack}]
67 :     fun spillInstrF(r,offset) =
68 :     [I.FSTORE{stOp=I.STT, b=sp, d=I.IMMop offset, r=r, mem=stack}]
69 : monnier 247
70 : monnier 429 (* reload register *)
71 :     fun reloadInstrR(r,offset,rest) =
72 :     I.LOAD{ldOp=I.LDL, b=sp, d=I.IMMop offset, r=r, mem=stack}::rest
73 :     fun reloadInstrF(r,offset,rest) =
74 :     I.FLOAD{ldOp=I.LDT, b=sp, d=I.IMMop offset, r=r, mem=stack}::rest
75 :     )
76 :     )

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