Linux Perf
inat.h File Reference
#include "inat_types.h"
Include dependency graph for inat.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INAT_OPCODE_TABLE_SIZE   256
 
#define INAT_GROUP_TABLE_SIZE   8
 
#define INAT_PFX_OPNDSZ   1 /* 0x66 */ /* LPFX1 */
 
#define INAT_PFX_REPE   2 /* 0xF3 */ /* LPFX2 */
 
#define INAT_PFX_REPNE   3 /* 0xF2 */ /* LPFX3 */
 
#define INAT_PFX_LOCK   4 /* 0xF0 */
 
#define INAT_PFX_CS   5 /* 0x2E */
 
#define INAT_PFX_DS   6 /* 0x3E */
 
#define INAT_PFX_ES   7 /* 0x26 */
 
#define INAT_PFX_FS   8 /* 0x64 */
 
#define INAT_PFX_GS   9 /* 0x65 */
 
#define INAT_PFX_SS   10 /* 0x36 */
 
#define INAT_PFX_ADDRSZ   11 /* 0x67 */
 
#define INAT_PFX_REX   12 /* 0x4X */
 
#define INAT_PFX_VEX2   13 /* 2-bytes VEX prefix */
 
#define INAT_PFX_VEX3   14 /* 3-bytes VEX prefix */
 
#define INAT_PFX_EVEX   15 /* EVEX prefix */
 
#define INAT_LSTPFX_MAX   3
 
#define INAT_LGCPFX_MAX   11
 
#define INAT_IMM_BYTE   1
 
#define INAT_IMM_WORD   2
 
#define INAT_IMM_DWORD   3
 
#define INAT_IMM_QWORD   4
 
#define INAT_IMM_PTR   5
 
#define INAT_IMM_VWORD32   6
 
#define INAT_IMM_VWORD   7
 
#define INAT_PFX_OFFS   0
 
#define INAT_PFX_BITS   4
 
#define INAT_PFX_MAX   ((1 << INAT_PFX_BITS) - 1)
 
#define INAT_PFX_MASK   (INAT_PFX_MAX << INAT_PFX_OFFS)
 
#define INAT_ESC_OFFS   (INAT_PFX_OFFS + INAT_PFX_BITS)
 
#define INAT_ESC_BITS   2
 
#define INAT_ESC_MAX   ((1 << INAT_ESC_BITS) - 1)
 
#define INAT_ESC_MASK   (INAT_ESC_MAX << INAT_ESC_OFFS)
 
#define INAT_GRP_OFFS   (INAT_ESC_OFFS + INAT_ESC_BITS)
 
#define INAT_GRP_BITS   5
 
#define INAT_GRP_MAX   ((1 << INAT_GRP_BITS) - 1)
 
#define INAT_GRP_MASK   (INAT_GRP_MAX << INAT_GRP_OFFS)
 
#define INAT_IMM_OFFS   (INAT_GRP_OFFS + INAT_GRP_BITS)
 
#define INAT_IMM_BITS   3
 
#define INAT_IMM_MASK   (((1 << INAT_IMM_BITS) - 1) << INAT_IMM_OFFS)
 
#define INAT_FLAG_OFFS   (INAT_IMM_OFFS + INAT_IMM_BITS)
 
#define INAT_MODRM   (1 << (INAT_FLAG_OFFS))
 
#define INAT_FORCE64   (1 << (INAT_FLAG_OFFS + 1))
 
#define INAT_SCNDIMM   (1 << (INAT_FLAG_OFFS + 2))
 
#define INAT_MOFFSET   (1 << (INAT_FLAG_OFFS + 3))
 
#define INAT_VARIANT   (1 << (INAT_FLAG_OFFS + 4))
 
#define INAT_VEXOK   (1 << (INAT_FLAG_OFFS + 5))
 
#define INAT_VEXONLY   (1 << (INAT_FLAG_OFFS + 6))
 
#define INAT_EVEXONLY   (1 << (INAT_FLAG_OFFS + 7))
 
#define INAT_MAKE_PREFIX(pfx)   (pfx << INAT_PFX_OFFS)
 
#define INAT_MAKE_ESCAPE(esc)   (esc << INAT_ESC_OFFS)
 
