2009-07-02 22:18:33 +00:00
|
|
|
//===- Thumb2RegisterInfo.h - Thumb-2 Register Information Impl ----*- C++ -*-===//
|
2009-06-27 12:16:40 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2009-07-02 22:18:33 +00:00
|
|
|
// This file contains the Thumb-2 implementation of the TargetRegisterInfo class.
|
2009-06-27 12:16:40 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-07-02 22:18:33 +00:00
|
|
|
#ifndef THUMB2REGISTERINFO_H
|
|
|
|
#define THUMB2REGISTERINFO_H
|
2009-06-27 12:16:40 +00:00
|
|
|
|
|
|
|
#include "ARM.h"
|
|
|
|
#include "ARMRegisterInfo.h"
|
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class ARMSubtarget;
|
2009-07-08 18:31:39 +00:00
|
|
|
class ARMBaseInstrInfo;
|
2009-06-27 12:16:40 +00:00
|
|
|
class Type;
|
|
|
|
|
2009-07-02 22:18:33 +00:00
|
|
|
struct Thumb2RegisterInfo : public ARMBaseRegisterInfo {
|
2009-06-27 12:16:40 +00:00
|
|
|
public:
|
2009-07-08 18:31:39 +00:00
|
|
|
Thumb2RegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
|
2009-06-27 12:16:40 +00:00
|
|
|
|
2009-07-24 00:16:18 +00:00
|
|
|
// rewrite MI to access 'Offset' bytes from the FP. Return the offset that
|
|
|
|
// could not be handled directly in MI.
|
|
|
|
int rewriteFrameIndex(MachineInstr &MI, unsigned FrameRegIdx,
|
|
|
|
unsigned FrameReg, int Offset) const;
|
|
|
|
|
2009-06-27 12:16:40 +00:00
|
|
|
/// emitLoadConstPool - Emits a load from constpool to materialize the
|
|
|
|
/// specified immediate.
|
2009-07-24 00:16:18 +00:00
|
|
|
void emitLoadConstPool(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator &MBBI,
|
|
|
|
DebugLoc dl,
|
|
|
|
unsigned DestReg, unsigned SubIdx, int Val,
|
|
|
|
ARMCC::CondCodes Pred = ARMCC::AL,
|
|
|
|
unsigned PredReg = 0) const;
|
2009-06-27 12:16:40 +00:00
|
|
|
|
|
|
|
bool requiresRegisterScavenging(const MachineFunction &MF) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2009-07-02 22:18:33 +00:00
|
|
|
#endif // THUMB2REGISTERINFO_H
|