LLVM  4.0.0
Macros | Functions
X86MCInstLower.cpp File Reference
#include "X86AsmPrinter.h"
#include "X86RegisterInfo.h"
#include "X86ShuffleDecodeConstantPool.h"
#include "InstPrinter/X86ATTInstPrinter.h"
#include "InstPrinter/X86InstComments.h"
#include "MCTargetDesc/X86BaseInfo.h"
#include "Utils/X86ShuffleDecode.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineModuleInfoImpls.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/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolELF.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/ELF.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
Include dependency graph for X86MCInstLower.cpp:

Go to the source code of this file.

Macros

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

Functions

static void EmitNops (MCStreamer &OS, unsigned NumBytes, bool Is64Bit, const MCSubtargetInfo &STI)
 Emit the optimal amount of multi-byte nops on X86. More...
 
static void SimplifyShortImmForm (MCInst &Inst, unsigned Opcode)
 Simplify FOO $imm, %{al,ax,eax,rax} to FOO $imm, for instruction with a short fixed-register form. More...
 
static void SimplifyMOVSX (MCInst &Inst)
 If a movsx instruction has a shorter encoding for the used register simplify the instruction to use it instead. More...
 
static void SimplifyShortMoveForm (X86AsmPrinter &Printer, MCInst &Inst, unsigned Opcode)
 Simplify things like MOV32rm to MOV32o32a. More...
 
static unsigned getRetOpcode (const X86Subtarget &Subtarget)
 
static unsigned EmitNop (MCStreamer &OS, unsigned NumBytes, bool Is64Bit, const MCSubtargetInfo &STI)
 Emit the largest nop instruction smaller than or equal to NumBytes bytes. More...
 
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)
 

Macro Definition Documentation

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

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

#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:
#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

static unsigned EmitNop ( MCStreamer OS,
unsigned  NumBytes,
bool  Is64Bit,
const MCSubtargetInfo STI 
)
static

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

Return the size of nop emitted.

Definition at line 767 of file X86MCInstLower.cpp.

References assert(), llvm::MCStreamer::EmitBytes(), llvm::MCStreamer::EmitInstruction(), i, llvm_unreachable, and fuzzer::min().

Referenced by EmitNops().

static void EmitNops ( MCStreamer OS,
unsigned  NumBytes,
bool  Is64Bit,
const MCSubtargetInfo STI 
)
static

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

Definition at line 828 of file X86MCInstLower.cpp.

References assert(), and EmitNop().

static const Constant* getConstantFromPool ( const MachineInstr MI,
const MachineOperand Op 
)
static
static unsigned getRetOpcode ( const X86Subtarget Subtarget)
static

Definition at line 351 of file X86MCInstLower.cpp.

References llvm::X86Subtarget::is64Bit().

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

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

If a movsx instruction has a shorter encoding for the used register simplify the instruction to use it instead.

Definition at line 273 of file X86MCInstLower.cpp.

References llvm::AArch64CC::AL, llvm::N86::EAX, llvm::MCInst::getOpcode(), llvm::MCInst::getOperand(), llvm::MCOperand::getReg(), llvm_unreachable, and llvm::MCInst::setOpcode().

static void SimplifyShortImmForm ( MCInst Inst,
unsigned  Opcode 
)
static
static void SimplifyShortMoveForm ( X86AsmPrinter Printer,
MCInst Inst,
unsigned  Opcode 
)
static