Rizin
unix-like reverse engineering framework and cli tools
MCInstrDesc.h
Go to the documentation of this file.
1 //===-- llvm/MC/MCInstrDesc.h - Instruction Descriptors -*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the MCOperandInfo and MCInstrDesc classes, which
11 // are used to describe target instructions and their operands.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 /* Capstone Disassembly Engine */
16 /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
17 
18 #ifndef CS_LLVM_MC_MCINSTRDESC_H
19 #define CS_LLVM_MC_MCINSTRDESC_H
20 
21 #include "capstone/platform.h"
22 
23 //===----------------------------------------------------------------------===//
24 // Machine Operand Flags and Description
25 //===----------------------------------------------------------------------===//
26 
27 // Operand constraints
29  MCOI_TIED_TO = 0, // Must be allocated the same register as.
30  MCOI_EARLY_CLOBBER // Operand is an early clobber register operand
31 };
32 
40 };
41 
49 };
50 
51 
55 typedef struct MCOperandInfo {
61 
64 
67 
73 
74 
75 //===----------------------------------------------------------------------===//
76 // Machine Instruction Flags and Description
77 //===----------------------------------------------------------------------===//
78 
83 enum {
115 };
116 
122 typedef struct MCInstrDesc {
123  unsigned short Opcode; // The opcode number
124  unsigned char NumOperands; // Num of args (may be more if variable_ops)
125  unsigned char NumDefs; // Num of args that are definitions
126  unsigned short SchedClass; // enum identifying instr sched class
127  unsigned char Size; // Number of bytes in encoding.
128  unsigned Flags; // Flags identifying machine instr class
129  uint64_t TSFlags; // Target Specific Flag values
130  char ImplicitUses; // Registers implicitly read by this instr
131  char ImplicitDefs; // Registers implicitly defined by this instr
132  const MCOperandInfo *OpInfo; // 'NumOperands' entries about operands
133  uint64_t DeprecatedFeatureMask;// Feature bits that this is deprecated on, if any
134  // A complex method to determine is a certain is deprecated or not, and return
135  // the reason for deprecation.
136  //bool (*ComplexDeprecationInfo)(MCInst &, MCSubtargetInfo &, std::string &);
137  unsigned char ComplexDeprecationInfo; // dummy field, just to satisfy initializer
139 
141 
143 
144 #endif
MCOI_OperandType
Operand Type - Operands are tagged with one of the values of this enum.
Definition: MCInstrDesc.h:43
@ 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
bool MCOperandInfo_isOptionalDef(const MCOperandInfo *m)
Definition: MCInstrDesc.c:15
bool MCOperandInfo_isPredicate(const MCOperandInfo *m)
Definition: MCInstrDesc.c:8
struct MCOperandInfo MCOperandInfo
MCOI_OperandFlags
Definition: MCInstrDesc.h:36
@ MCOI_Predicate
Definition: MCInstrDesc.h:38
@ MCOI_OptionalDef
Definition: MCInstrDesc.h:39
@ MCOI_LookupPtrRegClass
Definition: MCInstrDesc.h:37
@ 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
Definition: MCInstrDesc.h:28
@ MCOI_TIED_TO
Definition: MCInstrDesc.h:29
@ MCOI_EARLY_CLOBBER
Definition: MCInstrDesc.h:30
struct MCInstrDesc MCInstrDesc
unsigned int uint32_t
Definition: sftypes.h:29
unsigned long uint64_t
Definition: sftypes.h:28
short int16_t
Definition: sftypes.h:34
unsigned char uint8_t
Definition: sftypes.h:31
char ImplicitDefs
Definition: MCInstrDesc.h:131
uint64_t TSFlags
Definition: MCInstrDesc.h:129
unsigned char Size
Definition: MCInstrDesc.h:127
char ImplicitUses
Definition: MCInstrDesc.h:130
unsigned char ComplexDeprecationInfo
Definition: MCInstrDesc.h:137
unsigned Flags
Definition: MCInstrDesc.h:128
const MCOperandInfo * OpInfo
Definition: MCInstrDesc.h:132
unsigned short Opcode
Definition: MCInstrDesc.h:123
unsigned char NumDefs
Definition: MCInstrDesc.h:125
unsigned short SchedClass
Definition: MCInstrDesc.h:126
unsigned char NumOperands
Definition: MCInstrDesc.h:124
uint64_t DeprecatedFeatureMask
Definition: MCInstrDesc.h:133
uint32_t Constraints
Definition: MCInstrDesc.h:70
uint8_t Flags
Flags - These are flags from the MCOI::OperandFlags enum.
Definition: MCInstrDesc.h:63
uint8_t OperandType
OperandType - Information about the type of the operand.
Definition: MCInstrDesc.h:66
int16_t RegClass
Definition: MCInstrDesc.h:60