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/SMLNJ/src/compiler/CodeGen/ppc/ppcCG.sml
ViewVC logotype

Annotation of /sml/branches/SMLNJ/src/compiler/CodeGen/ppc/ppcCG.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 429 - (view) (download)

1 : monnier 429 (*
2 :     * PPC specific backend
3 :     *)
4 :     structure PPCCG =
5 :     MachineGen
6 :     ( structure MachSpec = PPCSpec
7 :     structure PseudoOps = PPCPseudoOps
8 :     structure CpsRegs = PPCCpsRegs
9 :     structure InsnProps = PPCProps(PPCInstr)
10 :     structure Asm = PPCAsmEmitter
11 : monnier 247
12 : monnier 429 structure MLTreeComp=
13 :     PPC(structure PPCInstr = PPCInstr
14 :     structure PPCMLTree = PPCMLTree
15 :     structure PseudoInstrs=
16 :     PPCPseudoInstr(structure Instr=PPCInstr)
17 :     val bit64mode=false
18 :     val multCost=ref 6 (* an estimate *)
19 :     )
20 : monnier 247
21 : monnier 429 structure PPCJumps =
22 :     PPCJumps(structure Instr=PPCInstr
23 :     structure Shuffle=PPCShuffle)
24 : monnier 247
25 : monnier 429 structure BackPatch =
26 :     BBSched2(structure Flowgraph = PPCFlowGraph
27 :     structure Jumps = PPCJumps
28 :     structure Emitter = PPCMCEmitter)
29 : monnier 411
30 : monnier 429 structure RA =
31 :     RegAlloc
32 :     (structure I = PPCInstr
33 :     structure MachSpec = PPCSpec
34 :     structure Flowgraph = PPCFlowGraph
35 :     structure CpsRegs = PPCCpsRegs
36 :     structure InsnProps = InsnProps
37 :     structure Rewrite = PPCRewrite(PPCInstr)
38 :     structure Asm = PPCAsmEmitter
39 :     functor Ra = PPCRegAlloc
40 : monnier 247
41 : monnier 429 val sp = I.C.stackptrR
42 :     val stack = I.Region.stack
43 : monnier 247
44 : monnier 429 (* make copy *)
45 :     fun copyR((rds as [_], rss as [_]), _) =
46 :     I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=NONE}
47 :     | copyR((rds, rss), I.COPY{tmp, ...}) =
48 :     I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=tmp}
49 :     fun copyF((fds as [_], fss as [_]), _) =
50 :     I.FCOPY{dst=fds, src=fss, impl=ref NONE, tmp=NONE}
51 :     | copyF((fds, fss), I.FCOPY{tmp, ...}) =
52 :     I.FCOPY{dst=fds, src=fss, impl=ref NONE, tmp=tmp}
53 : monnier 247
54 : monnier 429 (* spill copy temp *)
55 :     fun spillCopyTmp(I.COPY{dst,src,tmp,impl},offset) =
56 :     I.COPY{dst=dst, src=src, impl=impl,
57 :     tmp=SOME(I.Displace{base=sp, disp=I.ImmedOp offset})}
58 :     fun spillFcopyTmp(I.FCOPY{dst,src,tmp,impl},offset) =
59 :     I.FCOPY{dst=dst, src=src, impl=impl,
60 :     tmp=SOME(I.Displace{base=sp, disp=I.ImmedOp offset})}
61 : monnier 247
62 : monnier 429 (* spill register *)
63 :     fun spillInstrR(rs,offset) =
64 :     [I.ST{st=I.STW, ra=sp, d=I.ImmedOp offset, rs=rs, mem=stack}]
65 :     fun spillInstrF(fs,offset) =
66 :     [I.STF{st=I.STFD, ra=sp, d=I.ImmedOp offset, fs=fs, mem=stack}]
67 : monnier 247
68 : monnier 429 (* reload register *)
69 :     fun reloadInstrR(rt,offset,rest) =
70 :     I.L{ld=I.LWZ, ra=sp, d=I.ImmedOp offset, rt=rt, mem=stack}::rest
71 :     fun reloadInstrF(ft,offset,rest) =
72 :     I.LF{ld=I.LFD, ra=sp, d=I.ImmedOp offset, ft=ft, mem=stack}::rest
73 :     )
74 :     )

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