Pin
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Macros | Functions | Variables
ins_xed_ia32.cpp File Reference
#include "level_base_with_ia32_ins.H"
#include "level_core_with_ia32_ins.H"
#include "my_unistd.H"

Macros

#define LOG_XED(message)
 

Functions

LOCALVAR MESSAGE_TYPE LEVEL_CORE::MessageTypeLogXEDIa32 ("log_xed","", false, false, false, false, LOGTYPE_LOGFILE,"pin log: xed ")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatDecode ("pin","xed","decoded_insts_by_xed","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatDecodeForDecodeIns ("pin","xed","decoded_insts_for_DecodeIns","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatDecodeForValidation ("pin","xed","decoded_insts_for_Validation","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatDecodeFor_update_stripe ("pin","insts","decoded_for_update_stripe","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatEncode ("pin","insts","encoded_insts_by_xed","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatReencodeAndDecode ("pin","insts","encoded_decode_reencode","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::PinFetchedInssStat ("pin","insts","fetched_total","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::PinGeneratedInssStat ("pin","insts","generated_inss_via_xed","")
 
LOCALVAR STAT_NORM LEVEL_CORE::TimerXEDStatEncodeAndDecode ("pin","time","XED_e_d_updt_strp","",&TimerCompile)
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatInsEncode ("pin","insts","encode_INS_Encode_total","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatInsEncodeUsedCachedEncode ("pin","insts","encode_INS_Encode_used_cached","")
 
LOCALVAR STAT_UINT64 LEVEL_CORE::XEDStatCachedReencode ("pin","insts","cached_reencoded_insts","")
 
LOCALVAR KNOB_COMMENT LEVEL_CORE::knob_xed_family ("supported:xed","XED switches")
 
KNOB< BOOL > LEVEL_CORE::knob_mpx_mode (KNOB_MODE_WRITEONCE,"supported:xed","xed_mpx_mode","0","Enable Intel(R) MPX instruction decoding")
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobXedValidateEncoding (KNOB_MODE_WRITEONCE,"supported","xedvalidateencoding","0","Check the encoding by decoding and comparing")
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobXedReencodeTest (KNOB_MODE_WRITEONCE,"supported","xedreencodetest","0","XED reencode test")
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobXedReencodeCache (KNOB_MODE_WRITEONCE,"supported","xedreencodecache","1","XED reencode cache")
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobXedEncoderTest (KNOB_MODE_WRITEONCE,"supported","xedenc","0","XED encoder testing")
 
LOCALVAR KNOB< UINT32 > LEVEL_CORE::KnobXedLog (KNOB_MODE_WRITEONCE,"supported","xedlog","0","XED log messages levels 0-5")
 
LOCALVAR KNOB< string > LEVEL_CORE::KnobXedLogfile (KNOB_MODE_WRITEONCE,"supported","xedlogfile","xed.log","The XED logfile prefix")
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobXedDecodeLog (KNOB_MODE_WRITEONCE,"supported","log_xed_decode","0","log all decodes")
 
LOCALVAR KNOB< BOOL > LEVEL_CORE::KnobXedEncodeLog (KNOB_MODE_WRITEONCE,"supported","log_xed_encode","0","log all encodes")
 
STRIPE< INS_XED_STRUCT_DECODE > LEVEL_CORE::InsStripeXEDDecode ("ins stripe xed ia32 decoded","core",&InsArrayBase)
 
STRIPE< INS_XED_STRUCT_ENCODE > LEVEL_CORE::InsStripeXEDEncode ("ins stripe xed ia32 encoded","core",&InsArrayBase)
 
UINT32 LEVEL_CORE::INS_orig_size (INS x)
 
VOID LEVEL_CORE::INS_orig_size_set (INS x, UINT32 y)
 
xed_decoded_inst_t * LEVEL_CORE::INS_xed_dec (INS ins)
 
xed_operand_values_t * LEVEL_CORE::INS_xed_operand_values (INS ins)
 
VOID LEVEL_CORE::INS_SetDirty (INS ins)
 
xed_decoded_inst_t * LEVEL_CORE::INS_XedDec (INS ins)
 
LOCALINLINE VOID LEVEL_CORE::INS_ClearDirty (INS ins)
 
VOID LEVEL_CORE::INS_ClearDirtyG (INS ins)
 
LOCALINLINE BOOL LEVEL_CORE::INS_Dirty (INS ins)
 
BOOL LEVEL_CORE::INS_DirtyG (INS ins)
 
LOCALINLINE VOID LEVEL_CORE::INS_EncodeSizeSet (INS ins, UINT32 size)
 
VOID LEVEL_CORE::INS_EncodeSizeSetG (INS ins, UINT32 size)
 
LOCALINLINE UINT32 LEVEL_CORE::INS_EncodeSize (INS ins)
 
UINT32 LEVEL_CORE::INS_EncodeSizeG (INS ins)
 
LOCALINLINE UINT8 * LEVEL_CORE::INS_EncodeBuffer (INS ins)
 
UINT8 * LEVEL_CORE::INS_EncodeBufferG (INS ins)
 
VOID LEVEL_CORE::INS_set_reg_r (INS x, UINT i, REG r)
 
VOID LEVEL_CORE::INS_set_reg_w (INS x, UINT i, REG r)
 
REG LEVEL_CORE::INS_get_reg_r (INS x, UINT i)
 
REG LEVEL_CORE::INS_get_reg_w (INS x, UINT i)
 
xed_operand_enum_t LEVEL_CORE::INS_get_role_r (INS x, UINT i)
 
xed_operand_enum_t LEVEL_CORE::INS_get_role_w (INS x, UINT i)
 
UINT LEVEL_CORE::INS_get_pos_r (INS x, UINT i)
 
UINT LEVEL_CORE::INS_get_pos_w (INS x, UINT i)
 
xed_operand_enum_t LEVEL_CORE::INS_GetRole (INS ins, UINT i, BOOL read)
 
UINT LEVEL_CORE::INS_GetPos (INS ins, UINT i, BOOL read)
 
REG LEVEL_CORE::INS_GetReg (INS ins, UINT i, BOOL read)
 
VOID LEVEL_CORE::INS_SetReg (INS ins, UINT i, REG r, BOOL read)
 
UINT8 LEVEL_CORE::INS_get_num_reads (INS x)
 
UINT8 LEVEL_CORE::INS_get_num_writes (INS x)
 
UINT8 LEVEL_CORE::INS_set_num_reads (INS x, UINT v)
 
UINT8 LEVEL_CORE::INS_set_num_writes (INS x, UINT v)
 
LOCALFUN VOID LEVEL_CORE::INS_set_role_r (INS x, UINT i, xed_operand_enum_t r)
 
LOCALFUN VOID LEVEL_CORE::INS_set_role_w (INS x, UINT i, xed_operand_enum_t r)
 
LOCALFUN VOID LEVEL_CORE::INS_set_pos_r (INS x, UINT i, UINT r)
 
LOCALFUN VOID LEVEL_CORE::INS_set_pos_w (INS x, UINT i, UINT r)
 
LOCALFUN string LEVEL_CORE::XED_StringXed (xed_decoded_inst_t *xedd)
 
string LEVEL_CORE::INS_StringXed (INS ins)
 
LOCALFUN string LEVEL_CORE::BeforeAfter (xed_decoded_inst_t *before, xed_decoded_inst_t *after)
 
LOCALFUN VOID LEVEL_CORE::RecordMismatch (BOOL &mismatch, ostringstream &ostr, const string reason)
 
LOCALVAR STAT_NORM LEVEL_CORE::TimerDecode ("pin","time","decode_(overlaps)","",&TimerVm)
 
LOCALFUN VOID LEVEL_CORE::XED_print_bytes (ostream &os, const UINT8 *buf, UINT len)
 
LOCALFUN xed_error_enum_t LEVEL_CORE::XedDecode (xed_decoded_inst_t *output, const UINT8 *buffer, UINT32 size)
 
LOCALVAR STAT_NORM LEVEL_CORE::TimerEncode ("pin","time","encode_(overlaps)","",&TimerVm)
 
LOCALFUN BOOL LEVEL_CORE::XedEncode (xed_encoder_request_t *xed_enc, UINT8 *new_bits, const UINT itext_length, UINT *olen)
 
LOCALFUN VOID LEVEL_CORE::ValidateEncoding (INS inputIns, UINT len, UINT8 *buffer)
 
LOCALFUN VOID LEVEL_CORE::XED_decode_update_stripe (INS ins, const xed_operand_values_t *enc_operands, UINT itext_buf_len, UINT enc_len, UINT8 *itext_buf)
 
LOCALFUN string LEVEL_CORE::StrXedEnc (const xed_encoder_request_t *r)
 
VOID LEVEL_CORE::XED_reencode_decode_update_stripe (INS ins)
 
VOID LEVEL_CORE::XED_encode_decode_update_stripe (INS ins, xed_encoder_request_t *xed_enc)
 
REG LEVEL_CORE::xed_reg_to_pin_reg (xed_reg_enum_t xedreg, INS ins)
 
REG LEVEL_CORE::XED_BaseOnly (INS ins, BOOL filterWrites, BOOL filterReads, BOOL filterImplicit)
 
VOID LEVEL_CORE::XED_logger (INS ins, char *msg)
 
LOCALFUN VOID LEVEL_CORE::init_xed_pin_reg_arrays ()
 
REG LEVEL_CORE::INS_XedExactMapToPinReg (unsigned int r)
 
REG LEVEL_CORE::xed_exact_map_to_pin_reg (xed_reg_enum_t xed_reg)
 
REG LEVEL_CORE::xed_map_to_pin_reg (xed_reg_enum_t xed_reg)
 
xed_reg_enum_t LEVEL_CORE::xed_exact_map_from_pin_reg (REG pin_reg)
 
xed_reg_enum_t LEVEL_CORE::xed_exact_map_from_pin_reg_fast (REG pin_reg)
 
VOID LEVEL_CORE::XED_RegRolePosToXED (INS ins)
 
FLAGS LEVEL_CORE::XED_PhyFlagsWritten (const xed_decoded_inst_t *xedd, BOOL onlyDefinite)
 
FLAGS LEVEL_CORE::XED_PhyFlagsRead (const xed_decoded_inst_t *xedd)
 
LOCALINLINE VOID LEVEL_CORE::AddRegToRegsRead (INS ins, UINT &nr, REG pinRegR, xed_operand_enum_t xed_operand, UINT xed_operand_index)
 
LOCALINLINE VOID LEVEL_CORE::AddRegToRegsWritten (INS ins, UINT &nw, REG pinRegW, xed_operand_enum_t xed_operand, UINT xed_operand_index)
 
LOCALFUN VOID LEVEL_CORE::XED_add_reg_to_stripe (INS ins, const xed_decoded_inst_t *xedd, const xed_operand_action_enum_t rw, xed_operand_enum_t xed_operand, UINT xed_operand_index, UINT &nr, UINT &nw)
 
LOCALFUN UINT LEVEL_CORE::find_or_bump_pos_write (INS ins, const xed_operand_enum_t xed_operand, UINT &n)
 
LOCALFUN UINT LEVEL_CORE::find_or_bump_pos_read (INS ins, const xed_operand_enum_t xed_operand, UINT &n)
 
LOCALFUN VOID LEVEL_CORE::XED_update_reg_in_stripe (INS ins, const xed_decoded_inst_t *xedd, const xed_operand_action_enum_t rw, xed_operand_enum_t xed_operand, UINT xed_operand_index, UINT &nr, UINT &nw)
 
VOID LEVEL_CORE::XED_RegRolePosFromXED (INS ins)
 
VOID LEVEL_CORE::INS_XED_replace_dummy (INS ins, xed_reg_enum_t xedreg, REG pin_virt_reg, xed_operand_enum_t role, UINT xedpos)
 
VOID LEVEL_CORE::XED_log_init ()
 
LOCALFUN VOID LEVEL_CORE::InitJccConvertTable ()
 
xed_iclass_enum_t LEVEL_CORE::JccIclassToCmovcc (INS ins)
 
PREDICATE_IA32 LEVEL_CORE::INS_TestedCondition (INS ins)
 
LOCALFUN VOID LEVEL_CORE::pin_abort_for_xed (const char *msg, const char *file, int line, void *)
 
VOID LEVEL_CORE::XED_init ()
 
INT32 LEVEL_CORE::INS_RawEncodeIns (INS ins, UINT8 *buffer)
 
UINT32 LEVEL_CORE::INS_EncodeIns (INS ins, VOID *buffer)
 
LOCALFUN VOID LEVEL_CORE::ReencodeTest (xed_decoded_inst_t *xedd, UINT orig_len, const UINT8 *bytes, INS ins)
 
LOCALFUN EXCEPTION_CODE LEVEL_CORE::XedError2ExceptionCode (xed_error_enum_t xed_error)
 
INSDECODE LEVEL_CORE::INS_DecodeIns (INS ins, const VOID **address, UINT32 size, EXCEPTION_CODE *excCode)
 

Variables

LOCALVAR BOOL LEVEL_CORE::xed_decode_log
 
LOCALVAR BOOL LEVEL_CORE::xed_encode_log
 
GLOBALCONST UINT32 LEVEL_CORE::MAX_XED_REG_TO_PIN_REG = XED_REG_LAST
 
GLOBALCONST UINT32 LEVEL_CORE::MAX_PIN_REG_TO_XED_REG = REG_MACHINE_LAST+1
 
LOCALVAR REG LEVEL_CORE::xed_reg_to_pin_reg_exact [MAX_XED_REG_TO_PIN_REG]
 
LOCALVAR xed_reg_enum_t LEVEL_CORE::pin_reg_to_xed_reg_exact [MAX_PIN_REG_TO_XED_REG]
 
struct {
   xed_iclass_enum_t   _cmov
 
   xed_iclass_enum_t   _brinv
 
   PREDICATE_IA32   _condition
 
LEVEL_CORE::JccToCMOVcc [XED_ICLASS_LAST]
 

Detailed Description

XED (x86 encoder decoder) low-level support routines.

This supports the other core_ia32 files and is the lowest level interface to XED encoding/decoding.

Macro Definition Documentation

#define LOG_XED (   message)
Value:
QMESSAGE(MessageTypeLogXEDIa32, \
string("decode: ") + message)