1 //===-- SystemZMCTargetDesc.h - SystemZ target descriptions -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef SYSTEMZMCTARGETDESC_H
11 #define SYSTEMZMCTARGETDESC_H
13 #include "llvm/Support/DataTypes.h"
23 class MCSubtargetInfo;
28 extern Target TheSystemZTarget;
31 // How many bytes are in the ABI-defined, caller-allocated part of
33 const int64_t CallFrameSize = 160;
35 // The offset of the DWARF CFA from the incoming stack pointer.
36 const int64_t CFAOffsetFromInitialSP = CallFrameSize;
38 // Maps of asm register numbers to LLVM register numbers, with 0 indicating
39 // an invalid register. In principle we could use 32-bit and 64-bit register
40 // classes directly, provided that we relegated the GPR allocation order
41 // in SystemZRegisterInfo.td to an AltOrder and left the default order
42 // as %r0-%r15. It seems better to provide the same interface for
43 // all classes though.
44 extern const unsigned GR32Regs[16];
45 extern const unsigned GR64Regs[16];
46 extern const unsigned GR128Regs[16];
47 extern const unsigned FP32Regs[16];
48 extern const unsigned FP64Regs[16];
49 extern const unsigned FP128Regs[16];
51 // Return the 0-based number of the first architectural register that
52 // contains the given LLVM register. E.g. R1D -> 1.
53 unsigned getFirstReg(unsigned Reg);
55 // Return the given register as a GR64.
56 inline unsigned getRegAsGR64(unsigned Reg) {
57 return GR64Regs[getFirstReg(Reg)];
61 MCCodeEmitter *createSystemZMCCodeEmitter(const MCInstrInfo &MCII,
62 const MCRegisterInfo &MRI,
63 const MCSubtargetInfo &STI,
66 MCAsmBackend *createSystemZMCAsmBackend(const Target &T,
67 const MCRegisterInfo &MRI,
68 StringRef TT, StringRef CPU);
70 MCObjectWriter *createSystemZObjectWriter(raw_ostream &OS, uint8_t OSABI);
71 } // end namespace llvm
73 // Defines symbolic names for SystemZ registers.
74 // This defines a mapping from register name to register number.
75 #define GET_REGINFO_ENUM
76 #include "SystemZGenRegisterInfo.inc"
78 // Defines symbolic names for the SystemZ instructions.
79 #define GET_INSTRINFO_ENUM
80 #include "SystemZGenInstrInfo.inc"
82 #define GET_SUBTARGETINFO_ENUM
83 #include "SystemZGenSubtargetInfo.inc"