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

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