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

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