#include "MCTargetDesc/LoongArchInstPrinter.h"
#include "MCTargetDesc/LoongArchMCExpr.h"
#include "MCTargetDesc/LoongArchMCTargetDesc.h"
#include "MCTargetDesc/LoongArchMatInt.h"
#include "TargetInfo/LoongArchTargetInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCParser/MCAsmLexer.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/MCValue.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Casting.h"
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
class LoongArchAsmParser : public MCTargetAsmParser { … };
class LoongArchOperand : public MCParsedAsmOperand { … };
}
#define GET_REGISTER_MATCHER
#define GET_SUBTARGET_FEATURE_NAME
#define GET_MATCHER_IMPLEMENTATION
#define GET_MNEMONIC_SPELL_CHECKER
#include "LoongArchGenAsmMatcher.inc"
static MCRegister convertFPR32ToFPR64(MCRegister Reg) { … }
static bool matchRegisterNameHelper(MCRegister &RegNo, StringRef Name) { … }
bool LoongArchAsmParser::parseRegister(MCRegister &Reg, SMLoc &StartLoc,
SMLoc &EndLoc) { … }
ParseStatus LoongArchAsmParser::tryParseRegister(MCRegister &Reg,
SMLoc &StartLoc,
SMLoc &EndLoc) { … }
bool LoongArchAsmParser::classifySymbolRef(const MCExpr *Expr,
LoongArchMCExpr::VariantKind &Kind) { … }
ParseStatus LoongArchAsmParser::parseRegister(OperandVector &Operands) { … }
ParseStatus LoongArchAsmParser::parseImmediate(OperandVector &Operands) { … }
ParseStatus
LoongArchAsmParser::parseOperandWithModifier(OperandVector &Operands) { … }
ParseStatus LoongArchAsmParser::parseSImm26Operand(OperandVector &Operands) { … }
ParseStatus LoongArchAsmParser::parseAtomicMemOp(OperandVector &Operands) { … }
bool LoongArchAsmParser::parseOperand(OperandVector &Operands,
StringRef Mnemonic) { … }
bool LoongArchAsmParser::parseInstruction(ParseInstructionInfo &Info,
StringRef Name, SMLoc NameLoc,
OperandVector &Operands) { … }
void LoongArchAsmParser::emitLAInstSeq(MCRegister DestReg, MCRegister TmpReg,
const MCExpr *Symbol,
SmallVectorImpl<Inst> &Insts,
SMLoc IDLoc, MCStreamer &Out,
bool RelaxHint) { … }
void LoongArchAsmParser::emitLoadAddressAbs(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressPcrel(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressPcrelLarge(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressGot(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressGotLarge(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSLE(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSIE(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSIELarge(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSLD(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSLDLarge(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSGD(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSGDLarge(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSDescAbs(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSDescPcrel(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadAddressTLSDescPcrelLarge(MCInst &Inst,
SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitLoadImm(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out) { … }
void LoongArchAsmParser::emitFuncCall36(MCInst &Inst, SMLoc IDLoc,
MCStreamer &Out, bool IsTailCall) { … }
bool LoongArchAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
OperandVector &Operands,
MCStreamer &Out) { … }
unsigned LoongArchAsmParser::checkTargetMatchPredicate(MCInst &Inst) { … }
unsigned
LoongArchAsmParser::validateTargetOperandClass(MCParsedAsmOperand &AsmOp,
unsigned Kind) { … }
bool LoongArchAsmParser::generateImmOutOfRangeError(
OperandVector &Operands, uint64_t ErrorInfo, int64_t Lower, int64_t Upper,
const Twine &Msg = "immediate must be an integer in the range") { … }
bool LoongArchAsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
OperandVector &Operands,
MCStreamer &Out,
uint64_t &ErrorInfo,
bool MatchingInlineAsm) { … }
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeLoongArchAsmParser() { … }