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

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