LLVM 22.0.0git
ARMAsmParser.cpp File Reference
#include "ARMBaseInstrInfo.h"
#include "ARMFeatures.h"
#include "MCTargetDesc/ARMAddressingModes.h"
#include "MCTargetDesc/ARMBaseInfo.h"
#include "MCTargetDesc/ARMInstPrinter.h"
#include "MCTargetDesc/ARMMCAsmInfo.h"
#include "MCTargetDesc/ARMMCTargetDesc.h"
#include "TargetInfo/ARMTargetInfo.h"
#include "Utils/ARMBaseInfo.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.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/MCInstrDesc.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCParser/AsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCAsmParserExtension.h"
#include "llvm/MC/MCParser/MCAsmParserUtils.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/MCParser/MCTargetAsmParser.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/ARMBuildAttributes.h"
#include "llvm/Support/ARMEHABI.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.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/SubtargetFeature.h"
#include "llvm/TargetParser/TargetParser.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "ARMGenAsmMatcher.inc"

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Macros

#define DEBUG_TYPE   "asm-parser"
#define GET_OPERAND_DIAGNOSTIC_TYPES
Auto-generated Match Functions

{

#define GET_ASSEMBLER_HEADER

Functions

template<>
bool llvm::IsCPSRDead< MCInst > (const MCInst *Instr)

Auto-generated Match Functions

{

#define GET_REGISTER_MATCHER
#define GET_SUBTARGET_FEATURE_NAME
#define GET_MATCHER_IMPLEMENTATION
#define GET_MNEMONIC_SPELL_CHECKER
static MCRegister MatchRegisterName (StringRef Name)
static bool isDataTypeToken (StringRef Tok)
 }
static unsigned getMnemonicOpsEndInd (const OperandVector &Operands)
static int MatchCoprocessorOperandName (StringRef Name, char CoprocOp)
 MatchCoprocessorOperandName - Try to parse an coprocessor related instruction with a symbolic operand name.
static MCRegister getNextRegister (MCRegister Reg)
static bool insertNoDuplicates (SmallVectorImpl< std::pair< unsigned, MCRegister > > &Regs, unsigned Enc, MCRegister Reg)
unsigned findCondCodeInd (const OperandVector &Operands, unsigned MnemonicOpsEndInd)
unsigned findCCOutInd (const OperandVector &Operands, unsigned MnemonicOpsEndInd)
bool operandsContainWide (OperandVector &Operands, unsigned MnemonicOpsEndInd)
static bool isThumbI8Relocation (MCParsedAsmOperand &MCOp)
static bool doesIgnoreDataTypeSuffix (StringRef Mnemonic, StringRef DT)
static void applyMnemonicAliases (StringRef &Mnemonic, const FeatureBitset &Features, unsigned VariantID)
void removeCondCode (OperandVector &Operands, unsigned &MnemonicOpsEndInd)
void removeCCOut (OperandVector &Operands, unsigned &MnemonicOpsEndInd)
void removeVPTCondCode (OperandVector &Operands, unsigned &MnemonicOpsEndInd)
static bool checkLowRegisterList (const MCInst &Inst, unsigned OpNo, MCRegister Reg, MCRegister HiReg, bool &containsReg)
static bool listContainsReg (const MCInst &Inst, unsigned OpNo, MCRegister Reg)
static bool instIsBreakpoint (const MCInst &Inst)
unsigned getRegListInd (const OperandVector &Operands, unsigned MnemonicOpsEndInd)
static int findFirstVectorPredOperandIdx (const MCInstrDesc &MCID)
static bool isVectorPredicable (const MCInstrDesc &MCID)
static bool isARMMCExpr (MCParsedAsmOperand &MCOp)
static unsigned getRealVSTOpcode (unsigned Opc, unsigned &Spacing)
static unsigned getRealVLDOpcode (unsigned Opc, unsigned &Spacing)
static std::string ARMMnemonicSpellCheck (StringRef S, const FeatureBitset &FBS, unsigned VariantID=0)
static const chargetSubtargetFeatureName (uint64_t Val)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMAsmParser ()
 Force static initialization.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "asm-parser"

Definition at line 70 of file ARMAsmParser.cpp.

◆ GET_ASSEMBLER_HEADER

#define GET_ASSEMBLER_HEADER

Definition at line 623 of file ARMAsmParser.cpp.

◆ GET_MATCHER_IMPLEMENTATION

#define GET_MATCHER_IMPLEMENTATION

Definition at line 12737 of file ARMAsmParser.cpp.

◆ GET_MNEMONIC_SPELL_CHECKER

#define GET_MNEMONIC_SPELL_CHECKER

Definition at line 12738 of file ARMAsmParser.cpp.

◆ GET_OPERAND_DIAGNOSTIC_TYPES

#define GET_OPERAND_DIAGNOSTIC_TYPES

Definition at line 686 of file ARMAsmParser.cpp.

◆ GET_REGISTER_MATCHER

#define GET_REGISTER_MATCHER

Definition at line 12735 of file ARMAsmParser.cpp.

◆ GET_SUBTARGET_FEATURE_NAME

#define GET_SUBTARGET_FEATURE_NAME

Definition at line 12736 of file ARMAsmParser.cpp.

Function Documentation

◆ applyMnemonicAliases()

void applyMnemonicAliases ( StringRef & Mnemonic,
const FeatureBitset & Features,
unsigned VariantID )
static

References MRI, and Operands.

◆ ARMMnemonicSpellCheck()

std::string ARMMnemonicSpellCheck ( StringRef S,
const FeatureBitset & FBS,
unsigned VariantID = 0 )
static

◆ checkLowRegisterList()

bool checkLowRegisterList ( const MCInst & Inst,
unsigned OpNo,
MCRegister Reg,
MCRegister HiReg,
bool & containsReg )
static

◆ doesIgnoreDataTypeSuffix()

bool doesIgnoreDataTypeSuffix ( StringRef Mnemonic,
StringRef DT )
static

Definition at line 6937 of file ARMAsmParser.cpp.

References llvm::StringRef::starts_with().

◆ findCCOutInd()

unsigned findCCOutInd ( const OperandVector & Operands,
unsigned MnemonicOpsEndInd )

Definition at line 5810 of file ARMAsmParser.cpp.

References I, and Operands.

◆ findCondCodeInd()

unsigned findCondCodeInd ( const OperandVector & Operands,
unsigned MnemonicOpsEndInd )

Definition at line 5800 of file ARMAsmParser.cpp.

References I, and Operands.

◆ findFirstVectorPredOperandIdx()

int findFirstVectorPredOperandIdx ( const MCInstrDesc & MCID)
static

Definition at line 7639 of file ARMAsmParser.cpp.

References llvm::ARM::isVpred().

Referenced by isVectorPredicable().

◆ getMnemonicOpsEndInd()

◆ getNextRegister()

MCRegister getNextRegister ( MCRegister Reg)
static

Definition at line 4579 of file ARMAsmParser.cpp.

References contains(), llvm_unreachable, and Reg.

◆ getRealVLDOpcode()

unsigned getRealVLDOpcode ( unsigned Opc,
unsigned & Spacing )
static

Definition at line 8803 of file ARMAsmParser.cpp.

References llvm_unreachable, and Opc.

◆ getRealVSTOpcode()

unsigned getRealVSTOpcode ( unsigned Opc,
unsigned & Spacing )
static

Definition at line 8694 of file ARMAsmParser.cpp.

References llvm_unreachable, and Opc.

◆ getRegListInd()

unsigned getRegListInd ( const OperandVector & Operands,
unsigned MnemonicOpsEndInd )

Definition at line 7529 of file ARMAsmParser.cpp.

References I, and Operands.

◆ getSubtargetFeatureName()

const char * getSubtargetFeatureName ( uint64_t Val)
static

References llvm::dbgs(), and Operands.

◆ insertNoDuplicates()

bool insertNoDuplicates ( SmallVectorImpl< std::pair< unsigned, MCRegister > > & Regs,
unsigned Enc,
MCRegister Reg )
static

Definition at line 4601 of file ARMAsmParser.cpp.

References E(), I, Reg, and std::swap().

◆ instIsBreakpoint()

bool instIsBreakpoint ( const MCInst & Inst)
static

Definition at line 7522 of file ARMAsmParser.cpp.

References llvm::MCInst::getOpcode().

◆ isARMMCExpr()

bool isARMMCExpr ( MCParsedAsmOperand & MCOp)
static

Definition at line 7651 of file ARMAsmParser.cpp.

References llvm::dyn_cast(), and E().

◆ isDataTypeToken()

bool isDataTypeToken ( StringRef Tok)
static

◆ isThumbI8Relocation()

bool isThumbI8Relocation ( MCParsedAsmOperand & MCOp)
static

◆ isVectorPredicable()

bool isVectorPredicable ( const MCInstrDesc & MCID)
static

Definition at line 7647 of file ARMAsmParser.cpp.

References findFirstVectorPredOperandIdx().

◆ listContainsReg()

bool listContainsReg ( const MCInst & Inst,
unsigned OpNo,
MCRegister Reg )
static

◆ LLVMInitializeARMAsmParser()

LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMAsmParser ( )

◆ MatchCoprocessorOperandName()

int MatchCoprocessorOperandName ( StringRef Name,
char CoprocOp )
static

MatchCoprocessorOperandName - Try to parse an coprocessor related instruction with a symbolic operand name.

We accept "crN" syntax for GAS compatibility. <operand-name> ::= <prefix><number> If CoprocOp is 'c', then: <prefix> ::= c | cr If CoprocOp is 'p', then : <prefix> ::= p <number> ::= integer in range [0, 15]

Definition at line 4447 of file ARMAsmParser.cpp.

◆ MatchRegisterName()

MCRegister MatchRegisterName ( StringRef Name)
static

◆ operandsContainWide()

bool operandsContainWide ( OperandVector & Operands,
unsigned MnemonicOpsEndInd )

Definition at line 6776 of file ARMAsmParser.cpp.

References I, and Operands.

◆ removeCCOut()

void removeCCOut ( OperandVector & Operands,
unsigned & MnemonicOpsEndInd )

Definition at line 7068 of file ARMAsmParser.cpp.

References I, and Operands.

◆ removeCondCode()

void removeCondCode ( OperandVector & Operands,
unsigned & MnemonicOpsEndInd )

Definition at line 7059 of file ARMAsmParser.cpp.

References I, and Operands.

◆ removeVPTCondCode()

void removeVPTCondCode ( OperandVector & Operands,
unsigned & MnemonicOpsEndInd )

Definition at line 7077 of file ARMAsmParser.cpp.

References I, and Operands.