42 |
) |
) |
43 |
|
|
44 |
structure RA = |
structure RA = |
45 |
RegAlloc |
RegAlloc2 |
46 |
(structure I = HppaInstr |
(structure I = HppaInstr |
47 |
structure MachSpec = HppaSpec |
structure MachSpec = HppaSpec |
48 |
structure Flowgraph = HppaFlowGraph |
structure Flowgraph = HppaFlowGraph |
50 |
structure InsnProps = InsnProps |
structure InsnProps = InsnProps |
51 |
structure Rewrite = HppaRewrite(HppaInstr) |
structure Rewrite = HppaRewrite(HppaInstr) |
52 |
structure Asm = HppaAsmEmitter |
structure Asm = HppaAsmEmitter |
|
functor Ra = HppaRegAlloc |
|
53 |
|
|
54 |
(* NOTE: the spill offset grows backwards on the stack! |
(* NOTE: the spill offset grows backwards on the stack! |
55 |
*) |
*) |
62 |
fun low11(n) = wtoi(Word.andb(itow n, 0wx7ff)) |
fun low11(n) = wtoi(Word.andb(itow n, 0wx7ff)) |
63 |
fun high21(n) = wtoi(Word.~>>(itow n, 0w11)) |
fun high21(n) = wtoi(Word.~>>(itow n, 0w11)) |
64 |
|
|
65 |
|
fun pure(I.LOAD _) = true |
66 |
|
| pure(I.LOADI _) = true |
67 |
|
| pure(I.FLOAD _) = true |
68 |
|
| pure(I.FLOADX _) = true |
69 |
|
| pure(I.ARITH _) = true |
70 |
|
| pure(I.ARITHI _) = true |
71 |
|
| pure(I.FARITH _) = true |
72 |
|
| pure(I.FUNARY _) = true |
73 |
|
| pure(I.FCNV _) = true |
74 |
|
| pure(I.ANNOTATION{i,...}) = pure i |
75 |
|
| pure _ = false |
76 |
|
|
77 |
(* make copy *) |
(* make copy *) |
78 |
fun copyR((rds as [_], rss as [_]), _) = |
fun copyR((rds as [_], rss as [_]), _) = |
79 |
I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=NONE} |
I.COPY{dst=rds, src=rss, impl=ref NONE, tmp=NONE} |