#define INAT_MAKE_GROUP(grp)   ((grp << INAT_GRP_OFFS) | INAT_MODRM)
 
#define INAT_MAKE_IMM(imm)   (imm << INAT_IMM_OFFS)
 
#define INAT_SEG_REG_IGNORE   0
 
#define INAT_SEG_REG_DEFAULT   1
 
#define INAT_SEG_REG_CS   2
 
#define INAT_SEG_REG_SS   3
 
#define INAT_SEG_REG_DS   4
 
#define INAT_SEG_REG_ES   5
 
#define INAT_SEG_REG_FS   6
 
#define INAT_SEG_REG_GS   7
 

Functions

insn_attr_t inat_get_opcode_attribute (insn_byte_t opcode)
 
int inat_get_last_prefix_id (insn_byte_t last_pfx)
 
insn_attr_t inat_get_escape_attribute (insn_byte_t opcode, int lpfx_id, insn_attr_t esc_attr)
 
insn_attr_t inat_get_group_attribute (insn_byte_t modrm, int lpfx_id, insn_attr_t esc_attr)
 
insn_attr_t inat_get_avx_attribute (insn_byte_t opcode, insn_byte_t vex_m, insn_byte_t vex_pp)
 
static int inat_is_legacy_prefix (insn_attr_t attr)
 
static int inat_is_address_size_prefix (insn_attr_t attr)
 
static int inat_is_operand_size_prefix (insn_attr_t attr)
 
static int inat_is_rex_prefix (insn_attr_t attr)
 
static int inat_last_prefix_id (insn_attr_t attr)
 
static int inat_is_vex_prefix (insn_attr_t attr)
 
static int inat_is_evex_prefix (insn_attr_t attr)
 
static int inat_is_vex3_prefix (insn_attr_t attr)
 
static int inat_is_escape (insn_attr_t attr)
 
static int inat_escape_id (insn_attr_t attr)
 
static int inat_is_group (insn_attr_t attr)
 
static int inat_group_id (insn_attr_t attr)
 
static int inat_group_common_attribute (insn_attr_t attr)
 
static int inat_has_immediate (insn_attr_t attr)
 
static int inat_immediate_size (insn_attr_t attr)
 
static int inat_has_modrm (insn_attr_t attr)
 
static int inat_is_force64 (insn_attr_t attr)
 
static int inat_has_second_immediate (insn_attr_t attr)
 
static int inat_has_moffset (insn_attr_t attr)
 
static int inat_has_variant (insn_attr_t attr)
 
static int inat_accept_vex (insn_attr_t attr)
 
static int inat_must_vex (insn_attr_t attr)
 
static int inat_must_evex (insn_attr_t attr)
 

Macro Definition Documentation

◆ INAT_ESC_BITS

#define INAT_ESC_BITS   2

Definition at line 72 of file inat.h.

◆ INAT_ESC_MASK

#define INAT_ESC_MASK   (INAT_ESC_MAX << INAT_ESC_OFFS)

Definition at line 74 of file inat.h.

◆ INAT_ESC_MAX

#define INAT_ESC_MAX   ((1 << INAT_ESC_BITS) - 1)

Definition at line 73 of file inat.h.

◆ INAT_ESC_OFFS

#define INAT_ESC_OFFS   (INAT_PFX_OFFS + INAT_PFX_BITS)

Definition at line 71 of file inat.h.

◆ INAT_EVEXONLY

#define INAT_EVEXONLY   (1 << (INAT_FLAG_OFFS + 7))

Definition at line 93 of file inat.h.

◆ INAT_FLAG_OFFS

#define INAT_FLAG_OFFS   (INAT_IMM_OFFS + INAT_IMM_BITS)

Definition at line 85 of file inat.h.

◆ INAT_FORCE64

#define INAT_FORCE64   (1 << (INAT_FLAG_OFFS + 1))

Definition at line 87 of file inat.h.

◆ INAT_GROUP_TABLE_SIZE

#define INAT_GROUP_TABLE_SIZE   8

Definition at line 31 of file inat.h.

◆ INAT_GRP_BITS

#define INAT_GRP_BITS   5

Definition at line 77 of file inat.h.

◆ INAT_GRP_MASK

#define INAT_GRP_MASK   (INAT_GRP_MAX << INAT_GRP_OFFS)

Definition at line 79 of file inat.h.

◆ INAT_GRP_MAX

#define INAT_GRP_MAX   ((1 << INAT_GRP_BITS) - 1)

Definition at line 78 of file inat.h.

◆ INAT_GRP_OFFS

#define INAT_GRP_OFFS   (INAT_ESC_OFFS + INAT_ESC_BITS)

Definition at line 76 of file inat.h.

◆ INAT_IMM_BITS

#define INAT_IMM_BITS   3

Definition at line 82 of file inat.h.

◆ INAT_IMM_BYTE

#define INAT_IMM_BYTE   1

Definition at line 57 of file inat.h.

◆ INAT_IMM_DWORD

#define INAT_IMM_DWORD   3

Definition at line 59 of file inat.h.

◆ INAT_IMM_MASK

#define INAT_IMM_MASK   (((1 << INAT_IMM_BITS) - 1) << INAT_IMM_OFFS)

Definition at line 83 of file inat.h.

◆ INAT_IMM_OFFS

#define INAT_IMM_OFFS   (INAT_GRP_OFFS + INAT_GRP_BITS)

Definition at line 81 of file inat.h.

◆ INAT_IMM_PTR

#define INAT_IMM_PTR   5

Definition at line 61 of file inat.h.

◆ INAT_IMM_QWORD

#define INAT_IMM_QWORD   4

Definition at line 60 of file inat.h.

◆ INAT_IMM_VWORD

#define INAT_IMM_VWORD   7

Definition at line 63 of file inat.h.

◆ INAT_IMM_VWORD32

#define INAT_IMM_VWORD32   6

Definition at line 62 of file inat.h.

◆ INAT_IMM_WORD

#define INAT_IMM_WORD   2

Definition at line 58 of file inat.h.

◆ INAT_LGCPFX_MAX

#define INAT_LGCPFX_MAX   11

Definition at line 54 of file inat.h.

◆ INAT_LSTPFX_MAX

#define INAT_LSTPFX_MAX   3

Definition at line 53 of file inat.h.

◆ INAT_MAKE_ESCAPE

#define INAT_MAKE_ESCAPE (   esc)    (esc << INAT_ESC_OFFS)

Definition at line 96 of file inat.h.

◆ INAT_MAKE_GROUP

#define INAT_MAKE_GROUP (   grp)    ((grp << INAT_GRP_OFFS) | INAT_MODRM)

Definition at line 97 of file inat.h.

◆ INAT_MAKE_IMM

#define INAT_MAKE_IMM (   imm)    (imm << INAT_IMM_OFFS)

Definition at line 98 of file inat.h.

◆ INAT_MAKE_PREFIX

#define INAT_MAKE_PREFIX (   pfx)    (pfx << INAT_PFX_OFFS)

Definition at line 95 of file inat.h.

◆ INAT_MODRM

#define INAT_MODRM   (1 << (INAT_FLAG_OFFS))

Definition at line 86 of file inat.h.

◆ INAT_MOFFSET

#define INAT_MOFFSET   (1 << (INAT_FLAG_OFFS + 3))

Definition at line 89 of file inat.h.

◆ INAT_OPCODE_TABLE_SIZE

#define INAT_OPCODE_TABLE_SIZE   256

Definition at line 30 of file inat.h.

◆ INAT_PFX_ADDRSZ

#define INAT_PFX_ADDRSZ   11 /* 0x67 */

Definition at line 45 of file inat.h.

◆ INAT_PFX_BITS

#define INAT_PFX_BITS   4

Definition at line 67 of file inat.h.

◆ INAT_PFX_CS

#define INAT_PFX_CS   5 /* 0x2E */

Definition at line 39 of file inat.h.

◆ INAT_PFX_DS

#define INAT_PFX_DS   6 /* 0x3E */

Definition at line 40 of file inat.h.

◆ INAT_PFX_ES

#define INAT_PFX_ES   7 /* 0x26 */

Definition at line 41 of file inat.h.

◆ INAT_PFX_EVEX

#define INAT_PFX_EVEX   15 /* EVEX prefix */

Definition at line 51 of file inat.h.

◆ INAT_PFX_FS

#define INAT_PFX_FS   8 /* 0x64 */

Definition at line 42 of file inat.h.

◆ INAT_PFX_GS

#define INAT_PFX_GS   9 /* 0x65 */

Definition at line 43 of file inat.h.

◆ INAT_PFX_LOCK

#define INAT_PFX_LOCK   4 /* 0xF0 */

Definition at line 38 of file inat.h.

◆ INAT_PFX_MASK

#define INAT_PFX_MASK   (INAT_PFX_MAX << INAT_PFX_OFFS)

Definition at line 69 of file inat.h.

◆ INAT_PFX_MAX

#define INAT_PFX_MAX   ((1 << INAT_PFX_BITS) - 1)

Definition at line 68 of file inat.h.

◆ INAT_PFX_OFFS

#define INAT_PFX_OFFS   0

Definition at line 66 of file inat.h.

◆ INAT_PFX_OPNDSZ

#define INAT_PFX_OPNDSZ   1 /* 0x66 */ /* LPFX1 */

Definition at line 34 of file inat.h.

◆ INAT_PFX_REPE

#define INAT_PFX_REPE   2 /* 0xF3 */ /* LPFX2 */

Definition at line 35 of file inat.h.

◆ INAT_PFX_REPNE

#define INAT_PFX_REPNE   3 /* 0xF2 */ /* LPFX3 */

Definition at line 36 of file inat.h.

◆ INAT_PFX_REX

#define INAT_PFX_REX   12 /* 0x4X */

Definition at line 47 of file inat.h.

◆ INAT_PFX_SS

#define INAT_PFX_SS   10 /* 0x36 */

Definition at line 44 of file inat.h.

◆ INAT_PFX_VEX2

#define INAT_PFX_VEX2   13 /* 2-bytes VEX prefix */

Definition at line 49 of file inat.h.

◆ INAT_PFX_VEX3

#define INAT_PFX_VEX3   14 /* 3-bytes VEX prefix */

Definition at line 50 of file inat.h.

◆ INAT_SCNDIMM

#define INAT_SCNDIMM   (1 << (INAT_FLAG_OFFS + 2))

Definition at line 88 of file inat.h.

◆ INAT_SEG_REG_CS

#define INAT_SEG_REG_CS   2

Definition at line 103 of file inat.h.

◆ INAT_SEG_REG_DEFAULT

#define INAT_SEG_REG_DEFAULT   1

Definition at line 102 of file inat.h.

◆ INAT_SEG_REG_DS

#define INAT_SEG_REG_DS   4

Definition at line 105 of file inat.h.

◆ INAT_SEG_REG_ES

#define INAT_SEG_REG_ES   5

Definition at line 106 of file inat.h.

◆ INAT_SEG_REG_FS

#define INAT_SEG_REG_FS   6

Definition at line 107 of file inat.h.

◆ INAT_SEG_REG_GS

#define INAT_SEG_REG_GS   7

Definition at line 108 of file inat.h.

◆ INAT_SEG_REG_IGNORE

#define INAT_SEG_REG_IGNORE   0

Definition at line 101 of file inat.h.

◆ INAT_SEG_REG_SS

#define INAT_SEG_REG_SS   3

Definition at line 104 of file inat.h.

◆ INAT_VARIANT

#define INAT_VARIANT   (1 << (INAT_FLAG_OFFS + 4))

Definition at line 90 of file inat.h.

◆ INAT_VEXOK

#define INAT_VEXOK   (1 << (INAT_FLAG_OFFS + 5))

Definition at line 91 of file inat.h.

◆ INAT_VEXONLY

#define INAT_VEXONLY   (1 << (INAT_FLAG_OFFS + 6))

Definition at line 92 of file inat.h.

Function Documentation

◆ inat_accept_vex()

static int inat_accept_vex ( insn_attr_t  attr)
inlinestatic

Definition at line 230 of file inat.h.

◆ inat_escape_id()

static int inat_escape_id ( insn_attr_t  attr)
inlinestatic

Definition at line 175 of file inat.h.

◆ inat_get_avx_attribute()

insn_attr_t inat_get_avx_attribute ( insn_byte_t  opcode,
insn_byte_t  vex_m,
insn_byte_t  vex_pp 
)

Definition at line 79 of file inat.c.

Here is the call graph for this function:

◆ inat_get_escape_attribute()

insn_attr_t inat_get_escape_attribute ( insn_byte_t  opcode,
int  lpfx_id,
insn_attr_t  esc_attr 
)

Definition at line 40 of file inat.c.

Here is the call graph for this function:

◆ inat_get_group_attribute()

insn_attr_t inat_get_group_attribute ( insn_byte_t  modrm,
int  lpfx_id,
insn_attr_t  esc_attr 
)

Definition at line 59 of file inat.c.

Here is the call graph for this function:

◆ inat_get_last_prefix_id()

int inat_get_last_prefix_id ( insn_byte_t  last_pfx)

Definition at line 32 of file inat.c.

Here is the call graph for this function:

◆ inat_get_opcode_attribute()

insn_attr_t inat_get_opcode_attribute ( insn_byte_t  opcode)

Definition at line 27 of file inat.c.

◆ inat_group_common_attribute()

static int inat_group_common_attribute ( insn_attr_t  attr)
inlinestatic

Definition at line 190 of file inat.h.

◆ inat_group_id()

static int inat_group_id ( insn_attr_t  attr)
inlinestatic

Definition at line 185 of file inat.h.

◆ inat_has_immediate()

static int inat_has_immediate ( insn_attr_t  attr)
inlinestatic

Definition at line 195 of file inat.h.

◆ inat_has_modrm()

static int inat_has_modrm ( insn_attr_t  attr)
inlinestatic

Definition at line 205 of file inat.h.

◆ inat_has_moffset()

static int inat_has_moffset ( insn_attr_t  attr)
inlinestatic

Definition at line 220 of file inat.h.

◆ inat_has_second_immediate()

static int inat_has_second_immediate ( insn_attr_t  attr)
inlinestatic

Definition at line 215 of file inat.h.

◆ inat_has_variant()

static int inat_has_variant ( insn_attr_t  attr)
inlinestatic

Definition at line 225 of file inat.h.

◆ inat_immediate_size()

static int inat_immediate_size ( insn_attr_t  attr)
inlinestatic

Definition at line 200 of file inat.h.

◆ inat_is_address_size_prefix()

static int inat_is_address_size_prefix ( insn_attr_t  attr)
inlinestatic

Definition at line 130 of file inat.h.

◆ inat_is_escape()

static int inat_is_escape ( insn_attr_t  attr)
inlinestatic

Definition at line 170 of file inat.h.

◆ inat_is_evex_prefix()

static int inat_is_evex_prefix ( insn_attr_t  attr)
inlinestatic

Definition at line 160 of file inat.h.

◆ inat_is_force64()

static int inat_is_force64 ( insn_attr_t  attr)
inlinestatic

Definition at line 210 of file inat.h.

◆ inat_is_group()

static int inat_is_group ( insn_attr_t  attr)
inlinestatic

Definition at line 180 of file inat.h.

◆ inat_is_legacy_prefix()

static int inat_is_legacy_prefix ( insn_attr_t  attr)
inlinestatic

Definition at line 124 of file inat.h.

◆ inat_is_operand_size_prefix()

static int inat_is_operand_size_prefix ( insn_attr_t  attr)
inlinestatic

Definition at line 135 of file inat.h.

◆ inat_is_rex_prefix()

static int inat_is_rex_prefix ( insn_attr_t  attr)
inlinestatic

Definition at line 140 of file inat.h.

◆ inat_is_vex3_prefix()

static int inat_is_vex3_prefix ( insn_attr_t  attr)
inlinestatic

Definition at line 165 of file inat.h.

◆ inat_is_vex_prefix()

static int inat_is_vex_prefix ( insn_attr_t  attr)
inlinestatic

Definition at line 153 of file inat.h.

◆ inat_last_prefix_id()

static int inat_last_prefix_id ( insn_attr_t  attr)
inlinestatic

Definition at line 145 of file inat.h.

◆ inat_must_evex()

static int inat_must_evex ( insn_attr_t  attr)
inlinestatic

Definition at line 240 of file inat.h.

◆ inat_must_vex()

static int inat_must_vex ( insn_attr_t  attr)
inlinestatic

Definition at line 235 of file inat.h.