2002-12-28 21:32:54 +01:00
|
|
|
//===- X86RegisterInfo.h - X86 Register Information Impl --------*- C++ -*-===//
|
2005-04-22 01:38:14 +02:00
|
|
|
//
|
2003-10-21 17:17:13 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-22 01:38:14 +02:00
|
|
|
//
|
2003-10-21 17:17:13 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-10-26 00:55:53 +02:00
|
|
|
//
|
|
|
|
// This file contains the X86 implementation of the MRegisterInfo class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef X86REGISTERINFO_H
|
|
|
|
#define X86REGISTERINFO_H
|
|
|
|
|
|
|
|
#include "llvm/Target/MRegisterInfo.h"
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
class llvm::Type;
|
2002-11-20 19:59:43 +01:00
|
|
|
|
2003-08-03 17:48:14 +02:00
|
|
|
#include "X86GenRegisterInfo.h.inc"
|
2002-12-25 06:06:43 +01:00
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
namespace llvm {
|
|
|
|
|
2003-08-03 17:48:14 +02:00
|
|
|
struct X86RegisterInfo : public X86GenRegisterInfo {
|
|
|
|
X86RegisterInfo();
|
2002-12-25 06:06:43 +01:00
|
|
|
|
2002-12-28 21:32:54 +01:00
|
|
|
/// Code Generation virtual methods...
|
2004-08-16 00:15:11 +02:00
|
|
|
void storeRegToStackSlot(MachineBasicBlock &MBB,
|
2004-02-12 09:11:04 +01:00
|
|
|
MachineBasicBlock::iterator MI,
|
2005-09-30 03:29:42 +02:00
|
|
|
unsigned SrcReg, int FrameIndex,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2004-08-16 00:15:11 +02:00
|
|
|
|
|
|
|
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI,
|
2005-09-30 03:29:42 +02:00
|
|
|
unsigned DestReg, int FrameIndex,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2005-04-22 01:38:14 +02:00
|
|
|
|
2004-08-16 00:15:11 +02:00
|
|
|
void copyRegToReg(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI,
|
|
|
|
unsigned DestReg, unsigned SrcReg,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2002-12-25 06:06:43 +01:00
|
|
|
|
2004-02-17 06:54:57 +01:00
|
|
|
/// foldMemoryOperand - If this target supports it, fold a load or store of
|
|
|
|
/// the specified stack slot into the specified machine instruction for the
|
|
|
|
/// specified operand. If this is possible, the target should perform the
|
|
|
|
/// folding and return true, otherwise it should return false. If it folds
|
|
|
|
/// the instruction, it is likely that the MachineInstruction the iterator
|
|
|
|
/// references has been changed.
|
2006-05-18 02:12:58 +02:00
|
|
|
MachineInstr* foldMemoryOperand(MachineInstr* MI,
|
|
|
|
unsigned OpNum,
|
|
|
|
int FrameIndex) const;
|
|
|
|
|
|
|
|
/// getCalleeSaveRegs - Return a null-terminated list of all of the
|
|
|
|
/// callee-save registers on this target.
|
|
|
|
const unsigned *getCalleeSaveRegs() const;
|
|
|
|
|
|
|
|
/// getCalleeSaveRegClasses - Return a null-terminated list of the preferred
|
|
|
|
/// register classes to spill each callee-saved register with. The order and
|
|
|
|
/// length of this list match the getCalleeSaveRegs() list.
|
|
|
|
const TargetRegisterClass* const* getCalleeSaveRegClasses() const;
|
2004-02-17 05:33:18 +01:00
|
|
|
|
2004-02-14 20:49:54 +01:00
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI) const;
|
2002-12-13 10:54:12 +01:00
|
|
|
|
2004-08-15 00:05:10 +02:00
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator MI) const;
|
2002-11-20 19:59:43 +01:00
|
|
|
|
2004-02-14 20:49:54 +01:00
|
|
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
2002-12-04 00:11:21 +01:00
|
|
|
|
2004-02-14 20:49:54 +01:00
|
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
2006-03-23 19:12:57 +01:00
|
|
|
|
2006-03-28 15:48:33 +02:00
|
|
|
// Debug information queries.
|
2006-04-07 18:34:46 +02:00
|
|
|
unsigned getRARegister() const;
|
2006-03-28 15:48:33 +02:00
|
|
|
unsigned getFrameRegister(MachineFunction &MF) const;
|
2002-10-26 00:55:53 +02:00
|
|
|
};
|
|
|
|
|
2006-05-05 07:40:20 +02:00
|
|
|
// getX86SubSuperRegister - X86 utility function. It returns the sub or super
|
|
|
|
// register of a specific X86 register.
|
|
|
|
// e.g. getX86SubSuperRegister(X86::EAX, MVT::i16) return X86:AX
|
|
|
|
unsigned getX86SubSuperRegister(unsigned, MVT::ValueType, bool High=false);
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2002-10-26 00:55:53 +02:00
|
|
|
#endif
|