LLVM 24.0.0git
X86AsmParser.cpp File Reference
#include "MCTargetDesc/X86BaseInfo.h"
#include "MCTargetDesc/X86EncodingOptimization.h"
#include "MCTargetDesc/X86IntelInstPrinter.h"
#include "MCTargetDesc/X86MCAsmInfo.h"
#include "MCTargetDesc/X86MCExpr.h"
#include "MCTargetDesc/X86MCTargetDesc.h"
#include "MCTargetDesc/X86TargetStreamer.h"
#include "TargetInfo/X86TargetInfo.h"
#include "X86Operand.h"
#include "X86RegisterInfo.h"
#include "llvm-c/Visibility.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.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/MCInstrInfo.h"
#include "llvm/MC/MCParser/AsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/MCParser/MCTargetAsmParser.h"
#include "llvm/MC/MCRegister.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/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cstdint>
#include <memory>
#include <optional>
#include "X86GenInstrMapping.inc"
#include "X86GenAsmMatcher.inc"

Go to the source code of this file.

Macros

#define GET_X86_SSE2AVX_TABLE
#define GET_OPERAND_DIAGNOSTIC_TYPES
#define GET_REGISTER_MATCHER
#define GET_SUBTARGET_FEATURE_NAME
#define FROM_TO(FROM, TO)
#define GET_MATCHER_IMPLEMENTATION
Auto-generated Matcher Functions

{

#define GET_ASSEMBLER_HEADER

Functions

static bool checkScale (unsigned Scale, StringRef &ErrMsg)
static bool CheckBaseRegAndIndexRegAndScale (MCRegister BaseReg, MCRegister IndexReg, unsigned Scale, bool Is64BitMode, StringRef &ErrMsg)
uint16_t RegSizeInBits (const MCRegisterInfo &MRI, MCRegister RegNo)
static bool convertSSEToAVX (MCInst &Inst)
static unsigned getPrefixes (OperandVector &Operands)
LLVM_C_ABI void LLVMInitializeX86AsmParser ()

Variables

static cl::opt< boolLVIInlineAsmHardening ("x86-experimental-lvi-inline-asm-hardening", cl::desc("Harden inline assembly code that may be vulnerable to Load Value" " Injection (LVI). This feature is experimental."), cl::Hidden)

Macro Definition Documentation

◆ FROM_TO

#define FROM_TO ( FROM,
TO )
Value:
case X86::FROM: \
return replaceWithCCMPCTEST(X86::TO);

Referenced by convertALUrr2ALUri(), getImplicitCondFromMI(), and llvm::X86InstrInfo::optimizeCompareInstr().

◆ GET_ASSEMBLER_HEADER

#define GET_ASSEMBLER_HEADER

Definition at line 1377 of file X86AsmParser.cpp.

◆ GET_MATCHER_IMPLEMENTATION

#define GET_MATCHER_IMPLEMENTATION

Definition at line 5323 of file X86AsmParser.cpp.

◆ GET_OPERAND_DIAGNOSTIC_TYPES

#define GET_OPERAND_DIAGNOSTIC_TYPES

Definition at line 1385 of file X86AsmParser.cpp.

◆ GET_REGISTER_MATCHER

#define GET_REGISTER_MATCHER

Definition at line 1412 of file X86AsmParser.cpp.

◆ GET_SUBTARGET_FEATURE_NAME

#define GET_SUBTARGET_FEATURE_NAME

Definition at line 1413 of file X86AsmParser.cpp.

◆ GET_X86_SSE2AVX_TABLE

#define GET_X86_SSE2AVX_TABLE

Definition at line 68 of file X86AsmParser.cpp.

Function Documentation

◆ CheckBaseRegAndIndexRegAndScale()

bool CheckBaseRegAndIndexRegAndScale ( MCRegister BaseReg,
MCRegister IndexReg,
unsigned Scale,
bool Is64BitMode,
StringRef & ErrMsg )
static

Definition at line 1416 of file X86AsmParser.cpp.

References checkScale(), and contains().

◆ checkScale()

bool checkScale ( unsigned Scale,
StringRef & ErrMsg )
static

Definition at line 57 of file X86AsmParser.cpp.

Referenced by CheckBaseRegAndIndexRegAndScale().

◆ convertSSEToAVX()

◆ getPrefixes()

unsigned getPrefixes ( OperandVector & Operands)
static

Definition at line 4287 of file X86AsmParser.cpp.

References Operands.

◆ LLVMInitializeX86AsmParser()

LLVM_C_ABI void LLVMInitializeX86AsmParser ( )

Definition at line 5318 of file X86AsmParser.cpp.

References llvm::getTheX86_32Target(), llvm::getTheX86_64Target(), LLVM_C_ABI, X, and Y.

◆ RegSizeInBits()

uint16_t RegSizeInBits ( const MCRegisterInfo & MRI,
MCRegister RegNo )

Definition at line 2701 of file X86AsmParser.cpp.

References contains().

Variable Documentation

◆ LVIInlineAsmHardening

cl::opt< bool > LVIInlineAsmHardening("x86-experimental-lvi-inline-asm-hardening", cl::desc("Harden inline assembly code that may be vulnerable to Load Value" " Injection (LVI). This feature is experimental."), cl::Hidden) ( "x86-experimental-lvi-inline-asm-hardening" ,
cl::desc("Harden inline assembly code that may be vulnerable to Load Value" " Injection (LVI). This feature is experimental.") ,
cl::Hidden  )
static