|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.backend.RegisterSet
public abstract class RegisterSet
This is the base class for describing the register set of the machine.
$Id: RegisterSet.java,v 1.35 2007-10-04 19:57:49 burrill Exp $
Copyright 2007 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary | |
---|---|
static short |
ADRREG
Register may be used for addresses. |
static short |
AFIREG
Register may be used for address, floating point or integer values. |
static short |
AIREG
Register may be used for address or integer values. |
static short |
checkMask
The sizeMask + RDREG. |
static short |
CNTREG
Register is a continuation of another register. |
static short |
DBLEREG
Register spans two contiguous registers. |
static short |
FIREG
Register may be used for floating point or integer values. |
static short |
FLTREG
Register may be used for floating point value. |
static short |
INTREG
Register may be used for integer values. |
protected int |
nextRegister
Index of next virtual register. |
static short |
PAIRREG
Register is first register of a two register pair. |
static short |
QUADREG
Register spans four contiguous registers. |
static short |
RDREG
Register is read-only. |
protected short[] |
registers
Indexed by register number. |
static short |
sizeMask
Mask out the size information from the register attributes. |
static short |
SPCREG
Register may be used for special information. |
static short |
typeMask
Mask out the type information from the register attributes. |
Constructor Summary | |
---|---|
RegisterSet(short[] actualRegisters)
|
Method Summary | |
---|---|
int |
actualRegister(int reg)
For architecture where a pseudo register are mapped onto actual registers, return the actual register. |
boolean |
adrRegister(int reg)
Return true if the register contains address value. |
boolean |
compatible(int realReg,
int virtualReg)
Return true if the real register is able to hold the virtual register. |
boolean |
compatibleNS(int realReg,
int virtualReg)
Return true if the real register is able to hold part of the virtual register. |
boolean |
continueRegister(int reg)
Return true if the register is a continuation of a multi-register register. |
java.lang.String |
display(int register)
Return a string representation of the register. |
boolean |
doubleRegister(int reg)
Return true if the register is a double register. |
boolean |
floatRegister(int reg)
Return true if the register contains floating point value. |
abstract short[] |
getCalleeSaves()
Return the callee saves registers. |
abstract short[] |
getCalleeUses()
Return the callee uses registers. |
short[] |
getPreferredOrder()
Return a mapping from an order index to a real register number. |
int |
getResultRegister(int type)
Return a register to be used as the result register. |
int |
getType(int register)
Return the register attributes. |
void |
initialize()
Initialize for a new procedure. |
boolean |
intRegister(int reg)
Return true if the register contains integer value. |
boolean |
isAdrType(int regType)
Return true if the register type allows addresses. |
boolean |
isContinueType(int regType)
Return true if the register type is for a continuation of a multi-register register. |
boolean |
isDoubleType(int regType)
Return true if the register type is for a double register. |
boolean |
isFloatType(int regType)
Return true if the register type allows floating point values. |
boolean |
isIntType(int regType)
Return true if the register type alllows integers. |
boolean |
isModType(int regType,
int bit)
Return true if the register type has has specified bit set. |
boolean |
isPairType(int regType)
Return true if the register type is for the first of a two register pair. |
boolean |
isQuadType(int regType)
Return true if the register type is for a quad register. |
boolean |
isReadOnlyType(int regType)
Return true if the register can only be read. |
boolean |
isSpecialType(int regType)
Return true if the register type is for special values such as a status register. |
int |
lastRegister(int reg)
Return the register number of the last register in the sequence of continguous real registers that this virtual register requires. |
boolean |
modRegister(int reg,
int bit)
Return true if the register is has specified bit set. |
int |
newTempRegister(int type)
Allocate a new virtual/temporary register. |
abstract int |
numAllocatableRegisters()
Return the number of unique registers that can hold programmer values. |
int |
numContiguousRegisters(int reg)
Return the number of continguous real registers that this virtual register requires. |
int |
numContiguousType(int regType)
Return the number of contiguous registers required for this type. |
int |
numRealRegisters()
Return the number of addressable registers. |
int |
numRegisters()
Return the number of registers currently defined. |
boolean |
pairRegister(int reg)
Return true if the register is first of a two register pair. |
boolean |
quadRegister(int reg)
Return true if the register is a quad register. |
int |
rangeBegin(int reg)
Return the first real register that is affected when this register is modified. |
int |
rangeEnd(int reg)
Return the last real register that is affected when this register is modified. |
boolean |
readOnlyRegister(int reg)
Return true if the register can only be read. |
abstract java.lang.String |
registerName(int reg)
Convert a register number into its assembly language form. |
abstract int |
registerSize(int reg)
Return the size of the register in addressable memory units. |
void |
setResultRegister(int reg)
Specify a register to be used for the next result register. |
boolean |
specialRegister(int reg)
Return true if the register contains special values such as a status register. |
boolean |
tempRegister(int reg)
Return true if the register is a virtual register. |
int |
tempRegisterType(int type,
int bs)
Return the register type with the size information added. |
abstract int |
tempRegisterType(Type type,
long bs)
Return the register type with the size information added. |
boolean |
useContiguous()
Return true if virtual registers, that require more than one real register, must be allocated to contiguous real registers. |
boolean |
virtualRegister(int reg)
Return true if the register is a virtual register. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short DBLEREG
public static final short QUADREG
public static final short INTREG
public static final short FLTREG
public static final short ADRREG
public static final short SPCREG
public static final short RDREG
public static final short PAIRREG
public static final short CNTREG
public static final short FIREG
public static final short AIREG
public static final short AFIREG
public static final short sizeMask
public static final short typeMask
public static final short checkMask
protected int nextRegister
protected short[] registers
Constructor Detail |
---|
public RegisterSet(short[] actualRegisters)
actualRegisters
- is a list of the types of the actual
registers of the machine that specifies how each real register
may be usedMethod Detail |
---|
public int newTempRegister(int type)
type
- specifies the type of register
public int getResultRegister(int type)
setResultRegister(int)
public void setResultRegister(int reg)
getResultRegister(int)
public int getType(int register)
public void initialize()
public int numRegisters()
public int numRealRegisters()
public abstract int numAllocatableRegisters()
public short[] getPreferredOrder()
public boolean useContiguous()
public final boolean tempRegister(int reg)
public final boolean floatRegister(int reg)
public final boolean isFloatType(int regType)
public final boolean intRegister(int reg)
public final boolean isIntType(int regType)
public final boolean adrRegister(int reg)
public final boolean isAdrType(int regType)
public final boolean specialRegister(int reg)
public final boolean isSpecialType(int regType)
public final boolean readOnlyRegister(int reg)
public final boolean isReadOnlyType(int regType)
public final boolean pairRegister(int reg)
public final boolean isPairType(int regType)
public final boolean virtualRegister(int reg)
public final boolean continueRegister(int reg)
public final boolean isContinueType(int regType)
public final boolean doubleRegister(int reg)
public final boolean isDoubleType(int regType)
public final boolean quadRegister(int reg)
public final boolean isQuadType(int regType)
public final boolean modRegister(int reg, int bit)
public final boolean isModType(int regType, int bit)
public int rangeBegin(int reg)
public int rangeEnd(int reg)
public int actualRegister(int reg)
SparcV8RegisterSet
where a 64-bit long long
register
is mapped onto a set of two 32-bit registers.
public final boolean compatibleNS(int realReg, int virtualReg)
public final boolean compatible(int realReg, int virtualReg)
public abstract java.lang.String registerName(int reg)
public abstract int registerSize(int reg)
public abstract short[] getCalleeSaves()
public abstract short[] getCalleeUses()
public int tempRegisterType(int type, int bs)
type
- is the type requiredbs
- is the size requiredpublic abstract int tempRegisterType(Type type, long bs)
type
- is the type requiredbs
- is the size requiredpublic final int numContiguousRegisters(int reg)
public final int lastRegister(int reg)
public final int numContiguousType(int regType)
public java.lang.String display(int register)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |