LLVM  3.7.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
llvm::X86Operand Struct Reference

X86Operand - Instances of this class represent a parsed X86 machine instruction. More...

#include <X86Operand.h>

Inheritance diagram for llvm::X86Operand:
[legend]
Collaboration diagram for llvm::X86Operand:
[legend]

Classes

struct  ImmOp
 
struct  MemOp
 
struct  RegOp
 
struct  TokOp
 

Public Types

enum  KindTy { Token, Register, Immediate, Memory }
 

Public Member Functions

 X86Operand (KindTy K, SMLoc Start, SMLoc End)
 
StringRef getSymName () override
 
void * getOpDecl () override
 
SMLoc getStartLoc () const override
 getStartLoc - Get the location of the first token of this operand. More...
 
SMLoc getEndLoc () const override
 getEndLoc - Get the location of the last token of this operand. More...
 
SMRange getLocRange () const
 getLocRange - Get the range between the first and last token of this operand. More...
 
SMLoc getOffsetOfLoc () const override
 getOffsetOfLoc - Get the location of the offset operator. More...
 
void print (raw_ostream &OS) const override
 print - Print a debug representation of the operand to the given stream. More...
 
StringRef getToken () const
 
void setTokenValue (StringRef Value)
 
unsigned getReg () const override
 
const MCExprgetImm () const
 
const MCExprgetMemDisp () const
 
unsigned getMemSegReg () const
 
unsigned getMemBaseReg () const
 
unsigned getMemIndexReg () const
 
unsigned getMemScale () const
 
unsigned getMemModeSize () const
 
bool isToken () const override
 isToken - Is this a token operand? More...
 
bool isImm () const override
 isImm - Is this an immediate operand? More...
 
bool isImmSExti16i8 () const
 
bool isImmSExti32i8 () const
 
bool isImmSExti64i8 () const
 
bool isImmSExti64i32 () const
 
bool isImmUnsignedi8 () const
 
bool isOffsetOf () const override
 isOffsetOf - Do we need to emit code to get the offset of the variable, rather then the value of the variable? Only valid when parsing MS-style inline assembly. More...
 
bool needAddressOf () const override
 needAddressOf - Do we need to emit code to get the address of the variable/label? Only valid when parsing MS-style inline assembly. More...
 
bool isMem () const override
 isMem - Is this a memory operand? More...
 
bool isMemUnsized () const
 
bool isMem8 () const
 
bool isMem16 () const
 
bool isMem32 () const
 
bool isMem64 () const
 
bool isMem80 () const
 
bool isMem128 () const
 
bool isMem256 () const
 
bool isMem512 () const
 
bool isMemVX32 () const
 
bool isMemVX32X () const
 
bool isMemVY32 () const
 
bool isMemVY32X () const
 
bool isMemVX64 () const
 
bool isMemVX64X () const
 
bool isMemVY64 () const
 
bool isMemVY64X () const
 
bool isMemVZ32 () const
 
bool isMemVZ64 () const
 
bool isAbsMem () const
 
bool isAVX512RC () const
 
bool isAbsMem16 () const
 
bool isSrcIdx () const
 
bool isSrcIdx8 () const
 
bool isSrcIdx16 () const
 
bool isSrcIdx32 () const
 
bool isSrcIdx64 () const
 
bool isDstIdx () const
 
bool isDstIdx8 () const
 
bool isDstIdx16 () const
 
bool isDstIdx32 () const
 
bool isDstIdx64 () const
 
bool isMemOffs () const
 
bool isMemOffs16_8 () const
 
bool isMemOffs16_16 () const
 
bool isMemOffs16_32 () const
 
bool isMemOffs32_8 () const
 
bool isMemOffs32_16 () const
 
bool isMemOffs32_32 () const
 
bool isMemOffs32_64 () const
 
bool isMemOffs64_8 () const
 
bool isMemOffs64_16 () const
 
bool isMemOffs64_32 () const
 
bool isMemOffs64_64 () const
 
bool isReg () const override
 isReg - Is this a register operand? More...
 
bool isGR32orGR64 () const
 
void addExpr (MCInst &Inst, const MCExpr *Expr) const
 
void addRegOperands (MCInst &Inst, unsigned N) const
 
void addGR32orGR64Operands (MCInst &Inst, unsigned N) const
 
void addAVX512RCOperands (MCInst &Inst, unsigned N) const
 
void addImmOperands (MCInst &Inst, unsigned N) const
 
void addMemOperands (MCInst &Inst, unsigned N) const
 
void addAbsMemOperands (MCInst &Inst, unsigned N) const
 
void addSrcIdxOperands (MCInst &Inst, unsigned N) const
 
void addDstIdxOperands (MCInst &Inst, unsigned N) const
 
void addMemOffsOperands (MCInst &Inst, unsigned N) const
 
- Public Member Functions inherited from llvm::MCParsedAsmOperand
 MCParsedAsmOperand ()
 
virtual ~MCParsedAsmOperand ()
 
void setConstraint (StringRef C)
 
StringRef getConstraint ()
 
void setMCOperandNum (unsigned OpNum)
 
unsigned getMCOperandNum ()
 
virtual void dump () const
 dump - Print to the debug stream. More...
 

Static Public Member Functions

static unsigned getGR32FromGR64 (unsigned RegNo)
 
static std::unique_ptr
< X86Operand
CreateToken (StringRef Str, SMLoc Loc)
 
static std::unique_ptr
< X86Operand
CreateReg (unsigned RegNo, SMLoc StartLoc, SMLoc EndLoc, bool AddressOf=false, SMLoc OffsetOfLoc=SMLoc(), StringRef SymName=StringRef(), void *OpDecl=nullptr)
 
static std::unique_ptr
< X86Operand
CreateImm (const MCExpr *Val, SMLoc StartLoc, SMLoc EndLoc)
 
static std::unique_ptr
< X86Operand
CreateMem (unsigned ModeSize, const MCExpr *Disp, SMLoc StartLoc, SMLoc EndLoc, unsigned Size=0, StringRef SymName=StringRef(), void *OpDecl=nullptr)
 Create an absolute memory operand. More...
 
static std::unique_ptr
< X86Operand
CreateMem (unsigned ModeSize, unsigned SegReg, const MCExpr *Disp, unsigned BaseReg, unsigned IndexReg, unsigned Scale, SMLoc StartLoc, SMLoc EndLoc, unsigned Size=0, StringRef SymName=StringRef(), void *OpDecl=nullptr)
 Create a generalized memory operand. More...
 

Public Attributes

enum llvm::X86Operand::KindTy Kind
 
SMLoc StartLoc
 
SMLoc EndLoc
 
SMLoc OffsetOfLoc
 
StringRef SymName
 
void * OpDecl
 
bool AddressOf
 
union {
   struct TokOp   Tok
 
   struct RegOp   Reg
 
   struct ImmOp   Imm
 
   struct MemOp   Mem
 
}; 
 

Detailed Description

X86Operand - Instances of this class represent a parsed X86 machine instruction.

Definition at line 25 of file X86Operand.h.

Member Enumeration Documentation

Enumerator
Token 
Register 
Immediate 
Memory 

Definition at line 26 of file X86Operand.h.

Constructor & Destructor Documentation

llvm::X86Operand::X86Operand ( KindTy  K,
SMLoc  Start,
SMLoc  End 
)
inline

Definition at line 69 of file X86Operand.h.

Member Function Documentation

void llvm::X86Operand::addAbsMemOperands ( MCInst Inst,
unsigned  N 
) const
inline
void llvm::X86Operand::addAVX512RCOperands ( MCInst Inst,
unsigned  N 
) const
inline

Definition at line 419 of file X86Operand.h.

References addExpr(), and getImm().

void llvm::X86Operand::addDstIdxOperands ( MCInst Inst,
unsigned  N 
) const
inline
void llvm::X86Operand::addExpr ( MCInst Inst,
const MCExpr Expr 
) const
inline
void llvm::X86Operand::addGR32orGR64Operands ( MCInst Inst,
unsigned  N 
) const
inline
void llvm::X86Operand::addImmOperands ( MCInst Inst,
unsigned  N 
) const
inline

Definition at line 423 of file X86Operand.h.

References addExpr(), and getImm().

void llvm::X86Operand::addMemOffsOperands ( MCInst Inst,
unsigned  N 
) const
inline
void llvm::X86Operand::addMemOperands ( MCInst Inst,
unsigned  N 
) const
inline
void llvm::X86Operand::addRegOperands ( MCInst Inst,
unsigned  N 
) const
inline

Definition at line 384 of file X86Operand.h.

References llvm::MCInst::addOperand(), llvm::MCOperand::createReg(), and getReg().

void llvm::X86Operand::addSrcIdxOperands ( MCInst Inst,
unsigned  N 
) const
inline
static std::unique_ptr<X86Operand> llvm::X86Operand::CreateImm ( const MCExpr Val,
SMLoc  StartLoc,
SMLoc  EndLoc 
)
inlinestatic

Definition at line 487 of file X86Operand.h.

References EndLoc, Immediate, and StartLoc.

static std::unique_ptr<X86Operand> llvm::X86Operand::CreateMem ( unsigned  ModeSize,
const MCExpr Disp,
SMLoc  StartLoc,
SMLoc  EndLoc,
unsigned  Size = 0,
StringRef  SymName = StringRef(),
void *  OpDecl = nullptr 
)
inlinestatic

Create an absolute memory operand.

Definition at line 496 of file X86Operand.h.

References EndLoc, Memory, OpDecl, StartLoc, and SymName.

static std::unique_ptr<X86Operand> llvm::X86Operand::CreateMem ( unsigned  ModeSize,
unsigned  SegReg,
const MCExpr Disp,
unsigned  BaseReg,
unsigned  IndexReg,
unsigned  Scale,
SMLoc  StartLoc,
SMLoc  EndLoc,
unsigned  Size = 0,
StringRef  SymName = StringRef(),
void *  OpDecl = nullptr 
)
inlinestatic

Create a generalized memory operand.

Definition at line 515 of file X86Operand.h.

References EndLoc, Memory, OpDecl, StartLoc, and SymName.

static std::unique_ptr<X86Operand> llvm::X86Operand::CreateReg ( unsigned  RegNo,
SMLoc  StartLoc,
SMLoc  EndLoc,
bool  AddressOf = false,
SMLoc  OffsetOfLoc = SMLoc(),
StringRef  SymName = StringRef(),
void *  OpDecl = nullptr 
)
inlinestatic

Definition at line 475 of file X86Operand.h.

References AddressOf, EndLoc, OffsetOfLoc, OpDecl, Register, StartLoc, and SymName.

static std::unique_ptr<X86Operand> llvm::X86Operand::CreateToken ( StringRef  Str,
SMLoc  Loc 
)
inlinestatic
SMLoc llvm::X86Operand::getEndLoc ( ) const
inlineoverridevirtual

getEndLoc - Get the location of the last token of this operand.

Implements llvm::MCParsedAsmOperand.

Definition at line 78 of file X86Operand.h.

References EndLoc.

static unsigned llvm::X86Operand::getGR32FromGR64 ( unsigned  RegNo)
inlinestatic
const MCExpr* llvm::X86Operand::getImm ( ) const
inline
SMRange llvm::X86Operand::getLocRange ( ) const
inline

getLocRange - Get the range between the first and last token of this operand.

Definition at line 81 of file X86Operand.h.

References EndLoc, and StartLoc.

unsigned llvm::X86Operand::getMemBaseReg ( ) const
inline
const MCExpr* llvm::X86Operand::getMemDisp ( ) const
inline
unsigned llvm::X86Operand::getMemIndexReg ( ) const
inline
unsigned llvm::X86Operand::getMemModeSize ( ) const
inline

Definition at line 127 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::ModeSize.

unsigned llvm::X86Operand::getMemScale ( ) const
inline

Definition at line 123 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Scale.

Referenced by addMemOperands(), isAbsMem(), isDstIdx(), isMemOffs(), and isSrcIdx().

unsigned llvm::X86Operand::getMemSegReg ( ) const
inline
SMLoc llvm::X86Operand::getOffsetOfLoc ( ) const
inlineoverridevirtual

getOffsetOfLoc - Get the location of the offset operator.

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 83 of file X86Operand.h.

References OffsetOfLoc.

void* llvm::X86Operand::getOpDecl ( )
inlineoverridevirtual

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 73 of file X86Operand.h.

References OpDecl.

unsigned llvm::X86Operand::getReg ( ) const
inlineoverridevirtual

Implements llvm::MCParsedAsmOperand.

Definition at line 97 of file X86Operand.h.

References Kind, Reg, Register, and llvm::X86Operand::RegOp::RegNo.

Referenced by addGR32orGR64Operands(), addRegOperands(), and isGR32orGR64().

SMLoc llvm::X86Operand::getStartLoc ( ) const
inlineoverridevirtual

getStartLoc - Get the location of the first token of this operand.

Implements llvm::MCParsedAsmOperand.

Definition at line 76 of file X86Operand.h.

References StartLoc.

