LLVM  9.0.0svn
Classes | Macros | Enumerations
AArch64AsmParser.cpp File Reference
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "MCTargetDesc/AArch64MCExpr.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "MCTargetDesc/AArch64TargetStreamer.h"
#include "TargetInfo/AArch64TargetInfo.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, const FeatureBitset &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 5527 of file AArch64AsmParser.cpp.

◆ GET_MNEMONIC_SPELL_CHECKER

#define GET_MNEMONIC_SPELL_CHECKER

Definition at line 5528 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 5525 of file AArch64AsmParser.cpp.

◆ GET_SUBTARGET_FEATURE_NAME

#define GET_SUBTARGET_FEATURE_NAME

Definition at line 5526 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,
const FeatureBitset 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, 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(), 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 3880 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::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 2195 of file AArch64AsmParser.cpp.

◆ LLVMInitializeAArch64AsmParser()

void LLVMInitializeAArch64AsmParser ( )

◆ MatchNeonVectorRegName()

static unsigned MatchNeonVectorRegName ( StringRef  Name)
static

}

Definition at line 2101 of file AArch64AsmParser.cpp.

◆ MatchRegisterName()

static unsigned MatchRegisterName ( StringRef  Name)
static

◆ matchSVEDataVectorRegName()

static unsigned matchSVEDataVectorRegName ( StringRef  Name)
static

Definition at line 2199 of file AArch64AsmParser.cpp.

◆ matchSVEPredicateVectorRegName()

static unsigned matchSVEPredicateVectorRegName ( StringRef  Name)
static

Definition at line 2236 of file AArch64AsmParser.cpp.

References llvm::APFloat::changeSign(), llvm::AsmToken::Comma, llvm::APFloat::convertFromString(), llvm::AArch64MCExpr::create(), llvm::StringRef::drop_front(), llvm::dyn_cast(), E, llvm::StringRef::equals_lower(), llvm::Error, F(), llvm::StringRef::getAsInteger(), llvm::AArch64_AM::getFPImmFloat(), llvm::SMLoc::getFromPointer(), llvm::AsmToken::getIdentifier(), llvm::AsmToken::getIntVal(), llvm::AsmToken::getLoc(), llvm::AsmToken::getString(), llvm::MCAsmParser::getTok(), llvm::MCConstantExpr::getValue(), llvm::AsmToken::Hash, llvm::AsmToken::Identifier, llvm::APFloatBase::IEEEdouble(), llvm::AsmToken::Integer, llvm::AsmToken::is(), llvm::AsmToken::isNot(), llvm::APFloat::isPosZero(), llvm::AsmToken::LBrac, llvm::MCAsmParser::Lex(), llvm::StringRef::lower(), llvm::MatchOperand_NoMatch, llvm::MatchOperand_ParseFail, llvm::MatchOperand_Success, llvm::AsmToken::Minus, N, llvm::APFloatBase::opOK, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::AsmToken::Real, Reg, llvm::APFloatBase::rmTowardZero, llvm::NVPTX::PTXLdStInstCode::Scalar, llvm::StringRef::startswith(), llvm::utostr(), 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, and llvm::MCSymbolRefExpr::VK_TLVPPAGE.

◆ 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 2142 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}},
{"sve2", {AArch64::FeatureSVE2}},
{"sve2-aes", {AArch64::FeatureSVE2AES}},
{"sve2-sm4", {AArch64::FeatureSVE2SM4}},
{"sve2-sha3", {AArch64::FeatureSVE2SHA3}},
{"bitperm", {AArch64::FeatureSVE2BitPerm}},
{"pan", {}},
{"lor", {}},
{"rdma", {}},
{"profile", {}},
}

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