LLVM 18.0.0git
Classes | Macros | Functions
X86MCInstLower.cpp File Reference
#include "MCTargetDesc/X86ATTInstPrinter.h"
#include "MCTargetDesc/X86BaseInfo.h"
#include "MCTargetDesc/X86EncodingOptimization.h"
#include "MCTargetDesc/X86InstComments.h"
#include "MCTargetDesc/X86ShuffleDecode.h"
#include "MCTargetDesc/X86TargetStreamer.h"
#include "X86AsmPrinter.h"
#include "X86MachineFunctionInfo.h"
#include "X86RegisterInfo.h"
#include "X86ShuffleDecodeConstantPool.h"
#include "X86Subtarget.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Mangler.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixup.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolELF.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
#include "llvm/Transforms/Instrumentation/AddressSanitizerCommon.h"
#include <string>

Go to the source code of this file.

Classes

struct  NoAutoPaddingScope
 A RAII helper which defines a region of instructions which can't have padding added between them for correctness. More...
 

Macros

#define MOV_CASE(Prefix, Suffix)
 
#define MOV_AVX512_CASE(Suffix)
 
#define CASE_ALL_MOV_RM()
 

Functions

static void emitX86Nops (MCStreamer &OS, unsigned NumBytes, const X86Subtarget *Subtarget)
 Emit the optimal amount of multi-byte nops on X86.
 
static unsigned getRetOpcode (const X86Subtarget &Subtarget)
 
static unsigned convertTailJumpOpcode (unsigned Opcode)
 
static unsigned emitNop (MCStreamer &OS, unsigned NumBytes, const X86Subtarget *Subtarget)
 Emit the largest nop instruction smaller than or equal to NumBytes bytes.
 
static MachineBasicBlock::const_iterator PrevCrossBBInst (MachineBasicBlock::const_iterator MBBI)
 
static const ConstantgetConstantFromPool (const MachineInstr &MI, const MachineOperand &Op)
 
static std::string getShuffleComment (const MachineInstr *MI, unsigned SrcOp1Idx, unsigned SrcOp2Idx, ArrayRef< int > Mask)
 
static void printConstant (const APInt &Val, raw_ostream &CS)
 
static void printConstant (const APFloat &Flt, raw_ostream &CS)
 
static void printConstant (const Constant *COp, unsigned BitWidth, raw_ostream &CS)
 
static unsigned getRegisterWidth (const MCOperandInfo &Info)
 
static void addConstantComments (const MachineInstr *MI, MCStreamer &OutStreamer)
 

Macro Definition Documentation

◆ CASE_ALL_MOV_RM

#define CASE_ALL_MOV_RM ( )
Value:
MOV_CASE(, ) /* SSE */ \
MOV_CASE(V, ) /* AVX-128 */ \
MOV_CASE(V, Y) /* AVX-256 */ \
MOV_AVX512_CASE(Z) \
MOV_AVX512_CASE(Z256) \
MOV_AVX512_CASE(Z128)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
#define MOV_CASE(Prefix, Suffix)

◆ MOV_AVX512_CASE

#define MOV_AVX512_CASE (   Suffix)
Value:
case X86::VMOVDQA64##Suffix##rm: \
case X86::VMOVDQA32##Suffix##rm: \
case X86::VMOVDQU64##Suffix##rm: \
case X86::VMOVDQU32##Suffix##rm: \
case X86::VMOVDQU16##Suffix##rm: \
case X86::VMOVDQU8##Suffix##rm: \
case X86::VMOVAPS##Suffix##rm: \
case X86::VMOVAPD##Suffix##rm: \
case X86::VMOVUPS##Suffix##rm: \
case X86::VMOVUPD##Suffix##rm:

◆ MOV_CASE

#define MOV_CASE (   Prefix,
  Suffix 
)
Value:
case X86::Prefix##MOVAPD##Suffix##rm: \
case X86::Prefix##MOVAPS##Suffix##rm: \
case X86::Prefix##MOVUPD##Suffix##rm: \
case X86::Prefix##MOVUPS##Suffix##rm: \
case X86::Prefix##MOVDQA##Suffix##rm: \
case X86::Prefix##MOVDQU##Suffix##rm:

Function Documentation

◆ addConstantComments()

static void addConstantComments ( const MachineInstr MI,
MCStreamer OutStreamer 
)
static

◆ convertTailJumpOpcode()

static unsigned convertTailJumpOpcode ( unsigned  Opcode)
static

Definition at line 364 of file X86MCInstLower.cpp.

◆ emitNop()

static unsigned emitNop ( MCStreamer OS,
unsigned  NumBytes,
const X86Subtarget Subtarget 
)
static

Emit the largest nop instruction smaller than or equal to NumBytes bytes.

Return the size of nop emitted.

Definition at line 631 of file X86MCInstLower.cpp.

References assert(), llvm_unreachable, and OS.

Referenced by emitX86Nops().

◆ emitX86Nops()

static void emitX86Nops ( MCStreamer OS,
unsigned  NumBytes,
const X86Subtarget Subtarget 
)
static

Emit the optimal amount of multi-byte nops on X86.

Definition at line 748 of file X86MCInstLower.cpp.

References assert(), emitNop(), and OS.

◆ getConstantFromPool()

static const Constant * getConstantFromPool ( const MachineInstr MI,
const MachineOperand Op 
)
static

◆ getRegisterWidth()

static unsigned getRegisterWidth ( const MCOperandInfo Info)
static

Definition at line 1633 of file X86MCInstLower.cpp.

References Info, and llvm_unreachable.

Referenced by addConstantComments().

◆ getRetOpcode()

static unsigned getRetOpcode ( const X86Subtarget Subtarget)
static

Definition at line 325 of file X86MCInstLower.cpp.

Referenced by llvm::X86AsmPrinter::emitInstruction().

◆ getShuffleComment()

static std::string getShuffleComment ( const MachineInstr MI,
unsigned  SrcOp1Idx,
unsigned  SrcOp2Idx,
ArrayRef< int >  Mask 
)
static

◆ PrevCrossBBInst()

◆ printConstant() [1/3]

static void printConstant ( const APFloat Flt,
raw_ostream CS 
)
static

Definition at line 1520 of file X86MCInstLower.cpp.

References Flt.

◆ printConstant() [2/3]

static void printConstant ( const APInt Val,
raw_ostream CS 
)
static

◆ printConstant() [3/3]

static void printConstant ( const Constant COp,
unsigned  BitWidth,
raw_ostream CS 
)
static