typedef const unsigned* iterator;
typedef const unsigned* const_iterator;
- typedef const MVT::ValueType* vt_iterator;
+ typedef const MVT* vt_iterator;
typedef const TargetRegisterClass* const * sc_iterator;
private:
unsigned ID;
const iterator RegsBegin, RegsEnd;
public:
TargetRegisterClass(unsigned id,
- const MVT::ValueType *vts,
+ const MVT *vts,
const TargetRegisterClass * const *subcs,
const TargetRegisterClass * const *supcs,
const TargetRegisterClass * const *subregcs,
/// getNumRegs - Return the number of registers in this class.
///
- unsigned getNumRegs() const { return RegsEnd-RegsBegin; }
+ unsigned getNumRegs() const { return (unsigned)(RegsEnd-RegsBegin); }
/// getRegister - Return the specified register in the class.
///
/// hasType - return true if this TargetRegisterClass has the ValueType vt.
///
- bool hasType(MVT::ValueType vt) const {
+ bool hasType(MVT vt) const {
for(int i = 0; VTs[i] != MVT::Other; ++i)
if (VTs[i] == vt)
return true;
}
/// getPhysicalRegisterRegClass - Returns the Register Class of a physical
- /// register of the given type.
- const TargetRegisterClass *getPhysicalRegisterRegClass(MVT::ValueType VT,
- unsigned Reg) const;
+ /// register of the given type. If type is MVT::Other, then just return any
+ /// register class the register belongs to.
+ const TargetRegisterClass *getPhysicalRegisterRegClass(unsigned Reg,
+ MVT VT = MVT::Other) const;
/// getAllocatableSet - Returns a bitset indexed by register number
/// indicating if a register is allocatable or not. If a register class is
return get(RegNo).AliasSet;
}
- /// getSubRegisters - Return the set of registers that are sub-registers of
+ /// getSubRegisters - Return the list of registers that are sub-registers of
/// the specified register, or a null list of there are none. The list
- /// returned is zero terminated.
+ /// returned is zero terminated and sorted according to super-sub register
+ /// relations. e.g. X86::RAX's sub-register list is EAX, AX, AL, AH.
///
const unsigned *getSubRegisters(unsigned RegNo) const {
return get(RegNo).SubRegs;
return get(RegNo).ImmSubRegs;
}
- /// getSuperRegisters - Return the set of registers that are super-registers
+ /// getSuperRegisters - Return the list of registers that are super-registers
/// of the specified register, or a null list of there are none. The list
- /// returned is zero terminated.
+ /// returned is zero terminated and sorted according to super-sub register
+ /// relations. e.g. X86::AL's super-register list is RAX, EAX, AX.
///
const unsigned *getSuperRegisters(unsigned RegNo) const {
return get(RegNo).SuperRegs;
regclass_iterator regclass_end() const { return RegClassEnd; }
unsigned getNumRegClasses() const {
- return regclass_end()-regclass_begin();
+ return (unsigned)(regclass_end()-regclass_begin());
}
/// getRegClass - Returns the register class associated with the enumeration
return NULL;
}
- /// reMaterialize - Re-issue the specified 'original' instruction at the
- /// specific location targeting a new destination register.
- virtual void reMaterialize(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg,
- const MachineInstr *Orig) const = 0;
-
/// targetHandlesStackFrameRounding - Returns true if the target is
/// responsible for rounding up the stack frame (probably at emitPrologue
/// time).