public final class RegisterRestrictions extends GenericRegisterRestrictions
Modifier and Type | Field and Description |
---|---|
static boolean |
SCRATCH_IN_PEI
Allow scratch registers in PEIs?
|
phys, regAllocState
Constructor and Description |
---|
RegisterRestrictions(GenericPhysicalRegisterSet phys) |
Modifier and Type | Method and Description |
---|---|
void |
addArchRestrictions(BasicBlock bb,
ArrayList<LiveIntervalElement> symbolics)
Add architecture-specific register restrictions for a basic block.
|
(package private) void |
handle8BitRestrictions(Instruction s)
Ensure that if an operand has an 8 bit memory operand that
all of its register operands are in 8 bit registers.
|
(package private) boolean |
has8BitMemoryOperand(Instruction s) |
boolean |
isForbidden(Register symb,
Register r,
Instruction s)
Is it forbidden to assign symbolic register symb to physical register r
in instruction s?
|
static boolean |
mustBeInRegister(Register r,
Instruction s)
Given symbolic register r that appears in instruction s, does the
architecture demand that r be assigned to a physical register in s?
|
private boolean |
okFor8(Register r) |
(package private) void |
restrictTo8Bits(Register r)
Ensures that a particular register is only assigned to AL, BL, CL, or
DL, since these are the only 8-bit registers we normally address.
|
addRestriction, addRestrictions, allVolatilesForbidden, contains, init, isForbidden, mustNotSpill, noteMustNotSpill
public static final boolean SCRATCH_IN_PEI
public RegisterRestrictions(GenericPhysicalRegisterSet phys)
public void addArchRestrictions(BasicBlock bb, ArrayList<LiveIntervalElement> symbolics)
GenericRegisterRestrictions
addArchRestrictions
in class GenericRegisterRestrictions
bb
- the basic blocksymbolics
- the live intervals for symbolic registers on this
blockboolean has8BitMemoryOperand(Instruction s)
s
- the instruction to checktrue
if and only if the instruction contains an 8-bit memory operandvoid handle8BitRestrictions(Instruction s)
s
- the instruction to restrictvoid restrictTo8Bits(Register r)
r
- the register that needs to be restricted to 8 bitspublic static boolean mustBeInRegister(Register r, Instruction s)
r
- a symbolic registers
- instruction where the register appearstrue
if the symbolic register r must use a physical
register in the instruction, false
if we can use a spill locationprivate boolean okFor8(Register r)
r
- the register to checktrue
if the physical register r hold an 8-bit value?public boolean isForbidden(Register symb, Register r, Instruction s)
GenericRegisterRestrictions
isForbidden
in class GenericRegisterRestrictions
symb
- a symbolic registerr
- a physical registers
- the instruction that's the scope for the checktrue
if it's forbidden, false otherwise