LLVM  8.0.1
Classes | Macros | Enumerations
AArch64AsmParser.cpp File Reference
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "MCTargetDesc/AArch64MCExpr.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "MCTargetDesc/AArch64TargetStreamer.h"
#include "AArch64InstrInfo.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/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/SubtargetFeature.h"
#include "llvm/MC/MCValue.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/TargetParser.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cctype>
#include <cstdint>
#include <cstdio>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include "AArch64GenAsmMatcher.inc"

Go to the source code of this file.

Classes

struct  Extension
 

Macros

#define GET_OPERAND_DIAGNOSTIC_TYPES
 
Auto-generated Match Functions

{

#define GET_ASSEMBLER_HEADER
 

Enumerations

enum  RegKind
 
enum  RegConstraintEqualityTy
 

Auto-generated Match Functions

{

#define GET_REGISTER_MATCHER
 
#define GET_SUBTARGET_FEATURE_NAME
 
#define GET_MATCHER_IMPLEMENTATION
 
#define GET_MNEMONIC_SPELL_CHECKER
 
static const struct Extension ExtensionMap []
 
static unsigned MatchRegisterName (StringRef Name)
 
static unsigned MatchNeonVectorRegName (StringRef Name)
 } More...
 
static Optional< std::pair< int, int > > parseVectorKind (StringRef Suffix, RegKind VectorKind)
 Returns an optional pair of (#elements, element-width) if Suffix is a valid vector kind. More...
 
static bool isValidVectorKind (StringRef Suffix, RegKind VectorKind)
 
static unsigned matchSVEDataVectorRegName (StringRef Name)
 
static unsigned matchSVEPredicateVectorRegName (StringRef Name)
 
static void setRequiredFeatureString (FeatureBitset FBS, std::string &Str)
 
static bool isMatchingOrAlias (unsigned ZReg, unsigned Reg)
 
static std::string AArch64MnemonicSpellCheck (StringRef S, uint64_t FBS, unsigned VariantID=0)
 
static const chargetSubtargetFeatureName (uint64_t Val)
 
static void ExpandCryptoAEK (AArch64::ArchKind ArchKind, SmallVector< StringRef, 4 > &RequestedExtensions)
 
static SMLoc incrementLoc (SMLoc L, int Offset)
 
void LLVMInitializeAArch64AsmParser ()
 Force static initialization. More...
 

Macro Definition Documentation

◆ GET_ASSEMBLER_HEADER

#define GET_ASSEMBLER_HEADER

Definition at line 191 of file AArch64AsmParser.cpp.

◆ GET_MATCHER_IMPLEMENTATION

#define GET_MATCHER_IMPLEMENTATION

Definition at line 5525 of file AArch64AsmParser.cpp.

◆ GET_MNEMONIC_SPELL_CHECKER

#define GET_MNEMONIC_SPELL_CHECKER

Definition at line 5526 of file AArch64AsmParser.cpp.

◆ GET_OPERAND_DIAGNOSTIC_TYPES

#define GET_OPERAND_DIAGNOSTIC_TYPES

Definition at line 231 of file AArch64AsmParser.cpp.

◆ GET_REGISTER_MATCHER

#define GET_REGISTER_MATCHER

Definition at line 5523 of file AArch64AsmParser.cpp.

◆ GET_SUBTARGET_FEATURE_NAME

#define GET_SUBTARGET_FEATURE_NAME

Definition at line 5524 of file AArch64AsmParser.cpp.

Enumeration Type Documentation

◆ RegConstraintEqualityTy

Definition at line 71 of file AArch64AsmParser.cpp.

◆ RegKind

enum RegKind
strong

Definition at line 64 of file AArch64AsmParser.cpp.

Function Documentation

◆ AArch64MnemonicSpellCheck()

static std::string AArch64MnemonicSpellCheck ( StringRef  S,
uint64_t  FBS,
unsigned  VariantID = 0 
)
static

Referenced by isMatchingOrAlias().

◆ ExpandCryptoAEK()

static void ExpandCryptoAEK ( AArch64::ArchKind  ArchKind,
SmallVector< StringRef, 4 > &  RequestedExtensions 
)
static

◆ getSubtargetFeatureName()

static const char* getSubtargetFeatureName ( uint64_t  Val)
static

Referenced by isMatchingOrAlias(), and printMCExpr().

◆ incrementLoc()

static SMLoc incrementLoc ( SMLoc  L,
int  Offset 
)
static

Definition at line 5204 of file AArch64AsmParser.cpp.

References llvm::MCInst::addOperand(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::AsmToken::Comma, llvm::AArch64MCExpr::create(), llvm::MCSymbolRefExpr::create(), llvm::MCOperand::createExpr(), llvm::dyn_cast(), llvm::StringRef::empty(), llvm::AsmToken::EndOfStatement, llvm::Error, llvm::MCExpr::evaluateAsRelocatable(), ExpandCryptoAEK(), ExtensionMap, Extension::Features, Features, llvm::MCValue::getConstant(), llvm::AArch64::getCPUArchKind(), llvm::MCSubtargetInfo::getFeatureBits(), llvm::SMLoc::getFromPointer(), llvm::AsmToken::getIdentifier(), llvm::MCSymbolRefExpr::getKind(), llvm::SMLoc::getPointer(), llvm::MCValue::getSymA(), llvm::MCValue::getSymB(), llvm::MCAsmParser::getTok(), llvm::MCConstantExpr::getValue(), llvm::AsmToken::Identifier, llvm::AsmToken::Integer, llvm::isValidMCLOHType(), Kind, llvm::MCAsmParser::Lex(), llvm::StringRef::lower(), llvm::MatchOperand_ParseFail, llvm::MatchOperand_Success, llvm::MCLOHIdToNbArgs(), llvm::MCLOHNameToId(), Name, Extension::Name, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::report_fatal_error(), llvm::NVPTX::PTXLdStInstCode::Scalar, llvm::MCSubtargetInfo::setDefaultFeatures(), llvm::MCInst::setOpcode(), llvm::StringRef::size(), llvm::StringRef::split(), llvm::StringRef::startswith_lower(), llvm::StringRef::substr(), llvm::MCSubtargetInfo::ToggleFeature(), llvm::StringRef::trim(), llvm::AArch64MCExpr::VK_INVALID, llvm::MCSymbolRefExpr::VK_None, llvm::AArch64MCExpr::VK_TLSDESC, and llvm::Warning.

◆ isMatchingOrAlias()

static bool isMatchingOrAlias ( unsigned  ZReg,
unsigned  Reg 
)
inlinestatic

Definition at line 3873 of file AArch64AsmParser.cpp.

References AArch64MnemonicSpellCheck(), assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::SmallVectorTemplateCommon< T, typename >::back(), contains(), llvm::MCConstantExpr::create(), llvm::AArch64::DestructiveInstTypeMask, llvm::dyn_cast(), llvm::AArch64::ElementSizeMask, llvm::AArch64::ElementSizeNone, llvm::MCStreamer::EmitInstruction(), llvm::SmallVectorBase::empty(), llvm::Error, llvm::Format, llvm::MCOperand::getExpr(), llvm::AsmToken::getIdentifier(), llvm::AsmToken::getLoc(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOpcode(), llvm::MCInst::getOperand(), llvm::MCInstrDesc::getOperandConstraint(), llvm::MCOperand::getReg(), getSubtargetFeatureName(), llvm::getToken(), llvm::MCConstantExpr::getValue(), llvm::getWRegFromXReg(), llvm::getXRegFromWReg(), llvm::MCOperand::isExpr(), llvm::MCObjectFileInfo::IsMachO, llvm::MCOperand::isReg(), llvm::MCRegisterInfo::isSubRegisterEq(), LLVM_FALLTHROUGH, llvm_unreachable, llvm::StringRef::lower(), llvm::BitmaskEnumDetail::Mask(), llvm::MCLOHDirectiveName(), llvm::AArch64::NotDestructive, llvm::cl::Prefix, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::NVPTX::PTXLdStInstCode::Scalar, llvm::SmallVectorBase::size(), llvm::MCOI::TIED_TO, llvm::MCInstrDesc::TSFlags, llvm::AArch64MCExpr::VK_DTPREL_HI12, llvm::AArch64MCExpr::VK_DTPREL_LO12, llvm::AArch64MCExpr::VK_DTPREL_LO12_NC, llvm::AArch64MCExpr::VK_LO12, llvm::MCSymbolRefExpr::VK_PAGEOFF, llvm::AArch64MCExpr::VK_SECREL_HI12, llvm::AArch64MCExpr::VK_SECREL_LO12, llvm::AArch64MCExpr::VK_TLSDESC_LO12, llvm::MCSymbolRefExpr::VK_TLVPPAGEOFF, llvm::AArch64MCExpr::VK_TPREL_HI12, llvm::AArch64MCExpr::VK_TPREL_LO12, llvm::AArch64MCExpr::VK_TPREL_LO12_NC, and llvm::Warning.

◆ isValidVectorKind()

static bool isValidVectorKind ( StringRef  Suffix,
RegKind  VectorKind 
)
static

Definition at line 2193 of file AArch64AsmParser.cpp.

◆ LLVMInitializeAArch64AsmParser()

void LLVMInitializeAArch64AsmParser ( )

Force static initialization.

Definition at line 5517 of file AArch64AsmParser.cpp.

References llvm::getTheAArch64beTarget(), llvm::getTheAArch64leTarget(), llvm::getTheARM64Target(), X, Y, and llvm::Z.

◆ MatchNeonVectorRegName()

static unsigned MatchNeonVectorRegName ( StringRef  Name)
static

}

Definition at line 2099 of file AArch64AsmParser.cpp.

◆ MatchRegisterName()

static unsigned MatchRegisterName ( StringRef  Name)
static

◆ matchSVEDataVectorRegName()

static unsigned matchSVEDataVectorRegName ( StringRef  Name)
static

Definition at line 2197 of file AArch64AsmParser.cpp.

◆ matchSVEPredicateVectorRegName()

static unsigned matchSVEPredicateVectorRegName ( StringRef  Name)
static

Definition at line 2234 of file AArch64AsmParser.cpp.

References llvm::AArch64CC::AL, llvm::AArch64_AM::ASR, assert(), llvm::StringSwitch< T, R >::Case(), llvm::APFloat::changeSign(), llvm::AsmToken::Comma, llvm::APFloat::convertFromString(), llvm::AArch64MCExpr::create(), llvm::StringSwitch< T, R >::Default(), llvm::StringRef::drop_front(), llvm::dyn_cast(), E, llvm::AArch64CC::EQ, llvm::StringRef::equals_lower(), llvm::Error, F(), llvm::AArch64CC::GE, llvm::StringRef::getAsInteger(), llvm::AArch64_AM::getFPImmFloat(), llvm::SMLoc::getFromPointer(), llvm::AsmToken::getIdentifier(), llvm::AsmToken::getIntVal(), llvm::AArch64CC::getInvertedCondCode(), llvm::AsmToken::getLoc(), llvm::AsmToken::getString(), llvm::MCAsmParser::getTok(), llvm::MCConstantExpr::getValue(), llvm::AArch64CC::GT, llvm::AsmToken::Hash, llvm::AArch64CC::HI, llvm::AArch64CC::HS, llvm::AsmToken::Identifier, llvm::APFloatBase::IEEEdouble(), llvm::AsmToken::Integer, llvm::AArch64CC::Invalid, llvm::AArch64_AM::InvalidShiftExtend, llvm::AsmToken::is(), llvm::AsmToken::isNot(), llvm::APFloat::isPosZero(), llvm::AsmToken::LBrac, llvm::AArch64CC::LE, llvm::MCAsmParser::Lex(), llvm::AArch64CC::LO, llvm::StringRef::lower(), llvm::AsmToken::LParen, llvm::AArch64CC::LS, llvm::AArch64_AM::LSL, llvm::AArch64_AM::LSR, llvm::AArch64CC::LT, llvm::MatchOperand_NoMatch, llvm::MatchOperand_ParseFail, llvm::MatchOperand_Success, llvm::AArch64CC::MI, llvm::AsmToken::Minus, llvm::AArch64_AM::MSL, N, llvm::AArch64CC::NE, llvm::AArch64CC::NV, llvm::APFloatBase::opOK, llvm::AArch64CC::PL, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::AsmToken::Real, Reg, llvm::APFloatBase::rmTowardZero, llvm::AArch64_AM::ROR, llvm::NVPTX::PTXLdStInstCode::Scalar, llvm::StringRef::startswith(), llvm::AArch64_AM::SXTB, llvm::AArch64_AM::SXTH, llvm::AArch64_AM::SXTW, llvm::AArch64_AM::SXTX, llvm::utostr(), llvm::AArch64_AM::UXTB, llvm::AArch64_AM::UXTH, llvm::AArch64_AM::UXTW, llvm::AArch64_AM::UXTX, llvm::AArch64CC::VC, llvm::AArch64MCExpr::VK_ABS, llvm::AArch64MCExpr::VK_ABS_PAGE, llvm::AArch64MCExpr::VK_GOT_PAGE, llvm::MCSymbolRefExpr::VK_GOTPAGE, llvm::AArch64MCExpr::VK_GOTTPREL_PAGE, llvm::AArch64MCExpr::VK_INVALID, llvm::MCSymbolRefExpr::VK_None, llvm::MCSymbolRefExpr::VK_PAGE, llvm::AArch64MCExpr::VK_TLSDESC_PAGE, llvm::MCSymbolRefExpr::VK_TLVPPAGE, and llvm::AArch64CC::VS.

◆ parseVectorKind()

static Optional<std::pair<int, int> > parseVectorKind ( StringRef  Suffix,
RegKind  VectorKind 
)
static

Returns an optional pair of (#elements, element-width) if Suffix is a valid vector kind.

Where the number of elements in a vector or the vector width is implicit or explicitly unknown (but still a valid suffix kind), 0 is used.

Definition at line 2140 of file AArch64AsmParser.cpp.

Referenced by setRequiredFeatureString().

◆ setRequiredFeatureString()

static void setRequiredFeatureString ( FeatureBitset  FBS,
std::string &  Str 
)
static

Variable Documentation

◆ ExtensionMap

const struct Extension ExtensionMap[]
static
Initial value:
= {
{"crc", {AArch64::FeatureCRC}},
{"sm4", {AArch64::FeatureSM4}},
{"sha3", {AArch64::FeatureSHA3}},
{"sha2", {AArch64::FeatureSHA2}},
{"aes", {AArch64::FeatureAES}},
{"crypto", {AArch64::FeatureCrypto}},
{"fp", {AArch64::FeatureFPARMv8}},
{"simd", {AArch64::FeatureNEON}},
{"ras", {AArch64::FeatureRAS}},
{"lse", {AArch64::FeatureLSE}},
{"predres", {AArch64::FeaturePredRes}},
{"ccdp", {AArch64::FeatureCacheDeepPersist}},
{"mte", {AArch64::FeatureMTE}},
{"tlb-rmi", {AArch64::FeatureTLB_RMI}},
{"pan-rwv", {AArch64::FeaturePAN_RWV}},
{"ccpp", {AArch64::FeatureCCPP}},
{"sve", {AArch64::FeatureSVE}},
{"pan", {}},
{"lor", {}},
{"rdma", {}},
{"profile", {}},
}

Referenced by ExpandCryptoAEK(), incrementLoc(), and setRequiredFeatureString().