SystemZRegisterInfo.h revision 272461
117683Spst//===-- SystemZRegisterInfo.h - SystemZ register information ----*- C++ -*-===//
239291Sfenner//
317683Spst//                     The LLVM Compiler Infrastructure
417683Spst//
517683Spst// This file is distributed under the University of Illinois Open Source
617683Spst// License. See LICENSE.TXT for details.
717683Spst//
817683Spst//===----------------------------------------------------------------------===//
917683Spst
1017683Spst#ifndef SystemZREGISTERINFO_H
1117683Spst#define SystemZREGISTERINFO_H
1217683Spst
1317683Spst#include "SystemZ.h"
1417683Spst#include "llvm/Target/TargetRegisterInfo.h"
1517683Spst
1617683Spst#define GET_REGINFO_HEADER
1717683Spst#include "SystemZGenRegisterInfo.inc"
1817683Spst
1917683Spstnamespace llvm {
2017683Spst
2117683Spstnamespace SystemZ {
22146768Ssam  // Return the subreg to use for referring to the even and odd registers
23147894Ssam  // in a GR128 pair.  Is32Bit says whether we want a GR32 or GR64.
24147894Ssam  inline unsigned even128(bool Is32bit) {
25190225Srpaulo    return Is32bit ? subreg_hl32 : subreg_h64;
2617683Spst  }
2717683Spst  inline unsigned odd128(bool Is32bit) {
2817683Spst    return Is32bit ? subreg_l32 : subreg_l64;
29127664Sbms  }
3017683Spst}
3117683Spst
3217683Spstclass SystemZSubtarget;
33146768Ssamclass SystemZInstrInfo;
3417683Spst
3517683Spststruct SystemZRegisterInfo : public SystemZGenRegisterInfo {
3617683Spstprivate:
3717683Spst  SystemZTargetMachine &TM;
3817683Spst
39127664Sbmspublic:
40146768Ssam  SystemZRegisterInfo(SystemZTargetMachine &tm);
41147894Ssam
42147894Ssam  // Override TargetRegisterInfo.h.
43146768Ssam  virtual bool requiresRegisterScavenging(const MachineFunction &MF) const
44146768Ssam    LLVM_OVERRIDE {
45146768Ssam    return true;
46146768Ssam  }
47146768Ssam  virtual bool requiresFrameIndexScavenging(const MachineFunction &MF) const
48146768Ssam    LLVM_OVERRIDE {
49146768Ssam    return true;
50146768Ssam  }
51146768Ssam  virtual bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const
52146768Ssam    LLVM_OVERRIDE {
53147894Ssam    return true;
54147894Ssam  }
55147894Ssam  virtual const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0)
56146768Ssam    const LLVM_OVERRIDE;
57147894Ssam  virtual BitVector getReservedRegs(const MachineFunction &MF)
58146768Ssam    const LLVM_OVERRIDE;
59147894Ssam  virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI,
60147894Ssam                                   int SPAdj, unsigned FIOperandNum,
61146768Ssam                                   RegScavenger *RS) const LLVM_OVERRIDE;
62147894Ssam  virtual unsigned getFrameRegister(const MachineFunction &MF) const
63146768Ssam    LLVM_OVERRIDE;
64147894Ssam};
65147894Ssam
66147894Ssam} // end namespace llvm
67147894Ssam
68147894Ssam#endif
6917683Spst