⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hdefs.h

📁 The Valgrind distribution has multiple tools. The most popular is the memory checking tool (called M
💻 H
📖 第 1 页 / 共 2 页
字号:
/*---------------------------------------------------------------*//*---                                                         ---*//*--- This file (host-amd64/hdefs.h) is                       ---*//*--- Copyright (C) OpenWorks LLP.  All rights reserved.      ---*//*---                                                         ---*//*---------------------------------------------------------------*//*   This file is part of LibVEX, a library for dynamic binary   instrumentation and translation.   Copyright (C) 2004-2006 OpenWorks LLP.  All rights reserved.   This library is made available under a dual licensing scheme.   If you link LibVEX against other code all of which is itself   licensed under the GNU General Public License, version 2 dated June   1991 ("GPL v2"), then you may use LibVEX under the terms of the GPL   v2, as appearing in the file LICENSE.GPL.  If the file LICENSE.GPL   is missing, you can obtain a copy of the GPL v2 from the Free   Software Foundation Inc., 51 Franklin St, Fifth Floor, Boston, MA   02110-1301, USA.   For any other uses of LibVEX, you must first obtain a commercial   license from OpenWorks LLP.  Please contact info@open-works.co.uk   for information about commercial licensing.   This software is provided by OpenWorks LLP "as is" and any express   or implied warranties, including, but not limited to, the implied   warranties of merchantability and fitness for a particular purpose   are disclaimed.  In no event shall OpenWorks LLP be liable for any   direct, indirect, incidental, special, exemplary, or consequential   damages (including, but not limited to, procurement of substitute   goods or services; loss of use, data, or profits; or business   interruption) however caused and on any theory of liability,   whether in contract, strict liability, or tort (including   negligence or otherwise) arising in any way out of the use of this   software, even if advised of the possibility of such damage.   Neither the names of the U.S. Department of Energy nor the   University of California nor the names of its contributors may be   used to endorse or promote products derived from this software   without prior written permission.*/#ifndef __LIBVEX_HOST_AMD64_HDEFS_H#define __LIBVEX_HOST_AMD64_HDEFS_H/* --------- Registers. --------- *//* The usual HReg abstraction.  There are 16 real int regs, 6 real   float regs, and 16 real vector regs.*/extern void ppHRegAMD64 ( HReg );extern HReg hregAMD64_RAX ( void );extern HReg hregAMD64_RBX ( void );extern HReg hregAMD64_RCX ( void );extern HReg hregAMD64_RDX ( void );extern HReg hregAMD64_RSP ( void );extern HReg hregAMD64_RBP ( void );extern HReg hregAMD64_RSI ( void );extern HReg hregAMD64_RDI ( void );extern HReg hregAMD64_R8  ( void );extern HReg hregAMD64_R9  ( void );extern HReg hregAMD64_R10 ( void );extern HReg hregAMD64_R11 ( void );extern HReg hregAMD64_R12 ( void );extern HReg hregAMD64_R13 ( void );extern HReg hregAMD64_R14 ( void );extern HReg hregAMD64_R15 ( void );extern HReg hregAMD64_FAKE0 ( void );extern HReg hregAMD64_FAKE1 ( void );extern HReg hregAMD64_FAKE2 ( void );extern HReg hregAMD64_FAKE3 ( void );extern HReg hregAMD64_FAKE4 ( void );extern HReg hregAMD64_FAKE5 ( void );extern HReg hregAMD64_XMM0  ( void );extern HReg hregAMD64_XMM1  ( void );extern HReg hregAMD64_XMM2  ( void );extern HReg hregAMD64_XMM3  ( void );extern HReg hregAMD64_XMM4  ( void );extern HReg hregAMD64_XMM5  ( void );extern HReg hregAMD64_XMM6  ( void );extern HReg hregAMD64_XMM7  ( void );extern HReg hregAMD64_XMM8  ( void );extern HReg hregAMD64_XMM9  ( void );extern HReg hregAMD64_XMM10 ( void );extern HReg hregAMD64_XMM11 ( void );extern HReg hregAMD64_XMM12 ( void );extern HReg hregAMD64_XMM13 ( void );extern HReg hregAMD64_XMM14 ( void );extern HReg hregAMD64_XMM15 ( void );/* --------- Condition codes, AMD encoding. --------- */typedef   enum {      Acc_O      = 0,  /* overflow           */      Acc_NO     = 1,  /* no overflow        */      Acc_B      = 2,  /* below              */      Acc_NB     = 3,  /* not below          */      Acc_Z      = 4,  /* zero               */      Acc_NZ     = 5,  /* not zero           */      Acc_BE     = 6,  /* below or equal     */      Acc_NBE    = 7,  /* not below or equal */      Acc_S      = 8,  /* negative           */      Acc_NS     = 9,  /* not negative       */      Acc_P      = 10, /* parity even        */      Acc_NP     = 11, /* not parity even    */      Acc_L      = 12, /* jump less          */      Acc_NL     = 13, /* not less           */      Acc_LE     = 14, /* less or equal      */      Acc_NLE    = 15, /* not less or equal  */      Acc_ALWAYS = 16  /* the usual hack     */   }   AMD64CondCode;extern HChar* showAMD64CondCode ( AMD64CondCode );/* --------- Memory address expressions (amodes). --------- */typedef   enum {     Aam_IR,        /* Immediate + Reg */     Aam_IRRS       /* Immediate + Reg1 + (Reg2 << Shift) */   }   AMD64AModeTag;typedef   struct {      AMD64AModeTag tag;      union {         struct {            UInt imm;            HReg reg;         } IR;         struct {            UInt imm;            HReg base;            HReg index;            Int  shift; /* 0, 1, 2 or 3 only */         } IRRS;      } Aam;   }   AMD64AMode;extern AMD64AMode* AMD64AMode_IR   ( UInt, HReg );extern AMD64AMode* AMD64AMode_IRRS ( UInt, HReg, HReg, Int );extern AMD64AMode* dopyAMD64AMode ( AMD64AMode* );extern void ppAMD64AMode ( AMD64AMode* );/* --------- Operand, which can be reg, immediate or memory. --------- */typedef    enum {      Armi_Imm,      Armi_Reg,      Armi_Mem   }   AMD64RMITag;typedef   struct {      AMD64RMITag tag;      union {         struct {            UInt imm32;         } Imm;         struct {            HReg reg;         } Reg;         struct {            AMD64AMode* am;         } Mem;      }      Armi;   }   AMD64RMI;extern AMD64RMI* AMD64RMI_Imm ( UInt );extern AMD64RMI* AMD64RMI_Reg ( HReg );extern AMD64RMI* AMD64RMI_Mem ( AMD64AMode* );extern void ppAMD64RMI ( AMD64RMI* );/* --------- Operand, which can be reg or immediate only. --------- */typedef    enum {      Ari_Imm,      Ari_Reg   }   AMD64RITag;typedef   struct {      AMD64RITag tag;      union {         struct {            UInt imm32;         } Imm;         struct {            HReg reg;         } Reg;      }      Ari;   }   AMD64RI;extern AMD64RI* AMD64RI_Imm ( UInt );extern AMD64RI* AMD64RI_Reg ( HReg );extern void ppAMD64RI ( AMD64RI* );/* --------- Operand, which can be reg or memory only. --------- */typedef    enum {      Arm_Reg,      Arm_Mem   }   AMD64RMTag;typedef   struct {      AMD64RMTag tag;      union {         struct {            HReg reg;         } Reg;         struct {            AMD64AMode* am;         } Mem;      }      Arm;   }   AMD64RM;extern AMD64RM* AMD64RM_Reg ( HReg );extern AMD64RM* AMD64RM_Mem ( AMD64AMode* );extern void ppAMD64RM ( AMD64RM* );/* --------- Instructions. --------- *//* --------- */typedef   enum {      Aun_NEG,      Aun_NOT   }   AMD64UnaryOp;extern HChar* showAMD64UnaryOp ( AMD64UnaryOp );/* --------- */typedef    enum {      Aalu_INVALID,      Aalu_MOV,      Aalu_CMP,      Aalu_ADD, Aalu_SUB, Aalu_ADC, Aalu_SBB,       Aalu_AND, Aalu_OR, Aalu_XOR,      Aalu_MUL   }   AMD64AluOp;extern HChar* showAMD64AluOp ( AMD64AluOp );/* --------- */typedef   enum {      Ash_INVALID,      Ash_SHL, Ash_SHR, Ash_SAR   }   AMD64ShiftOp;extern HChar* showAMD64ShiftOp ( AMD64ShiftOp );/* --------- */typedef   enum {      Afp_INVALID,      /* Binary */      Afp_SCALE, Afp_ATAN, Afp_YL2X, Afp_YL2XP1, Afp_PREM,      /* Unary */      Afp_SQRT,      Afp_SIN, Afp_COS, Afp_TAN,      Afp_ROUND, Afp_2XM1   }   A87FpOp;extern HChar* showA87FpOp ( A87FpOp );/* --------- */typedef   enum {      Asse_INVALID,      /* mov */      Asse_MOV,      /* Floating point binary */      Asse_ADDF, Asse_SUBF, Asse_MULF, Asse_DIVF,      Asse_MAXF, Asse_MINF,      Asse_CMPEQF, Asse_CMPLTF, Asse_CMPLEF, Asse_CMPUNF,      /* Floating point unary */      Asse_RCPF, Asse_RSQRTF, Asse_SQRTF,       /* Bitwise */      Asse_AND, Asse_OR, Asse_XOR, Asse_ANDN,      Asse_ADD8, Asse_ADD16, Asse_ADD32, Asse_ADD64,      Asse_QADD8U, Asse_QADD16U,      Asse_QADD8S, Asse_QADD16S,      Asse_SUB8, Asse_SUB16, Asse_SUB32, Asse_SUB64,      Asse_QSUB8U, Asse_QSUB16U,      Asse_QSUB8S, Asse_QSUB16S,      Asse_MUL16,      Asse_MULHI16U,      Asse_MULHI16S,      Asse_AVG8U, Asse_AVG16U,      Asse_MAX16S,      Asse_MAX8U,      Asse_MIN16S,      Asse_MIN8U,      Asse_CMPEQ8, Asse_CMPEQ16, Asse_CMPEQ32,      Asse_CMPGT8S, Asse_CMPGT16S, Asse_CMPGT32S,      Asse_SHL16, Asse_SHL32, Asse_SHL64,      Asse_SHR16, Asse_SHR32, Asse_SHR64,      Asse_SAR16, Asse_SAR32,       Asse_PACKSSD, Asse_PACKSSW, Asse_PACKUSW,      Asse_UNPCKHB, Asse_UNPCKHW, Asse_UNPCKHD, Asse_UNPCKHQ,      Asse_UNPCKLB, Asse_UNPCKLW, Asse_UNPCKLD, Asse_UNPCKLQ   }   AMD64SseOp;extern HChar* showAMD64SseOp ( AMD64SseOp );/* --------- */typedef   enum {      Ain_Imm64,       /* Generate 64-bit literal to register */      Ain_Alu64R,      /* 64-bit mov/arith/logical, dst=REG */      Ain_Alu64M,      /* 64-bit mov/arith/logical, dst=MEM */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -