LLVM 24.0.0git
MipsAsmParser.cpp File Reference
#include "MCTargetDesc/MipsABIFlagsSection.h"
#include "MCTargetDesc/MipsABIInfo.h"
#include "MCTargetDesc/MipsBaseInfo.h"
#include "MCTargetDesc/MipsInstPrinter.h"
#include "MCTargetDesc/MipsMCAsmInfo.h"
#include "MCTargetDesc/MipsMCOptions.h"
#include "MCTargetDesc/MipsMCTargetDesc.h"
#include "MCTargetDesc/MipsTargetStreamer.h"
#include "TargetInfo/MipsTargetInfo.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCAssembler.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/MCObjectFileInfo.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/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolELF.h"
#include "llvm/MC/MCValue.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Casting.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/SaveAndRestore.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/SubtargetFeature.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include "MipsGenAsmMatcher.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   "mips-asm-parser"
#define GET_ASSEMBLER_HEADER
#define GET_OPERAND_DIAGNOSTIC_TYPES
#define GET_REGISTER_MATCHER
#define GET_MATCHER_IMPLEMENTATION
#define GET_MNEMONIC_SPELL_CHECKER

Functions

static bool hasShortDelaySlot (MCInst &Inst)
static const MCSymbol * getSingleMCSymbol (const MCExpr *Expr)
static unsigned countMCSymbolRefExpr (const MCExpr *Expr)
static bool isEvaluated (const MCExpr *Expr)
static bool needsExpandMemInst (MCInst &Inst, const MCInstrDesc &MCID)
static bool isGPR (MCRegister Reg, const MCRegisterInfo &MRI)
static bool isFPUReg (MCRegister Reg, const MCRegisterInfo &MRI)
static bool isFCCReg (MCRegister Reg, const MCRegisterInfo &MRI)
static bool isCopReg (MCRegister Reg, const MCRegisterInfo &MRI)
static bool isLoad (const MCInstrDesc &Desc)
static bool isGOTLoad (const MCInst &Inst)
static bool readsReg (const MCInstrDesc &Desc, MCRegister Reg, const MCRegisterInfo &MRI)
static bool writesReg (const MCInstrDesc &Desc, MCRegister Reg, const MCRegisterInfo &MRI)
static FeatureBitset getHazardFeatures (const FeatureBitset &Features)
template<unsigned N>
static bool isShiftedUIntAtAnyPosition (uint64_t x)
 Can the value be represented by a unsigned N-bit value and a shift left?
static MCRegister nextReg (MCRegister Reg)
static uint64_t convertIntToDoubleImm (uint64_t ImmOp64)
static uint32_t covertDoubleImmToSingleImm (uint64_t ImmOp64)
static unsigned getRegisterForMxtrDSP (MCInst &Inst, bool IsMFDSP)
static unsigned getRegisterForMxtrFP (MCInst &Inst, bool IsMFTC1)
static SMLoc RefineErrorLoc (const SMLoc Loc, const OperandVector &Operands, uint64_t ErrorInfo)
static std::string MipsMnemonicSpellCheck (StringRef S, const FeatureBitset &FBS, unsigned VariantID=0)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeMipsAsmParser ()

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mips-asm-parser"

Definition at line 68 of file MipsAsmParser.cpp.

◆ GET_ASSEMBLER_HEADER

#define GET_ASSEMBLER_HEADER

Definition at line 191 of file MipsAsmParser.cpp.

◆ GET_MATCHER_IMPLEMENTATION

#define GET_MATCHER_IMPLEMENTATION

Definition at line 9352 of file MipsAsmParser.cpp.

◆ GET_MNEMONIC_SPELL_CHECKER

#define GET_MNEMONIC_SPELL_CHECKER

Definition at line 9353 of file MipsAsmParser.cpp.

◆ GET_OPERAND_DIAGNOSTIC_TYPES

#define GET_OPERAND_DIAGNOSTIC_TYPES

Definition at line 549 of file MipsAsmParser.cpp.

◆ GET_REGISTER_MATCHER

