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 546 - (view) (download)

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 : george 546 val SMLNJfloatingPoint = true (* must be true for SML/NJ *)
21 : monnier 429 )
22 : monnier 247
23 : monnier 429 structure Alpha32Jumps =
24 :     AlphaJumps(structure Instr=Alpha32Instr
25 :     structure Shuffle=Alpha32Shuffle)
26 : monnier 247
27 : monnier 429 structure BackPatch =
28 :     BBSched2(structure Flowgraph = Alpha32FlowGraph
29 :     structure Jumps = Alpha32Jumps
30 :     structure Emitter = Alpha32MCEmitter)
31 : monnier 247
32 : monnier 429 structure RA =
33 : monnier 475 RegAlloc
34 : monnier 429 (structure I = Alpha32Instr
35 :     structure MachSpec = Alpha32Spec
36 :     structure Flowgraph = Alpha32FlowGraph
37 :     structure CpsRegs = Alpha32CpsRegs
38 :     structure InsnProps = InsnProps
39 :     structure Rewrite = AlphaRewrite(Alpha32Instr)
40 :     structure Asm = Alpha32AsmEmitter
41 : monnier 247
42 : monnier 429 val sp = I.C.stackptrR
43 : monnier 498 val spill = CPSRegions.spill
44 : monnier 247
45 : monnier 469 fun pure _ = false
46 :    
47 : monnier 429 (* make copies *)
48 :     fun copyR((rds as [_], rss as [_]), _) =
49 :     I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=NONE}
50 :     | copyR((rds, rss), I.COPY{tmp, ...}) =
51 :     I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=tmp}
52 :     fun copyF((fds as [_], fss as [_]), _) =
53 :     I.FCOPY{dst=fds, src=fss, impl=ref NONE, tmp=NONE}
54 :     | copyF((fds, fss), I.FCOPY{tmp, ...}) =
55 :     I.FCOPY{dst=fds, src=fss, impl=ref NONE, tmp=tmp}
56 : monnier 247
57 : monnier 429 (* spill copy temp *)
58 :     fun spillCopyTmp(I.COPY{tmp,dst,src,impl},loc) =
59 :     I.COPY{tmp=SOME(I.Displace{base=sp, disp=loc}),
60 :     dst=dst,src=src,impl=impl}
61 :     fun spillFcopyTmp(I.FCOPY{tmp,dst,src,impl},loc) =
62 :     I.FCOPY{tmp=SOME(I.Displace{base=sp, disp=loc}),
63 :     dst=dst,src=src,impl=impl}
64 : monnier 247
65 : monnier 429 (* spill register *)
66 :     fun spillInstrR(r,offset) =
67 : monnier 498 [I.STORE{stOp=I.STL, b=sp, d=I.IMMop offset, r=r, mem=spill}]
68 : monnier 429 fun spillInstrF(r,offset) =
69 : monnier 498 [I.FSTORE{stOp=I.STT, b=sp, d=I.IMMop offset, r=r, mem=spill}]
70 : monnier 247
71 : monnier 429 (* reload register *)
72 :     fun reloadInstrR(r,offset,rest) =
73 : monnier 498 I.LOAD{ldOp=I.LDL, b=sp, d=I.IMMop offset, r=r, mem=spill}::rest
74 : monnier 429 fun reloadInstrF(r,offset,rest) =
75 : monnier 498 I.FLOAD{ldOp=I.LDT, b=sp, d=I.IMMop offset, r=r, mem=spill}::rest
76 : monnier 429 )
77 :     )

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