LLVM  6.0.0svn
Macros | Functions
X86InstComments.cpp File Reference
#include "X86InstComments.h"
#include "MCTargetDesc/X86MCTargetDesc.h"
#include "Utils/X86ShuffleDecode.h"
#include "llvm/CodeGen/MachineValueType.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for X86InstComments.cpp:

Go to the source code of this file.

Macros

#define CASE_SSE_INS_COMMON(Inst, src)   case X86::Inst##src:
 
#define CASE_AVX_INS_COMMON(Inst, Suffix, src)   case X86::V##Inst##Suffix##src:
 
#define CASE_MASK_INS_COMMON(Inst, Suffix, src)   case X86::V##Inst##Suffix##src##k:
 
#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src)   case X86::V##Inst##Suffix##src##kz:
 
#define CASE_AVX512_INS_COMMON(Inst, Suffix, src)
 
#define CASE_MOVDUP(Inst, src)
 
#define CASE_MASK_MOVDUP(Inst, src)
 
#define CASE_MASKZ_MOVDUP(Inst, src)
 
#define CASE_PMOVZX(Inst, src)
 
#define CASE_MASK_PMOVZX(Inst, src)
 
#define CASE_MASKZ_PMOVZX(Inst, src)
 
#define CASE_UNPCK(Inst, src)
 
#define CASE_MASK_UNPCK(Inst, src)
 
#define CASE_MASKZ_UNPCK(Inst, src)
 
#define CASE_SHUF(Inst, suf)
 
#define CASE_MASK_SHUF(Inst, src)
 
#define CASE_MASKZ_SHUF(Inst, src)
 
#define CASE_VPERMILPI(Inst, src)
 
#define CASE_MASK_VPERMILPI(Inst, src)
 
#define CASE_MASKZ_VPERMILPI(Inst, src)
 
#define CASE_VPERM(Inst, src)
 
#define CASE_MASK_VPERM(Inst, src)
 
#define CASE_MASKZ_VPERM(Inst, src)
 
#define CASE_VSHUF(Inst, src)
 
#define CASE_MASK_VSHUF(Inst, src)
 
#define CASE_MASKZ_VSHUF(Inst, src)
 

Functions

static unsigned getVectorRegSize (unsigned RegNo)
 
static MVT getRegOperandVectorVT (const MCInst *MI, const MVT &ScalarVT, unsigned OperandIndex)
 
static MVT getZeroExtensionResultType (const MCInst *MI)
 Extracts the dst type for a given zero extension instruction. More...
 
static void printMasking (raw_ostream &OS, const MCInst *MI, const char *(*getRegName)(unsigned))
 Wraps the destination register name with AVX512 mask/maskz filtering. More...
 

Macro Definition Documentation

◆ CASE_AVX512_INS_COMMON

#define CASE_AVX512_INS_COMMON (   Inst,
  Suffix,
  src 
)
Value:
CASE_AVX_INS_COMMON(Inst, Suffix, src) \
CASE_MASK_INS_COMMON(Inst, Suffix, src) \
CASE_MASKZ_INS_COMMON(Inst, Suffix, src)
#define CASE_AVX_INS_COMMON(Inst, Suffix, src)

Definition at line 36 of file X86InstComments.cpp.

Referenced by llvm::EmitAnyX86InstComments().

◆ CASE_AVX_INS_COMMON

#define CASE_AVX_INS_COMMON (   Inst,
  Suffix,
  src 
)    case X86::V##Inst##Suffix##src:

Definition at line 27 of file X86InstComments.cpp.

◆ CASE_MASK_INS_COMMON

#define CASE_MASK_INS_COMMON (   Inst,
  Suffix,
  src 
)    case X86::V##Inst##Suffix##src##k:

Definition at line 30 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASK_MOVDUP

#define CASE_MASK_MOVDUP (   Inst,
  src 
)
Value:
CASE_MASK_INS_COMMON(Inst, Z, r##src) \
CASE_MASK_INS_COMMON(Inst, Z256, r##src) \
CASE_MASK_INS_COMMON(Inst, Z128, r##src)
#define CASE_MASK_INS_COMMON(Inst, Suffix, src)

Definition at line 49 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASK_PMOVZX

#define CASE_MASK_PMOVZX (   Inst,
  src 
)
Value:
CASE_MASK_INS_COMMON(Inst, Z, r##src) \
CASE_MASK_INS_COMMON(Inst, Z256, r##src) \
CASE_MASK_INS_COMMON(Inst, Z128, r##src)
#define CASE_MASK_INS_COMMON(Inst, Suffix, src)

Definition at line 67 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASK_SHUF

#define CASE_MASK_SHUF (   Inst,
  src 
)
Value:
CASE_MASK_INS_COMMON(Inst, Z, r##src##i) \
CASE_MASK_INS_COMMON(Inst, Z256, r##src##i) \
CASE_MASK_INS_COMMON(Inst, Z128, r##src##i)
#define CASE_MASK_INS_COMMON(Inst, Suffix, src)

Definition at line 103 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASK_UNPCK

#define CASE_MASK_UNPCK (   Inst,
  src 
)
Value:
CASE_MASK_INS_COMMON(Inst, Z, r##src) \
CASE_MASK_INS_COMMON(Inst, Z256, r##src) \
CASE_MASK_INS_COMMON(Inst, Z128, r##src)
#define CASE_MASK_INS_COMMON(Inst, Suffix, src)

Definition at line 85 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASK_VPERM

#define CASE_MASK_VPERM (   Inst,
  src 
)
Value:
CASE_MASK_INS_COMMON(Inst, Z, src##i) \
CASE_MASK_INS_COMMON(Inst, Z256, src##i)
#define CASE_MASK_INS_COMMON(Inst, Suffix, src)

Definition at line 135 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASK_VPERMILPI

#define CASE_MASK_VPERMILPI (   Inst,
  src 
)
Value:
CASE_MASK_INS_COMMON(Inst, Z, src##i) \
CASE_MASK_INS_COMMON(Inst, Z256, src##i) \
CASE_MASK_INS_COMMON(Inst, Z128, src##i)
#define CASE_MASK_INS_COMMON(Inst, Suffix, src)

Definition at line 120 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASK_VSHUF

#define CASE_MASK_VSHUF (   Inst,
  src 
)
Value:
CASE_MASK_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
CASE_MASK_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
CASE_MASK_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
CASE_MASK_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
#define CASE_MASK_INS_COMMON(Inst, Suffix, src)

Definition at line 149 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASKZ_INS_COMMON

#define CASE_MASKZ_INS_COMMON (   Inst,
  Suffix,
  src 
)    case X86::V##Inst##Suffix##src##kz:

Definition at line 33 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASKZ_MOVDUP

#define CASE_MASKZ_MOVDUP (   Inst,
  src 
)
Value:
CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \
CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \
CASE_MASKZ_INS_COMMON(Inst, Z128, r##src)
#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src)

Definition at line 54 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASKZ_PMOVZX

#define CASE_MASKZ_PMOVZX (   Inst,
  src 
)
Value:
CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \
CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \
CASE_MASKZ_INS_COMMON(Inst, Z128, r##src)
#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src)

Definition at line 72 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASKZ_SHUF

#define CASE_MASKZ_SHUF (   Inst,
  src 
)
Value:
CASE_MASKZ_INS_COMMON(Inst, Z, r##src##i) \
CASE_MASKZ_INS_COMMON(Inst, Z256, r##src##i) \
CASE_MASKZ_INS_COMMON(Inst, Z128, r##src##i)
#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src)

Definition at line 108 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASKZ_UNPCK

#define CASE_MASKZ_UNPCK (   Inst,
  src 
)
Value:
CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \
CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \
CASE_MASKZ_INS_COMMON(Inst, Z128, r##src)
#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src)

Definition at line 90 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASKZ_VPERM

#define CASE_MASKZ_VPERM (   Inst,
  src 
)
Value:
CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \
CASE_MASKZ_INS_COMMON(Inst, Z256, src##i)
#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src)

Definition at line 139 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASKZ_VPERMILPI

#define CASE_MASKZ_VPERMILPI (   Inst,
  src 
)
Value:
CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \
CASE_MASKZ_INS_COMMON(Inst, Z256, src##i) \
CASE_MASKZ_INS_COMMON(Inst, Z128, src##i)
#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src)

Definition at line 125 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MASKZ_VSHUF

#define CASE_MASKZ_VSHUF (   Inst,
  src 
)
Value:
CASE_MASKZ_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
CASE_MASKZ_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
CASE_MASKZ_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
CASE_MASKZ_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src)

Definition at line 155 of file X86InstComments.cpp.

Referenced by printMasking().

◆ CASE_MOVDUP

#define CASE_MOVDUP (   Inst,
  src 
)
Value:
CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
CASE_AVX_INS_COMMON(Inst, , r##src) \
CASE_AVX_INS_COMMON(Inst, Y, r##src) \
CASE_SSE_INS_COMMON(Inst, r##src)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
#define CASE_AVX512_INS_COMMON(Inst, Suffix, src)

Definition at line 41 of file X86InstComments.cpp.

Referenced by llvm::EmitAnyX86InstComments().

◆ CASE_PMOVZX

#define CASE_PMOVZX (   Inst,
  src 
)
Value:
CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
CASE_AVX_INS_COMMON(Inst, , r##src) \
CASE_AVX_INS_COMMON(Inst, Y, r##src) \
CASE_SSE_INS_COMMON(Inst, r##src)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
#define CASE_AVX512_INS_COMMON(Inst, Suffix, src)

Definition at line 59 of file X86InstComments.cpp.

Referenced by llvm::EmitAnyX86InstComments(), and getZeroExtensionResultType().

◆ CASE_SHUF

#define CASE_SHUF (   Inst,
  suf 
)
Value:
CASE_AVX512_INS_COMMON(Inst, Z256, suf) \
CASE_AVX512_INS_COMMON(Inst, Z128, suf) \
CASE_AVX_INS_COMMON(Inst, , suf) \
CASE_AVX_INS_COMMON(Inst, Y, suf) \
CASE_SSE_INS_COMMON(Inst, suf)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
#define CASE_AVX512_INS_COMMON(Inst, Suffix, src)

Definition at line 95 of file X86InstComments.cpp.

Referenced by llvm::EmitAnyX86InstComments().

◆ CASE_SSE_INS_COMMON

#define CASE_SSE_INS_COMMON (   Inst,
  src 
)    case X86::Inst##src:

Definition at line 24 of file X86InstComments.cpp.

◆ CASE_UNPCK

#define CASE_UNPCK (   Inst,
  src 
)
Value:
CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
CASE_AVX_INS_COMMON(Inst, , r##src) \
CASE_AVX_INS_COMMON(Inst, Y, r##src) \
CASE_SSE_INS_COMMON(Inst, r##src)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
#define CASE_AVX512_INS_COMMON(Inst, Suffix, src)

Definition at line 77 of file X86InstComments.cpp.

Referenced by llvm::EmitAnyX86InstComments().

◆ CASE_VPERM

#define CASE_VPERM (   Inst,
  src 
)
Value:
CASE_AVX512_INS_COMMON(Inst, Z, src##i) \
CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \
CASE_AVX_INS_COMMON(Inst, Y, src##i)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
#define CASE_AVX512_INS_COMMON(Inst, Suffix, src)

Definition at line 130 of file X86InstComments.cpp.

Referenced by llvm::EmitAnyX86InstComments().

◆ CASE_VPERMILPI

#define CASE_VPERMILPI (   Inst,
  src 
)
Value:
CASE_AVX512_INS_COMMON(Inst, Z, src##i) \
CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \
CASE_AVX512_INS_COMMON(Inst, Z128, src##i) \
CASE_AVX_INS_COMMON(Inst, , src##i) \
CASE_AVX_INS_COMMON(Inst, Y, src##i)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
#define CASE_AVX512_INS_COMMON(Inst, Suffix, src)

Definition at line 113 of file X86InstComments.cpp.

Referenced by llvm::EmitAnyX86InstComments().

◆ CASE_VSHUF

#define CASE_VSHUF (   Inst,
  src 
)
Value:
CASE_AVX512_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
CASE_AVX512_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
CASE_AVX512_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
CASE_AVX512_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
#define CASE_AVX512_INS_COMMON(Inst, Suffix, src)

Definition at line 143 of file X86InstComments.cpp.

Referenced by llvm::EmitAnyX86InstComments().

Function Documentation

◆ getRegOperandVectorVT()

static MVT getRegOperandVectorVT ( const MCInst MI,
const MVT ScalarVT,
unsigned  OperandIndex 
)
static

◆ getVectorRegSize()

static unsigned getVectorRegSize ( unsigned  RegNo)
static

Definition at line 161 of file X86InstComments.cpp.

References llvm_unreachable.

Referenced by getRegOperandVectorVT().

◆ getZeroExtensionResultType()

static MVT getZeroExtensionResultType ( const MCInst MI)
static

Extracts the dst type for a given zero extension instruction.

Definition at line 182 of file X86InstComments.cpp.

References CASE_PMOVZX, llvm::MCInst::getOpcode(), getRegOperandVectorVT(), llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, and llvm_unreachable.

Referenced by llvm::EmitAnyX86InstComments().

◆ printMasking()

static void printMasking ( raw_ostream OS,
const MCInst MI,
const char *(*)(unsigned getRegName 
)
static