16#ifndef LLVM_LIB_TARGET_AARCH64_UTILS_AARCH64BASEINFO_H
17#define LLVM_LIB_TARGET_AARCH64_UTILS_AARCH64BASEINFO_H
32 case AArch64::X0:
return AArch64::W0;
33 case AArch64::X1:
return AArch64::W1;
34 case AArch64::X2:
return AArch64::W2;
35 case AArch64::X3:
return AArch64::W3;
36 case AArch64::X4:
return AArch64::W4;
37 case AArch64::X5:
return AArch64::W5;
38 case AArch64::X6:
return AArch64::W6;
39 case AArch64::X7:
return AArch64::W7;
40 case AArch64::X8:
return AArch64::W8;
41 case AArch64::X9:
return AArch64::W9;
42 case AArch64::X10:
return AArch64::W10;
43 case AArch64::X11:
return AArch64::W11;
44 case AArch64::X12:
return AArch64::W12;
45 case AArch64::X13:
return AArch64::W13;
46 case AArch64::X14:
return AArch64::W14;
47 case AArch64::X15:
return AArch64::W15;
48 case AArch64::X16:
return AArch64::W16;
49 case AArch64::X17:
return AArch64::W17;
50 case AArch64::X18:
return AArch64::W18;
51 case AArch64::X19:
return AArch64::W19;
52 case AArch64::X20:
return AArch64::W20;
53 case AArch64::X21:
return AArch64::W21;
54 case AArch64::X22:
return AArch64::W22;
55 case AArch64::X23:
return AArch64::W23;
56 case AArch64::X24:
return AArch64::W24;
57 case AArch64::X25:
return AArch64::W25;
58 case AArch64::X26:
return AArch64::W26;
59 case AArch64::X27:
return AArch64::W27;
60 case AArch64::X28:
return AArch64::W28;
61 case AArch64::FP:
return AArch64::W29;
62 case AArch64::LR:
return AArch64::W30;
63 case AArch64::SP:
return AArch64::WSP;
64 case AArch64::XZR:
return AArch64::WZR;
72 case AArch64::W0:
return AArch64::X0;
73 case AArch64::W1:
return AArch64::X1;
74 case AArch64::W2:
return AArch64::X2;
75 case AArch64::W3:
return AArch64::X3;
76 case AArch64::W4:
return AArch64::X4;
77 case AArch64::W5:
return AArch64::X5;
78 case AArch64::W6:
return AArch64::X6;
79 case AArch64::W7:
return AArch64::X7;
80 case AArch64::W8:
return AArch64::X8;
81 case AArch64::W9:
return AArch64::X9;
82 case AArch64::W10:
return AArch64::X10;
83 case AArch64::W11:
return AArch64::X11;
84 case AArch64::W12:
return AArch64::X12;
85 case AArch64::W13:
return AArch64::X13;
86 case AArch64::W14:
return AArch64::X14;
87 case AArch64::W15:
return AArch64::X15;
88 case AArch64::W16:
return AArch64::X16;
89 case AArch64::W17:
return AArch64::X17;
90 case AArch64::W18:
return AArch64::X18;
91 case AArch64::W19:
return AArch64::X19;
92 case AArch64::W20:
return AArch64::X20;
93 case AArch64::W21:
return AArch64::X21;
94 case AArch64::W22:
return AArch64::X22;
95 case AArch64::W23:
return AArch64::X23;
96 case AArch64::W24:
return AArch64::X24;
97 case AArch64::W25:
return AArch64::X25;
98 case AArch64::W26:
return AArch64::X26;
99 case AArch64::W27:
return AArch64::X27;
100 case AArch64::W28:
return AArch64::X28;
101 case AArch64::W29:
return AArch64::FP;
102 case AArch64::W30:
return AArch64::LR;
103 case AArch64::WSP:
return AArch64::SP;
104 case AArch64::WZR:
return AArch64::XZR;
112 case AArch64::X0_X1_X2_X3_X4_X5_X6_X7:
return AArch64::X0;
113 case AArch64::X2_X3_X4_X5_X6_X7_X8_X9:
return AArch64::X2;
114 case AArch64::X4_X5_X6_X7_X8_X9_X10_X11:
return AArch64::X4;
115 case AArch64::X6_X7_X8_X9_X10_X11_X12_X13:
return AArch64::X6;
116 case AArch64::X8_X9_X10_X11_X12_X13_X14_X15:
return AArch64::X8;
117 case AArch64::X10_X11_X12_X13_X14_X15_X16_X17:
return AArch64::X10;
118 case AArch64::X12_X13_X14_X15_X16_X17_X18_X19:
return AArch64::X12;
119 case AArch64::X14_X15_X16_X17_X18_X19_X20_X21:
return AArch64::X14;
120 case AArch64::X16_X17_X18_X19_X20_X21_X22_X23:
return AArch64::X16;
121 case AArch64::X18_X19_X20_X21_X22_X23_X24_X25:
return AArch64::X18;
122 case AArch64::X20_X21_X22_X23_X24_X25_X26_X27:
return AArch64::X20;
123 case AArch64::X22_X23_X24_X25_X26_X27_X28_FP:
return AArch64::X22;
131 case AArch64::D0:
return AArch64::B0;
132 case AArch64::D1:
return AArch64::B1;
133 case AArch64::D2:
return AArch64::B2;
134 case AArch64::D3:
return AArch64::B3;
135 case AArch64::D4:
return AArch64::B4;
136 case AArch64::D5:
return AArch64::B5;
137 case AArch64::D6:
return AArch64::B6;
138 case AArch64::D7:
return AArch64::B7;
139 case AArch64::D8:
return AArch64::B8;
140 case AArch64::D9:
return AArch64::B9;
141 case AArch64::D10:
return AArch64::B10;
142 case AArch64::D11:
return AArch64::B11;
143 case AArch64::D12:
return AArch64::B12;
144 case AArch64::D13:
return AArch64::B13;
145 case AArch64::D14:
return AArch64::B14;
146 case AArch64::D15:
return AArch64::B15;
147 case AArch64::D16:
return AArch64::B16;
148 case AArch64::D17:
return AArch64::B17;
149 case AArch64::D18:
return AArch64::B18;
150 case AArch64::D19:
return AArch64::B19;
151 case AArch64::D20:
return AArch64::B20;
152 case AArch64::D21:
return AArch64::B21;
153 case AArch64::D22:
return AArch64::B22;
154 case AArch64::D23:
return AArch64::B23;
155 case AArch64::D24:
return AArch64::B24;
156 case AArch64::D25:
return AArch64::B25;
157 case AArch64::D26:
return AArch64::B26;
158 case AArch64::D27:
return AArch64::B27;
159 case AArch64::D28:
return AArch64::B28;
160 case AArch64::D29:
return AArch64::B29;
161 case AArch64::D30:
return AArch64::B30;
162 case AArch64::D31:
return AArch64::B31;
171 case AArch64::B0:
return AArch64::D0;
172 case AArch64::B1:
return AArch64::D1;
173 case AArch64::B2:
return AArch64::D2;
174 case AArch64::B3:
return AArch64::D3;
175 case AArch64::B4:
return AArch64::D4;
176 case AArch64::B5:
return AArch64::D5;
177 case AArch64::B6:
return AArch64::D6;
178 case AArch64::B7:
return AArch64::D7;
179 case AArch64::B8:
return AArch64::D8;
180 case AArch64::B9:
return AArch64::D9;
181 case AArch64::B10:
return AArch64::D10;
182 case AArch64::B11:
return AArch64::D11;
183 case AArch64::B12:
return AArch64::D12;
184 case AArch64::B13:
return AArch64::D13;
185 case AArch64::B14:
return AArch64::D14;
186 case AArch64::B15:
return AArch64::D15;
187 case AArch64::B16:
return AArch64::D16;
188 case AArch64::B17:
return AArch64::D17;
189 case AArch64::B18:
return AArch64::D18;
190 case AArch64::B19:
return AArch64::D19;
191 case AArch64::B20:
return AArch64::D20;
192 case AArch64::B21:
return AArch64::D21;
193 case AArch64::B22:
return AArch64::D22;
194 case AArch64::B23:
return AArch64::D23;
195 case AArch64::B24:
return AArch64::D24;
196 case AArch64::B25:
return AArch64::D25;
197 case AArch64::B26:
return AArch64::D26;
198 case AArch64::B27:
return AArch64::D27;
199 case AArch64::B28:
return AArch64::D28;
200 case AArch64::B29:
return AArch64::D29;
201 case AArch64::B30:
return AArch64::D30;
202 case AArch64::B31:
return AArch64::D31;
210 case AArch64::LDADDAB:
case AArch64::LDADDAH:
211 case AArch64::LDADDAW:
case AArch64::LDADDAX:
212 case AArch64::LDADDALB:
case AArch64::LDADDALH:
213 case AArch64::LDADDALW:
case AArch64::LDADDALX:
214 case AArch64::LDCLRAB:
case AArch64::LDCLRAH:
215 case AArch64::LDCLRAW:
case AArch64::LDCLRAX:
216 case AArch64::LDCLRALB:
case AArch64::LDCLRALH:
217 case AArch64::LDCLRALW:
case AArch64::LDCLRALX:
218 case AArch64::LDEORAB:
case AArch64::LDEORAH:
219 case AArch64::LDEORAW:
case AArch64::LDEORAX:
220 case AArch64::LDEORALB:
case AArch64::LDEORALH:
221 case AArch64::LDEORALW:
case AArch64::LDEORALX:
222 case AArch64::LDSETAB:
case AArch64::LDSETAH:
223 case AArch64::LDSETAW:
case AArch64::LDSETAX:
224 case AArch64::LDSETALB:
case AArch64::LDSETALH:
225 case AArch64::LDSETALW:
case AArch64::LDSETALX:
226 case AArch64::LDSMAXAB:
case AArch64::LDSMAXAH:
227 case AArch64::LDSMAXAW:
case AArch64::LDSMAXAX:
228 case AArch64::LDSMAXALB:
case AArch64::LDSMAXALH:
229 case AArch64::LDSMAXALW:
case AArch64::LDSMAXALX:
230 case AArch64::LDSMINAB:
case AArch64::LDSMINAH:
231 case AArch64::LDSMINAW:
case AArch64::LDSMINAX:
232 case AArch64::LDSMINALB:
case AArch64::LDSMINALH:
233 case AArch64::LDSMINALW:
case AArch64::LDSMINALX:
234 case AArch64::LDUMAXAB:
case AArch64::LDUMAXAH:
235 case AArch64::LDUMAXAW:
case AArch64::LDUMAXAX:
236 case AArch64::LDUMAXALB:
case AArch64::LDUMAXALH:
237 case AArch64::LDUMAXALW:
case AArch64::LDUMAXALX:
238 case AArch64::LDUMINAB:
case AArch64::LDUMINAH:
239 case AArch64::LDUMINAW:
case AArch64::LDUMINAX:
240 case AArch64::LDUMINALB:
case AArch64::LDUMINALH:
241 case AArch64::LDUMINALW:
case AArch64::LDUMINALX:
242 case AArch64::SWPAB:
case AArch64::SWPAH:
243 case AArch64::SWPAW:
case AArch64::SWPAX:
244 case AArch64::SWPALB:
case AArch64::SWPALH:
245 case AArch64::SWPALW:
case AArch64::SWPALX:
285 case EQ:
return "eq";
286 case NE:
return "ne";
287 case HS:
return "hs";
288 case LO:
return "lo";
289 case MI:
return "mi";
290 case PL:
return "pl";
291 case VS:
return "vs";
292 case VC:
return "vc";
293 case HI:
return "hi";
294 case LS:
return "ls";
295 case GE:
return "ge";
296 case LT:
return "lt";
297 case GT:
return "gt";
298 case LE:
return "le";
299 case AL:
return "al";
300 case NV:
return "nv";
307 return static_cast<CondCode>(
static_cast<unsigned>(Code) ^ 0x1);
316 enum {
N = 8, Z = 4,
C = 2, V = 1 };
348 return ActiveFeatures[llvm::AArch64::FeatureAll] ||
371namespace AArch64SVCR {
375 #define GET_SVCR_DECL
376 #include "AArch64GenSystemOperands.inc"
384 #include "AArch64GenSystemOperands.inc"
392 #include "AArch64GenSystemOperands.inc"
395namespace AArch64DBnXS {
399 #define GET_DBNXS_DECL
400 #include "AArch64GenSystemOperands.inc"
408 #include "AArch64GenSystemOperands.inc"
416 #include "AArch64GenSystemOperands.inc"
419namespace AArch64ISB {
424 #include "AArch64GenSystemOperands.inc"
427namespace AArch64TSB {
432 #include "AArch64GenSystemOperands.inc"
435namespace AArch64PRFM {
439 #define GET_PRFM_DECL
440 #include "AArch64GenSystemOperands.inc"
443namespace AArch64SVEPRFM {
447#define GET_SVEPRFM_DECL
448#include "AArch64GenSystemOperands.inc"
451namespace AArch64RPRFM {
455#define GET_RPRFM_DECL
456#include "AArch64GenSystemOperands.inc"
459namespace AArch64SVEPredPattern {
464#define GET_SVEPREDPAT_DECL
465#include "AArch64GenSystemOperands.inc"
468namespace AArch64SVEVecLenSpecifier {
473#define GET_SVEVECLENSPECIFIER_DECL
474#include "AArch64GenSystemOperands.inc"
483 case AArch64SVEPredPattern::vl1:
484 case AArch64SVEPredPattern::vl2:
485 case AArch64SVEPredPattern::vl3:
486 case AArch64SVEPredPattern::vl4:
487 case AArch64SVEPredPattern::vl5:
488 case AArch64SVEPredPattern::vl6:
489 case AArch64SVEPredPattern::vl7:
490 case AArch64SVEPredPattern::vl8:
492 case AArch64SVEPredPattern::vl16:
494 case AArch64SVEPredPattern::vl32:
496 case AArch64SVEPredPattern::vl64:
498 case AArch64SVEPredPattern::vl128:
500 case AArch64SVEPredPattern::vl256:
506inline std::optional<unsigned>
508 switch (MinNumElts) {
521 return AArch64SVEPredPattern::vl16;
523 return AArch64SVEPredPattern::vl32;
525 return AArch64SVEPredPattern::vl64;
527 return AArch64SVEPredPattern::vl128;
529 return AArch64SVEPredPattern::vl256;
554namespace AArch64ExactFPImm {
560#define GET_EXACTFPIMM_DECL
561#include "AArch64GenSystemOperands.inc"
564namespace AArch64PState {
568 #define GET_PSTATEIMM0_15_DECL
569 #include "AArch64GenSystemOperands.inc"
574 #define GET_PSTATEIMM0_1_DECL
575 #include "AArch64GenSystemOperands.inc"
578namespace AArch64PSBHint {
583 #include "AArch64GenSystemOperands.inc"
586namespace AArch64BTIHint {
591 #include "AArch64GenSystemOperands.inc"
594namespace AArch64SME {
623namespace AArch64Layout {
645inline static const char *
682namespace AArch64SysReg {
692 return ActiveFeatures[llvm::AArch64::FeatureAll] ||
697 #define GET_SYSREG_DECL
698 #include "AArch64GenSystemOperands.inc"
707namespace AArch64TLBI {
711 #define GET_TLBITable_DECL
712 #include "AArch64GenSystemOperands.inc"
715namespace AArch64PRCTX {
719 #define GET_PRCTX_DECL
720 #include "AArch64GenSystemOperands.inc"
818namespace AArch64PACKey {
844inline static std::optional<AArch64PACKey::ID>
#define LLVM_DECLARE_ENUM_AS_BITMASK(Enum, LargestValue)
LLVM_DECLARE_ENUM_AS_BITMASK can be used to declare an enum type as a bit set, so that bitwise operat...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Container class for subtarget features.
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static const char * getCondCodeName(CondCode Code)
static CondCode getInvertedCondCode(CondCode Code)
static unsigned getNZCVToSatisfyCondCode(CondCode Code)
Given a condition code, return NZCV flags that would satisfy that condition.
TOF
Target Operand Flag enum.
@ MO_DLLIMPORT
MO_DLLIMPORT - On a symbol operand, this represents that the reference to the symbol is for an import...
@ MO_NC
MO_NC - Indicates whether the linker is expected to check the symbol reference for overflow.
@ MO_G1
MO_G1 - A symbol operand with this flag (granule 1) represents the bits 16-31 of a 64-bit address,...
@ MO_S
MO_S - Indicates that the bits of the symbol operand represented by MO_G0 etc are signed.
@ MO_PAGEOFF
MO_PAGEOFF - A symbol operand with this flag represents the offset of that symbol within a 4K page.
@ MO_GOT
MO_GOT - This flag indicates that a symbol operand represents the address of the GOT entry for the sy...
@ MO_PREL
MO_PREL - Indicates that the bits of the symbol operand represented by MO_G0 etc are PC relative.
@ MO_G0
MO_G0 - A symbol operand with this flag (granule 0) represents the bits 0-15 of a 64-bit address,...
@ MO_ARM64EC_CALLMANGLE
MO_ARM64EC_CALLMANGLE - Operand refers to the Arm64EC-mangled version of a symbol,...
@ MO_PAGE
MO_PAGE - A symbol operand with this flag represents the pc-relative offset of the 4K page containing...
@ MO_HI12
MO_HI12 - This flag indicates that a symbol operand represents the bits 13-24 of a 64-bit address,...
@ MO_TLS
MO_TLS - Indicates that the operand being accessed is some kind of thread-local symbol.
@ MO_G2
MO_G2 - A symbol operand with this flag (granule 2) represents the bits 32-47 of a 64-bit address,...
@ MO_TAGGED
MO_TAGGED - With MO_PAGE, indicates that the page includes a memory tag in bits 56-63.
@ MO_G3
MO_G3 - A symbol operand with this flag (granule 3) represents the high 16-bits of a 64-bit address,...
@ MO_COFFSTUB
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "....
const SysReg * lookupSysRegByEncoding(uint16_t)
uint32_t parseGenericRegister(StringRef Name)
std::string genericRegisterString(uint32_t Bits)
const SysReg * lookupSysRegByName(StringRef)
static constexpr unsigned SVEMaxBitsPerVector
static constexpr unsigned SVEBitsPerBlock
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
static std::optional< AArch64PACKey::ID > AArch64StringToPACKeyID(StringRef Name)
Return numeric key ID for 2-letter identifier string.
TailFoldingOpts
An enum to describe what types of loops we should attempt to tail-fold: Disabled: None Reductions: Lo...
static AArch64Layout::VectorLayout AArch64StringToVectorLayout(StringRef LayoutStr)
static const char * AArch64VectorLayoutToString(AArch64Layout::VectorLayout Layout)
std::optional< unsigned > getSVEPredPatternFromNumElements(unsigned MinNumElts)
Return specific VL predicate pattern based on the number of elements.
static unsigned getXRegFromWReg(unsigned Reg)
static unsigned getXRegFromXRegTuple(unsigned RegTuple)
static unsigned getDRegFromBReg(unsigned Reg)
static bool atomicBarrierDroppedOnZero(unsigned Opcode)
static unsigned getWRegFromXReg(unsigned Reg)
unsigned getNumElementsFromSVEPredPattern(unsigned Pattern)
Return the number of active elements for VL1 to VL256 predicate pattern, zero for all other patterns.
static unsigned getBRegFromDReg(unsigned Reg)
static StringRef AArch64PACKeyIDToString(AArch64PACKey::ID KeyID)
Return 2-letter identifier string for numeric key ID.
FeatureBitset FeaturesRequired
bool haveFeatures(FeatureBitset ActiveFeatures) const
constexpr SysAliasImm(const char *N, uint16_t E, uint16_t I)
constexpr SysAliasImm(const char *N, uint16_t E, uint16_t I, FeatureBitset F)
constexpr SysAliasReg(const char *N, uint16_t E, bool R, FeatureBitset F)
constexpr SysAliasReg(const char *N, uint16_t E, bool R)
bool haveFeatures(FeatureBitset ActiveFeatures) const
constexpr SysAlias(const char *N, uint16_t E)
FeatureBitset getRequiredFeatures() const
FeatureBitset FeaturesRequired
constexpr SysAlias(const char *N, uint16_t E, FeatureBitset F)