#define GET_REGISTER_MATCHER

Definition at line 9351 of file MipsAsmParser.cpp.

Function Documentation

◆ convertIntToDoubleImm()

uint64_t convertIntToDoubleImm ( uint64_t ImmOp64)
static

◆ countMCSymbolRefExpr()

unsigned countMCSymbolRefExpr ( const MCExpr * Expr)
static

Definition at line 1877 of file MipsAsmParser.cpp.

References countMCSymbolRefExpr(), llvm::dyn_cast(), and llvm::isa().

Referenced by countMCSymbolRefExpr().

◆ covertDoubleImmToSingleImm()

uint32_t covertDoubleImmToSingleImm ( uint64_t ImmOp64)
static

Definition at line 3856 of file MipsAsmParser.cpp.

References llvm::bit_cast(), and uint64_t.

◆ getHazardFeatures()

FeatureBitset getHazardFeatures ( const FeatureBitset & Features)
static

Definition at line 2751 of file MipsAsmParser.cpp.

◆ getRegisterForMxtrDSP()

unsigned getRegisterForMxtrDSP ( MCInst & Inst,
bool IsMFDSP )
static

◆ getRegisterForMxtrFP()

◆ getSingleMCSymbol()

const MCSymbol * getSingleMCSymbol ( const MCExpr * Expr)
static

Definition at line 1853 of file MipsAsmParser.cpp.

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

Referenced by getSingleMCSymbol().

◆ hasShortDelaySlot()

bool hasShortDelaySlot ( MCInst & Inst)
static

◆ isCopReg()

bool isCopReg ( MCRegister Reg,
const MCRegisterInfo & MRI )
static

Definition at line 2551 of file MipsAsmParser.cpp.

References MRI, and Reg.

◆ isEvaluated()

◆ isFCCReg()

bool isFCCReg ( MCRegister Reg,
const MCRegisterInfo & MRI )
static

Definition at line 2545 of file MipsAsmParser.cpp.

References MRI, and Reg.

◆ isFPUReg()

bool isFPUReg ( MCRegister Reg,
const MCRegisterInfo & MRI )
static

Definition at line 2539 of file MipsAsmParser.cpp.

References MRI, and Reg.

◆ isGOTLoad()

◆ isGPR()

bool isGPR ( MCRegister Reg,
const MCRegisterInfo & MRI )
static

Definition at line 2534 of file MipsAsmParser.cpp.

References MRI, and Reg.

◆ isLoad()

bool isLoad ( const MCInstrDesc & Desc)
static

Definition at line 2559 of file MipsAsmParser.cpp.

◆ isShiftedUIntAtAnyPosition()

template<unsigned N>
bool isShiftedUIntAtAnyPosition ( uint64_t x)
static

Can the value be represented by a unsigned N-bit value and a shift left?

Definition at line 3098 of file MipsAsmParser.cpp.

References llvm::countr_zero(), llvm::isUInt(), and uint64_t.

◆ LLVMInitializeMipsAsmParser()

◆ MipsMnemonicSpellCheck()

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

◆ needsExpandMemInst()

◆ nextReg()

MCRegister nextReg ( MCRegister Reg)
static

Definition at line 3694 of file MipsAsmParser.cpp.

References contains(), llvm_unreachable, and Reg.

◆ readsReg()

bool readsReg ( const MCInstrDesc & Desc,
MCRegister Reg,
const MCRegisterInfo & MRI )
static

Definition at line 2573 of file MipsAsmParser.cpp.

References llvm::any_of(), MRI, and Reg.

◆ RefineErrorLoc()

SMLoc RefineErrorLoc ( const SMLoc Loc,
const OperandVector & Operands,
uint64_t ErrorInfo )
static

Definition at line 6383 of file MipsAsmParser.cpp.

References Operands, and uint64_t.

◆ writesReg()

bool writesReg ( const MCInstrDesc & Desc,
MCRegister Reg,
const MCRegisterInfo & MRI )
static

Definition at line 2579 of file MipsAsmParser.cpp.

References llvm::any_of(), MRI, and Reg.