LLVM 22.0.0git
MipsAsmParser.cpp File Reference
#include "MCTargetDesc/MipsABIFlagsSection.h"
#include "MCTargetDesc/MipsABIInfo.h"
#include "MCTargetDesc/MipsBaseInfo.h"
#include "MCTargetDesc/MipsMCAsmInfo.h"
#include "MCTargetDesc/MipsMCTargetDesc.h"
#include "MCTargetDesc/MipsTargetStreamer.h"
#include "TargetInfo/MipsTargetInfo.h"
#include "llvm/ADT/APFloat.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/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/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/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/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 <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 MCSymbolgetSingleMCSymbol (const MCExpr *Expr)
static unsigned countMCSymbolRefExpr (const MCExpr *Expr)
static bool isEvaluated (const MCExpr *Expr)
static bool needsExpandMemInst (MCInst &Inst, const MCInstrDesc &MCID)
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 unsigned getRegisterForMxtrC0 (MCInst &Inst, bool IsMFTC0)
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 ()

Variables

cl::opt< boolEmitJalrReloc

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mips-asm-parser"

Definition at line 62 of file MipsAsmParser.cpp.

◆ GET_ASSEMBLER_HEADER

#define GET_ASSEMBLER_HEADER

Definition at line 168 of file MipsAsmParser.cpp.

◆ GET_MATCHER_IMPLEMENTATION

#define GET_MATCHER_IMPLEMENTATION

Definition at line 8919 of file MipsAsmParser.cpp.

◆ GET_MNEMONIC_SPELL_CHECKER

#define GET_MNEMONIC_SPELL_CHECKER

Definition at line 8920 of file MipsAsmParser.cpp.

◆ GET_OPERAND_DIAGNOSTIC_TYPES

#define GET_OPERAND_DIAGNOSTIC_TYPES

Definition at line 519 of file MipsAsmParser.cpp.

◆ GET_REGISTER_MATCHER

#define GET_REGISTER_MATCHER

Definition at line 8918 of file MipsAsmParser.cpp.

Function Documentation

◆ convertIntToDoubleImm()

uint64_t convertIntToDoubleImm ( uint64_t ImmOp64)
static

◆ countMCSymbolRefExpr()

unsigned countMCSymbolRefExpr ( const MCExpr * Expr)
static

Definition at line 1758 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 3370 of file MipsAsmParser.cpp.

References llvm::bit_cast().

◆ getRegisterForMxtrC0()

unsigned getRegisterForMxtrC0 ( MCInst & Inst,
bool IsMFTC0 )
static

◆ getRegisterForMxtrDSP()

unsigned getRegisterForMxtrDSP ( MCInst & Inst,
bool IsMFDSP )
static

◆ getRegisterForMxtrFP()

unsigned getRegisterForMxtrFP ( MCInst & Inst,
bool IsMFTC1 )
static

◆ getSingleMCSymbol()

const MCSymbol * getSingleMCSymbol ( const MCExpr * Expr)
static

Definition at line 1734 of file MipsAsmParser.cpp.

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

Referenced by getSingleMCSymbol().

◆ hasShortDelaySlot()

bool hasShortDelaySlot ( MCInst & Inst)
static

◆ isEvaluated()

◆ 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 2701 of file MipsAsmParser.cpp.

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

◆ LLVMInitializeMipsAsmParser()

◆ MipsMnemonicSpellCheck()

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

◆ needsExpandMemInst()

◆ nextReg()

MCRegister nextReg ( MCRegister Reg)
static

Definition at line 3246 of file MipsAsmParser.cpp.

References contains(), llvm_unreachable, and Reg.

◆ RefineErrorLoc()

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

Definition at line 5926 of file MipsAsmParser.cpp.

References Operands.

Variable Documentation

◆ EmitJalrReloc