LLVM
5.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
lib
Target
Hexagon
MCTargetDesc
HexagonBaseInfo.h
Go to the documentation of this file.
1
//===-- HexagonBaseInfo.h - Top level definitions for Hexagon --*- 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 contains small standalone helper functions and enum definitions for
11
// the Hexagon target useful for the compiler back-end and the MC libraries.
12
// As such, it deliberately does not include references to LLVM core
13
// code gen types, passes, etc..
14
//
15
//===----------------------------------------------------------------------===//
16
17
#ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONBASEINFO_H
18
#define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONBASEINFO_H
19
20
#include "
HexagonDepITypes.h
"
21
#include "
HexagonMCTargetDesc.h
"
22
#include "
llvm/Support/ErrorHandling.h
"
23
#include <stdint.h>
24
25
namespace
llvm {
26
27
/// HexagonII - This namespace holds all of the target specific flags that
28
/// instruction info tracks.
29
///
30
namespace
HexagonII {
31
unsigned
const
TypeCVI_FIRST
=
TypeCVI_HIST
;
32
unsigned
const
TypeCVI_LAST
=
TypeCVI_VX_LATE
;
33
34
enum
SubTarget
{
35
HasV4SubT
= 0x3f,
36
HasV5SubT
= 0x3e,
37
HasV55SubT
= 0x3c,
38
HasV60SubT
= 0x38,
39
};
40
41
enum
AddrMode
{
42
NoAddrMode
= 0,
// No addressing mode
43
Absolute
= 1,
// Absolute addressing mode
44
AbsoluteSet
= 2,
// Absolute set addressing mode
45
BaseImmOffset
= 3,
// Indirect with offset
46
BaseLongOffset
= 4,
// Indirect with long offset
47
BaseRegOffset
= 5,
// Indirect with register offset
48
PostInc
= 6
// Post increment addressing mode
49
};
50
51
// MemAccessSize is represented as 1+log2(N) where N is size in bits.
52
enum class
MemAccessSize
{
53
NoMemAccess
= 0,
// Not a memory access instruction.
54
ByteAccess
= 1,
// Byte access instruction (memb).
55
HalfWordAccess
= 2,
// Half word access instruction (memh).
56
WordAccess
= 3,
// Word access instruction (memw).
57
DoubleWordAccess
= 4,
// Double word access instruction (memd)
58
// 5, // We do not have a 16 byte vector access.
59
Vector64Access
= 7,
// 64 Byte vector access instruction (vmem).
60
Vector128Access
= 8
// 128 Byte vector access instruction (vmem).
61
};
62
63
// MCInstrDesc TSFlags
64
// *** Must match HexagonInstrFormat*.td ***
65
enum
{
66
// This 5-bit field describes the insn type.
67
TypePos
= 0,
68
TypeMask
= 0x3f,
69
70
// Solo instructions.
71
SoloPos
= 6,
72
SoloMask
= 0x1,
73
// Packed only with A or X-type instructions.
74
SoloAXPos
= 7,
75
SoloAXMask
= 0x1,
76
// Only A-type instruction in first slot or nothing.
77
SoloAin1Pos
= 8,
78
SoloAin1Mask
= 0x1,
79
80
// Predicated instructions.
81
PredicatedPos
= 9,
82
PredicatedMask
= 0x1,
83
PredicatedFalsePos
= 10,
84
PredicatedFalseMask
= 0x1,
85
PredicatedNewPos
= 11,
86
PredicatedNewMask
= 0x1,
87
PredicateLatePos
= 12,
88
PredicateLateMask
= 0x1,
89
90
// New-Value consumer instructions.
91
NewValuePos
= 13,
92
NewValueMask
= 0x1,
93
// New-Value producer instructions.
94
hasNewValuePos
= 14,
95
hasNewValueMask
= 0x1,
96
// Which operand consumes or produces a new value.
97
NewValueOpPos
= 15,
98
NewValueOpMask
= 0x7,
99
// Stores that can become new-value stores.
100
mayNVStorePos
= 18,
101
mayNVStoreMask
= 0x1,
102
// New-value store instructions.
103
NVStorePos
= 19,
104
NVStoreMask
= 0x1,
105
// Loads that can become current-value loads.
106
mayCVLoadPos
= 20,
107
mayCVLoadMask
= 0x1,
108
// Current-value load instructions.
109
CVLoadPos
= 21,
110
CVLoadMask
= 0x1,
111
112
// Extendable insns.
113
ExtendablePos
= 22,
114
ExtendableMask
= 0x1,
115
// Insns must be extended.
116
ExtendedPos
= 23,
117
ExtendedMask
= 0x1,
118
// Which operand may be extended.
119
ExtendableOpPos
= 24,
120
ExtendableOpMask
= 0x7,
121
// Signed or unsigned range.
122
ExtentSignedPos
= 27,
123
ExtentSignedMask
= 0x1,
124
// Number of bits of range before extending operand.
125
ExtentBitsPos
= 28,
126
ExtentBitsMask
= 0x1f,
127
// Alignment power-of-two before extending operand.
128
ExtentAlignPos
= 33,
129
ExtentAlignMask
= 0x3,
130
131
// Addressing mode for load/store instructions.
132
AddrModePos
= 41,
133
AddrModeMask
= 0x7,
134
// Access size for load/store instructions.
135
MemAccessSizePos
= 44,
136
MemAccesSizeMask
= 0xf,
137
138
// Branch predicted taken.
139
TakenPos
= 48,
140
TakenMask
= 0x1,
141
142
// Floating-point instructions.
143
FPPos
= 49,
144
FPMask
= 0x1,
145
146
// New-Value producer-2 instructions.
147
hasNewValuePos2
= 51,
148
hasNewValueMask2
= 0x1,
149
// Which operand consumes or produces a new value.
150
NewValueOpPos2
= 52,
151
NewValueOpMask2
= 0x7,
152
153
// Accumulator instructions.
154
AccumulatorPos
= 55,
155
AccumulatorMask
= 0x1,
156
157
// Complex XU, prevent xu competition by preferring slot3
158
PrefersSlot3Pos
= 56,
159
PrefersSlot3Mask
= 0x1,
160
161
CofMax1Pos
= 60,
162
CofMax1Mask
= 0x1,
163
164
CVINewPos
= 61,
165
CVINewMask
= 0x1
166
};
167
168
// *** The code above must match HexagonInstrFormat*.td *** //
169
170
// Hexagon specific MO operand flag mask.
171
enum
HexagonMOTargetFlagVal
{
172
// Hexagon-specific MachineOperand target flags.
173
//
174
// When chaning these, make sure to update
175
// getSerializableDirectMachineOperandTargetFlags and
176
// getSerializableBitmaskMachineOperandTargetFlags if needed.
177
MO_NO_FLAG
,
178
179
/// MO_PCREL - On a symbol operand, indicates a PC-relative relocation
180
/// Used for computing a global address for PIC compilations
181
MO_PCREL
,
182
183
/// MO_GOT - Indicates a GOT-relative relocation
184
MO_GOT
,
185
186
// Low or high part of a symbol.
187
MO_LO16
,
MO_HI16
,
188
189
// Offset from the base of the SDA.
190
MO_GPREL
,
191
192
// MO_GDGOT - indicates GOT relative relocation for TLS
193
// GeneralDynamic method
194
MO_GDGOT
,
195
196
// MO_GDPLT - indicates PLT relative relocation for TLS
197
// GeneralDynamic method
198
MO_GDPLT
,
199
200
// MO_IE - indicates non PIC relocation for TLS
201
// Initial Executable method
202
MO_IE
,
203
204
// MO_IEGOT - indicates PIC relocation for TLS
205
// Initial Executable method
206
MO_IEGOT
,
207
208
// MO_TPREL - indicates relocation for TLS
209
// local Executable method
210
MO_TPREL
,
211
212
// HMOTF_ConstExtended
213
// Addendum to above, indicates a const extended op
214
// Can be used as a mask.
215
HMOTF_ConstExtended
= 0x80,
216
217
// Union of all bitmasks (currently only HMOTF_ConstExtended).
218
MO_Bitmasks
=
HMOTF_ConstExtended
219
};
220
221
// Hexagon Sub-instruction classes.
222
enum
SubInstructionGroup
{
223
HSIG_None
= 0,
224
HSIG_L1
,
225
HSIG_L2
,
226
HSIG_S1
,
227
HSIG_S2
,
228
HSIG_A
,
229
HSIG_Compound
230
};
231
232
// Hexagon Compound classes.
233
enum
CompoundGroup
{
234
HCG_None
= 0,
235
HCG_A
,
236
HCG_B
,
237
HCG_C
238
};
239
240
enum
InstParseBits
{
241
INST_PARSE_MASK
= 0x0000c000,
242
INST_PARSE_PACKET_END
= 0x0000c000,
243
INST_PARSE_LOOP_END
= 0x00008000,
244
INST_PARSE_NOT_END
= 0x00004000,
245
INST_PARSE_DUPLEX
= 0x00000000,
246
INST_PARSE_EXTENDER
= 0x00000000
247
};
248
249
enum
InstIClassBits
:
unsigned
{
250
INST_ICLASS_MASK
= 0xf0000000,
251
INST_ICLASS_EXTENDER
= 0x00000000,
252
INST_ICLASS_J_1
= 0x10000000,
253
INST_ICLASS_J_2
= 0x20000000,
254
INST_ICLASS_LD_ST_1
= 0x30000000,
255
INST_ICLASS_LD_ST_2
= 0x40000000,
256
INST_ICLASS_J_3
= 0x50000000,
257
INST_ICLASS_CR
= 0x60000000,
258
INST_ICLASS_ALU32_1
= 0x70000000,
259
INST_ICLASS_XTYPE_1
= 0x80000000,
260
INST_ICLASS_LD
= 0x90000000,
261
INST_ICLASS_ST
= 0xa0000000,
262
INST_ICLASS_ALU32_2
= 0xb0000000,
263
INST_ICLASS_XTYPE_2
= 0xc0000000,
264
INST_ICLASS_XTYPE_3
= 0xd0000000,
265
INST_ICLASS_XTYPE_4
= 0xe0000000,
266
INST_ICLASS_ALU32_3
= 0xf0000000
267
};
268
269
}
// End namespace HexagonII.
270
271
}
// End namespace llvm.
272
273
#endif
llvm::HexagonII::CVINewPos
Definition:
HexagonBaseInfo.h:164
llvm::HexagonII::MemAccessSize::ByteAccess
llvm::HexagonII::INST_ICLASS_XTYPE_3
Definition:
HexagonBaseInfo.h:264
llvm::HexagonII::ExtentBitsPos
Definition:
HexagonBaseInfo.h:125
llvm::HexagonII::HSIG_Compound
Definition:
HexagonBaseInfo.h:229
llvm::HexagonII::HasV55SubT
Definition:
HexagonBaseInfo.h:37
llvm::HexagonII::MemAccessSize
MemAccessSize
Definition:
HexagonBaseInfo.h:52
llvm::HexagonII::INST_ICLASS_ALU32_1
Definition:
HexagonBaseInfo.h:258
llvm::HexagonII::HSIG_S1
Definition:
HexagonBaseInfo.h:226
HexagonDepITypes.h
llvm::HexagonII::MO_NO_FLAG
Definition:
HexagonBaseInfo.h:177
llvm::HexagonII::AbsoluteSet
Definition:
HexagonBaseInfo.h:44
llvm::HexagonII::TypePos
Definition:
HexagonBaseInfo.h:67
llvm::HexagonII::SoloPos
Definition:
HexagonBaseInfo.h:71
llvm::HexagonII::InstIClassBits
InstIClassBits
Definition:
HexagonBaseInfo.h:249
llvm::HexagonII::NewValueOpPos
Definition:
HexagonBaseInfo.h:97
llvm::HexagonII::ExtendablePos
Definition:
HexagonBaseInfo.h:113
llvm::HexagonII::PrefersSlot3Mask
Definition:
HexagonBaseInfo.h:159
llvm::HexagonII::NoAddrMode
Definition:
HexagonBaseInfo.h:42
llvm::HexagonII::CofMax1Mask
Definition:
HexagonBaseInfo.h:162
llvm::HexagonII::MemAccesSizeMask
Definition:
HexagonBaseInfo.h:136
llvm::HexagonII::SoloAin1Mask
Definition:
HexagonBaseInfo.h:78
llvm::HexagonII::CVINewMask
Definition:
HexagonBaseInfo.h:165
llvm::HexagonII::ExtentSignedPos
Definition:
HexagonBaseInfo.h:122
llvm::HexagonII::INST_ICLASS_XTYPE_1
Definition:
HexagonBaseInfo.h:259
llvm::HexagonII::AddrModePos
Definition:
HexagonBaseInfo.h:132
llvm::HexagonII::SubInstructionGroup
SubInstructionGroup
Definition:
HexagonBaseInfo.h:222
llvm::HexagonII::SoloAXPos
Definition:
HexagonBaseInfo.h:74
llvm::HexagonII::TypeCVI_VX_LATE
Definition:
HexagonDepITypes.h:34
llvm::HexagonII::TypeMask
Definition:
HexagonBaseInfo.h:68
llvm::HexagonII::NewValueOpPos2
Definition:
HexagonBaseInfo.h:150
llvm::HexagonII::SoloAXMask
Definition:
HexagonBaseInfo.h:75
llvm::HexagonII::Absolute
Definition:
HexagonBaseInfo.h:43
llvm::HexagonII::mayCVLoadPos
Definition:
HexagonBaseInfo.h:106
llvm::HexagonII::PredicatedFalsePos
Definition:
HexagonBaseInfo.h:83
llvm::HexagonII::PredicatedNewMask
Definition:
HexagonBaseInfo.h:86
llvm::HexagonII::CompoundGroup
CompoundGroup
Definition:
HexagonBaseInfo.h:233
llvm::HexagonII::MO_TPREL
Definition:
HexagonBaseInfo.h:210
llvm::HexagonII::NewValueOpMask2
Definition:
HexagonBaseInfo.h:151
llvm::HexagonII::INST_PARSE_EXTENDER
Definition:
HexagonBaseInfo.h:246
llvm::HexagonII::HCG_B
Definition:
HexagonBaseInfo.h:236
llvm::HexagonII::ExtentBitsMask
Definition:
HexagonBaseInfo.h:126
llvm::HexagonII::SoloMask
Definition:
HexagonBaseInfo.h:72
llvm::HexagonII::SubTarget
SubTarget
Definition:
HexagonBaseInfo.h:34
llvm::HexagonII::mayCVLoadMask
Definition:
HexagonBaseInfo.h:107
llvm::HexagonII::INST_ICLASS_ST
Definition:
HexagonBaseInfo.h:261
llvm::HexagonII::HSIG_S2
Definition:
HexagonBaseInfo.h:227
llvm::HexagonII::AddrMode
AddrMode
Definition:
HexagonBaseInfo.h:41
llvm::HexagonII::hasNewValuePos
Definition:
HexagonBaseInfo.h:94
llvm::HexagonII::PredicateLatePos
Definition:
HexagonBaseInfo.h:87
llvm::HexagonII::HMOTF_ConstExtended
Definition:
HexagonBaseInfo.h:215
llvm::HexagonII::PrefersSlot3Pos
Definition:
HexagonBaseInfo.h:158
llvm::HexagonII::INST_ICLASS_XTYPE_4
Definition:
HexagonBaseInfo.h:265
llvm::HexagonII::AccumulatorPos
Definition:
HexagonBaseInfo.h:154
llvm::HexagonII::MemAccessSizePos
Definition:
HexagonBaseInfo.h:135
llvm::HexagonII::HCG_None
Definition:
HexagonBaseInfo.h:234
llvm::HexagonII::SoloAin1Pos
Definition:
HexagonBaseInfo.h:77
llvm::HexagonII::TakenPos
Definition:
HexagonBaseInfo.h:139
llvm::HexagonII::TypeCVI_HIST
Definition:
HexagonDepITypes.h:19
llvm::HexagonII::MO_HI16
Definition:
HexagonBaseInfo.h:187
llvm::HexagonII::INST_PARSE_DUPLEX
Definition:
HexagonBaseInfo.h:245
llvm::HexagonII::HCG_A
Definition:
HexagonBaseInfo.h:235
llvm::HexagonII::hasNewValuePos2
Definition:
HexagonBaseInfo.h:147
llvm::HexagonII::MemAccessSize::NoMemAccess
llvm::HexagonII::MO_Bitmasks
Definition:
HexagonBaseInfo.h:218
llvm::HexagonII::MO_LO16
Definition:
HexagonBaseInfo.h:187
llvm::HexagonII::PredicatedMask
Definition:
HexagonBaseInfo.h:82
llvm::HexagonII::INST_ICLASS_XTYPE_2
Definition:
HexagonBaseInfo.h:263
llvm::HexagonII::MO_IE
Definition:
HexagonBaseInfo.h:202
llvm::HexagonII::HasV60SubT
Definition:
HexagonBaseInfo.h:38
llvm::HexagonII::hasNewValueMask
Definition:
HexagonBaseInfo.h:95
llvm::HexagonII::NewValueOpMask
Definition:
HexagonBaseInfo.h:98
llvm::HexagonII::HSIG_None
Definition:
HexagonBaseInfo.h:223
llvm::HexagonII::NewValueMask
Definition:
HexagonBaseInfo.h:92
llvm::HexagonII::MemAccessSize::HalfWordAccess
llvm::HexagonII::INST_ICLASS_LD_ST_2
Definition:
HexagonBaseInfo.h:255
llvm::HexagonII::INST_ICLASS_J_1
Definition:
HexagonBaseInfo.h:252
llvm::HexagonII::NVStoreMask
Definition:
HexagonBaseInfo.h:104
llvm::HexagonII::AccumulatorMask
Definition:
HexagonBaseInfo.h:155
llvm::HexagonII::PredicatedFalseMask
Definition:
HexagonBaseInfo.h:84
llvm::HexagonII::CofMax1Pos
Definition:
HexagonBaseInfo.h:161
llvm::HexagonII::MO_IEGOT
Definition:
HexagonBaseInfo.h:206
llvm::HexagonII::INST_ICLASS_ALU32_2
Definition:
HexagonBaseInfo.h:262
llvm::HexagonII::INST_ICLASS_EXTENDER
Definition:
HexagonBaseInfo.h:251
llvm::HexagonII::BaseLongOffset
Definition:
HexagonBaseInfo.h:46
llvm::HexagonII::INST_ICLASS_CR
Definition:
HexagonBaseInfo.h:257
llvm::HexagonII::FPPos
Definition:
HexagonBaseInfo.h:143
llvm::HexagonII::INST_ICLASS_J_3
Definition:
HexagonBaseInfo.h:256
llvm::HexagonII::FPMask
Definition:
HexagonBaseInfo.h:144
llvm::HexagonII::INST_PARSE_NOT_END
Definition:
HexagonBaseInfo.h:244
llvm::HexagonII::TakenMask
Definition:
HexagonBaseInfo.h:140
ErrorHandling.h
llvm::HexagonII::INST_ICLASS_J_2
Definition:
HexagonBaseInfo.h:253
llvm::HexagonII::MO_PCREL
MO_PCREL - On a symbol operand, indicates a PC-relative relocation Used for computing a global addres...
Definition:
HexagonBaseInfo.h:181
llvm::HexagonII::INST_ICLASS_ALU32_3
Definition:
HexagonBaseInfo.h:266
llvm::HexagonII::HexagonMOTargetFlagVal
HexagonMOTargetFlagVal
Definition:
HexagonBaseInfo.h:171
llvm::HexagonII::INST_ICLASS_LD_ST_1
Definition:
HexagonBaseInfo.h:254
llvm::HexagonII::ExtentAlignMask
Definition:
HexagonBaseInfo.h:129
llvm::HexagonII::TypeCVI_FIRST
unsigned const TypeCVI_FIRST
Definition:
HexagonBaseInfo.h:31
llvm::HexagonII::HSIG_A
Definition:
HexagonBaseInfo.h:228
llvm::HexagonII::MemAccessSize::Vector128Access
llvm::HexagonII::TypeCVI_LAST
unsigned const TypeCVI_LAST
Definition:
HexagonBaseInfo.h:32
llvm::HexagonII::ExtendableMask
Definition:
HexagonBaseInfo.h:114
llvm::HexagonII::INST_ICLASS_LD
Definition:
HexagonBaseInfo.h:260
llvm::HexagonII::BaseImmOffset
Definition:
HexagonBaseInfo.h:45
llvm::HexagonII::CVLoadMask
Definition:
HexagonBaseInfo.h:110
llvm::HexagonII::MO_GOT
MO_GOT - Indicates a GOT-relative relocation.
Definition:
HexagonBaseInfo.h:184
llvm::HexagonII::HasV4SubT
Definition:
HexagonBaseInfo.h:35
llvm::HexagonII::ExtentAlignPos
Definition:
HexagonBaseInfo.h:128
llvm::HexagonII::HCG_C
Definition:
HexagonBaseInfo.h:237
llvm::HexagonII::MemAccessSize::Vector64Access
llvm::HexagonII::mayNVStorePos
Definition:
HexagonBaseInfo.h:100
llvm::HexagonII::mayNVStoreMask
Definition:
HexagonBaseInfo.h:101
llvm::HexagonII::MO_GDPLT
Definition:
HexagonBaseInfo.h:198
llvm::HexagonII::INST_PARSE_PACKET_END
Definition:
HexagonBaseInfo.h:242
llvm::HexagonII::InstParseBits
InstParseBits
Definition:
HexagonBaseInfo.h:240
llvm::HexagonII::ExtentSignedMask
Definition:
HexagonBaseInfo.h:123
llvm::HexagonII::INST_PARSE_LOOP_END
Definition:
HexagonBaseInfo.h:243
llvm::HexagonII::PredicateLateMask
Definition:
HexagonBaseInfo.h:88
llvm::HexagonII::HasV5SubT
Definition:
HexagonBaseInfo.h:36
llvm::HexagonII::HSIG_L1
Definition:
HexagonBaseInfo.h:224
HexagonMCTargetDesc.h
llvm::HexagonII::MO_GDGOT
Definition:
HexagonBaseInfo.h:194
llvm::HexagonII::MO_GPREL
Definition:
HexagonBaseInfo.h:190
llvm::HexagonII::MemAccessSize::DoubleWordAccess
llvm::HexagonII::BaseRegOffset
Definition:
HexagonBaseInfo.h:47
llvm::HexagonII::AddrModeMask
Definition:
HexagonBaseInfo.h:133
llvm::HexagonII::NewValuePos
Definition:
HexagonBaseInfo.h:91
llvm::HexagonII::MemAccessSize::WordAccess
llvm::HexagonII::PredicatedNewPos
Definition:
HexagonBaseInfo.h:85
llvm::HexagonII::hasNewValueMask2
Definition:
HexagonBaseInfo.h:148
llvm::HexagonII::CVLoadPos
Definition:
HexagonBaseInfo.h:109
llvm::HexagonII::ExtendableOpMask
Definition:
HexagonBaseInfo.h:120
llvm::HexagonII::ExtendedPos
Definition:
HexagonBaseInfo.h:116
llvm::HexagonII::INST_ICLASS_MASK
Definition:
HexagonBaseInfo.h:250
llvm::HexagonII::PostInc
Definition:
HexagonBaseInfo.h:48
llvm::HexagonII::INST_PARSE_MASK
Definition:
HexagonBaseInfo.h:241
llvm::HexagonII::ExtendableOpPos
Definition:
HexagonBaseInfo.h:119
llvm::HexagonII::ExtendedMask
Definition:
HexagonBaseInfo.h:117
llvm::HexagonII::NVStorePos
Definition:
HexagonBaseInfo.h:103
llvm::HexagonII::PredicatedPos
Definition:
HexagonBaseInfo.h:81
llvm::HexagonII::HSIG_L2
Definition:
HexagonBaseInfo.h:225
Generated on Fri Sep 1 2017 14:14:38 for LLVM by
1.8.6