#include "AArch64InstrInfo.h"
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "MCTargetDesc/AArch64InstPrinter.h"
#include "MCTargetDesc/AArch64MCExpr.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "MCTargetDesc/AArch64TargetStreamer.h"
#include "TargetInfo/AArch64TargetInfo.h"
#include "Utils/AArch64BaseInfo.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCLinkerOptimizationHint.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCAsmParserExtension.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/MCParser/MCTargetAsmParser.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCTargetOptions.h"
#include "llvm/MC/MCValue.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/AArch64TargetParser.h"
#include "llvm/TargetParser/SubtargetFeature.h"
#include <cassert>
#include <cctype>
#include <cstdint>
#include <cstdio>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
usingnamespacellvm;
namespace {
enum class RegKind { … };
enum class MatrixKind { … };
enum RegConstraintEqualityTy { … };
class AArch64AsmParser : public MCTargetAsmParser { … };
class AArch64Operand : public MCParsedAsmOperand { … };
}
void AArch64Operand::print(raw_ostream &OS) const { … }
static MCRegister MatchRegisterName(StringRef Name);
static unsigned MatchNeonVectorRegName(StringRef Name) { … }
static std::optional<std::pair<int, int>> parseVectorKind(StringRef Suffix,
RegKind VectorKind) { … }
static bool isValidVectorKind(StringRef Suffix, RegKind VectorKind) { … }
static unsigned matchSVEDataVectorRegName(StringRef Name) { … }
static unsigned matchSVEPredicateVectorRegName(StringRef Name) { … }
static unsigned matchSVEPredicateAsCounterRegName(StringRef Name) { … }
static unsigned matchMatrixTileListRegName(StringRef Name) { … }
static unsigned matchMatrixRegName(StringRef Name) { … }
bool AArch64AsmParser::parseRegister(MCRegister &Reg, SMLoc &StartLoc,
SMLoc &EndLoc) { … }
ParseStatus AArch64AsmParser::tryParseRegister(MCRegister &Reg, SMLoc &StartLoc,
SMLoc &EndLoc) { … }
unsigned AArch64AsmParser::matchRegisterNameAlias(StringRef Name,
RegKind Kind) { … }
unsigned AArch64AsmParser::getNumRegsForRegKind(RegKind K) { … }
ParseStatus AArch64AsmParser::tryParseScalarRegister(MCRegister &RegNum) { … }
ParseStatus AArch64AsmParser::tryParseSysCROperand(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseRPRFMOperand(OperandVector &Operands) { … }
template <bool IsSVEPrefetch>
ParseStatus AArch64AsmParser::tryParsePrefetch(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParsePSBHint(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseSyspXzrPair(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseBTIHint(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseAdrpLabel(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseAdrLabel(OperandVector &Operands) { … }
template <bool AddFPZeroAsLiteral>
ParseStatus AArch64AsmParser::tryParseFPImm(OperandVector &Operands) { … }
ParseStatus
AArch64AsmParser::tryParseImmWithOptionalShift(OperandVector &Operands) { … }
AArch64CC::CondCode
AArch64AsmParser::parseCondCodeString(StringRef Cond, std::string &Suggestion) { … }
bool AArch64AsmParser::parseCondCode(OperandVector &Operands,
bool invertCondCode) { … }
ParseStatus AArch64AsmParser::tryParseSVCR(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseMatrixRegister(OperandVector &Operands) { … }
ParseStatus
AArch64AsmParser::tryParseOptionalShiftExtend(OperandVector &Operands) { … }
static const struct Extension { … } ExtensionMap[] = …;
static void setRequiredFeatureString(FeatureBitset FBS, std::string &Str) { … }
void AArch64AsmParser::createSysAlias(uint16_t Encoding, OperandVector &Operands,
SMLoc S) { … }
bool AArch64AsmParser::parseSysAlias(StringRef Name, SMLoc NameLoc,
OperandVector &Operands) { … }
bool AArch64AsmParser::parseSyspAlias(StringRef Name, SMLoc NameLoc,
OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseBarrierOperand(OperandVector &Operands) { … }
ParseStatus
AArch64AsmParser::tryParseBarriernXSOperand(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseSysReg(OperandVector &Operands) { … }
bool AArch64AsmParser::tryParseNeonVectorRegister(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseVectorIndex(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseVectorRegister(MCRegister &Reg,
StringRef &Kind,
RegKind MatchKind) { … }
ParseStatus AArch64AsmParser::tryParseSVEPredicateOrPredicateAsCounterVector(
OperandVector &Operands) { … }
template <RegKind RK>
ParseStatus
AArch64AsmParser::tryParseSVEPredicateVector(OperandVector &Operands) { … }
bool AArch64AsmParser::parseRegister(OperandVector &Operands) { … }
bool AArch64AsmParser::parseSymbolicImmVal(const MCExpr *&ImmVal) { … }
ParseStatus AArch64AsmParser::tryParseMatrixTileList(OperandVector &Operands) { … }
template <RegKind VectorKind>
ParseStatus AArch64AsmParser::tryParseVectorList(OperandVector &Operands,
bool ExpectMatch) { … }
bool AArch64AsmParser::parseNeonVectorList(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseGPR64sp0Operand(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseZTOperand(OperandVector &Operands) { … }
template <bool ParseShiftExtend, RegConstraintEqualityTy EqTy>
ParseStatus AArch64AsmParser::tryParseGPROperand(OperandVector &Operands) { … }
bool AArch64AsmParser::parseOptionalMulOperand(OperandVector &Operands) { … }
bool AArch64AsmParser::parseOptionalVGOperand(OperandVector &Operands,
StringRef &VecGroup) { … }
bool AArch64AsmParser::parseKeywordOperand(OperandVector &Operands) { … }
bool AArch64AsmParser::parseOperand(OperandVector &Operands, bool isCondCode,
bool invertCondCode) { … }
bool AArch64AsmParser::parseImmExpr(int64_t &Out) { … }
bool AArch64AsmParser::parseComma() { … }
bool AArch64AsmParser::parseRegisterInRange(unsigned &Out, unsigned Base,
unsigned First, unsigned Last) { … }
bool AArch64AsmParser::areEqualRegs(const MCParsedAsmOperand &Op1,
const MCParsedAsmOperand &Op2) const { … }
bool AArch64AsmParser::parseInstruction(ParseInstructionInfo &Info,
StringRef Name, SMLoc NameLoc,
OperandVector &Operands) { … }
static inline bool isMatchingOrAlias(MCRegister ZReg, MCRegister Reg) { … }
bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
SmallVectorImpl<SMLoc> &Loc) { … }
static std::string AArch64MnemonicSpellCheck(StringRef S,
const FeatureBitset &FBS,
unsigned VariantID = 0);
bool AArch64AsmParser::showMatchError(SMLoc Loc, unsigned ErrCode,
uint64_t ErrorInfo,
OperandVector &Operands) { … }
static const char *getSubtargetFeatureName(uint64_t Val);
bool AArch64AsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
OperandVector &Operands,
MCStreamer &Out,
uint64_t &ErrorInfo,
bool MatchingInlineAsm) { … }
bool AArch64AsmParser::ParseDirective(AsmToken DirectiveID) { … }
static void ExpandCryptoAEK(const AArch64::ArchInfo &ArchInfo,
SmallVector<StringRef, 4> &RequestedExtensions) { … }
static SMLoc incrementLoc(SMLoc L, int Offset) { … }
bool AArch64AsmParser::parseDirectiveArch(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveArchExtension(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveCPU(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveInst(SMLoc Loc) { … }
bool AArch64AsmParser::parseDirectiveTLSDescCall(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveLOH(StringRef IDVal, SMLoc Loc) { … }
bool AArch64AsmParser::parseDirectiveLtorg(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveReq(StringRef Name, SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveUnreq(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveCFINegateRAState() { … }
bool AArch64AsmParser::parseDirectiveCFIBKeyFrame() { … }
bool AArch64AsmParser::parseDirectiveCFIMTETaggedFrame() { … }
bool AArch64AsmParser::parseDirectiveVariantPCS(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHAllocStack(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHPrologEnd(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveR19R20X(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveFPLR(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveFPLRX(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveReg(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveRegX(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveRegP(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveRegPX(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveLRPair(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveFReg(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveFRegX(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveFRegP(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveFRegPX(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSetFP(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHAddFP(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHNop(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveNext(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHEpilogStart(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHEpilogEnd(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHTrapFrame(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHMachineFrame(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHContext(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHECContext(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHClearUnwoundToCall(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHPACSignLR(SMLoc L) { … }
bool AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
bool Writeback) { … }
bool AArch64AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) { … }
bool AArch64AsmParser::parseAuthExpr(const MCExpr *&Res, SMLoc &EndLoc) { … }
bool
AArch64AsmParser::classifySymbolRef(const MCExpr *Expr,
AArch64MCExpr::VariantKind &ELFRefKind,
MCSymbolRefExpr::VariantKind &DarwinRefKind,
int64_t &Addend) { … }
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64AsmParser() { … }
#define GET_REGISTER_MATCHER
#define GET_SUBTARGET_FEATURE_NAME
#define GET_MATCHER_IMPLEMENTATION
#define GET_MNEMONIC_SPELL_CHECKER
#include "AArch64GenAsmMatcher.inc"
unsigned AArch64AsmParser::validateTargetOperandClass(MCParsedAsmOperand &AsmOp,
unsigned Kind) { … }
ParseStatus AArch64AsmParser::tryParseGPRSeqPair(OperandVector &Operands) { … }
template <bool ParseShiftExtend, bool ParseSuffix>
ParseStatus AArch64AsmParser::tryParseSVEDataVector(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseSVEPattern(OperandVector &Operands) { … }
ParseStatus
AArch64AsmParser::tryParseSVEVecLenSpecifier(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseGPR64x8(OperandVector &Operands) { … }
ParseStatus AArch64AsmParser::tryParseImmRange(OperandVector &Operands) { … }