LLVM  8.0.1
HexagonMCTargetDesc.h
Go to the documentation of this file.
1 //===-- HexagonMCTargetDesc.h - Hexagon Target Descriptions -----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file provides Hexagon specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCTARGETDESC_H
15 #define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCTARGETDESC_H
16 
18 #include <cstdint>
19 #include <string>
20 
21 #define Hexagon_POINTER_SIZE 4
22 
23 #define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
24 #define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8)
25 #define Hexagon_WordSize Hexagon_PointerSize
26 #define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits
27 
28 // allocframe saves LR and FP on stack before allocating
29 // a new stack frame. This takes 8 bytes.
30 #define HEXAGON_LRFP_SIZE 8
31 
32 // Normal instruction size (in bytes).
33 #define HEXAGON_INSTR_SIZE 4
34 
35 // Maximum number of words and instructions in a packet.
36 #define HEXAGON_PACKET_SIZE 4
37 #define HEXAGON_MAX_PACKET_SIZE (HEXAGON_PACKET_SIZE * HEXAGON_INSTR_SIZE)
38 // Minimum number of instructions in an end-loop packet.
39 #define HEXAGON_PACKET_INNER_SIZE 2
40 #define HEXAGON_PACKET_OUTER_SIZE 3
41 // Maximum number of instructions in a packet before shuffling,
42 // including a compound one or a duplex or an extender.
43 #define HEXAGON_PRESHUFFLE_PACKET_SIZE (HEXAGON_PACKET_SIZE + 3)
44 
45 // Name of the global offset table as defined by the Hexagon ABI
46 #define HEXAGON_GOT_SYM_NAME "_GLOBAL_OFFSET_TABLE_"
47 
48 namespace llvm {
49 
50 struct InstrItinerary;
51 struct InstrStage;
52 class FeatureBitset;
53 class MCAsmBackend;
54 class MCCodeEmitter;
55 class MCContext;
56 class MCInstrInfo;
57 class MCObjectTargetWriter;
58 class MCRegisterInfo;
59 class MCSubtargetInfo;
60 class MCTargetOptions;
61 class Target;
62 class Triple;
63 class StringRef;
64 class raw_ostream;
65 class raw_pwrite_stream;
66 
67 Target &getTheHexagonTarget();
68 extern cl::opt<bool> HexagonDisableCompound;
69 extern cl::opt<bool> HexagonDisableDuplex;
70 extern const InstrStage HexagonStages[];
71 
72 MCInstrInfo *createHexagonMCInstrInfo();
73 MCRegisterInfo *createHexagonMCRegisterInfo(StringRef TT);
74 
75 namespace Hexagon_MC {
77 
79  /// Create a Hexagon MCSubtargetInfo instance. This is exposed so Asm parser,
80  /// etc. do not need to go through TargetRegistry.
82  StringRef FS);
83  unsigned GetELFFlags(const MCSubtargetInfo &STI);
84 }
85 
87  const MCRegisterInfo &MRI,
88  MCContext &MCT);
89 
91  const MCSubtargetInfo &STI,
92  const MCRegisterInfo &MRI,
93  const MCTargetOptions &Options);
94 
95 std::unique_ptr<MCObjectTargetWriter>
96 createHexagonELFObjectWriter(uint8_t OSABI, StringRef CPU);
97 
98 unsigned HexagonGetLastSlot();
99 
100 } // End llvm namespace
101 
102 // Define symbolic names for Hexagon registers. This defines a mapping from
103 // register name to register number.
104 //
105 #define GET_REGINFO_ENUM
106 #include "HexagonGenRegisterInfo.inc"
107 
108 // Defines symbolic names for the Hexagon instructions.
109 //
110 #define GET_INSTRINFO_ENUM
111 #define GET_INSTRINFO_SCHED_ENUM
112 #include "HexagonGenInstrInfo.inc"
113 
114 #define GET_SUBTARGETINFO_ENUM
115 #include "HexagonGenSubtargetInfo.inc"
116 
117 #endif // LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCTARGETDESC_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
unsigned HexagonGetLastSlot()
MCCodeEmitter * createHexagonMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &MCT)
MCAsmBackend * createHexagonAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Context object for machine code objects.
Definition: MCContext.h:63
MCInstrInfo * createHexagonMCInstrInfo()
StringRef selectHexagonCPU(StringRef CPU)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
unsigned const MachineRegisterInfo * MRI
Container class for subtarget features.
FeatureBitset completeHVXFeatures(const FeatureBitset &FB)
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:22
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
cl::opt< bool > HexagonDisableCompound
MCSubtargetInfo * createHexagonMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Create a Hexagon MCSubtargetInfo instance.
unsigned GetELFFlags(const MCSubtargetInfo &STI)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
std::unique_ptr< MCObjectTargetWriter > createHexagonELFObjectWriter(uint8_t OSABI, StringRef CPU)
Target - Wrapper for Target specific information.
Generic base class for all target subtargets.
const InstrStage HexagonStages[]
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:42
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
MCRegisterInfo * createHexagonMCRegisterInfo(StringRef TT)
Target & getTheHexagonTarget()
cl::opt< bool > HexagonDisableDuplex