|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Backend.Generic.InstrBuilder
InstrBuilder
defines an interface that general program
transformations can call to generate needed assembly code blocks for
arbitrary target architectures.
Many of the Instr
optimizations need to insert new
code to support the transformations that they make on the code.
This class provides a set of generic Instr
creation
routines that each backend wil implement, to be used in creating
the support code.
Constructor Summary | |
InstrBuilder()
Creates a InstrBuilder . |
Method Summary | |
int |
getSize(Temp temp)
Returns the size of temp on the stack. |
InstrLABEL |
makeLabel(Label l,
Instr template)
Returns a new InstrLABEL for generating new
arbitrary code blocks to branch to. |
List |
makeLoad(List regs,
int startingOffset,
Instr template)
Generates a new set of Instr s for memory traffic
from RAM to multiple registers in the register file. |
protected abstract List |
makeLoad(Temp reg,
int offset,
Instr template)
Generates a new set of Instr s for memory traffic
from RAM to one register in the register file. |
List |
makeStore(List regs,
int startingOffset,
Instr template)
Generates a new set of Instr s for memory traffic
from multiple registers in the register file to RAM. |
protected abstract List |
makeStore(Temp reg,
int offset,
Instr template)
Generates a new set of Instr s for memory traffic
from the register file to RAM. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InstrBuilder()
InstrBuilder
.
Method Detail |
public List makeLoad(List regs, int startingOffset, Instr template)
Instr
s for memory traffic
from RAM to multiple registers in the register file. This
method's default implementation simply calls
makeLoad(Temp,int,Instr)
for each element of
regs
and concatenates the returned
List
s of Instr
s, so architectures
with more efficient memory-to-multiple-register operations
should override this implementation with a better one.
makeLoad(Temp, int, Instr)
,
getSize(harpoon.Temp.Temp)
public List makeStore(List regs, int startingOffset, Instr template)
Instr
s for memory traffic
from multiple registers in the register file to RAM. This
method's default implementation simply calls
makeStore(Temp,int,Instr)
for each element of
regs
and concatenates the returned
List
s of Instr
s, so architectures
with more efficient multiple-register-to-memory operations
should override this implementation with a better one.
makeStore(Temp, int, Instr)
,
getSize(harpoon.Temp.Temp)
protected abstract List makeLoad(Temp reg, int offset, Instr template)
Instr
s for memory traffic
from RAM to one register in the register file.
getSize(harpoon.Temp.Temp)
protected abstract List makeStore(Temp reg, int offset, Instr template)
Instr
s for memory traffic
from the register file to RAM.
getSize(harpoon.Temp.Temp)
public int getSize(Temp temp)
temp
on the stack.
temp
would have on the stack (in
terms of the abstract number used for calculating stack
offsets in makeLoad()
and
makeStore()
).
t1
and
t2
, either
( offset(t2)
is greater than or equal to
offset(t1) + getSize(t1)
)
OR
( offset(t1)
is greater than or equal to
offset(t2) + getSize(t2)
).
makeLoad(java.util.List, int, harpoon.IR.Assem.Instr)
,
makeStore(java.util.List, int, harpoon.IR.Assem.Instr)
public InstrLABEL makeLabel(Label l, Instr template)
InstrLABEL
for generating new
arbitrary code blocks to branch to.
template
- An Instr
to base the generated
InstrLABEL
.
template
should be part of the
instruction stream that the returned
InstrLABEL
is intended for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |