Rizin
unix-like reverse engineering framework and cli tools
MCInstrDesc.h File Reference
#include "capstone/platform.h"

Go to the source code of this file.

Classes

struct  MCOperandInfo
 
struct  MCInstrDesc
 

Typedefs

typedef struct MCOperandInfo MCOperandInfo
 
typedef struct MCInstrDesc MCInstrDesc
 

Enumerations

enum  MCOI_OperandConstraint { MCOI_TIED_TO = 0 , MCOI_EARLY_CLOBBER }
 
enum  MCOI_OperandFlags { MCOI_LookupPtrRegClass = 0 , MCOI_Predicate , MCOI_OptionalDef }
 
enum  MCOI_OperandType {
  MCOI_OPERAND_UNKNOWN , MCOI_OPERAND_IMMEDIATE , MCOI_OPERAND_REGISTER , MCOI_OPERAND_MEMORY ,
  MCOI_OPERAND_PCREL
}
 Operand Type - Operands are tagged with one of the values of this enum. More...
 
enum  {
  MCID_Variadic = 0 , MCID_HasOptionalDef , MCID_Pseudo , MCID_Return ,
  MCID_Call , MCID_Barrier , MCID_Terminator , MCID_Branch ,
  MCID_IndirectBranch , MCID_Compare , MCID_MoveImm , MCID_Bitcast ,
  MCID_Select , MCID_DelaySlot , MCID_FoldableAsLoad , MCID_MayLoad ,
  MCID_MayStore , MCID_Predicable , MCID_NotDuplicable , MCID_UnmodeledSideEffects ,
  MCID_Commutable , MCID_ConvertibleTo3Addr , MCID_UsesCustomInserter , MCID_HasPostISelHook ,
  MCID_Rematerializable , MCID_CheapAsAMove , MCID_ExtraSrcRegAllocReq , MCID_ExtraDefRegAllocReq ,
  MCID_RegSequence , MCID_ExtractSubreg , MCID_InsertSubreg
}
 

Functions

bool MCOperandInfo_isPredicate (const MCOperandInfo *m)
 
bool MCOperandInfo_isOptionalDef (const MCOperandInfo *m)
 

Typedef Documentation

◆ MCInstrDesc

typedef struct MCInstrDesc MCInstrDesc

MCInstrDesc - Describe properties that are true of each instruction in the target description file. This captures information about side effects, register use and many other things. There is one instance of this struct for each target instruction class, and the MachineInstr class points to this struct directly to describe itself.

◆ MCOperandInfo

typedef struct MCOperandInfo MCOperandInfo

MCOperandInfo - This holds information about one operand of a machine instruction, indicating the register class for register operands, etc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

MCInstrDesc flags - These should be considered private to the implementation of the MCInstrDesc class. Clients should use the predicate methods on MCInstrDesc, not use these directly. These all correspond to bitfields in the MCInstrDesc::Flags field.

Enumerator
MCID_Variadic 
MCID_HasOptionalDef 
MCID_Pseudo 
MCID_Return 
MCID_Call 
MCID_Barrier 
MCID_Terminator 
MCID_Branch 
MCID_IndirectBranch 
MCID_Compare 
MCID_MoveImm 
MCID_Bitcast 
MCID_Select 
MCID_DelaySlot 
MCID_FoldableAsLoad 
MCID_MayLoad 
MCID_MayStore 
MCID_Predicable 
MCID_NotDuplicable 
MCID_UnmodeledSideEffects 
MCID_Commutable 
MCID_ConvertibleTo3Addr 
MCID_UsesCustomInserter 
MCID_HasPostISelHook 
MCID_Rematerializable 
MCID_CheapAsAMove 
MCID_ExtraSrcRegAllocReq 
MCID_ExtraDefRegAllocReq 
MCID_RegSequence 
MCID_ExtractSubreg 
MCID_InsertSubreg 

Definition at line 83 of file MCInstrDesc.h.

83  {
84  MCID_Variadic = 0,
88  MCID_Call,
115 };
@ MCID_FoldableAsLoad
Definition: MCInstrDesc.h:98
@ MCID_Compare
Definition: MCInstrDesc.h:93
@ MCID_Return
Definition: MCInstrDesc.h:87
@ MCID_Branch
Definition: MCInstrDesc.h:91
@ MCID_Terminator
Definition: MCInstrDesc.h:90
@ MCID_HasOptionalDef
Definition: MCInstrDesc.h:85
@ MCID_UsesCustomInserter
Definition: MCInstrDesc.h:106
@ MCID_ExtraSrcRegAllocReq
Definition: MCInstrDesc.h:110
@ MCID_ConvertibleTo3Addr
Definition: MCInstrDesc.h:105
@ MCID_ExtractSubreg
Definition: MCInstrDesc.h:113
@ MCID_MayLoad
Definition: MCInstrDesc.h:99
@ MCID_Pseudo
Definition: MCInstrDesc.h:86
@ MCID_HasPostISelHook
Definition: MCInstrDesc.h:107
@ MCID_Bitcast
Definition: MCInstrDesc.h:95
@ MCID_Predicable
Definition: MCInstrDesc.h:101
@ MCID_Commutable
Definition: MCInstrDesc.h:104
@ MCID_Variadic
Definition: MCInstrDesc.h:84
@ MCID_MoveImm
Definition: MCInstrDesc.h:94
@ MCID_Select
Definition: MCInstrDesc.h:96
@ MCID_InsertSubreg
Definition: MCInstrDesc.h:114
@ MCID_MayStore
Definition: MCInstrDesc.h:100
@ MCID_RegSequence
Definition: MCInstrDesc.h:112
@ MCID_NotDuplicable
Definition: MCInstrDesc.h:102
@ MCID_UnmodeledSideEffects
Definition: MCInstrDesc.h:103
@ MCID_ExtraDefRegAllocReq
Definition: MCInstrDesc.h:111
@ MCID_CheapAsAMove
Definition: MCInstrDesc.h:109
@ MCID_DelaySlot
Definition: MCInstrDesc.h:97
@ MCID_Rematerializable
Definition: MCInstrDesc.h:108
@ MCID_IndirectBranch
Definition: MCInstrDesc.h:92
@ MCID_Call
Definition: MCInstrDesc.h:88
@ MCID_Barrier
Definition: MCInstrDesc.h:89

◆ MCOI_OperandConstraint

Enumerator
MCOI_TIED_TO 
MCOI_EARLY_CLOBBER 

Definition at line 28 of file MCInstrDesc.h.

28  {
29  MCOI_TIED_TO = 0, // Must be allocated the same register as.
30  MCOI_EARLY_CLOBBER // Operand is an early clobber register operand
31 };
@ MCOI_TIED_TO
Definition: MCInstrDesc.h:29
@ MCOI_EARLY_CLOBBER
Definition: MCInstrDesc.h:30

◆ MCOI_OperandFlags

OperandFlags - These are flags set on operands, but should be considered private, all access should go through the MCOperandInfo accessors. See the accessors for a description of what these are.

Enumerator
MCOI_LookupPtrRegClass 
MCOI_Predicate 
MCOI_OptionalDef 

Definition at line 36 of file MCInstrDesc.h.

36  {
40 };
@ MCOI_Predicate
Definition: MCInstrDesc.h:38
@ MCOI_OptionalDef
Definition: MCInstrDesc.h:39
@ MCOI_LookupPtrRegClass
Definition: MCInstrDesc.h:37

◆ MCOI_OperandType

Operand Type - Operands are tagged with one of the values of this enum.

Enumerator
MCOI_OPERAND_UNKNOWN 
MCOI_OPERAND_IMMEDIATE 
MCOI_OPERAND_REGISTER 
MCOI_OPERAND_MEMORY 
MCOI_OPERAND_PCREL 

Definition at line 43 of file MCInstrDesc.h.

43  {
49 };
@ MCOI_OPERAND_PCREL
Definition: MCInstrDesc.h:48
@ MCOI_OPERAND_UNKNOWN
Definition: MCInstrDesc.h:44
@ MCOI_OPERAND_IMMEDIATE
Definition: MCInstrDesc.h:45
@ MCOI_OPERAND_REGISTER
Definition: MCInstrDesc.h:46
@ MCOI_OPERAND_MEMORY
Definition: MCInstrDesc.h:47

Function Documentation

◆ MCOperandInfo_isOptionalDef()

bool MCOperandInfo_isOptionalDef ( const MCOperandInfo m)

isOptionalDef - Set if this operand is a optional def.

Definition at line 15 of file MCInstrDesc.c.

16 {
17  return m->Flags & (1 << MCOI_OptionalDef);
18 }

References regress::m, and MCOI_OptionalDef.

◆ MCOperandInfo_isPredicate()

bool MCOperandInfo_isPredicate ( const MCOperandInfo m)

isPredicate - Set if this is one of the operands that made up of the predicate operand that controls an isPredicable() instruction.

Definition at line 8 of file MCInstrDesc.c.

9 {
10  return m->Flags & (1 << MCOI_Predicate);
11 }

References regress::m, and MCOI_Predicate.