StringRef llvm::X86Operand::getSymName ( )
inlineoverridevirtual

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 72 of file X86Operand.h.

References SymName.

StringRef llvm::X86Operand::getToken ( ) const
inline
bool llvm::X86Operand::isAbsMem ( ) const
inline

Definition at line 278 of file X86Operand.h.

References getMemBaseReg(), getMemIndexReg(), getMemScale(), getMemSegReg(), and Kind.

Referenced by isAbsMem16().

bool llvm::X86Operand::isAbsMem16 ( ) const
inline

Definition at line 286 of file X86Operand.h.

References isAbsMem(), Mem, and llvm::X86Operand::MemOp::ModeSize.

bool llvm::X86Operand::isAVX512RC ( ) const
inline

Definition at line 282 of file X86Operand.h.

References isImm().

bool llvm::X86Operand::isDstIdx ( ) const
inline
bool llvm::X86Operand::isDstIdx16 ( ) const
inline

Definition at line 319 of file X86Operand.h.

References isDstIdx(), and isMem16().

bool llvm::X86Operand::isDstIdx32 ( ) const
inline

Definition at line 322 of file X86Operand.h.

References isDstIdx(), and isMem32().

bool llvm::X86Operand::isDstIdx64 ( ) const
inline

Definition at line 325 of file X86Operand.h.

References isDstIdx(), and isMem64().

bool llvm::X86Operand::isDstIdx8 ( ) const
inline

Definition at line 316 of file X86Operand.h.

References isDstIdx(), and isMem8().

bool llvm::X86Operand::isGR32orGR64 ( ) const
inline

Definition at line 370 of file X86Operand.h.

References getReg(), Kind, and Register.

bool llvm::X86Operand::isImm ( ) const
inlineoverridevirtual

isImm - Is this an immediate operand?

Implements llvm::MCParsedAsmOperand.

Definition at line 134 of file X86Operand.h.

References Immediate, and Kind.

Referenced by isAVX512RC(), isImmSExti16i8(), isImmSExti32i8(), isImmSExti64i32(), isImmSExti64i8(), and isImmUnsignedi8().

bool llvm::X86Operand::isImmSExti16i8 ( ) const
inline
bool llvm::X86Operand::isImmSExti32i8 ( ) const
inline
bool llvm::X86Operand::isImmSExti64i32 ( ) const
inline
bool llvm::X86Operand::isImmSExti64i8 ( ) const
inline
bool llvm::X86Operand::isImmUnsignedi8 ( ) const
inline
bool llvm::X86Operand::isMem ( ) const
inlineoverridevirtual

isMem - Is this a memory operand?

Implements llvm::MCParsedAsmOperand.

Definition at line 208 of file X86Operand.h.

References Kind, and Memory.

bool llvm::X86Operand::isMem128 ( ) const
inline

Definition at line 227 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMem16 ( ) const
inline

Definition at line 215 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

Referenced by isDstIdx16(), and isSrcIdx16().

bool llvm::X86Operand::isMem256 ( ) const
inline

Definition at line 230 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMem32 ( ) const
inline

Definition at line 218 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

Referenced by isDstIdx32(), and isSrcIdx32().

bool llvm::X86Operand::isMem512 ( ) const
inline

Definition at line 233 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMem64 ( ) const
inline

Definition at line 221 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

Referenced by isDstIdx64(), and isSrcIdx64().

bool llvm::X86Operand::isMem8 ( ) const
inline

Definition at line 212 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

Referenced by isDstIdx8(), and isSrcIdx8().

bool llvm::X86Operand::isMem80 ( ) const
inline

Definition at line 224 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemOffs ( ) const
inline
bool llvm::X86Operand::isMemOffs16_16 ( ) const
inline
bool llvm::X86Operand::isMemOffs16_32 ( ) const
inline
bool llvm::X86Operand::isMemOffs16_8 ( ) const
inline
bool llvm::X86Operand::isMemOffs32_16 ( ) const
inline
bool llvm::X86Operand::isMemOffs32_32 ( ) const
inline
bool llvm::X86Operand::isMemOffs32_64 ( ) const
inline
bool llvm::X86Operand::isMemOffs32_8 ( ) const
inline
bool llvm::X86Operand::isMemOffs64_16 ( ) const
inline
bool llvm::X86Operand::isMemOffs64_32 ( ) const
inline
bool llvm::X86Operand::isMemOffs64_64 ( ) const
inline
bool llvm::X86Operand::isMemOffs64_8 ( ) const
inline
bool llvm::X86Operand::isMemUnsized ( ) const
inline

