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/ppc/ppcCG.sml
ViewVC logotype

Annotation of /sml/trunk/src/compiler/CodeGen/ppc/ppcCG.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 498 - (view) (download)
Original Path: sml/branches/SMLNJ/src/compiler/CodeGen/ppc/ppcCG.sml

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 : monnier 475 structure InsnProps = PPCProps
10 : monnier 429 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 : monnier 475 RegAlloc
32 : monnier 429 (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 : monnier 247
40 : monnier 429 val sp = I.C.stackptrR
41 : monnier 498 val spill = CPSRegions.spill
42 : monnier 247
43 : monnier 469 fun pure _ = false
44 :    
45 : monnier 429 (* make copy *)
46 :     fun copyR((rds as [_], rss as [_]), _) =
47 :     I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=NONE}
48 :     | copyR((rds, rss), I.COPY{tmp, ...}) =
49 :     I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=tmp}
50 :     fun copyF((fds as [_], fss as [_]), _) =
51 :     I.FCOPY{dst=fds, src=fss, impl=ref NONE, tmp=NONE}
52 :     | copyF((fds, fss), I.FCOPY{tmp, ...}) =
53 :     I.FCOPY{dst=fds, src=fss, impl=ref NONE, tmp=tmp}
54 : monnier 247
55 : monnier 429 (* spill copy temp *)
56 :     fun spillCopyTmp(I.COPY{dst,src,tmp,impl},offset) =
57 :     I.COPY{dst=dst, src=src, impl=impl,
58 :     tmp=SOME(I.Displace{base=sp, disp=I.ImmedOp offset})}
59 :     fun spillFcopyTmp(I.FCOPY{dst,src,tmp,impl},offset) =
60 :     I.FCOPY{dst=dst, src=src, impl=impl,
61 :     tmp=SOME(I.Displace{base=sp, disp=I.ImmedOp offset})}
62 : monnier 247
63 : monnier 429 (* spill register *)
64 :     fun spillInstrR(rs,offset) =
65 : monnier 498 [I.ST{st=I.STW, ra=sp, d=I.ImmedOp offset, rs=rs, mem=spill}]
66 : monnier 429 fun spillInstrF(fs,offset) =
67 : monnier 498 [I.STF{st=I.STFD, ra=sp, d=I.ImmedOp offset, fs=fs, mem=spill}]
68 : monnier 247
69 : monnier 429 (* reload register *)
70 :     fun reloadInstrR(rt,offset,rest) =
71 : monnier 498 I.L{ld=I.LWZ, ra=sp, d=I.ImmedOp offset, rt=rt, mem=spill}::rest
72 : monnier 429 fun reloadInstrF(ft,offset,rest) =
73 : monnier 498 I.LF{ld=I.LFD, ra=sp, d=I.ImmedOp offset, ft=ft, mem=spill}::rest
74 : monnier 429 )
75 :     )

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