LLVM: lib/Target/X86/X86MCInstLower.cpp File Reference (original) (raw)

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 INSTR_CASE(Prefix, Instr, Suffix, Postfix)
#define CASE_AVX512_ARITH_RM(Instr)
#define CASE_ARITH_RM(Instr)
#define MASK_AVX512_CASE(Instr)
#define MOV_CASE(Prefix, Suffix)
#define MOV_AVX512_CASE(Suffix, Postfix)
#define CASE_128_MOV_RM()
#define CASE_256_MOV_RM()
#define CASE_512_MOV_RM()
#define MOVX_CASE(Prefix, Ext, Type, Suffix, Postfix)
#define CASE_MOVX_RM(Ext, Type)
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 unsigned getSrcIdx (const MachineInstr *MI, unsigned SrcIdx)
static void printDstRegisterName (raw_ostream &CS, const MachineInstr *MI, unsigned SrcOpIdx)
static void printShuffleMask (raw_ostream &CS, StringRef Src1Name, StringRef Src2Name, ArrayRef< int > Mask)
static std::string getShuffleComment (const MachineInstr *MI, unsigned SrcOp1Idx, unsigned SrcOp2Idx, ArrayRef< int > Mask)
static void printConstant (const APInt &Val, raw_ostream &CS, bool PrintZero=false)
static void printConstant (const APFloat &Flt, raw_ostream &CS, bool PrintZero=false)
static void printConstant (const Constant *COp, unsigned BitWidth, raw_ostream &CS, bool PrintZero=false)
static void printZeroUpperMove (const MachineInstr *MI, MCStreamer &OutStreamer, int SclWidth, int VecWidth, const char *ShuffleComment)
static void printBroadcast (const MachineInstr *MI, MCStreamer &OutStreamer, int Repeats, int BitWidth)
static bool printExtend (const MachineInstr *MI, MCStreamer &OutStreamer, int SrcEltBits, int DstEltBits, bool IsSext)
static void printSignExtend (const MachineInstr *MI, MCStreamer &OutStreamer, int SrcEltBits, int DstEltBits)
static void printZeroExtend (const MachineInstr *MI, MCStreamer &OutStreamer, int SrcEltBits, int DstEltBits)
static void addConstantComments (const MachineInstr *MI, MCStreamer &OutStreamer)
bool isImportedFunction (const MachineOperand &MO)
bool isCallToCFGuardFunction (const MachineInstr *MI)
bool hasJumpTableInfoInBlock (const llvm::MachineInstr *MI)
Variables
static cl::opt< bool > EnableBranchHint ("enable-branch-hint", cl::desc("Enable branch hint."), cl::init(false), cl::Hidden)
static cl::opt< unsigned > BranchHintProbabilityThreshold ("branch-hint-probability-threshold", cl::desc("The probability threshold of enabling branch hint."), cl::init(50), cl::Hidden)

CASE_128_MOV_RM

#define CASE_128_MOV_RM ( )

Value:

MOV_CASE(, ) \

MOV_CASE(V, ) \

MOV_AVX512_CASE(Z128, ) \

MOV_AVX512_CASE(Z128, k) \

MOV_AVX512_CASE(Z128, kz)

#define MOV_CASE(Prefix, Suffix)

Referenced by addConstantComments().

CASE_256_MOV_RM

#define CASE_256_MOV_RM ( )

Value:

MOV_CASE(V, Y) \

MOV_AVX512_CASE(Z256, ) \

MOV_AVX512_CASE(Z256, k) \

MOV_AVX512_CASE(Z256, kz) \

static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")

Referenced by addConstantComments().

CASE_512_MOV_RM

#define CASE_512_MOV_RM ( )

Value:

MOV_AVX512_CASE(Z, ) \

MOV_AVX512_CASE(Z, k) \

MOV_AVX512_CASE(Z, kz) \

#define MOV_AVX512_CASE(Suffix, Postfix)

Referenced by addConstantComments().

CASE_ARITH_RM

#define CASE_ARITH_RM ( Instr )

Value:

INSTR_CASE(, Instr, , ) \

INSTR_CASE(V, Instr, , ) \

INSTR_CASE(V, Instr, Y, ) \

INSTR_CASE(V, Instr, Z128, ) \

INSTR_CASE(V, Instr, Z128, k) \

INSTR_CASE(V, Instr, Z128, kz) \

INSTR_CASE(V, Instr, Z256, ) \

INSTR_CASE(V, Instr, Z256, k) \

INSTR_CASE(V, Instr, Z256, kz) \

INSTR_CASE(V, Instr, Z, ) \

INSTR_CASE(V, Instr, Z, k) \

INSTR_CASE(V, Instr, Z, kz)

#define INSTR_CASE(Prefix, Instr, Suffix, Postfix)

Referenced by addConstantComments().

CASE_AVX512_ARITH_RM

#define CASE_AVX512_ARITH_RM ( Instr )

Value:

INSTR_CASE(V, Instr, Z128, ) \

INSTR_CASE(V, Instr, Z128, k) \

INSTR_CASE(V, Instr, Z128, kz) \

INSTR_CASE(V, Instr, Z256, ) \

INSTR_CASE(V, Instr, Z256, k) \

INSTR_CASE(V, Instr, Z256, kz) \

INSTR_CASE(V, Instr, Z, ) \

INSTR_CASE(V, Instr, Z, k) \

INSTR_CASE(V, Instr, Z, kz)

Referenced by addConstantComments().

CASE_MOVX_RM

#define CASE_MOVX_RM ( Ext,
Type )

Value:

MOVX_CASE(, Ext, Type, , ) \

MOVX_CASE(V, Ext, Type, , ) \

MOVX_CASE(V, Ext, Type, Y, ) \

MOVX_CASE(V, Ext, Type, Z128, ) \

MOVX_CASE(V, Ext, Type, Z128, k ) \

MOVX_CASE(V, Ext, Type, Z128, kz ) \

MOVX_CASE(V, Ext, Type, Z256, ) \

MOVX_CASE(V, Ext, Type, Z256, k ) \

MOVX_CASE(V, Ext, Type, Z256, kz ) \

MOVX_CASE(V, Ext, Type, Z, ) \

MOVX_CASE(V, Ext, Type, Z, k ) \

MOVX_CASE(V, Ext, Type, Z, kz )

#define MOVX_CASE(Prefix, Ext, Type, Suffix, Postfix)

The instances of the Type class are immutable: once they are created, they are never changed.

Referenced by addConstantComments().

INSTR_CASE

#define INSTR_CASE ( Prefix,
Instr,
Suffix,
Postfix )

Value:

case X86::Prefix##Instr##Suffix##rm##Postfix:

MASK_AVX512_CASE

#define MASK_AVX512_CASE ( Instr )

MOV_AVX512_CASE

#define MOV_AVX512_CASE ( Suffix,
Postfix )

Value:

case X86::VMOVDQA64##Suffix##rm##Postfix: \

case X86::VMOVDQA32##Suffix##rm##Postfix: \

case X86::VMOVDQU64##Suffix##rm##Postfix: \

case X86::VMOVDQU32##Suffix##rm##Postfix: \

case X86::VMOVDQU16##Suffix##rm##Postfix: \

case X86::VMOVDQU8##Suffix##rm##Postfix: \

case X86::VMOVAPS##Suffix##rm##Postfix: \

case X86::VMOVAPD##Suffix##rm##Postfix: \

case X86::VMOVUPS##Suffix##rm##Postfix: \

case X86::VMOVUPD##Suffix##rm##Postfix:

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:

MOVX_CASE

#define MOVX_CASE ( Prefix,
Ext,
Type,
Suffix,
Postfix )

Value:

case X86::Prefix##PMOV##Ext##Type##Suffix##rm##Postfix:

addConstantComments()

Definition at line 1803 of file X86MCInstLower.cpp.

References llvm::MCStreamer::AddComment(), llvm::X86::AddrNumOperands, assert(), llvm::CallingConv::C, CASE_128_MOV_RM, CASE_256_MOV_RM, CASE_512_MOV_RM, CASE_ARITH_RM, CASE_AVX512_ARITH_RM, CASE_MOVX_RM, llvm::DecodePSHUFBMask(), llvm::DecodeVPERMIL2PMask(), llvm::DecodeVPERMILPMask(), llvm::DecodeVPPERMMask(), llvm::dyn_cast(), llvm::X86::getConstantFromPool(), llvm::MachineOperand::getImm(), llvm::DstOp::getReg(), llvm::X86ATTInstPrinter::getRegisterName(), getShuffleComment(), getSrcIdx(), llvm::X86::getVectorRegisterWidth(), llvm::MachineOperand::isImm(), llvm_unreachable, MASK_AVX512_CASE, MI, printBroadcast(), printConstant(), printSignExtend(), printZeroExtend(), printZeroUpperMove(), llvm::raw_string_ostream::str(), and llvm::toString().

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

convertTailJumpOpcode()

emitNop()

emitX86Nops()

getRetOpcode()

getShuffleComment()

getSrcIdx()

hasJumpTableInfoInBlock()

isCallToCFGuardFunction()

isImportedFunction()

printBroadcast()

printConstant() [1/3]

printConstant() [2/3]

printConstant() [3/3]

Definition at line 1553 of file X86MCInstLower.cpp.

References llvm::BitWidth, llvm::dyn_cast(), E(), llvm::Type::getPrimitiveSizeInBits(), I, llvm::isa(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Type::isHalfTy(), llvm::Type::isIntegerTy(), and printConstant().

printDstRegisterName()

printExtend()

Definition at line 1657 of file X86MCInstLower.cpp.

References llvm::MCStreamer::AddComment(), llvm::CallingConv::C, llvm::dyn_cast(), llvm::X86::getConstantFromPool(), getSrcIdx(), MI, printConstant(), printDstRegisterName(), llvm::APInt::sext(), llvm::raw_string_ostream::str(), and llvm::APInt::zext().

Referenced by printSignExtend(), and printZeroExtend().

printShuffleMask()

printSignExtend()

printZeroExtend()

printZeroUpperMove()

BranchHintProbabilityThreshold

cl::opt< unsigned > BranchHintProbabilityThreshold("branch-hint-probability-threshold", cl::desc("The probability threshold of enabling branch hint."), cl::init(50), cl::Hidden) ( "branch-hint-probability-threshold" , cl::desc("The probability threshold of enabling branch hint.") , cl::init(50) , cl::Hidden ) static

EnableBranchHint

cl::opt< bool > EnableBranchHint("enable-branch-hint", cl::desc("Enable branch hint."), cl::init(false), cl::Hidden) ( "enable-branch-hint" , cl::desc("Enable branch hint.") , cl::init(false) , cl::Hidden ) static