Definition at line 209 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVX32 ( ) const
inline

Definition at line 237 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVX32X ( ) const
inline

Definition at line 241 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVX64 ( ) const
inline

Definition at line 253 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVX64X ( ) const
inline

Definition at line 257 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVY32 ( ) const
inline

Definition at line 245 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVY32X ( ) const
inline

Definition at line 249 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVY64 ( ) const
inline

Definition at line 261 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVY64X ( ) const
inline

Definition at line 265 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVZ32 ( ) const
inline

Definition at line 269 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVZ64 ( ) const
inline

Definition at line 273 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isOffsetOf ( ) const
inlineoverridevirtual

isOffsetOf - Do we need to emit code to get the offset of the variable, rather then the value of the variable? Only valid when parsing MS-style inline assembly.

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 200 of file X86Operand.h.

References llvm::SMLoc::getPointer(), and OffsetOfLoc.

bool llvm::X86Operand::isReg ( ) const
inlineoverridevirtual

isReg - Is this a register operand?

Implements llvm::MCParsedAsmOperand.

Definition at line 368 of file X86Operand.h.

References Kind, and Register.

bool llvm::X86Operand::isSrcIdx ( ) const
inline
bool llvm::X86Operand::isSrcIdx16 ( ) const
inline

Definition at line 299 of file X86Operand.h.

References isMem16(), and isSrcIdx().

bool llvm::X86Operand::isSrcIdx32 ( ) const
inline

Definition at line 302 of file X86Operand.h.

References isMem32(), and isSrcIdx().

bool llvm::X86Operand::isSrcIdx64 ( ) const
inline

Definition at line 305 of file X86Operand.h.

References isMem64(), and isSrcIdx().

bool llvm::X86Operand::isSrcIdx8 ( ) const
inline

Definition at line 296 of file X86Operand.h.

References isMem8(), and isSrcIdx().

bool llvm::X86Operand::isToken ( ) const
inlineoverridevirtual

isToken - Is this a token operand?

Implements llvm::MCParsedAsmOperand.

Definition at line 132 of file X86Operand.h.

References Kind, and Token.

bool llvm::X86Operand::needAddressOf ( ) const
inlineoverridevirtual

needAddressOf - Do we need to emit code to get the address of the variable/label? Only valid when parsing MS-style inline assembly.

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 204 of file X86Operand.h.

References AddressOf.

void llvm::X86Operand::print ( raw_ostream OS) const
inlineoverridevirtual

print - Print a debug representation of the operand to the given stream.

Implements llvm::MCParsedAsmOperand.

Definition at line 85 of file X86Operand.h.

void llvm::X86Operand::setTokenValue ( StringRef  Value)
inline

Member Data Documentation

union { ... }
bool llvm::X86Operand::AddressOf

Definition at line 37 of file X86Operand.h.

Referenced by CreateReg(), and needAddressOf().

SMLoc llvm::X86Operand::EndLoc

Definition at line 33 of file X86Operand.h.

Referenced by CreateImm(), CreateMem(), CreateReg(), CreateToken(), getEndLoc(), and getLocRange().

struct ImmOp llvm::X86Operand::Imm

Definition at line 65 of file X86Operand.h.

Referenced by getImm().

enum llvm::X86Operand::KindTy llvm::X86Operand::Kind
struct MemOp llvm::X86Operand::Mem
SMLoc llvm::X86Operand::OffsetOfLoc

Definition at line 34 of file X86Operand.h.

Referenced by CreateReg(), getOffsetOfLoc(), and isOffsetOf().

void* llvm::X86Operand::OpDecl

Definition at line 36 of file X86Operand.h.

Referenced by CreateMem(), CreateReg(), and getOpDecl().

struct RegOp llvm::X86Operand::Reg

Definition at line 64 of file X86Operand.h.

Referenced by getReg().

SMLoc llvm::X86Operand::StartLoc

Definition at line 33 of file X86Operand.h.

Referenced by CreateImm(), CreateMem(), CreateReg(), getLocRange(), and getStartLoc().

StringRef llvm::X86Operand::SymName

Definition at line 35 of file X86Operand.h.

Referenced by CreateMem(), CreateReg(), and getSymName().

struct TokOp llvm::X86Operand::Tok

Definition at line 63 of file X86Operand.h.

Referenced by getToken(), and setTokenValue().


The documentation for this struct was generated from the following file: