From: Lei Xia Date: Mon, 21 Jul 2008 16:25:38 +0000 (+0000) Subject: Add the xed header files X-Git-Tag: puppy-and-xed~3 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=0848f06f791602a82524d7fb0079e3c573894a61 Add the xed header files --- diff --git a/palacios/include/xed/xed-address-width-enum.h b/palacios/include/xed/xed-address-width-enum.h new file mode 100644 index 0000000..0317890 --- /dev/null +++ b/palacios/include/xed/xed-address-width-enum.h @@ -0,0 +1,53 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-address-width-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_ADDRESS_WIDTH_ENUM_H_) +# define _XED_ADDRESS_WIDTH_ENUM_H_ +#include +typedef enum { + XED_ADDRESS_WIDTH_INVALID=0, + XED_ADDRESS_WIDTH_16b=2, ///< 16b addressing + XED_ADDRESS_WIDTH_32b=4, ///< 32b addressing + XED_ADDRESS_WIDTH_64b=8, ///< 64b addressing + XED_ADDRESS_WIDTH_LAST +} xed_address_width_enum_t; + +XED_DLL_EXPORT xed_address_width_enum_t +str2xed_address_width_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_address_width_enum_t2str(const xed_address_width_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-attribute-enum.h b/palacios/include/xed/xed-attribute-enum.h new file mode 100644 index 0000000..c607a29 --- /dev/null +++ b/palacios/include/xed/xed-attribute-enum.h @@ -0,0 +1,67 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-attribute-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_ATTRIBUTE_ENUM_H_) +# define _XED_ATTRIBUTE_ENUM_H_ +#include +typedef enum { + XED_ATTRIBUTE_INVALID=0, + XED_ATTRIBUTE_ANY_REP_ABLE=1, + XED_ATTRIBUTE_ATT_OPERAND_ORDER_EXCEPTION=2, + XED_ATTRIBUTE_FAR_XFER=4, + XED_ATTRIBUTE_FIXED_BASE0=8, + XED_ATTRIBUTE_FIXED_BASE1=16, + XED_ATTRIBUTE_REQUIRES_ALIGNMENT=32, + XED_ATTRIBUTE_SIMD_PACKED_ALIGNMENT=64, + XED_ATTRIBUTE_SIMD_SCALAR=128, + XED_ATTRIBUTE_SKIPLOW32=256, + XED_ATTRIBUTE_SKIPLOW64=512, + XED_ATTRIBUTE_UNALIGNED=1024, + XED_ATTRIBUTE_X87_MMX_STATE_CW=2048, + XED_ATTRIBUTE_X87_MMX_STATE_R=4096, + XED_ATTRIBUTE_X87_MMX_STATE_W=8192, + XED_ATTRIBUTE_XMM_STATE_CW=16384, + XED_ATTRIBUTE_XMM_STATE_R=32768, + XED_ATTRIBUTE_XMM_STATE_W=65536, + XED_ATTRIBUTE_LAST +} xed_attribute_enum_t; + +XED_DLL_EXPORT xed_attribute_enum_t +str2xed_attribute_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_attribute_enum_t2str(const xed_attribute_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-category-enum.h b/palacios/include/xed/xed-category-enum.h new file mode 100644 index 0000000..92d0b73 --- /dev/null +++ b/palacios/include/xed/xed-category-enum.h @@ -0,0 +1,86 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-category-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_CATEGORY_ENUM_H_) +# define _XED_CATEGORY_ENUM_H_ +#include +typedef enum { + XED_CATEGORY_INVALID, + XED_CATEGORY_3DNOW, + XED_CATEGORY_BASE, + XED_CATEGORY_BINARY, + XED_CATEGORY_BITBYTE, + XED_CATEGORY_CALL, + XED_CATEGORY_CMOV, + XED_CATEGORY_COND_BR, + XED_CATEGORY_DATAXFER, + XED_CATEGORY_DECIMAL, + XED_CATEGORY_FCMOV, + XED_CATEGORY_FLAGOP, + XED_CATEGORY_INTERRUPT, + XED_CATEGORY_IO, + XED_CATEGORY_IOSTRINGOP, + XED_CATEGORY_LOGICAL, + XED_CATEGORY_MISC, + XED_CATEGORY_MMX, + XED_CATEGORY_NOP, + XED_CATEGORY_POP, + XED_CATEGORY_PREFETCH, + XED_CATEGORY_PUSH, + XED_CATEGORY_RET, + XED_CATEGORY_ROTATE, + XED_CATEGORY_SEGOP, + XED_CATEGORY_SEMAPHORE, + XED_CATEGORY_SHIFT, + XED_CATEGORY_SSE, + XED_CATEGORY_STRINGOP, + XED_CATEGORY_SYSCALL, + XED_CATEGORY_SYSRET, + XED_CATEGORY_SYSTEM, + XED_CATEGORY_UNCOND_BR, + XED_CATEGORY_VTX, + XED_CATEGORY_WIDENOP, + XED_CATEGORY_X87_ALU, + XED_CATEGORY_XSAVE, + XED_CATEGORY_LAST +} xed_category_enum_t; + +XED_DLL_EXPORT xed_category_enum_t +str2xed_category_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_category_enum_t2str(const xed_category_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-common-defs.h b/palacios/include/xed/xed-common-defs.h new file mode 100644 index 0000000..ec2b6b6 --- /dev/null +++ b/palacios/include/xed/xed-common-defs.h @@ -0,0 +1,78 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-common-defs.h +/// @author Mark Charney +/// @brief some pervasive defines + + + +#ifndef _XED_COMMON_DEFS_H_ +# define _XED_COMMON_DEFS_H_ + +//////////////////////////////////////////////////////////////////////////// + +#define XED_MAX_OPERANDS 11 +#define XED_MAX_NONTERMINALS_PER_INSTRUCTION 20 // FIXME somewhat arbitrary + +#define XED_MAX_DISPLACEMENT_BYTES 8 // for most things it is 4, but one 64b mov allows 8 +#define XED_MAX_IMMEDIATE_BYTES 8 // for most things it is max 4, but one 64b mov allows 8. + +#define XED_MAX_INSTRUCTION_BYTES 15 + + +#define XED_BYTE_MASK(x) ((x) & 0xFF) +#define XED_BYTE_CAST(x) (STATIC_CAST(xed_uint8_t,x)) + +//////////////////////////////////////////////////////////////////////////// +// used for defining bit-field widths +// Microsoft's compiler treats enumerations as signed and if you pack +// the bit-field with values, when you assign it to a full-width enumeration, +// you get junk-- a big negative number. This compensates for cases that I've +// encountered +#if defined(__GNUC__) +# define XED_BIT_FIELD_PSEUDO_WIDTH4 4 +# define XED_BIT_FIELD_PSEUDO_WIDTH8 8 +#else +# define XED_BIT_FIELD_PSEUDO_WIDTH4 8 +# define XED_BIT_FIELD_PSEUDO_WIDTH8 16 +#endif + + +#endif + + + + + + + + + diff --git a/palacios/include/xed/xed-common-hdrs.h b/palacios/include/xed/xed-common-hdrs.h new file mode 100644 index 0000000..359db1c --- /dev/null +++ b/palacios/include/xed/xed-common-hdrs.h @@ -0,0 +1,61 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-common-hdrs.h +/// @author Mark Charney + + + +#ifndef _XED_COMMON_HDRS_H_ +# define _XED_COMMON_HDRS_H_ + +//////////////////////////////////////////////////////////////////////////// +#if !defined(XED_MESSAGES) +# define XED_MESSAGES 0 +#endif + +#if defined(XED_DLL) +// __declspec(dllexport) works with GNU GCC or MS compilers +# define XED_DLL_EXPORT __declspec(dllexport) +# define XED_DLL_IMPORT __declspec(dllimport) +# if defined(XED_BUILD) +# define XED_DLL_GLOBAL XED_DLL_EXPORT +# else +# define XED_DLL_GLOBAL XED_DLL_IMPORT +# endif +#else +# define XED_DLL_EXPORT +# define XED_DLL_IMPORT +# define XED_DLL_GLOBAL +#endif +//////////////////////////////////////////////////////////////////////////// + +#endif + diff --git a/palacios/include/xed/xed-decode.h b/palacios/include/xed/xed-decode.h new file mode 100644 index 0000000..20e58d5 --- /dev/null +++ b/palacios/include/xed/xed-decode.h @@ -0,0 +1,93 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-decode.h +/// @author Mark Charney + + +#ifndef _XED_DECODE_H_ +# define _XED_DECODE_H_ + + +#include +#include +//////////////////////////////////////////////////////////////////////////// +// DEFINES +//////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////// +// TYPES +//////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////// +// PROTOTYPES +//////////////////////////////////////////////////////////////////////////// + +/// This is the main interface to the decoder. +/// @param xedd the decoded instruction of type #xed_decoded_inst_t . Mode/state sent in via xedd; See the #xed_state_t +/// @param itext the pointer to the array of instruction text bytes +/// @param bytes the length of the itext input array. 1 to 15 bytes, anything more is ignored. +/// @return #xed_error_enum_t indiciating success (#XED_ERROR_NONE) or failure. Note failure can be due to not +/// enough bytes in the input array. +/// +/// The maximum instruction is 15B and XED will tell you how long the +/// actual instruction is via an API function call +/// xed_decoded_inst_get_length(). However, it is not always safe or +/// advisable for XED to read 15 bytes if the decode location is at the +/// boundary of some sort of protection limit. For example, if one is +/// decoding near the end of a page and the XED user does not want to cause +/// extra page faults, one might send in the number of bytes that would +/// stop at the page boundary. In this case, XED might not be able to +/// decode the instruction and would return an error. The XED user would +/// then have to decide if it was safe to touch the next page and try again +/// to decode with more bytes. Also sometimes the user process does not +/// have read access to the next page and this allows the user to prevent +/// XED from causing process termination by limiting the memory range that +/// XED will access. +/// +/// @ingroup DEC +XED_DLL_EXPORT xed_error_enum_t +xed_decode(xed_decoded_inst_t* xedd, + const xed_uint8_t* itext, + const unsigned int bytes); + + +//////////////////////////////////////////////////////////////////////////// +// GLOBALS +//////////////////////////////////////////////////////////////////////////// + + +#endif +//////////////////////////////////////////////////////////////////////////// +//Local Variables: +//pref: "../../xed-decode.cpp" +//End: diff --git a/palacios/include/xed/xed-decoded-inst.h b/palacios/include/xed/xed-decoded-inst.h new file mode 100644 index 0000000..c2fc7b0 --- /dev/null +++ b/palacios/include/xed/xed-decoded-inst.h @@ -0,0 +1,468 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-decoded-inst.h +/// @author Mark Charney + +#if !defined(_XED_DECODER_STATE_H_) +# define _XED_DECODER_STATE_H_ +#include +#include +#include +#include +#include +#include +#include +#include +#include //generated + + +// fwd-decl xed_simple_flag_t; +// fwd-decl xed_inst_t; + + +struct xed_encoder_vars_s; +struct xed_decoder_vars_s; + +/// @ingroup DEC +/// The main container for instructions. After decode, it holds an array of +/// operands with derived information from decode and also valid +/// #xed_inst_t pointer which describes the operand templates and the +/// operand order. See @ref DEC for API documentation. +typedef struct XED_DLL_EXPORT xed_decoded_inst_s { + /// The operand storage fields discovered during decoding. This same array is used by encode. + xed_operand_values_t _operands[XED_OPERAND_LAST]; // FIXME: can further squeeze down 16b units + + /// Used for encode operand ordering. Not set by decode. + xed_uint8_t _operand_order[XED_ENCODE_ORDER_MAX_OPERANDS]; + + xed_uint8_t _decoded_length; + // Length of the _operand_order[] array. + xed_uint8_t _n_operand_order; + + /// when we decode an instruction, we set the _inst and get the + /// properites of that instruction here. This also points to the + /// operands template array. + const xed_inst_t* _inst; + + // decoder does not change it, encoder does + union { + xed_uint8_t* _enc; + const xed_uint8_t* _dec; + } _byte_array; + + // These are stack allocated by xed_encode() or xed_decode(). These are + // per-encode or per-decode transitory data. + union { + + /* user_data is available as a user data storage field after + * decoding. It does not live across re-encodes or re-decodes. */ + xed_uint64_t user_data; + struct xed_decoder_vars_s* dv; + struct xed_encoder_vars_s* ev; + } u; + + + +} xed_decoded_inst_t; + + + +/// @name xed_decoded_inst_t Operands array access +//@{ +/// @ingroup DEC +/// Obtain a constant pointer to the operands +static XED_INLINE const xed_operand_values_t* +xed_decoded_inst_operands_const(const xed_decoded_inst_t* p) { + return STATIC_CAST(xed_operand_values_t*,p->_operands); +} +/// @ingroup DEC +/// Obtain a non-constant pointer to the operands +static XED_INLINE xed_operand_values_t* +xed_decoded_inst_operands(xed_decoded_inst_t* p) { + return STATIC_CAST(xed_operand_values_t*,p->_operands); +} +//@} + +/// @name xed_decoded_inst_t Initialization +//@{ +/// @ingroup DEC +/// Zero the decode structure, but set the machine state/mode information +XED_DLL_EXPORT void xed_decoded_inst_zero_set_mode(xed_decoded_inst_t* p, const xed_state_t* dstate); +/// @ingroup DEC +/// Zero the decode structure, but preserve the existing machine state/mode information +XED_DLL_EXPORT void xed_decoded_inst_zero_keep_mode(xed_decoded_inst_t* p); +/// @ingroup DEC +/// Zero the decode structure completely. +XED_DLL_EXPORT void xed_decoded_inst_zero(xed_decoded_inst_t* p); +/// @ingroup DEC +/// Zero the decode structure, but copy the existing machine state/mode information from the supplied operands pointer. +XED_DLL_EXPORT void xed_decoded_inst_zero_keep_mode_from_operands(xed_decoded_inst_t* p, + const xed_operand_values_t* operands); +//@} + +/// @name xed_decoded_inst_t Length +//@{ +/// @ingroup DEC +/// Return the length of the decoded instruction in bytes. +static XED_INLINE xed_uint_t +xed_decoded_inst_get_length(const xed_decoded_inst_t* p) { + return p->_decoded_length; +} + + +//@} + +/// @name modes +//@{ +/// @ingroup DEC +static XED_INLINE xed_uint_t xed_decoded_inst_get_mode(const xed_decoded_inst_t* p) { + return p->_operands[XED_OPERAND_MODE]; +} +/// @ingroup DEC +static XED_INLINE xed_uint_t xed_decoded_inst_get_address_mode(const xed_decoded_inst_t* p) { + return p->_operands[XED_OPERAND_AMODE]; +} +/// @ingroup DEC +static XED_INLINE xed_uint_t xed_decoded_inst_get_stack_address_mode(const xed_decoded_inst_t* p) { + return p->_operands[XED_OPERAND_SMODE]; +} +//@} + + +/////////////////////////////////////////////////////// +/// API +/////////////////////////////////////////////////////// + +/// @name xed_decoded_inst_t High-level accessors +//@{ +/// @ingroup DEC +/// Return true if the instruction is valid +static XED_INLINE xed_bool_t xed_decoded_inst_valid(const xed_decoded_inst_t* p ) { + return STATIC_CAST(xed_bool_t,(p->_inst != 0)); +} +/// @ingroup DEC +/// Return the #xed_inst_t structure for this instruction. This is the route to the basic operands form information. +static XED_INLINE const xed_inst_t* xed_decoded_inst_inst( const xed_decoded_inst_t* p) { + return p->_inst; +} + + +/// @ingroup DEC +/// Return the instruction category enumeration +static XED_INLINE xed_category_enum_t xed_decoded_inst_get_category(const xed_decoded_inst_t* p) { + xed_assert(p->_inst != 0); + return xed_inst_category(p->_inst); +} +/// @ingroup DEC +/// Return the instruction extension enumeration +static XED_INLINE xed_extension_enum_t xed_decoded_inst_get_extension( const xed_decoded_inst_t* p) { + xed_assert(p->_inst != 0); + return xed_inst_extension(p->_inst); +} +/// @ingroup DEC +/// Return the instruction class enumeration. +static XED_INLINE xed_iclass_enum_t xed_decoded_inst_get_iclass( const xed_decoded_inst_t* p){ + xed_assert(p->_inst != 0); + return xed_inst_iclass(p->_inst); +} + +/// @ingroup DEC +/// Returns 1 if the attribute is defined for this instruction. +XED_DLL_EXPORT xed_uint32_t xed_decoded_inst_get_attribute(const xed_decoded_inst_t* p, xed_attribute_enum_t attr); + +/// @ingroup DEC +/// Returns the attribute bitvector +XED_DLL_EXPORT xed_uint32_t xed_decoded_inst_get_attributes(const xed_decoded_inst_t* p); +//@} + +/// @name IFORM handling +//@{ + +/// @ingroup DEC +/// Return the instruction iform enum of type #xed_iform_enum_t . +static XED_INLINE xed_iform_enum_t xed_decoded_inst_get_iform_enum(const xed_decoded_inst_t* p) { + xed_assert(p->_inst != 0); + return xed_inst_iform_enum(p->_inst); +} + + +/// @ingroup DEC +/// Return the instruction zero-based iform number based on masking the +/// corresponding #xed_iform_enum_t. This value is suitable for +/// dispatching. The maximum value for a particular iclass is provided by +/// #xed_iform_max_per_iclass() . +static XED_INLINE unsigned int xed_decoded_inst_get_iform_enum_dispatch(const xed_decoded_inst_t* p) { + xed_assert(p->_inst != 0); + return xed_inst_iform_enum(p->_inst) & 0xFF; +} + +/// @ingroup DEC +/// Return the maximum number of iforms for a particular iclass. This +/// function returns valid data as soon as global data is initialized. (This +/// function does not require a decoded instruction as input). +XED_DLL_EXPORT xed_uint32_t xed_iform_max_per_iclass(xed_iclass_enum_t iclass); + +#define XED_MASK_IFORM(x) ((x) & 0xFF) + +/// @ingroup DEC +/// DEPRECATED Return the instruction iform number. The iform is zero-based number of +/// the different instances of each iclass. +static XED_INLINE xed_uint_t xed_decoded_inst_get_old_iform( const xed_decoded_inst_t* p){ + xed_assert(p->_inst != 0); + return xed_inst_iform(p->_inst); +} + +//@} + + + +/// @name xed_decoded_inst_t Operands: Number and Length +//@{ +/// Return the length in bytes of the operand_index'th operand. +/// @ingroup DEC +XED_DLL_EXPORT unsigned int xed_decoded_inst_operand_length(const xed_decoded_inst_t* p, + unsigned int operand_index); +/// Return the number of operands +/// @ingroup DEC +static XED_INLINE unsigned int xed_decoded_inst_noperands(const xed_decoded_inst_t* p) { + unsigned int noperands = xed_inst_noperands(xed_decoded_inst_inst(p)); + return noperands; +} +//@} + +/// @name xed_decoded_inst_t Printers +//@{ +/// @ingroup DEC +/// Print out all the information about the decoded instruction to the buffer buf whose length is maximally buflen. +XED_DLL_EXPORT void xed_decoded_inst_dump(const xed_decoded_inst_t* p, char* buf, int buflen); + +/// @ingroup DEC +/// Print the instructions with the destination on the left. Use PTR qualifiers for memory access widths. +/// Recommendation: buflen must be more than 16 bytes, preferably at least 100 bytes. +/// @param p a #xed_decoded_inst_t for a decoded instruction +/// @param buf a buffer to write the disassembly in to. +/// @param buflen maximum length of the disassembly buffer +/// @param runtime_address the address of the instruction being disassembled +/// @return Returns 0 if the disassembly fails, 1 otherwise. +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_dump_intel_format(const xed_decoded_inst_t* p, + char* buf, + int buflen, + xed_uint64_t runtime_address); +/// @ingroup DEC +/// Print the instructions with the destination on the left. Use PTR qualifiers for memory access widths. +/// Recommendation: buflen must be more than 16 bytes, preferably at least 100 bytes. +/// @param p a #xed_decoded_inst_t for a decoded instruction +/// @param buf a buffer to write the disassembly in to. +/// @param buflen maximum length of the disassembly buffer +/// @param runtime_address the address of the instruction being disassembled +/// @param context A void* used only for the call back routine for symbolic disassembly if one is registered. +/// @return Returns 0 if the disassembly fails, 1 otherwise. +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_dump_intel_format_context(const xed_decoded_inst_t* p, + char* buf, + int buflen, + xed_uint64_t runtime_address, + void* context); + +/// @ingroup DEC +/// Print the instructions with the destination operand on the right, with +/// several exceptions (bound, invlpga, enter, and other instructions with +/// two immediate operands). Also use instruction name suffixes to +/// indicate operation width. Several instructions names are different as +/// well. +/// Recommendation: buflen must be more than 16 bytes, preferably at least 100 bytes. +/// @param p a #xed_decoded_inst_t for a decoded instruction +/// @param buf a buffer to write the disassembly in to. +/// @param buflen maximum length of the disassembly buffer +/// @param runtime_address the address of the instruction being disassembled +/// @return Returns 0 if the disassembly fails, 1 otherwise. +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_dump_att_format(const xed_decoded_inst_t* p, + char* buf, + int buflen, + xed_uint64_t runtime_address); + +/// @ingroup DEC +/// Print the instructions with the destination operand on the right, with +/// several exceptions (bound, invlpga, enter, and other instructions with +/// two immediate operands). Also use instruction name suffixes to +/// indicate operation width. Several instructions names are different as +/// well. buflen must be at least 100 bytes. +/// @param p a #xed_decoded_inst_t for a decoded instruction +/// @param buf a buffer to write the disassembly in to. +/// @param buflen maximum length of the disassembly buffer +/// @param runtime_address the address of the instruction being disassembled +/// @param context A void* used only for the call back routine for symbolic disassembly if one is registered. +/// @return Returns 0 if the disassembly fails, 1 otherwise. +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_dump_att_format_context(const xed_decoded_inst_t* p, + char* buf, + int buflen, + xed_uint64_t runtime_address, + void* context); + +/// @ingroup DEC +/// @param p a #xed_decoded_inst_t for a decoded instruction +/// @param buf a buffer to write the disassembly in to. +/// @param buflen maximum length of the disassembly buffer +/// @param runtime_address the address of the instruction being disassembled +/// @return Returns 0 if the disassembly fails, 1 otherwise. +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_dump_xed_format(const xed_decoded_inst_t* p, + char* buf, + int buflen, xed_uint64_t runtime_address) ; +//@} + +/// @name xed_decoded_inst_t Operand Field Details +//@{ +/// @ingroup DEC +XED_DLL_EXPORT xed_reg_enum_t xed_decoded_inst_get_seg_reg(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +XED_DLL_EXPORT xed_reg_enum_t xed_decoded_inst_get_base_reg(const xed_decoded_inst_t* p, unsigned int mem_idx); +XED_DLL_EXPORT xed_reg_enum_t xed_decoded_inst_get_index_reg(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_get_scale(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +XED_DLL_EXPORT xed_int64_t xed_decoded_inst_get_memory_displacement(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +/// Result in BYTES +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_get_memory_displacement_width(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +/// Result in BITS +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_get_memory_displacement_width_bits(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +XED_DLL_EXPORT xed_int32_t xed_decoded_inst_get_branch_displacement(const xed_decoded_inst_t* p); +/// @ingroup DEC +/// Result in BYTES +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_get_branch_displacement_width(const xed_decoded_inst_t* p); +/// @ingroup DEC +/// Result in BITS +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_get_branch_displacement_width_bits(const xed_decoded_inst_t* p); +/// @ingroup DEC +XED_DLL_EXPORT xed_uint64_t xed_decoded_inst_get_unsigned_immediate(const xed_decoded_inst_t* p); +/// @ingroup DEC +/// Return true if the first immediate (IMM0) is signed +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_get_immediate_is_signed(const xed_decoded_inst_t* p); +/// @ingroup DEC +/// Return the immediate width in BYTES. +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_get_immediate_width(const xed_decoded_inst_t* p); +/// @ingroup DEC +/// Return the immediate width in BITS. +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_get_immediate_width_bits(const xed_decoded_inst_t* p); +/// @ingroup DEC +XED_DLL_EXPORT xed_int32_t xed_decoded_inst_get_signed_immediate(const xed_decoded_inst_t* p); +/// @ingroup DEC +/// Return the second immediate. +static XED_INLINE xed_uint8_t xed_decoded_inst_get_second_immediate(const xed_decoded_inst_t* p) { + return STATIC_CAST(xed_uint8_t,p->_operands[XED_OPERAND_UIMM1]); +} + +/// @ingroup DEC +/// Return the specified register operand. The specifier is of type #xed_operand_enum_t . +static XED_INLINE xed_reg_enum_t xed_decoded_inst_get_reg(const xed_decoded_inst_t* p, + xed_operand_enum_t reg_operand) { + return STATIC_CAST(xed_reg_enum_t,p->_operands[reg_operand]); +} + + + +/// @ingroup DEC +XED_DLL_EXPORT const xed_simple_flag_t* xed_decoded_inst_get_rflags_info( const xed_decoded_inst_t* p ); +/// @ingroup DEC +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_uses_rflags(const xed_decoded_inst_t* p); +/// @ingroup DEC +XED_DLL_EXPORT xed_uint_t xed_decoded_inst_number_of_memory_operands(const xed_decoded_inst_t* p); +/// @ingroup DEC +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_mem_read(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_mem_written(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_mem_written_only(const xed_decoded_inst_t* p, unsigned int mem_idx); +/// @ingroup DEC +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_conditionally_writes_registers(const xed_decoded_inst_t* p); +/// @ingroup DEC +XED_DLL_EXPORT unsigned int xed_decoded_inst_get_memory_operand_length(const xed_decoded_inst_t* p, + unsigned int memop_idx); + + +/// @ingroup DEC +/// Returns true if the instruction is a prefetch +XED_DLL_EXPORT xed_bool_t xed_decoded_inst_is_prefetch(const xed_decoded_inst_t* p); +//@} + + +/// @name xed_decoded_inst_t Modification +//@{ +// Modifying decoded instructions before re-encoding +/// @ingroup DEC +XED_DLL_EXPORT void xed_decoded_inst_set_scale(xed_decoded_inst_t* p, xed_uint_t scale); +/// @ingroup DEC +/// Set the memory displacement using a BYTE length +XED_DLL_EXPORT void xed_decoded_inst_set_memory_displacement(xed_decoded_inst_t* p, xed_int64_t disp, xed_uint_t length_bytes); +/// @ingroup DEC +/// Set the branch displacement using a BYTE length +XED_DLL_EXPORT void xed_decoded_inst_set_branch_displacement(xed_decoded_inst_t* p, xed_int32_t disp, xed_uint_t length_bytes); +/// @ingroup DEC +/// Set the signed immediate a BYTE length +XED_DLL_EXPORT void xed_decoded_inst_set_immediate_signed(xed_decoded_inst_t* p, xed_int32_t x, xed_uint_t length_bytes); +/// @ingroup DEC +/// Set the unsigned immediate a BYTE length +XED_DLL_EXPORT void xed_decoded_inst_set_immediate_unsigned(xed_decoded_inst_t* p, xed_uint64_t x, xed_uint_t length_bytes); + + +/// @ingroup DEC +/// Set the memory displacement a BITS length +XED_DLL_EXPORT void xed_decoded_inst_set_memory_displacement_bits(xed_decoded_inst_t* p, xed_int64_t disp, xed_uint_t length_bits); +/// @ingroup DEC +/// Set the branch displacement a BITS length +XED_DLL_EXPORT void xed_decoded_inst_set_branch_displacement_bits(xed_decoded_inst_t* p, xed_int32_t disp, xed_uint_t length_bits); +/// @ingroup DEC +/// Set the signed immediate a BITS length +XED_DLL_EXPORT void xed_decoded_inst_set_immediate_signed_bits(xed_decoded_inst_t* p, xed_int32_t x, xed_uint_t length_bits); +/// @ingroup DEC +/// Set the unsigned immediate a BITS length +XED_DLL_EXPORT void xed_decoded_inst_set_immediate_unsigned_bits(xed_decoded_inst_t* p, xed_uint64_t x, xed_uint_t length_bits); + +//@} + +/// @name xed_decoded_inst_t User Data Field +//@{ +/// @ingroup DEC +/// Return a user data field for arbitrary use by the user after decoding. +static XED_INLINE xed_uint64_t xed_decoded_inst_get_user_data(xed_decoded_inst_t* p) { + return p->u.user_data; +} +/// @ingroup DEC +/// Modify the user data field. +static XED_INLINE void xed_decoded_inst_set_user_data(xed_decoded_inst_t* p, xed_uint64_t new_value) { + p->u.user_data = new_value; +} +//@} +#endif +//Local Variables: +//pref: "../../xed-decoded-inst.c" +//End: diff --git a/palacios/include/xed/xed-disas.h b/palacios/include/xed/xed-disas.h new file mode 100644 index 0000000..286697a --- /dev/null +++ b/palacios/include/xed/xed-disas.h @@ -0,0 +1,71 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-disas.h +/// @author Mark Charney + +#if !defined(_XED_DISAS_H_) +# define _XED_DISAS_H_ + +#include + +/// @ingroup PRINT +/// A #xed_disassembly_callback_fn_t takes an address, a pointer to a +/// symbol buffer of buffer_length bytes, and a pointer to an offset. The +/// function fills in the symbol_buffer and sets the offset to the desired +/// offset for that symbol. If the function succeeds, it returns 1. +// The call back should return 0 if the buffer is not long enough to +// include the null termination.If no symbolic information is +// located, the function returns zero. +/// @param address The input address for which we want symbolic name and offset +/// @param symbol_buffer A buffer to hold the symbol name. The callback function should fill this in and terminate +/// with a null byte. +/// @param buffer_length The maximum length of the symbol_buffer including then null +/// @param offset A pointer to a xed_uint64_t to old the offset from the provided symbol. +/// @param context This void* pointer passed to the disassembler's new interface so that the caller can identify +/// the proper context against which to resolve the symbols. +/// The disassembler passes this value to +/// the callback. The legacy formatters +/// that do not have context will pass zero for this parameter. +/// @return 0 on failure, 1 on success. +typedef int XED_DLL_EXPORT (*xed_disassembly_callback_fn_t)( + xed_uint64_t address, + char* symbol_buffer, + xed_uint32_t buffer_length, + xed_uint64_t* offset, + void* context); + +/// @ingroup PRINT +/// Register a disassembly call back function of type +/// #xed_disassembly_callback_fn_t to get called when the disassembler +/// needs to get a symbol and offset for an address. +XED_DLL_EXPORT void xed_register_disassembly_callback(xed_disassembly_callback_fn_t f); + +#endif diff --git a/palacios/include/xed/xed-encode-isa-functions.h b/palacios/include/xed/xed-encode-isa-functions.h new file mode 100644 index 0000000..5a13fb8 --- /dev/null +++ b/palacios/include/xed/xed-encode-isa-functions.h @@ -0,0 +1,48 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-encode-isa-functions.h +/// @author Mark Charney + +#ifndef _XED_ENCODE_ISA_FUNCTIONS_H_ +# define _XED_ENCODE_ISA_FUNCTIONS_H_ + +#include + + +xed_bool_t xed_encode_nonterminal_INSTRUCTIONS_EMIT(xed_encoder_request_t* xes); +xed_bool_t xed_encode_nonterminal_INSTRUCTIONS_BIND(xed_encoder_request_t* xes); + + +#endif + +//Local Variables: +//pref: "../../xed-encode-isa-functions.c" +//End: diff --git a/palacios/include/xed/xed-encode.h b/palacios/include/xed/xed-encode.h new file mode 100644 index 0000000..afa83f9 --- /dev/null +++ b/palacios/include/xed/xed-encode.h @@ -0,0 +1,298 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-encode.h +/// @author Mark Charney + + +#ifndef _XED_ENCODE_H_ +# define _XED_ENCODE_H_ +#include +#include +#include +#include +#include +#include //generated +#include //generated + +// we now (mostly) share the decode data structure +#include + + +// establish a type equivalence for the xed_encoder_request_t and the corresponding xed_decoded_inst_t. + +/// @ingroup ENC +typedef struct xed_decoded_inst_s xed_encoder_request_s; +/// @ingroup ENC +typedef xed_decoded_inst_t xed_encoder_request_t; + + +/// @ingroup ENC +XED_DLL_EXPORT xed_iclass_enum_t +xed_encoder_request_get_iclass( const xed_encoder_request_t* p); + +///////////////////////////////////////////////////////// +// set functions + +/// @ingroup ENC +XED_DLL_EXPORT void +xed_encoder_request_set_iclass( xed_encoder_request_t* p, + xed_iclass_enum_t iclass); + +/// @name Prefixes +//@{ +/// @ingroup ENC +/// For locked (atomic read-modify-write) memops requests. +XED_DLL_EXPORT void xed_encoder_request_set_lock(xed_encoder_request_t* p); +/// @ingroup ENC +/// for REP(F3) and REPNE(F2) prefixe on string ops +XED_DLL_EXPORT void xed_encoder_request_set_repne(xed_encoder_request_t* p); +/// @ingroup ENC +/// for REP(F3) and REPNE(F2) prefixe on string ops +XED_DLL_EXPORT void xed_encoder_request_set_rep(xed_encoder_request_t* p); +//@} + +/// @name Primary Encode Functions +//@{ +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_effective_operand_width( xed_encoder_request_t* p, + xed_uint_t width_bits); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_effective_address_size( xed_encoder_request_t* p, + xed_uint_t width_bits); +/*! @ingroup ENC + * Set the operands array element indexed by operand to the actual register name reg. + * + * @param[in] p xed_encoder_request_t + * @param[in] operand indicates which register operand storage field to use + * @param[in] reg the actual register represented (EAX, etc.) to store. + */ +XED_DLL_EXPORT void xed_encoder_request_set_reg(xed_encoder_request_t* p, + xed_operand_enum_t operand, + xed_reg_enum_t reg); +//@} + +/// @name Operand Order +//@{ +/*! @ingroup ENC + * Specify the name as the n'th operand in the operand order. + * + * The complication of this function is that the register operand names are + * specific to the position of the operand (REG0, REG1, REG2...). One can + * use this function for registers or one can use the + * xed_encoder_request_set_operand_name_reg() which takes integers instead + * of operand names. + * + * @param[in] p #xed_encoder_request_t + * @param[in] operand_index xed_uint_t representing n'th operand position + * @param[in] name #xed_operand_enum_t operand name. + */ +XED_DLL_EXPORT void xed_encoder_request_set_operand_order(xed_encoder_request_t* p, + xed_uint_t operand_index, + xed_operand_enum_t name); + +/*! @ingroup ENC + * Retreive the name of the n'th operand in the operand order. + * + * @param[in] p #xed_encoder_request_t + * @param[in] operand_index xed_uint_t representing n'th operand position + * @return The #xed_operand_enum_t operand name. + */ +XED_DLL_EXPORT xed_operand_enum_t xed_encoder_request_get_operand_order(xed_encoder_request_t* p, + xed_uint_t operand_index); + + +/// @ingroup ENC +/// Retreive the number of entries in the encoder operand order array +/// @return The number of entries in the encoder operand order array +static XED_INLINE +xed_uint_t xed_encoder_request_operand_order_entries(xed_encoder_request_t* p) { + return p->_n_operand_order; +} + +//@} + + +/// @name branches and far pointers +//@{ +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_relbr(xed_encoder_request_t* p); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_branch_displacement(xed_encoder_request_t* p, + xed_int32_t brdisp, + xed_uint_t nbytes); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_ptr(xed_encoder_request_t* p); +//@} + + +/// @name Immediates +//@{ +/// @ingroup ENC +/// Set the uimm0 using a BYTE width. +XED_DLL_EXPORT void xed_encoder_request_set_uimm0(xed_encoder_request_t* p, + xed_uint64_t uimm, + xed_uint_t nbytes); +/// @ingroup ENC +/// Set the uimm0 using a BIT width. +XED_DLL_EXPORT void xed_encoder_request_set_uimm0_bits(xed_encoder_request_t* p, + xed_uint64_t uimm, + xed_uint_t nbits); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_uimm1(xed_encoder_request_t* p, + xed_uint8_t uimm); +/// @ingroup ENC +/// same storage as uimm0 +XED_DLL_EXPORT void xed_encoder_request_set_simm(xed_encoder_request_t* p, + xed_int32_t simm, + xed_uint_t nbytes); +//@} + +/// @name Memory +//@{ +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_memory_displacement(xed_encoder_request_t* p, + xed_int64_t memdisp, + xed_uint_t nbytes); + +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_agen(xed_encoder_request_t* p); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_mem0(xed_encoder_request_t* p); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_mem1(xed_encoder_request_t* p); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_memory_operand_length(xed_encoder_request_t* p, + xed_uint_t nbytes); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_seg0(xed_encoder_request_t* p, + xed_reg_enum_t seg_reg); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_seg1(xed_encoder_request_t* p, + xed_reg_enum_t seg_reg); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_base0(xed_encoder_request_t* p, + xed_reg_enum_t base_reg); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_base1(xed_encoder_request_t* p, + xed_reg_enum_t base_reg) ; +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_index(xed_encoder_request_t* p, + xed_reg_enum_t index_reg); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_set_scale(xed_encoder_request_t* p, + xed_uint_t scale); +//@} + +////////////////////////////////////////////// +/// @ingroup ENC +XED_DLL_EXPORT const xed_operand_values_t* xed_encoder_request_operands_const(const xed_encoder_request_t* p); +/// @ingroup ENC +XED_DLL_EXPORT xed_operand_values_t* xed_encoder_request_operands(xed_encoder_request_t* p); + +/// @name Initialization +//@{ +/*! @ingroup ENC + * clear the operand order array + * @param[in] p xed_encoder_request_t + */ +XED_DLL_EXPORT void xed_encoder_request_zero_operand_order(xed_encoder_request_t* p); + +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_zero_set_mode(xed_encoder_request_t* p, + const xed_state_t* dstate); +/// @ingroup ENC +XED_DLL_EXPORT void xed_encoder_request_zero(xed_encoder_request_t* p) ; +//@} + +struct xed_decoded_inst_s; //fwd decl +/// @ingroup ENC +/// Converts an decoder request to a valid encoder request. +XED_DLL_EXPORT void xed_encoder_request_init_from_decode(struct xed_decoded_inst_s* d); + +void +xed_encoder_request_encode_emit(xed_encoder_request_t* q, + const unsigned int bits, + const xed_uint64_t value); + +xed_bool_t +xed_encoder_request__memop_compatible(const xed_encoder_request_t* p, + xed_operand_width_enum_t operand_width); + +/// @name String Printing +//@{ +/// @ingroup ENC +XED_DLL_EXPORT void xed_encode_request_print(const xed_encoder_request_t* p, + char* buf, xed_uint_t buflen); +//@} + +// Type signature for an encode function +typedef xed_uint_t (*xed_encode_function_pointer_t)(xed_encoder_request_t* enc_req); + + +/// @name Encoding +//@{ +/// This is the main interface to the encoder. The array should be +/// at most 15 bytes long. The ilen parameter should indiciate +/// this length. If the array is too short, the encoder may fail to +/// encode the request. Failure is indicated by a return value of +/// type #xed_error_enum_t that is not equal to +/// #XED_ERROR_NONE. Otherwise, #XED_ERROR_NONE is returned and the +/// length of the encoded instruction is returned in olen. +/// +/// @param r encoder request description (#xed_encoder_request_t), includes mode info +/// @param array the encoded instruction bytes are stored here +/// @param ilen the input length of array. +/// @param olen the actual length of array used for encoding +/// @return success/failure as a #xed_error_enum_t +/// @ingroup ENC +XED_DLL_EXPORT xed_error_enum_t +xed_encode(xed_encoder_request_t* r, + xed_uint8_t* array, + const unsigned int ilen, + unsigned int* olen); + +/// This function will attempt to encode a NOP of exactly ilen +/// bytes. If such a NOP is not encodeable, then false will be returned. +/// +/// @param array the encoded instruction bytes are stored here +/// @param ilen the input length array. +/// @return success/failure as a #xed_error_enum_t +/// @ingroup ENC +XED_DLL_EXPORT xed_error_enum_t +xed_encode_nop(xed_uint8_t* array, + const unsigned int ilen); +//@} + +#endif +//////////////////////////////////////////////////////////////////////////// +//Local Variables: +//pref: "../../xed-encode.c" +//End: diff --git a/palacios/include/xed/xed-encoder-gen-defs.h b/palacios/include/xed/xed-encoder-gen-defs.h new file mode 100644 index 0000000..1354a1b --- /dev/null +++ b/palacios/include/xed/xed-encoder-gen-defs.h @@ -0,0 +1,41 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-encoder-gen-defs.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_ENCODER_GEN_DEFS_H_) +# define _XED_ENCODER_GEN_DEFS_H_ +#define XED_ENCODE_ORDER_MAX_ENTRIES 23 +#define XED_ENCODE_ORDER_MAX_OPERANDS 4 +#endif diff --git a/palacios/include/xed/xed-encoder-iforms.h b/palacios/include/xed/xed-encoder-iforms.h new file mode 100644 index 0000000..e64b57e --- /dev/null +++ b/palacios/include/xed/xed-encoder-iforms.h @@ -0,0 +1,60 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-encoder-iforms.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_ENCODER_IFORMS_H_) +# define _XED_ENCODER_IFORMS_H_ +#include +typedef struct xed_encoder_iforms_s { + xed_uint16_t x_UIMM16; + xed_uint16_t x_UIMM8_1; + xed_uint16_t x_MEMDISP32; + xed_uint16_t x_MEMDISPv; + xed_uint16_t x_MEMDISP8; + xed_uint16_t x_MEMDISP16; + xed_uint16_t x_UIMM8; + xed_uint16_t x_SIB_NT; + xed_uint16_t x_REX_PREFIX_ENC; + xed_uint16_t x_INSTRUCTIONS; + xed_uint16_t x_SIMMz; + xed_uint16_t x_SIMM8; + xed_uint16_t x_UIMMv; + xed_uint16_t x_DISP_NT; + xed_uint16_t x_PREFIX_ENC; + xed_uint16_t x_BRDISP8; + xed_uint16_t x_BRDISPz; + xed_uint16_t x_UIMM32; +} xed_encoder_iforms_t; +#endif diff --git a/palacios/include/xed/xed-error-enum.h b/palacios/include/xed/xed-error-enum.h new file mode 100644 index 0000000..f0b5341 --- /dev/null +++ b/palacios/include/xed/xed-error-enum.h @@ -0,0 +1,55 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-error-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_ERROR_ENUM_H_) +# define _XED_ERROR_ENUM_H_ +#include +typedef enum { + XED_ERROR_NONE, ///< There was no error + XED_ERROR_BUFFER_TOO_SHORT, ///< There were not enough bytes in the given buffer + XED_ERROR_GENERAL_ERROR, ///< XED could not decode the given instruction + XED_ERROR_BAD_REGISTER, ///< XED could not decode the given instruction because an invalid register encoding was used. + XED_ERROR_BAD_LOCK_PREFIX, ///< A lock prefix was found where none is allowed. + XED_ERROR_BAD_REP_PREFIX, ///< An F2 or F3 prefix was found where none is allowed. + XED_ERROR_LAST +} xed_error_enum_t; + +XED_DLL_EXPORT xed_error_enum_t +str2xed_error_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_error_enum_t2str(const xed_error_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-extension-enum.h b/palacios/include/xed/xed-extension-enum.h new file mode 100644 index 0000000..1338d60 --- /dev/null +++ b/palacios/include/xed/xed-extension-enum.h @@ -0,0 +1,65 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-extension-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_EXTENSION_ENUM_H_) +# define _XED_EXTENSION_ENUM_H_ +#include +typedef enum { + XED_EXTENSION_INVALID, + XED_EXTENSION_3DNOW, + XED_EXTENSION_AMD, + XED_EXTENSION_BASE, + XED_EXTENSION_LONGMODE, + XED_EXTENSION_MMX, + XED_EXTENSION_SSE, + XED_EXTENSION_SSE2, + XED_EXTENSION_SSE3, + XED_EXTENSION_SSE4, + XED_EXTENSION_SSE4A, + XED_EXTENSION_SSSE3, + XED_EXTENSION_SVM, + XED_EXTENSION_VTX, + XED_EXTENSION_X87, + XED_EXTENSION_XSAVE, + XED_EXTENSION_LAST +} xed_extension_enum_t; + +XED_DLL_EXPORT xed_extension_enum_t +str2xed_extension_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_extension_enum_t2str(const xed_extension_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-flag-action-enum.h b/palacios/include/xed/xed-flag-action-enum.h new file mode 100644 index 0000000..b42f75c --- /dev/null +++ b/palacios/include/xed/xed-flag-action-enum.h @@ -0,0 +1,57 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-flag-action-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_FLAG_ACTION_ENUM_H_) +# define _XED_FLAG_ACTION_ENUM_H_ +#include +typedef enum { + XED_FLAG_ACTION_INVALID, + XED_FLAG_ACTION_u, ///< undefined (treated as a write) + XED_FLAG_ACTION_tst, ///< test (read) + XED_FLAG_ACTION_mod, ///< modification (write) + XED_FLAG_ACTION_0, ///< value will be zero (write) + XED_FLAG_ACTION_pop, ///< value comes from the stack (write) + XED_FLAG_ACTION_ah, ///< value comes from AH (write) + XED_FLAG_ACTION_1, ///< value will be 1 (write) + XED_FLAG_ACTION_LAST +} xed_flag_action_enum_t; + +XED_DLL_EXPORT xed_flag_action_enum_t +str2xed_flag_action_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_flag_action_enum_t2str(const xed_flag_action_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-flag-enum.h b/palacios/include/xed/xed-flag-enum.h new file mode 100644 index 0000000..5ab387c --- /dev/null +++ b/palacios/include/xed/xed-flag-enum.h @@ -0,0 +1,71 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-flag-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_FLAG_ENUM_H_) +# define _XED_FLAG_ENUM_H_ +#include +typedef enum { + XED_FLAG_INVALID, + XED_FLAG_of, ///<< overflow flag + XED_FLAG_sf, ///< sign flag + XED_FLAG_zf, ///< zero flag + XED_FLAG_af, ///< auxilliary flag + XED_FLAG_pf, ///< parity flag + XED_FLAG_cf, ///< carry flag + XED_FLAG_df, ///< direction flag + XED_FLAG_vif, ///< virtual interrupt flag + XED_FLAG_iopl, ///< I/O privilege level + XED_FLAG_if, ///< interrupt flag + XED_FLAG_ac, ///< alignment check + XED_FLAG_vm, ///< virtual-8086 mode + XED_FLAG_rf, ///< resume flag + XED_FLAG_nt, ///< nested task + XED_FLAG_tf, ///< traf flag + XED_FLAG_id, ///< ID flag + XED_FLAG_vip, ///< virtual interrupt pending + XED_FLAG_fc0, ///< x87 FC0 flag + XED_FLAG_fc1, ///< x87 FC1 flag + XED_FLAG_fc2, ///< x87 FC2 flag + XED_FLAG_fc3, ///< x87 FC3 flag + XED_FLAG_LAST +} xed_flag_enum_t; + +XED_DLL_EXPORT xed_flag_enum_t +str2xed_flag_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_flag_enum_t2str(const xed_flag_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-flags.h b/palacios/include/xed/xed-flags.h new file mode 100644 index 0000000..ca41e62 --- /dev/null +++ b/palacios/include/xed/xed-flags.h @@ -0,0 +1,210 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-flags.h +/// @author Mark Charney + +#ifndef _XED_FLAGS_H_ +# define _XED_FLAGS_H_ + +#include +#include +#include + + +//////////////////////////////////////////////////////////////////////////// +/// @ingroup FLAGS +/// a union of flags bits +union XED_DLL_EXPORT xed_flag_set_s { + struct { + xed_uint32_t of:1; + xed_uint32_t sf:1; + xed_uint32_t zf:1; + xed_uint32_t af:1; + xed_uint32_t pf:1; + xed_uint32_t cf:1; + xed_uint32_t df:1; + xed_uint32_t vif:1; + xed_uint32_t iopl:1; + xed_uint32_t _if:1; ///< underscore to avoid token clash + xed_uint32_t ac:1; + xed_uint32_t vm:1; + xed_uint32_t rf:1; + xed_uint32_t nt:1; + xed_uint32_t tf:1; + xed_uint32_t id:1; + xed_uint32_t vip:1; + xed_uint32_t fc0:1; ///< x87 flag FC0 + xed_uint32_t fc1:1; ///< x87 flag FC1 + xed_uint32_t fc2:1; ///< x87 flag FC2 + xed_uint32_t fc3:1; ///< x87 flag FC3 + } s; + xed_uint32_t flat; +}; + +typedef union xed_flag_set_s xed_flag_set_t; +/// @ingroup FLAGS +/// @name Flag-set accessors +//@{ +/// @ingroup FLAGS +/// print the flag set in the supplied buffer +XED_DLL_EXPORT int xed_flag_set_print(const xed_flag_set_t* p, char* buf, int buflen); +/// @ingroup FLAGS +/// returns true if this object has a subset of the flags of the +/// "other" object. +XED_DLL_EXPORT xed_bool_t xed_flag_set_is_subset_of(const xed_flag_set_t* p, + const xed_flag_set_t* other); +//@} + + +//////////////////////////////////////////////////////////////////////////// + +/// @ingroup FLAGS +/// Associated with each flag field there can be one action. +typedef struct XED_DLL_EXPORT xed_flag_enum_s { + xed_flag_enum_t flag; + // there are at most two actions per flag. The 2nd may be invalid. + xed_flag_action_enum_t action; +} xed_flag_action_t; + + + + +/// @ingroup FLAGS +/// @name Lowest-level flag-action accessors +//@{ +/// @ingroup FLAGS +/// get the name of the flag +XED_DLL_EXPORT xed_flag_enum_t +xed_flag_action_get_flag_name(const xed_flag_action_t* p); +/// @ingroup FLAGS +/// return the action +XED_DLL_EXPORT xed_flag_action_enum_t +xed_flag_action_get_action(const xed_flag_action_t* p, unsigned int i); +/// @ingroup FLAGS +/// returns true if the specified action is invalid. Only the 2nd flag might be invalid. +XED_DLL_EXPORT xed_bool_t +xed_flag_action_action_invalid(const xed_flag_action_enum_t a); +/// @ingroup FLAGS +/// print the flag & actions +XED_DLL_EXPORT int xed_flag_action_print(const xed_flag_action_t* p, char* buf, int buflen); +/// @ingroup FLAGS +/// returns true if either action is a read +XED_DLL_EXPORT xed_bool_t +xed_flag_action_read_flag(const xed_flag_action_t* p ); +/// @ingroup FLAGS +/// returns true if either action is a write +XED_DLL_EXPORT xed_bool_t +xed_flag_action_writes_flag(const xed_flag_action_t* p); + +/// @ingroup FLAGS +/// test to see if the specific action is a read +XED_DLL_EXPORT xed_bool_t +xed_flag_action_read_action( xed_flag_action_enum_t a); +/// @ingroup FLAGS +/// test to see if a specific action is a write +XED_DLL_EXPORT xed_bool_t +xed_flag_action_write_action( xed_flag_action_enum_t a); +//@} + +//////////////////////////////////////////////////////////////////////////// + +#define XED_MAX_FLAG_ACTIONS (XED_FLAG_LAST + 3) +/// @ingroup FLAGS +/// A collection of #xed_flag_action_t's and unions of read and written flags +typedef struct XED_DLL_EXPORT xed_simple_flag_s +{ + xed_uint8_t nflags; + + xed_bool_t may_write :1; + xed_bool_t must_write :1; + + /// indexed from 0, not by position in archtectural flags array. + xed_flag_action_t fa[XED_MAX_FLAG_ACTIONS]; + + ///union of read flags + xed_flag_set_t read; + + /// union of written flags; + xed_flag_set_t written; +} xed_simple_flag_t; + +/// @ingroup FLAGS +/// @name Accessing the simple flags (Mid-level access) +//@{ +/// @ingroup FLAGS +/// returns the number of flag-actions +XED_DLL_EXPORT unsigned int +xed_simple_flag_get_nflags(const xed_simple_flag_t* p); + +/// @ingroup FLAGS +/// return union of bits for read flags +XED_DLL_EXPORT const xed_flag_set_t* +xed_simple_flag_get_read_flag_set(const xed_simple_flag_t* p); + +/// @ingroup FLAGS +/// return union of bits for written flags +XED_DLL_EXPORT const xed_flag_set_t* +xed_simple_flag_get_written_flag_set(const xed_simple_flag_t* p); + +/// @ingroup FLAGS +/// Indicates the flags are only conditionally written. Usally MAY-writes +/// of the flags instructions that are dependent on a REP count. +XED_DLL_EXPORT xed_bool_t xed_simple_flag_get_may_write(const xed_simple_flag_t* p); + +/// @ingroup FLAGS +/// the flags always written +XED_DLL_EXPORT xed_bool_t xed_simple_flag_get_must_write(const xed_simple_flag_t* p); + +/// @ingroup FLAGS +/// return the specific flag-action. Very detailed low level information +XED_DLL_EXPORT const xed_flag_action_t* +xed_simple_flag_get_flag_action(const xed_simple_flag_t* p, unsigned int i); + +/// @ingroup FLAGS +/// boolean test to see if flags are read, scans the flags +XED_DLL_EXPORT xed_bool_t +xed_simple_flag_reads_flags(const xed_simple_flag_t* p); + +/// @ingroup FLAGS +/// boolean test to see if flags are written, scans the flags +XED_DLL_EXPORT xed_bool_t xed_simple_flag_writes_flags(const xed_simple_flag_t* p); + +/// @ingroup FLAGS +/// print the flags +XED_DLL_EXPORT int xed_simple_flag_print(const xed_simple_flag_t* p, char* buf, int buflen); +//@} + +//////////////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////////////// + +#endif diff --git a/palacios/include/xed/xed-gen-table-defs.h b/palacios/include/xed/xed-gen-table-defs.h new file mode 100644 index 0000000..508be38 --- /dev/null +++ b/palacios/include/xed/xed-gen-table-defs.h @@ -0,0 +1,48 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-gen-table-defs.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_GEN_TABLE_DEFS_H_) +# define _XED_GEN_TABLE_DEFS_H_ +#define XED_MAX_ATTRIBUTE_COUNT 17 +#define XED_MAX_GRAPH_NODES 8975 +#define XED_MAX_GRAPH_NEXT_NODES 10668 +#define XED_MAX_INST_TABLE_NODES 1943 +#define XED_MAX_OPERAND_TABLE_NODES 4909 +#define XED_MAX_REQUIRED_SIMPLE_FLAGS_ENTRIES 780 +#define XED_MAX_REQUIRED_COMPLEX_FLAGS_ENTRIES 53 +#define XED_MAX_IFORMS 1481 +#define XED_MAX_IFORMS_PER_ICLASS 18 +#endif diff --git a/palacios/include/xed/xed-iclass-enum.h b/palacios/include/xed/xed-iclass-enum.h new file mode 100644 index 0000000..3a776af --- /dev/null +++ b/palacios/include/xed/xed-iclass-enum.h @@ -0,0 +1,683 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-iclass-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_ICLASS_ENUM_H_) +# define _XED_ICLASS_ENUM_H_ +#include +typedef enum { + XED_ICLASS_INVALID, + XED_ICLASS_AAA, + XED_ICLASS_AAD, + XED_ICLASS_AAM, + XED_ICLASS_AAS, + XED_ICLASS_ADC, + XED_ICLASS_ADD, + XED_ICLASS_ADDPD, + XED_ICLASS_ADDPS, + XED_ICLASS_ADDSD, + XED_ICLASS_ADDSS, + XED_ICLASS_ADDSUBPD, + XED_ICLASS_ADDSUBPS, + XED_ICLASS_AND, + XED_ICLASS_ANDNPD, + XED_ICLASS_ANDNPS, + XED_ICLASS_ANDPD, + XED_ICLASS_ANDPS, + XED_ICLASS_ARPL, + XED_ICLASS_BLENDPD, + XED_ICLASS_BLENDPS, + XED_ICLASS_BLENDVPD, + XED_ICLASS_BLENDVPS, + XED_ICLASS_BOUND, + XED_ICLASS_BSF, + XED_ICLASS_BSR, + XED_ICLASS_BSWAP, + XED_ICLASS_BT, + XED_ICLASS_BTC, + XED_ICLASS_BTR, + XED_ICLASS_BTS, + XED_ICLASS_CALL_FAR, + XED_ICLASS_CALL_NEAR, + XED_ICLASS_CBW, + XED_ICLASS_CDQ, + XED_ICLASS_CDQE, + XED_ICLASS_CLC, + XED_ICLASS_CLD, + XED_ICLASS_CLFLUSH, + XED_ICLASS_CLGI, + XED_ICLASS_CLI, + XED_ICLASS_CLTS, + XED_ICLASS_CMC, + XED_ICLASS_CMOVB, + XED_ICLASS_CMOVBE, + XED_ICLASS_CMOVL, + XED_ICLASS_CMOVLE, + XED_ICLASS_CMOVNB, + XED_ICLASS_CMOVNBE, + XED_ICLASS_CMOVNL, + XED_ICLASS_CMOVNLE, + XED_ICLASS_CMOVNO, + XED_ICLASS_CMOVNP, + XED_ICLASS_CMOVNS, + XED_ICLASS_CMOVNZ, + XED_ICLASS_CMOVO, + XED_ICLASS_CMOVP, + XED_ICLASS_CMOVS, + XED_ICLASS_CMOVZ, + XED_ICLASS_CMP, + XED_ICLASS_CMPPD, + XED_ICLASS_CMPPS, + XED_ICLASS_CMPSB, + XED_ICLASS_CMPSD, + XED_ICLASS_CMPSD_XMM, + XED_ICLASS_CMPSQ, + XED_ICLASS_CMPSS, + XED_ICLASS_CMPSW, + XED_ICLASS_CMPXCHG, + XED_ICLASS_CMPXCHG16B, + XED_ICLASS_CMPXCHG8B, + XED_ICLASS_COMISD, + XED_ICLASS_COMISS, + XED_ICLASS_CPUID, + XED_ICLASS_CQO, + XED_ICLASS_CRC32, + XED_ICLASS_CVTDQ2PD, + XED_ICLASS_CVTDQ2PS, + XED_ICLASS_CVTPD2DQ, + XED_ICLASS_CVTPD2PI, + XED_ICLASS_CVTPD2PS, + XED_ICLASS_CVTPI2PD, + XED_ICLASS_CVTPI2PS, + XED_ICLASS_CVTPS2DQ, + XED_ICLASS_CVTPS2PD, + XED_ICLASS_CVTPS2PI, + XED_ICLASS_CVTSD2SI, + XED_ICLASS_CVTSD2SS, + XED_ICLASS_CVTSI2SD, + XED_ICLASS_CVTSI2SS, + XED_ICLASS_CVTSS2SD, + XED_ICLASS_CVTSS2SI, + XED_ICLASS_CVTTPD2DQ, + XED_ICLASS_CVTTPD2PI, + XED_ICLASS_CVTTPS2DQ, + XED_ICLASS_CVTTPS2PI, + XED_ICLASS_CVTTSD2SI, + XED_ICLASS_CVTTSS2SI, + XED_ICLASS_CWD, + XED_ICLASS_CWDE, + XED_ICLASS_DAA, + XED_ICLASS_DAS, + XED_ICLASS_DEC, + XED_ICLASS_DIV, + XED_ICLASS_DIVPD, + XED_ICLASS_DIVPS, + XED_ICLASS_DIVSD, + XED_ICLASS_DIVSS, + XED_ICLASS_DPPD, + XED_ICLASS_DPPS, + XED_ICLASS_EMMS, + XED_ICLASS_ENTER, + XED_ICLASS_EXTRACTPS, + XED_ICLASS_EXTRQ, + XED_ICLASS_F2XM1, + XED_ICLASS_FABS, + XED_ICLASS_FADD, + XED_ICLASS_FADDP, + XED_ICLASS_FBLD, + XED_ICLASS_FBSTP, + XED_ICLASS_FCHS, + XED_ICLASS_FCMOVB, + XED_ICLASS_FCMOVBE, + XED_ICLASS_FCMOVE, + XED_ICLASS_FCMOVNB, + XED_ICLASS_FCMOVNBE, + XED_ICLASS_FCMOVNE, + XED_ICLASS_FCMOVNU, + XED_ICLASS_FCMOVU, + XED_ICLASS_FCOM, + XED_ICLASS_FCOMI, + XED_ICLASS_FCOMIP, + XED_ICLASS_FCOMP, + XED_ICLASS_FCOMPP, + XED_ICLASS_FCOS, + XED_ICLASS_FDECSTP, + XED_ICLASS_FDIV, + XED_ICLASS_FDIVP, + XED_ICLASS_FDIVR, + XED_ICLASS_FDIVRP, + XED_ICLASS_FEMMS, + XED_ICLASS_FFREE, + XED_ICLASS_FFREEP, + XED_ICLASS_FIADD, + XED_ICLASS_FICOM, + XED_ICLASS_FICOMP, + XED_ICLASS_FIDIV, + XED_ICLASS_FIDIVR, + XED_ICLASS_FILD, + XED_ICLASS_FIMUL, + XED_ICLASS_FINCSTP, + XED_ICLASS_FIST, + XED_ICLASS_FISTP, + XED_ICLASS_FISTTP, + XED_ICLASS_FISUB, + XED_ICLASS_FISUBR, + XED_ICLASS_FLD, + XED_ICLASS_FLD1, + XED_ICLASS_FLDCW, + XED_ICLASS_FLDENV, + XED_ICLASS_FLDL2E, + XED_ICLASS_FLDL2T, + XED_ICLASS_FLDLG2, + XED_ICLASS_FLDLN2, + XED_ICLASS_FLDPI, + XED_ICLASS_FLDZ, + XED_ICLASS_FMUL, + XED_ICLASS_FMULP, + XED_ICLASS_FNCLEX, + XED_ICLASS_FNINIT, + XED_ICLASS_FNOP, + XED_ICLASS_FNSAVE, + XED_ICLASS_FNSTCW, + XED_ICLASS_FNSTENV, + XED_ICLASS_FNSTSW, + XED_ICLASS_FPATAN, + XED_ICLASS_FPREM, + XED_ICLASS_FPREM1, + XED_ICLASS_FPTAN, + XED_ICLASS_FRNDINT, + XED_ICLASS_FRSTOR, + XED_ICLASS_FSCALE, + XED_ICLASS_FSETPM287_NOP, + XED_ICLASS_FSIN, + XED_ICLASS_FSINCOS, + XED_ICLASS_FSQRT, + XED_ICLASS_FST, + XED_ICLASS_FSTP, + XED_ICLASS_FSUB, + XED_ICLASS_FSUBP, + XED_ICLASS_FSUBR, + XED_ICLASS_FSUBRP, + XED_ICLASS_FTST, + XED_ICLASS_FUCOM, + XED_ICLASS_FUCOMI, + XED_ICLASS_FUCOMIP, + XED_ICLASS_FUCOMP, + XED_ICLASS_FUCOMPP, + XED_ICLASS_FWAIT, + XED_ICLASS_FXAM, + XED_ICLASS_FXCH, + XED_ICLASS_FXRSTOR, + XED_ICLASS_FXSAVE, + XED_ICLASS_FXTRACT, + XED_ICLASS_FYL2X, + XED_ICLASS_FYL2XP1, + XED_ICLASS_HADDPD, + XED_ICLASS_HADDPS, + XED_ICLASS_HLT, + XED_ICLASS_HSUBPD, + XED_ICLASS_HSUBPS, + XED_ICLASS_IDIV, + XED_ICLASS_IMUL, + XED_ICLASS_IN, + XED_ICLASS_INC, + XED_ICLASS_INSB, + XED_ICLASS_INSD, + XED_ICLASS_INSERTPS, + XED_ICLASS_INSERTQ, + XED_ICLASS_INSW, + XED_ICLASS_INT, + XED_ICLASS_INT1, + XED_ICLASS_INT3, + XED_ICLASS_INTO, + XED_ICLASS_INVD, + XED_ICLASS_INVLPG, + XED_ICLASS_INVLPGA, + XED_ICLASS_IRET, + XED_ICLASS_IRETD, + XED_ICLASS_IRETQ, + XED_ICLASS_JB, + XED_ICLASS_JBE, + XED_ICLASS_JL, + XED_ICLASS_JLE, + XED_ICLASS_JMP, + XED_ICLASS_JMP_FAR, + XED_ICLASS_JNB, + XED_ICLASS_JNBE, + XED_ICLASS_JNL, + XED_ICLASS_JNLE, + XED_ICLASS_JNO, + XED_ICLASS_JNP, + XED_ICLASS_JNS, + XED_ICLASS_JNZ, + XED_ICLASS_JO, + XED_ICLASS_JP, + XED_ICLASS_JRCXZ, + XED_ICLASS_JS, + XED_ICLASS_JZ, + XED_ICLASS_LAHF, + XED_ICLASS_LAR, + XED_ICLASS_LDDQU, + XED_ICLASS_LDMXCSR, + XED_ICLASS_LDS, + XED_ICLASS_LEA, + XED_ICLASS_LEAVE, + XED_ICLASS_LES, + XED_ICLASS_LFENCE, + XED_ICLASS_LFS, + XED_ICLASS_LGDT, + XED_ICLASS_LGS, + XED_ICLASS_LIDT, + XED_ICLASS_LLDT, + XED_ICLASS_LMSW, + XED_ICLASS_LODSB, + XED_ICLASS_LODSD, + XED_ICLASS_LODSQ, + XED_ICLASS_LODSW, + XED_ICLASS_LOOP, + XED_ICLASS_LOOPE, + XED_ICLASS_LOOPNE, + XED_ICLASS_LSL, + XED_ICLASS_LSS, + XED_ICLASS_LTR, + XED_ICLASS_LZCNT, + XED_ICLASS_MASKMOVDQU, + XED_ICLASS_MASKMOVQ, + XED_ICLASS_MAXPD, + XED_ICLASS_MAXPS, + XED_ICLASS_MAXSD, + XED_ICLASS_MAXSS, + XED_ICLASS_MFENCE, + XED_ICLASS_MINPD, + XED_ICLASS_MINPS, + XED_ICLASS_MINSD, + XED_ICLASS_MINSS, + XED_ICLASS_MONITOR, + XED_ICLASS_MOV, + XED_ICLASS_MOVAPD, + XED_ICLASS_MOVAPS, + XED_ICLASS_MOVD, + XED_ICLASS_MOVDDUP, + XED_ICLASS_MOVDQ2Q, + XED_ICLASS_MOVDQA, + XED_ICLASS_MOVDQU, + XED_ICLASS_MOVHLPS, + XED_ICLASS_MOVHPD, + XED_ICLASS_MOVHPS, + XED_ICLASS_MOVLHPS, + XED_ICLASS_MOVLPD, + XED_ICLASS_MOVLPS, + XED_ICLASS_MOVMSKPD, + XED_ICLASS_MOVMSKPS, + XED_ICLASS_MOVNTDQ, + XED_ICLASS_MOVNTDQA, + XED_ICLASS_MOVNTI, + XED_ICLASS_MOVNTPD, + XED_ICLASS_MOVNTPS, + XED_ICLASS_MOVNTQ, + XED_ICLASS_MOVNTSD, + XED_ICLASS_MOVNTSS, + XED_ICLASS_MOVQ, + XED_ICLASS_MOVQ2DQ, + XED_ICLASS_MOVSB, + XED_ICLASS_MOVSD, + XED_ICLASS_MOVSD_XMM, + XED_ICLASS_MOVSHDUP, + XED_ICLASS_MOVSLDUP, + XED_ICLASS_MOVSQ, + XED_ICLASS_MOVSS, + XED_ICLASS_MOVSW, + XED_ICLASS_MOVSX, + XED_ICLASS_MOVSXD, + XED_ICLASS_MOVUPD, + XED_ICLASS_MOVUPS, + XED_ICLASS_MOVZX, + XED_ICLASS_MOV_CR, + XED_ICLASS_MOV_DR, + XED_ICLASS_MPSADBW, + XED_ICLASS_MUL, + XED_ICLASS_MULPD, + XED_ICLASS_MULPS, + XED_ICLASS_MULSD, + XED_ICLASS_MULSS, + XED_ICLASS_MWAIT, + XED_ICLASS_NEG, + XED_ICLASS_NOP, + XED_ICLASS_NOP2, + XED_ICLASS_NOP3, + XED_ICLASS_NOP4, + XED_ICLASS_NOP5, + XED_ICLASS_NOP6, + XED_ICLASS_NOP7, + XED_ICLASS_NOP8, + XED_ICLASS_NOP9, + XED_ICLASS_NOT, + XED_ICLASS_OR, + XED_ICLASS_ORPD, + XED_ICLASS_ORPS, + XED_ICLASS_OUT, + XED_ICLASS_OUTSB, + XED_ICLASS_OUTSD, + XED_ICLASS_OUTSW, + XED_ICLASS_PABSB, + XED_ICLASS_PABSD, + XED_ICLASS_PABSW, + XED_ICLASS_PACKSSDW, + XED_ICLASS_PACKSSWB, + XED_ICLASS_PACKUSDW, + XED_ICLASS_PACKUSWB, + XED_ICLASS_PADDB, + XED_ICLASS_PADDD, + XED_ICLASS_PADDQ, + XED_ICLASS_PADDSB, + XED_ICLASS_PADDSW, + XED_ICLASS_PADDUSB, + XED_ICLASS_PADDUSW, + XED_ICLASS_PADDW, + XED_ICLASS_PALIGNR, + XED_ICLASS_PAND, + XED_ICLASS_PANDN, + XED_ICLASS_PAUSE, + XED_ICLASS_PAVGB, + XED_ICLASS_PAVGUSB, + XED_ICLASS_PAVGW, + XED_ICLASS_PBLENDVB, + XED_ICLASS_PBLENDW, + XED_ICLASS_PCMPEQB, + XED_ICLASS_PCMPEQD, + XED_ICLASS_PCMPEQQ, + XED_ICLASS_PCMPEQW, + XED_ICLASS_PCMPESTRI, + XED_ICLASS_PCMPESTRM, + XED_ICLASS_PCMPGTB, + XED_ICLASS_PCMPGTD, + XED_ICLASS_PCMPGTQ, + XED_ICLASS_PCMPGTW, + XED_ICLASS_PCMPISTRI, + XED_ICLASS_PCMPISTRM, + XED_ICLASS_PEXTRB, + XED_ICLASS_PEXTRD, + XED_ICLASS_PEXTRQ, + XED_ICLASS_PEXTRW, + XED_ICLASS_PF2ID, + XED_ICLASS_PF2IW, + XED_ICLASS_PFACC, + XED_ICLASS_PFADD, + XED_ICLASS_PFCMPEQ, + XED_ICLASS_PFCMPGE, + XED_ICLASS_PFCMPGT, + XED_ICLASS_PFCPIT1, + XED_ICLASS_PFMAX, + XED_ICLASS_PFMIN, + XED_ICLASS_PFMUL, + XED_ICLASS_PFNACC, + XED_ICLASS_PFPNACC, + XED_ICLASS_PFRCP, + XED_ICLASS_PFRCPIT2, + XED_ICLASS_PFRSQIT1, + XED_ICLASS_PFSQRT, + XED_ICLASS_PFSUB, + XED_ICLASS_PFSUBR, + XED_ICLASS_PHADDD, + XED_ICLASS_PHADDSW, + XED_ICLASS_PHADDW, + XED_ICLASS_PHMINPOSUW, + XED_ICLASS_PHSUBD, + XED_ICLASS_PHSUBSW, + XED_ICLASS_PHSUBW, + XED_ICLASS_PI2FD, + XED_ICLASS_PI2FW, + XED_ICLASS_PINSRB, + XED_ICLASS_PINSRD, + XED_ICLASS_PINSRQ, + XED_ICLASS_PINSRW, + XED_ICLASS_PMADDUBSW, + XED_ICLASS_PMADDWD, + XED_ICLASS_PMAXSB, + XED_ICLASS_PMAXSD, + XED_ICLASS_PMAXSW, + XED_ICLASS_PMAXUB, + XED_ICLASS_PMAXUD, + XED_ICLASS_PMAXUW, + XED_ICLASS_PMINSB, + XED_ICLASS_PMINSD, + XED_ICLASS_PMINSW, + XED_ICLASS_PMINUB, + XED_ICLASS_PMINUD, + XED_ICLASS_PMINUW, + XED_ICLASS_PMOVMSKB, + XED_ICLASS_PMOVSXBD, + XED_ICLASS_PMOVSXBQ, + XED_ICLASS_PMOVSXBW, + XED_ICLASS_PMOVSXDQ, + XED_ICLASS_PMOVSXWD, + XED_ICLASS_PMOVSXWQ, + XED_ICLASS_PMOVZXBD, + XED_ICLASS_PMOVZXBQ, + XED_ICLASS_PMOVZXBW, + XED_ICLASS_PMOVZXDQ, + XED_ICLASS_PMOVZXWD, + XED_ICLASS_PMOVZXWQ, + XED_ICLASS_PMULDQ, + XED_ICLASS_PMULHRSW, + XED_ICLASS_PMULHRW, + XED_ICLASS_PMULHUW, + XED_ICLASS_PMULHW, + XED_ICLASS_PMULLD, + XED_ICLASS_PMULLW, + XED_ICLASS_PMULUDQ, + XED_ICLASS_POP, + XED_ICLASS_POPA, + XED_ICLASS_POPAD, + XED_ICLASS_POPCNT, + XED_ICLASS_POPF, + XED_ICLASS_POPFD, + XED_ICLASS_POPFQ, + XED_ICLASS_POR, + XED_ICLASS_PREFETCHNTA, + XED_ICLASS_PREFETCHT0, + XED_ICLASS_PREFETCHT1, + XED_ICLASS_PREFETCHT2, + XED_ICLASS_PREFETCH_EXCLUSIVE, + XED_ICLASS_PREFETCH_MODIFIED, + XED_ICLASS_PREFETCH_RESERVED, + XED_ICLASS_PSADBW, + XED_ICLASS_PSHUFB, + XED_ICLASS_PSHUFD, + XED_ICLASS_PSHUFHW, + XED_ICLASS_PSHUFLW, + XED_ICLASS_PSHUFW, + XED_ICLASS_PSIGNB, + XED_ICLASS_PSIGND, + XED_ICLASS_PSIGNW, + XED_ICLASS_PSLLD, + XED_ICLASS_PSLLDQ, + XED_ICLASS_PSLLQ, + XED_ICLASS_PSLLW, + XED_ICLASS_PSRAD, + XED_ICLASS_PSRAW, + XED_ICLASS_PSRLD, + XED_ICLASS_PSRLDQ, + XED_ICLASS_PSRLQ, + XED_ICLASS_PSRLW, + XED_ICLASS_PSUBB, + XED_ICLASS_PSUBD, + XED_ICLASS_PSUBQ, + XED_ICLASS_PSUBSB, + XED_ICLASS_PSUBSW, + XED_ICLASS_PSUBUSB, + XED_ICLASS_PSUBUSW, + XED_ICLASS_PSUBW, + XED_ICLASS_PSWAPD, + XED_ICLASS_PTEST, + XED_ICLASS_PUNPCKHBW, + XED_ICLASS_PUNPCKHDQ, + XED_ICLASS_PUNPCKHQDQ, + XED_ICLASS_PUNPCKHWD, + XED_ICLASS_PUNPCKLBW, + XED_ICLASS_PUNPCKLDQ, + XED_ICLASS_PUNPCKLQDQ, + XED_ICLASS_PUNPCKLWD, + XED_ICLASS_PUSH, + XED_ICLASS_PUSHA, + XED_ICLASS_PUSHAD, + XED_ICLASS_PUSHF, + XED_ICLASS_PUSHFD, + XED_ICLASS_PUSHFQ, + XED_ICLASS_PXOR, + XED_ICLASS_RCL, + XED_ICLASS_RCPPS, + XED_ICLASS_RCPSS, + XED_ICLASS_RCR, + XED_ICLASS_RDMSR, + XED_ICLASS_RDPMC, + XED_ICLASS_RDTSC, + XED_ICLASS_RDTSCP, + XED_ICLASS_RET_FAR, + XED_ICLASS_RET_NEAR, + XED_ICLASS_ROL, + XED_ICLASS_ROR, + XED_ICLASS_ROUNDPD, + XED_ICLASS_ROUNDPS, + XED_ICLASS_ROUNDSD, + XED_ICLASS_ROUNDSS, + XED_ICLASS_RSM, + XED_ICLASS_RSQRTPS, + XED_ICLASS_RSQRTSS, + XED_ICLASS_SAHF, + XED_ICLASS_SALC, + XED_ICLASS_SAR, + XED_ICLASS_SBB, + XED_ICLASS_SCASB, + XED_ICLASS_SCASD, + XED_ICLASS_SCASQ, + XED_ICLASS_SCASW, + XED_ICLASS_SETB, + XED_ICLASS_SETBE, + XED_ICLASS_SETL, + XED_ICLASS_SETLE, + XED_ICLASS_SETNB, + XED_ICLASS_SETNBE, + XED_ICLASS_SETNL, + XED_ICLASS_SETNLE, + XED_ICLASS_SETNO, + XED_ICLASS_SETNP, + XED_ICLASS_SETNS, + XED_ICLASS_SETNZ, + XED_ICLASS_SETO, + XED_ICLASS_SETP, + XED_ICLASS_SETS, + XED_ICLASS_SETZ, + XED_ICLASS_SFENCE, + XED_ICLASS_SGDT, + XED_ICLASS_SHL, + XED_ICLASS_SHLD, + XED_ICLASS_SHR, + XED_ICLASS_SHRD, + XED_ICLASS_SHUFPD, + XED_ICLASS_SHUFPS, + XED_ICLASS_SIDT, + XED_ICLASS_SKINIT, + XED_ICLASS_SLDT, + XED_ICLASS_SMSW, + XED_ICLASS_SQRTPD, + XED_ICLASS_SQRTPS, + XED_ICLASS_SQRTSD, + XED_ICLASS_SQRTSS, + XED_ICLASS_STC, + XED_ICLASS_STD, + XED_ICLASS_STGI, + XED_ICLASS_STI, + XED_ICLASS_STMXCSR, + XED_ICLASS_STOSB, + XED_ICLASS_STOSD, + XED_ICLASS_STOSQ, + XED_ICLASS_STOSW, + XED_ICLASS_STR, + XED_ICLASS_SUB, + XED_ICLASS_SUBPD, + XED_ICLASS_SUBPS, + XED_ICLASS_SUBSD, + XED_ICLASS_SUBSS, + XED_ICLASS_SWAPGS, + XED_ICLASS_SYSCALL, + XED_ICLASS_SYSENTER, + XED_ICLASS_SYSEXIT, + XED_ICLASS_SYSRET, + XED_ICLASS_TEST, + XED_ICLASS_UCOMISD, + XED_ICLASS_UCOMISS, + XED_ICLASS_UD2, + XED_ICLASS_UNPCKHPD, + XED_ICLASS_UNPCKHPS, + XED_ICLASS_UNPCKLPD, + XED_ICLASS_UNPCKLPS, + XED_ICLASS_VERR, + XED_ICLASS_VERW, + XED_ICLASS_VMCALL, + XED_ICLASS_VMCLEAR, + XED_ICLASS_VMLAUNCH, + XED_ICLASS_VMLOAD, + XED_ICLASS_VMMCALL, + XED_ICLASS_VMPTRLD, + XED_ICLASS_VMPTRST, + XED_ICLASS_VMREAD, + XED_ICLASS_VMRESUME, + XED_ICLASS_VMRUN, + XED_ICLASS_VMSAVE, + XED_ICLASS_VMWRITE, + XED_ICLASS_VMXOFF, + XED_ICLASS_VMXON, + XED_ICLASS_WBINVD, + XED_ICLASS_WRMSR, + XED_ICLASS_XADD, + XED_ICLASS_XCHG, + XED_ICLASS_XGETBV, + XED_ICLASS_XLAT, + XED_ICLASS_XOR, + XED_ICLASS_XORPD, + XED_ICLASS_XORPS, + XED_ICLASS_XRSTOR, + XED_ICLASS_XSAVE, + XED_ICLASS_XSETBV, + XED_ICLASS_LAST +} xed_iclass_enum_t; + +XED_DLL_EXPORT xed_iclass_enum_t +str2xed_iclass_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_iclass_enum_t2str(const xed_iclass_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-iform-enum.h b/palacios/include/xed/xed-iform-enum.h new file mode 100644 index 0000000..2d99a16 --- /dev/null +++ b/palacios/include/xed/xed-iform-enum.h @@ -0,0 +1,1531 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-iform-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_IFORM_ENUM_H_) +# define _XED_IFORM_ENUM_H_ +#include +#include +typedef enum { + XED_IFORM_INVALID=0, + XED_IFORM_AAA=(XED_ICLASS_AAA<<8)+0, + XED_IFORM_AAD_IMM=(XED_ICLASS_AAD<<8)+0, + XED_IFORM_AAM_IMM=(XED_ICLASS_AAM<<8)+0, + XED_IFORM_AAS=(XED_ICLASS_AAS<<8)+0, + XED_IFORM_ADC_MEMv_GPRv=(XED_ICLASS_ADC<<8)+0, + XED_IFORM_ADC_GPRv_GPRv=(XED_ICLASS_ADC<<8)+1, + XED_IFORM_ADC_GPR8_MEMb=(XED_ICLASS_ADC<<8)+2, + XED_IFORM_ADC_AL_IMM=(XED_ICLASS_ADC<<8)+3, + XED_IFORM_ADC_GPR8_IMM=(XED_ICLASS_ADC<<8)+4, + XED_IFORM_ADC_GPRv_MEMv=(XED_ICLASS_ADC<<8)+5, + XED_IFORM_ADC_OrAX_IMM=(XED_ICLASS_ADC<<8)+6, + XED_IFORM_ADC_MEMv_IMM=(XED_ICLASS_ADC<<8)+7, + XED_IFORM_ADC_GPRv_IMM=(XED_ICLASS_ADC<<8)+8, + XED_IFORM_ADC_MEMb_GPR8=(XED_ICLASS_ADC<<8)+9, + XED_IFORM_ADC_MEMb_IMM=(XED_ICLASS_ADC<<8)+10, + XED_IFORM_ADC_GPR8_GPR8=(XED_ICLASS_ADC<<8)+11, + XED_IFORM_ADD_GPR8_MEMb=(XED_ICLASS_ADD<<8)+0, + XED_IFORM_ADD_OrAX_IMM=(XED_ICLASS_ADD<<8)+1, + XED_IFORM_ADD_AL_IMM=(XED_ICLASS_ADD<<8)+2, + XED_IFORM_ADD_GPRv_GPRv=(XED_ICLASS_ADD<<8)+3, + XED_IFORM_ADD_MEMv_GPRv=(XED_ICLASS_ADD<<8)+4, + XED_IFORM_ADD_GPR8_GPR8=(XED_ICLASS_ADD<<8)+5, + XED_IFORM_ADD_GPRv_MEMv=(XED_ICLASS_ADD<<8)+6, + XED_IFORM_ADD_GPR8_IMM=(XED_ICLASS_ADD<<8)+7, + XED_IFORM_ADD_MEMb_IMM=(XED_ICLASS_ADD<<8)+8, + XED_IFORM_ADD_GPRv_IMM=(XED_ICLASS_ADD<<8)+9, + XED_IFORM_ADD_MEMb_GPR8=(XED_ICLASS_ADD<<8)+10, + XED_IFORM_ADD_MEMv_IMM=(XED_ICLASS_ADD<<8)+11, + XED_IFORM_ADDPD_XMMpd_XMMpd=(XED_ICLASS_ADDPD<<8)+0, + XED_IFORM_ADDPD_XMMpd_MEMpd=(XED_ICLASS_ADDPD<<8)+1, + XED_IFORM_ADDPS_XMMps_MEMps=(XED_ICLASS_ADDPS<<8)+0, + XED_IFORM_ADDPS_XMMps_XMMps=(XED_ICLASS_ADDPS<<8)+1, + XED_IFORM_ADDSD_XMMsd_MEMsd=(XED_ICLASS_ADDSD<<8)+0, + XED_IFORM_ADDSD_XMMsd_XMMsd=(XED_ICLASS_ADDSD<<8)+1, + XED_IFORM_ADDSS_XMMss_XMMss=(XED_ICLASS_ADDSS<<8)+0, + XED_IFORM_ADDSS_XMMss_MEMss=(XED_ICLASS_ADDSS<<8)+1, + XED_IFORM_ADDSUBPD_XMMpd_MEMpd=(XED_ICLASS_ADDSUBPD<<8)+0, + XED_IFORM_ADDSUBPD_XMMpd_XMMpd=(XED_ICLASS_ADDSUBPD<<8)+1, + XED_IFORM_ADDSUBPS_XMMps_XMMps=(XED_ICLASS_ADDSUBPS<<8)+0, + XED_IFORM_ADDSUBPS_XMMps_MEMps=(XED_ICLASS_ADDSUBPS<<8)+1, + XED_IFORM_AND_OrAX_IMM=(XED_ICLASS_AND<<8)+0, + XED_IFORM_AND_GPR8_GPR8=(XED_ICLASS_AND<<8)+1, + XED_IFORM_AND_GPR8_IMM=(XED_ICLASS_AND<<8)+2, + XED_IFORM_AND_MEMv_IMM=(XED_ICLASS_AND<<8)+3, + XED_IFORM_AND_MEMb_GPR8=(XED_ICLASS_AND<<8)+4, + XED_IFORM_AND_GPRv_MEMv=(XED_ICLASS_AND<<8)+5, + XED_IFORM_AND_GPRv_IMM=(XED_ICLASS_AND<<8)+6, + XED_IFORM_AND_GPR8_MEMb=(XED_ICLASS_AND<<8)+7, + XED_IFORM_AND_AL_IMM=(XED_ICLASS_AND<<8)+8, + XED_IFORM_AND_MEMv_GPRv=(XED_ICLASS_AND<<8)+9, + XED_IFORM_AND_MEMb_IMM=(XED_ICLASS_AND<<8)+10, + XED_IFORM_AND_GPRv_GPRv=(XED_ICLASS_AND<<8)+11, + XED_IFORM_ANDNPD_XMMpd_MEMpd=(XED_ICLASS_ANDNPD<<8)+0, + XED_IFORM_ANDNPD_XMMpd_XMMpd=(XED_ICLASS_ANDNPD<<8)+1, + XED_IFORM_ANDNPS_XMMps_XMMps=(XED_ICLASS_ANDNPS<<8)+0, + XED_IFORM_ANDNPS_XMMps_MEMps=(XED_ICLASS_ANDNPS<<8)+1, + XED_IFORM_ANDPD_XMMpd_XMMpd=(XED_ICLASS_ANDPD<<8)+0, + XED_IFORM_ANDPD_XMMpd_MEMpd=(XED_ICLASS_ANDPD<<8)+1, + XED_IFORM_ANDPS_XMMps_MEMps=(XED_ICLASS_ANDPS<<8)+0, + XED_IFORM_ANDPS_XMMps_XMMps=(XED_ICLASS_ANDPS<<8)+1, + XED_IFORM_ARPL_GPR16_GPR16=(XED_ICLASS_ARPL<<8)+0, + XED_IFORM_ARPL_MEMw_GPR16=(XED_ICLASS_ARPL<<8)+1, + XED_IFORM_BLENDPD_XMMdq_XMMdq_IMM=(XED_ICLASS_BLENDPD<<8)+0, + XED_IFORM_BLENDPD_XMMdq_MEMdq_IMM=(XED_ICLASS_BLENDPD<<8)+1, + XED_IFORM_BLENDPS_XMMdq_XMMdq_IMM=(XED_ICLASS_BLENDPS<<8)+0, + XED_IFORM_BLENDPS_XMMdq_MEMdq_IMM=(XED_ICLASS_BLENDPS<<8)+1, + XED_IFORM_BLENDVPD_XMMdq_XMMdq_XMM0dq=(XED_ICLASS_BLENDVPD<<8)+0, + XED_IFORM_BLENDVPD_XMMdq_MEMdq_XMM0dq=(XED_ICLASS_BLENDVPD<<8)+1, + XED_IFORM_BLENDVPS_XMMdq_XMMdq_XMM0dq=(XED_ICLASS_BLENDVPS<<8)+0, + XED_IFORM_BLENDVPS_XMMdq_MEMdq_XMM0dq=(XED_ICLASS_BLENDVPS<<8)+1, + XED_IFORM_BOUND_GPRv_MEMa=(XED_ICLASS_BOUND<<8)+0, + XED_IFORM_BSF_GPRv_MEMv=(XED_ICLASS_BSF<<8)+0, + XED_IFORM_BSF_GPRv_GPRv=(XED_ICLASS_BSF<<8)+1, + XED_IFORM_BSR_GPRv_GPRv=(XED_ICLASS_BSR<<8)+0, + XED_IFORM_BSR_GPRv_MEMv=(XED_ICLASS_BSR<<8)+1, + XED_IFORM_BSWAP_GPRv=(XED_ICLASS_BSWAP<<8)+0, + XED_IFORM_BT_GPRv_IMM=(XED_ICLASS_BT<<8)+0, + XED_IFORM_BT_MEMv_IMM=(XED_ICLASS_BT<<8)+1, + XED_IFORM_BT_MEMv_GPRv=(XED_ICLASS_BT<<8)+2, + XED_IFORM_BT_GPRv_GPRv=(XED_ICLASS_BT<<8)+3, + XED_IFORM_BTC_GPRv_GPRv=(XED_ICLASS_BTC<<8)+0, + XED_IFORM_BTC_MEMv_IMM=(XED_ICLASS_BTC<<8)+1, + XED_IFORM_BTC_MEMv_GPRv=(XED_ICLASS_BTC<<8)+2, + XED_IFORM_BTC_GPRv_IMM=(XED_ICLASS_BTC<<8)+3, + XED_IFORM_BTR_GPRv_IMM=(XED_ICLASS_BTR<<8)+0, + XED_IFORM_BTR_GPRv_GPRv=(XED_ICLASS_BTR<<8)+1, + XED_IFORM_BTR_MEMv_IMM=(XED_ICLASS_BTR<<8)+2, + XED_IFORM_BTR_MEMv_GPRv=(XED_ICLASS_BTR<<8)+3, + XED_IFORM_BTS_GPRv_GPRv=(XED_ICLASS_BTS<<8)+0, + XED_IFORM_BTS_MEMv_IMM=(XED_ICLASS_BTS<<8)+1, + XED_IFORM_BTS_MEMv_GPRv=(XED_ICLASS_BTS<<8)+2, + XED_IFORM_BTS_GPRv_IMM=(XED_ICLASS_BTS<<8)+3, + XED_IFORM_CALL_FAR_MEMp=(XED_ICLASS_CALL_FAR<<8)+0, + XED_IFORM_CALL_FAR_PTR_IMM=(XED_ICLASS_CALL_FAR<<8)+1, + XED_IFORM_CALL_NEAR_MEMv=(XED_ICLASS_CALL_NEAR<<8)+0, + XED_IFORM_CALL_NEAR_RELBR=(XED_ICLASS_CALL_NEAR<<8)+1, + XED_IFORM_CALL_NEAR_GPRv=(XED_ICLASS_CALL_NEAR<<8)+2, + XED_IFORM_CBW=(XED_ICLASS_CBW<<8)+0, + XED_IFORM_CDQ=(XED_ICLASS_CDQ<<8)+0, + XED_IFORM_CDQE=(XED_ICLASS_CDQE<<8)+0, + XED_IFORM_CLC=(XED_ICLASS_CLC<<8)+0, + XED_IFORM_CLD=(XED_ICLASS_CLD<<8)+0, + XED_IFORM_CLFLUSH_MEMb=(XED_ICLASS_CLFLUSH<<8)+0, + XED_IFORM_CLGI=(XED_ICLASS_CLGI<<8)+0, + XED_IFORM_CLI=(XED_ICLASS_CLI<<8)+0, + XED_IFORM_CLTS=(XED_ICLASS_CLTS<<8)+0, + XED_IFORM_CMC=(XED_ICLASS_CMC<<8)+0, + XED_IFORM_CMOVB_GPRv_GPRv=(XED_ICLASS_CMOVB<<8)+0, + XED_IFORM_CMOVB_GPRv_MEMv=(XED_ICLASS_CMOVB<<8)+1, + XED_IFORM_CMOVBE_GPRv_GPRv=(XED_ICLASS_CMOVBE<<8)+0, + XED_IFORM_CMOVBE_GPRv_MEMv=(XED_ICLASS_CMOVBE<<8)+1, + XED_IFORM_CMOVL_GPRv_MEMv=(XED_ICLASS_CMOVL<<8)+0, + XED_IFORM_CMOVL_GPRv_GPRv=(XED_ICLASS_CMOVL<<8)+1, + XED_IFORM_CMOVLE_GPRv_MEMv=(XED_ICLASS_CMOVLE<<8)+0, + XED_IFORM_CMOVLE_GPRv_GPRv=(XED_ICLASS_CMOVLE<<8)+1, + XED_IFORM_CMOVNB_GPRv_MEMv=(XED_ICLASS_CMOVNB<<8)+0, + XED_IFORM_CMOVNB_GPRv_GPRv=(XED_ICLASS_CMOVNB<<8)+1, + XED_IFORM_CMOVNBE_GPRv_GPRv=(XED_ICLASS_CMOVNBE<<8)+0, + XED_IFORM_CMOVNBE_GPRv_MEMv=(XED_ICLASS_CMOVNBE<<8)+1, + XED_IFORM_CMOVNL_GPRv_MEMv=(XED_ICLASS_CMOVNL<<8)+0, + XED_IFORM_CMOVNL_GPRv_GPRv=(XED_ICLASS_CMOVNL<<8)+1, + XED_IFORM_CMOVNLE_GPRv_GPRv=(XED_ICLASS_CMOVNLE<<8)+0, + XED_IFORM_CMOVNLE_GPRv_MEMv=(XED_ICLASS_CMOVNLE<<8)+1, + XED_IFORM_CMOVNO_GPRv_MEMv=(XED_ICLASS_CMOVNO<<8)+0, + XED_IFORM_CMOVNO_GPRv_GPRv=(XED_ICLASS_CMOVNO<<8)+1, + XED_IFORM_CMOVNP_GPRv_GPRv=(XED_ICLASS_CMOVNP<<8)+0, + XED_IFORM_CMOVNP_GPRv_MEMv=(XED_ICLASS_CMOVNP<<8)+1, + XED_IFORM_CMOVNS_GPRv_GPRv=(XED_ICLASS_CMOVNS<<8)+0, + XED_IFORM_CMOVNS_GPRv_MEMv=(XED_ICLASS_CMOVNS<<8)+1, + XED_IFORM_CMOVNZ_GPRv_MEMv=(XED_ICLASS_CMOVNZ<<8)+0, + XED_IFORM_CMOVNZ_GPRv_GPRv=(XED_ICLASS_CMOVNZ<<8)+1, + XED_IFORM_CMOVO_GPRv_MEMv=(XED_ICLASS_CMOVO<<8)+0, + XED_IFORM_CMOVO_GPRv_GPRv=(XED_ICLASS_CMOVO<<8)+1, + XED_IFORM_CMOVP_GPRv_GPRv=(XED_ICLASS_CMOVP<<8)+0, + XED_IFORM_CMOVP_GPRv_MEMv=(XED_ICLASS_CMOVP<<8)+1, + XED_IFORM_CMOVS_GPRv_GPRv=(XED_ICLASS_CMOVS<<8)+0, + XED_IFORM_CMOVS_GPRv_MEMv=(XED_ICLASS_CMOVS<<8)+1, + XED_IFORM_CMOVZ_GPRv_GPRv=(XED_ICLASS_CMOVZ<<8)+0, + XED_IFORM_CMOVZ_GPRv_MEMv=(XED_ICLASS_CMOVZ<<8)+1, + XED_IFORM_CMP_OrAX_IMM=(XED_ICLASS_CMP<<8)+0, + XED_IFORM_CMP_MEMv_GPRv=(XED_ICLASS_CMP<<8)+1, + XED_IFORM_CMP_AL_IMM=(XED_ICLASS_CMP<<8)+2, + XED_IFORM_CMP_GPRv_GPRv=(XED_ICLASS_CMP<<8)+3, + XED_IFORM_CMP_MEMb_IMM=(XED_ICLASS_CMP<<8)+4, + XED_IFORM_CMP_GPR8_GPR8=(XED_ICLASS_CMP<<8)+5, + XED_IFORM_CMP_MEMb_GPR8=(XED_ICLASS_CMP<<8)+6, + XED_IFORM_CMP_GPR8_IMM=(XED_ICLASS_CMP<<8)+7, + XED_IFORM_CMP_GPRv_IMM=(XED_ICLASS_CMP<<8)+8, + XED_IFORM_CMP_GPRv_MEMv=(XED_ICLASS_CMP<<8)+9, + XED_IFORM_CMP_GPR8_MEMb=(XED_ICLASS_CMP<<8)+10, + XED_IFORM_CMP_MEMv_IMM=(XED_ICLASS_CMP<<8)+11, + XED_IFORM_CMPPD_XMMpd_MEMpd_IMM=(XED_ICLASS_CMPPD<<8)+0, + XED_IFORM_CMPPD_XMMpd_XMMpd_IMM=(XED_ICLASS_CMPPD<<8)+1, + XED_IFORM_CMPPS_XMMps_XMMps_IMM=(XED_ICLASS_CMPPS<<8)+0, + XED_IFORM_CMPPS_XMMps_MEMps_IMM=(XED_ICLASS_CMPPS<<8)+1, + XED_IFORM_CMPSB=(XED_ICLASS_CMPSB<<8)+0, + XED_IFORM_CMPSD=(XED_ICLASS_CMPSD<<8)+0, + XED_IFORM_CMPSD_XMM_XMMsd_MEMsd_IMM=(XED_ICLASS_CMPSD_XMM<<8)+0, + XED_IFORM_CMPSD_XMM_XMMsd_XMMsd_IMM=(XED_ICLASS_CMPSD_XMM<<8)+1, + XED_IFORM_CMPSQ=(XED_ICLASS_CMPSQ<<8)+0, + XED_IFORM_CMPSS_XMMss_XMMss_IMM=(XED_ICLASS_CMPSS<<8)+0, + XED_IFORM_CMPSS_XMMss_MEMss_IMM=(XED_ICLASS_CMPSS<<8)+1, + XED_IFORM_CMPSW=(XED_ICLASS_CMPSW<<8)+0, + XED_IFORM_CMPXCHG_GPR8_GPR8=(XED_ICLASS_CMPXCHG<<8)+0, + XED_IFORM_CMPXCHG_MEMv_GPRv=(XED_ICLASS_CMPXCHG<<8)+1, + XED_IFORM_CMPXCHG_MEMb_GPR8=(XED_ICLASS_CMPXCHG<<8)+2, + XED_IFORM_CMPXCHG_GPRv_GPRv=(XED_ICLASS_CMPXCHG<<8)+3, + XED_IFORM_CMPXCHG16B_MEMdq=(XED_ICLASS_CMPXCHG16B<<8)+0, + XED_IFORM_CMPXCHG8B_MEMq=(XED_ICLASS_CMPXCHG8B<<8)+0, + XED_IFORM_COMISD_XMMsd_MEMsd=(XED_ICLASS_COMISD<<8)+0, + XED_IFORM_COMISD_XMMsd_XMMsd=(XED_ICLASS_COMISD<<8)+1, + XED_IFORM_COMISS_XMMss_XMMss=(XED_ICLASS_COMISS<<8)+0, + XED_IFORM_COMISS_XMMss_MEMss=(XED_ICLASS_COMISS<<8)+1, + XED_IFORM_CPUID=(XED_ICLASS_CPUID<<8)+0, + XED_IFORM_CQO=(XED_ICLASS_CQO<<8)+0, + XED_IFORM_CRC32_GPR32d_GPRv=(XED_ICLASS_CRC32<<8)+0, + XED_IFORM_CRC32_GPR32d_MEMb=(XED_ICLASS_CRC32<<8)+1, + XED_IFORM_CRC32_GPR32d_GPR8b=(XED_ICLASS_CRC32<<8)+2, + XED_IFORM_CRC32_GPR64q_MEMv=(XED_ICLASS_CRC32<<8)+3, + XED_IFORM_CRC32_GPR32d_MEMv=(XED_ICLASS_CRC32<<8)+4, + XED_IFORM_CRC32_GPR64q_MEMb=(XED_ICLASS_CRC32<<8)+5, + XED_IFORM_CRC32_GPR64q_GPRv=(XED_ICLASS_CRC32<<8)+6, + XED_IFORM_CRC32_GPR64q_GPR8b=(XED_ICLASS_CRC32<<8)+7, + XED_IFORM_CVTDQ2PD_XMMpd_MEMq=(XED_ICLASS_CVTDQ2PD<<8)+0, + XED_IFORM_CVTDQ2PD_XMMpd_XMMq=(XED_ICLASS_CVTDQ2PD<<8)+1, + XED_IFORM_CVTDQ2PS_XMMps_MEMdq=(XED_ICLASS_CVTDQ2PS<<8)+0, + XED_IFORM_CVTDQ2PS_XMMps_XMMdq=(XED_ICLASS_CVTDQ2PS<<8)+1, + XED_IFORM_CVTPD2DQ_XMMdq_MEMpd=(XED_ICLASS_CVTPD2DQ<<8)+0, + XED_IFORM_CVTPD2DQ_XMMdq_XMMpd=(XED_ICLASS_CVTPD2DQ<<8)+1, + XED_IFORM_CVTPD2PI_MMXq_XMMpd=(XED_ICLASS_CVTPD2PI<<8)+0, + XED_IFORM_CVTPD2PI_MMXq_MEMpd=(XED_ICLASS_CVTPD2PI<<8)+1, + XED_IFORM_CVTPD2PS_XMMps_MEMpd=(XED_ICLASS_CVTPD2PS<<8)+0, + XED_IFORM_CVTPD2PS_XMMps_XMMpd=(XED_ICLASS_CVTPD2PS<<8)+1, + XED_IFORM_CVTPI2PD_XMMpd_MMXq=(XED_ICLASS_CVTPI2PD<<8)+0, + XED_IFORM_CVTPI2PD_XMMpd_MEMq=(XED_ICLASS_CVTPI2PD<<8)+1, + XED_IFORM_CVTPI2PS_XMMq_MMXq=(XED_ICLASS_CVTPI2PS<<8)+0, + XED_IFORM_CVTPI2PS_XMMq_MEMq=(XED_ICLASS_CVTPI2PS<<8)+1, + XED_IFORM_CVTPS2DQ_XMMdq_MEMps=(XED_ICLASS_CVTPS2DQ<<8)+0, + XED_IFORM_CVTPS2DQ_XMMdq_XMMps=(XED_ICLASS_CVTPS2DQ<<8)+1, + XED_IFORM_CVTPS2PD_XMMpd_MEMq=(XED_ICLASS_CVTPS2PD<<8)+0, + XED_IFORM_CVTPS2PD_XMMpd_XMMq=(XED_ICLASS_CVTPS2PD<<8)+1, + XED_IFORM_CVTPS2PI_MMXq_MEMq=(XED_ICLASS_CVTPS2PI<<8)+0, + XED_IFORM_CVTPS2PI_MMXq_XMMq=(XED_ICLASS_CVTPS2PI<<8)+1, + XED_IFORM_CVTSD2SI_GPR32_MEMsd=(XED_ICLASS_CVTSD2SI<<8)+0, + XED_IFORM_CVTSD2SI_GPR32_XMMsd=(XED_ICLASS_CVTSD2SI<<8)+1, + XED_IFORM_CVTSD2SI_GPR64_XMMsd=(XED_ICLASS_CVTSD2SI<<8)+2, + XED_IFORM_CVTSD2SI_GPR64_MEMsd=(XED_ICLASS_CVTSD2SI<<8)+3, + XED_IFORM_CVTSD2SS_XMMss_MEMsd=(XED_ICLASS_CVTSD2SS<<8)+0, + XED_IFORM_CVTSD2SS_XMMss_XMMsd=(XED_ICLASS_CVTSD2SS<<8)+1, + XED_IFORM_CVTSI2SD_XMMsd_GPR64=(XED_ICLASS_CVTSI2SD<<8)+0, + XED_IFORM_CVTSI2SD_XMMsd_GPR32=(XED_ICLASS_CVTSI2SD<<8)+1, + XED_IFORM_CVTSI2SD_XMMsd_MEMd=(XED_ICLASS_CVTSI2SD<<8)+2, + XED_IFORM_CVTSI2SD_XMMsd_MEMq=(XED_ICLASS_CVTSI2SD<<8)+3, + XED_IFORM_CVTSI2SS_XMMss_GPR64=(XED_ICLASS_CVTSI2SS<<8)+0, + XED_IFORM_CVTSI2SS_XMMss_GPR32=(XED_ICLASS_CVTSI2SS<<8)+1, + XED_IFORM_CVTSI2SS_XMMss_MEMd=(XED_ICLASS_CVTSI2SS<<8)+2, + XED_IFORM_CVTSI2SS_XMMss_MEMq=(XED_ICLASS_CVTSI2SS<<8)+3, + XED_IFORM_CVTSS2SD_XMMsd_MEMss=(XED_ICLASS_CVTSS2SD<<8)+0, + XED_IFORM_CVTSS2SD_XMMsd_XMMss=(XED_ICLASS_CVTSS2SD<<8)+1, + XED_IFORM_CVTSS2SI_GPR64_XMMss=(XED_ICLASS_CVTSS2SI<<8)+0, + XED_IFORM_CVTSS2SI_GPR32_MEMss=(XED_ICLASS_CVTSS2SI<<8)+1, + XED_IFORM_CVTSS2SI_GPR32_XMMss=(XED_ICLASS_CVTSS2SI<<8)+2, + XED_IFORM_CVTSS2SI_GPR64_MEMss=(XED_ICLASS_CVTSS2SI<<8)+3, + XED_IFORM_CVTTPD2DQ_XMMdq_XMMpd=(XED_ICLASS_CVTTPD2DQ<<8)+0, + XED_IFORM_CVTTPD2DQ_XMMdq_MEMpd=(XED_ICLASS_CVTTPD2DQ<<8)+1, + XED_IFORM_CVTTPD2PI_MMXq_MEMpd=(XED_ICLASS_CVTTPD2PI<<8)+0, + XED_IFORM_CVTTPD2PI_MMXq_XMMpd=(XED_ICLASS_CVTTPD2PI<<8)+1, + XED_IFORM_CVTTPS2DQ_XMMdq_XMMps=(XED_ICLASS_CVTTPS2DQ<<8)+0, + XED_IFORM_CVTTPS2DQ_XMMdq_MEMps=(XED_ICLASS_CVTTPS2DQ<<8)+1, + XED_IFORM_CVTTPS2PI_MMXq_MEMq=(XED_ICLASS_CVTTPS2PI<<8)+0, + XED_IFORM_CVTTPS2PI_MMXq_XMMq=(XED_ICLASS_CVTTPS2PI<<8)+1, + XED_IFORM_CVTTSD2SI_GPR64_MEMsd=(XED_ICLASS_CVTTSD2SI<<8)+0, + XED_IFORM_CVTTSD2SI_GPR32_XMMsd=(XED_ICLASS_CVTTSD2SI<<8)+1, + XED_IFORM_CVTTSD2SI_GPR32_MEMsd=(XED_ICLASS_CVTTSD2SI<<8)+2, + XED_IFORM_CVTTSD2SI_GPR64_XMMsd=(XED_ICLASS_CVTTSD2SI<<8)+3, + XED_IFORM_CVTTSS2SI_GPR64_MEMss=(XED_ICLASS_CVTTSS2SI<<8)+0, + XED_IFORM_CVTTSS2SI_GPR64_XMMss=(XED_ICLASS_CVTTSS2SI<<8)+1, + XED_IFORM_CVTTSS2SI_GPR32_XMMss=(XED_ICLASS_CVTTSS2SI<<8)+2, + XED_IFORM_CVTTSS2SI_GPR32_MEMss=(XED_ICLASS_CVTTSS2SI<<8)+3, + XED_IFORM_CWD=(XED_ICLASS_CWD<<8)+0, + XED_IFORM_CWDE=(XED_ICLASS_CWDE<<8)+0, + XED_IFORM_DAA=(XED_ICLASS_DAA<<8)+0, + XED_IFORM_DAS=(XED_ICLASS_DAS<<8)+0, + XED_IFORM_DEC_GPR8=(XED_ICLASS_DEC<<8)+0, + XED_IFORM_DEC_MEMv=(XED_ICLASS_DEC<<8)+1, + XED_IFORM_DEC_MEMb=(XED_ICLASS_DEC<<8)+2, + XED_IFORM_DEC_GPRv=(XED_ICLASS_DEC<<8)+3, + XED_IFORM_DIV_MEMv=(XED_ICLASS_DIV<<8)+0, + XED_IFORM_DIV_GPR8=(XED_ICLASS_DIV<<8)+1, + XED_IFORM_DIV_GPRv=(XED_ICLASS_DIV<<8)+2, + XED_IFORM_DIV_MEMb=(XED_ICLASS_DIV<<8)+3, + XED_IFORM_DIVPD_XMMpd_XMMpd=(XED_ICLASS_DIVPD<<8)+0, + XED_IFORM_DIVPD_XMMpd_MEMpd=(XED_ICLASS_DIVPD<<8)+1, + XED_IFORM_DIVPS_XMMps_MEMps=(XED_ICLASS_DIVPS<<8)+0, + XED_IFORM_DIVPS_XMMps_XMMps=(XED_ICLASS_DIVPS<<8)+1, + XED_IFORM_DIVSD_XMMsd_MEMsd=(XED_ICLASS_DIVSD<<8)+0, + XED_IFORM_DIVSD_XMMsd_XMMsd=(XED_ICLASS_DIVSD<<8)+1, + XED_IFORM_DIVSS_XMMss_XMMss=(XED_ICLASS_DIVSS<<8)+0, + XED_IFORM_DIVSS_XMMss_MEMss=(XED_ICLASS_DIVSS<<8)+1, + XED_IFORM_DPPD_XMMdq_XMMdq_IMM=(XED_ICLASS_DPPD<<8)+0, + XED_IFORM_DPPD_XMMdq_MEMdq_IMM=(XED_ICLASS_DPPD<<8)+1, + XED_IFORM_DPPS_XMMdq_XMMdq_IMM=(XED_ICLASS_DPPS<<8)+0, + XED_IFORM_DPPS_XMMdq_MEMdq_IMM=(XED_ICLASS_DPPS<<8)+1, + XED_IFORM_EMMS=(XED_ICLASS_EMMS<<8)+0, + XED_IFORM_ENTER_IMM_IMM=(XED_ICLASS_ENTER<<8)+0, + XED_IFORM_EXTRACTPS_GPR32w_XMMdq_IMM=(XED_ICLASS_EXTRACTPS<<8)+0, + XED_IFORM_EXTRACTPS_MEMw_XMMps_IMM=(XED_ICLASS_EXTRACTPS<<8)+1, + XED_IFORM_EXTRQ_XMMq_IMM_IMM=(XED_ICLASS_EXTRQ<<8)+0, + XED_IFORM_EXTRQ_XMMq_XMMdq=(XED_ICLASS_EXTRQ<<8)+1, + XED_IFORM_F2XM1_ST0=(XED_ICLASS_F2XM1<<8)+0, + XED_IFORM_FABS_ST0=(XED_ICLASS_FABS<<8)+0, + XED_IFORM_FADD_ST0_MEMmem32real=(XED_ICLASS_FADD<<8)+0, + XED_IFORM_FADD_ST0_MEMm64real=(XED_ICLASS_FADD<<8)+1, + XED_IFORM_FADD_X87_ST0=(XED_ICLASS_FADD<<8)+2, + XED_IFORM_FADD_ST0_X87=(XED_ICLASS_FADD<<8)+3, + XED_IFORM_FADDP_X87_ST0=(XED_ICLASS_FADDP<<8)+0, + XED_IFORM_FBLD_ST0_MEMmem80dec=(XED_ICLASS_FBLD<<8)+0, + XED_IFORM_FBSTP_MEMmem80dec_ST0=(XED_ICLASS_FBSTP<<8)+0, + XED_IFORM_FCHS_ST0=(XED_ICLASS_FCHS<<8)+0, + XED_IFORM_FCMOVB_ST0_X87=(XED_ICLASS_FCMOVB<<8)+0, + XED_IFORM_FCMOVBE_ST0_X87=(XED_ICLASS_FCMOVBE<<8)+0, + XED_IFORM_FCMOVE_ST0_X87=(XED_ICLASS_FCMOVE<<8)+0, + XED_IFORM_FCMOVNB_ST0_X87=(XED_ICLASS_FCMOVNB<<8)+0, + XED_IFORM_FCMOVNBE_ST0_X87=(XED_ICLASS_FCMOVNBE<<8)+0, + XED_IFORM_FCMOVNE_ST0_X87=(XED_ICLASS_FCMOVNE<<8)+0, + XED_IFORM_FCMOVNU_ST0_X87=(XED_ICLASS_FCMOVNU<<8)+0, + XED_IFORM_FCMOVU_ST0_X87=(XED_ICLASS_FCMOVU<<8)+0, + XED_IFORM_FCOM_ST0_X87=(XED_ICLASS_FCOM<<8)+0, + XED_IFORM_FCOM_ST0_MEMmem32real=(XED_ICLASS_FCOM<<8)+1, + XED_IFORM_FCOM_ST0_MEMm64real=(XED_ICLASS_FCOM<<8)+2, + XED_IFORM_FCOMI_ST0_X87=(XED_ICLASS_FCOMI<<8)+0, + XED_IFORM_FCOMIP_ST0_X87=(XED_ICLASS_FCOMIP<<8)+0, + XED_IFORM_FCOMP_ST0_X87=(XED_ICLASS_FCOMP<<8)+0, + XED_IFORM_FCOMP_ST0_MEMmem32real=(XED_ICLASS_FCOMP<<8)+1, + XED_IFORM_FCOMP_ST0_MEMm64real=(XED_ICLASS_FCOMP<<8)+2, + XED_IFORM_FCOMPP_ST0_ST1=(XED_ICLASS_FCOMPP<<8)+0, + XED_IFORM_FCOS_ST0=(XED_ICLASS_FCOS<<8)+0, + XED_IFORM_FDECSTP=(XED_ICLASS_FDECSTP<<8)+0, + XED_IFORM_FDIV_X87_ST0=(XED_ICLASS_FDIV<<8)+0, + XED_IFORM_FDIV_ST0_MEMmem32real=(XED_ICLASS_FDIV<<8)+1, + XED_IFORM_FDIV_ST0_MEMm64real=(XED_ICLASS_FDIV<<8)+2, + XED_IFORM_FDIV_ST0_X87=(XED_ICLASS_FDIV<<8)+3, + XED_IFORM_FDIVP_X87_ST0=(XED_ICLASS_FDIVP<<8)+0, + XED_IFORM_FDIVR_ST0_MEMm64real=(XED_ICLASS_FDIVR<<8)+0, + XED_IFORM_FDIVR_X87_ST0=(XED_ICLASS_FDIVR<<8)+1, + XED_IFORM_FDIVR_ST0_X87=(XED_ICLASS_FDIVR<<8)+2, + XED_IFORM_FDIVR_ST0_MEMmem32real=(XED_ICLASS_FDIVR<<8)+3, + XED_IFORM_FDIVRP_X87_ST0=(XED_ICLASS_FDIVRP<<8)+0, + XED_IFORM_FEMMS=(XED_ICLASS_FEMMS<<8)+0, + XED_IFORM_FFREE_X87=(XED_ICLASS_FFREE<<8)+0, + XED_IFORM_FFREEP_X87=(XED_ICLASS_FFREEP<<8)+0, + XED_IFORM_FIADD_ST0_MEMmem32int=(XED_ICLASS_FIADD<<8)+0, + XED_IFORM_FIADD_ST0_MEMmem16int=(XED_ICLASS_FIADD<<8)+1, + XED_IFORM_FICOM_ST0_MEMmem32int=(XED_ICLASS_FICOM<<8)+0, + XED_IFORM_FICOM_ST0_MEMmem16int=(XED_ICLASS_FICOM<<8)+1, + XED_IFORM_FICOMP_ST0_MEMmem16int=(XED_ICLASS_FICOMP<<8)+0, + XED_IFORM_FICOMP_ST0_MEMmem32int=(XED_ICLASS_FICOMP<<8)+1, + XED_IFORM_FIDIV_ST0_MEMmem16int=(XED_ICLASS_FIDIV<<8)+0, + XED_IFORM_FIDIV_ST0_MEMmem32int=(XED_ICLASS_FIDIV<<8)+1, + XED_IFORM_FIDIVR_ST0_MEMmem32int=(XED_ICLASS_FIDIVR<<8)+0, + XED_IFORM_FIDIVR_ST0_MEMmem16int=(XED_ICLASS_FIDIVR<<8)+1, + XED_IFORM_FILD_ST0_MEMmem32int=(XED_ICLASS_FILD<<8)+0, + XED_IFORM_FILD_ST0_MEMmem16int=(XED_ICLASS_FILD<<8)+1, + XED_IFORM_FILD_ST0_MEMm64int=(XED_ICLASS_FILD<<8)+2, + XED_IFORM_FIMUL_ST0_MEMmem16int=(XED_ICLASS_FIMUL<<8)+0, + XED_IFORM_FIMUL_ST0_MEMmem32int=(XED_ICLASS_FIMUL<<8)+1, + XED_IFORM_FINCSTP=(XED_ICLASS_FINCSTP<<8)+0, + XED_IFORM_FIST_MEMmem32int_ST0=(XED_ICLASS_FIST<<8)+0, + XED_IFORM_FIST_MEMmem16int_ST0=(XED_ICLASS_FIST<<8)+1, + XED_IFORM_FISTP_MEMmem32int_ST0=(XED_ICLASS_FISTP<<8)+0, + XED_IFORM_FISTP_MEMmem16int_ST0=(XED_ICLASS_FISTP<<8)+1, + XED_IFORM_FISTP_MEMm64int_ST0=(XED_ICLASS_FISTP<<8)+2, + XED_IFORM_FISTTP_MEMmem16int_ST0=(XED_ICLASS_FISTTP<<8)+0, + XED_IFORM_FISTTP_MEMmem32int_ST0=(XED_ICLASS_FISTTP<<8)+1, + XED_IFORM_FISTTP_MEMm64int_ST0=(XED_ICLASS_FISTTP<<8)+2, + XED_IFORM_FISUB_ST0_MEMmem32int=(XED_ICLASS_FISUB<<8)+0, + XED_IFORM_FISUB_ST0_MEMmem16int=(XED_ICLASS_FISUB<<8)+1, + XED_IFORM_FISUBR_ST0_MEMmem32int=(XED_ICLASS_FISUBR<<8)+0, + XED_IFORM_FISUBR_ST0_MEMmem16int=(XED_ICLASS_FISUBR<<8)+1, + XED_IFORM_FLD_ST0_X87=(XED_ICLASS_FLD<<8)+0, + XED_IFORM_FLD_ST0_MEMm64real=(XED_ICLASS_FLD<<8)+1, + XED_IFORM_FLD_ST0_MEMmem32real=(XED_ICLASS_FLD<<8)+2, + XED_IFORM_FLD_ST0_MEMmem80real=(XED_ICLASS_FLD<<8)+3, + XED_IFORM_FLD1_ST0=(XED_ICLASS_FLD1<<8)+0, + XED_IFORM_FLDCW_MEMmem16=(XED_ICLASS_FLDCW<<8)+0, + XED_IFORM_FLDENV_MEMmem14=(XED_ICLASS_FLDENV<<8)+0, + XED_IFORM_FLDENV_MEMmem28=(XED_ICLASS_FLDENV<<8)+1, + XED_IFORM_FLDL2E_ST0=(XED_ICLASS_FLDL2E<<8)+0, + XED_IFORM_FLDL2T_ST0=(XED_ICLASS_FLDL2T<<8)+0, + XED_IFORM_FLDLG2_ST0=(XED_ICLASS_FLDLG2<<8)+0, + XED_IFORM_FLDLN2_ST0=(XED_ICLASS_FLDLN2<<8)+0, + XED_IFORM_FLDPI_ST0=(XED_ICLASS_FLDPI<<8)+0, + XED_IFORM_FLDZ_ST0=(XED_ICLASS_FLDZ<<8)+0, + XED_IFORM_FMUL_ST0_MEMm64real=(XED_ICLASS_FMUL<<8)+0, + XED_IFORM_FMUL_ST0_MEMmem32real=(XED_ICLASS_FMUL<<8)+1, + XED_IFORM_FMUL_X87_ST0=(XED_ICLASS_FMUL<<8)+2, + XED_IFORM_FMUL_ST0_X87=(XED_ICLASS_FMUL<<8)+3, + XED_IFORM_FMULP_X87_ST0=(XED_ICLASS_FMULP<<8)+0, + XED_IFORM_FNCLEX=(XED_ICLASS_FNCLEX<<8)+0, + XED_IFORM_FNINIT=(XED_ICLASS_FNINIT<<8)+0, + XED_IFORM_FNOP=(XED_ICLASS_FNOP<<8)+0, + XED_IFORM_FNSAVE_MEMmem98=(XED_ICLASS_FNSAVE<<8)+0, + XED_IFORM_FNSAVE_MEMmem108=(XED_ICLASS_FNSAVE<<8)+1, + XED_IFORM_FNSTCW_MEMmem16=(XED_ICLASS_FNSTCW<<8)+0, + XED_IFORM_FNSTENV_MEMmem28=(XED_ICLASS_FNSTENV<<8)+0, + XED_IFORM_FNSTENV_MEMmem14=(XED_ICLASS_FNSTENV<<8)+1, + XED_IFORM_FNSTSW_MEMmem16=(XED_ICLASS_FNSTSW<<8)+0, + XED_IFORM_FNSTSW_AX=(XED_ICLASS_FNSTSW<<8)+1, + XED_IFORM_FPATAN_ST0_ST1=(XED_ICLASS_FPATAN<<8)+0, + XED_IFORM_FPREM_ST0_ST1=(XED_ICLASS_FPREM<<8)+0, + XED_IFORM_FPREM1_ST0_ST1=(XED_ICLASS_FPREM1<<8)+0, + XED_IFORM_FPTAN_ST0_ST1=(XED_ICLASS_FPTAN<<8)+0, + XED_IFORM_FRNDINT_ST0=(XED_ICLASS_FRNDINT<<8)+0, + XED_IFORM_FRSTOR_MEMmem108=(XED_ICLASS_FRSTOR<<8)+0, + XED_IFORM_FRSTOR_MEMmem98=(XED_ICLASS_FRSTOR<<8)+1, + XED_IFORM_FSCALE_ST0_ST1=(XED_ICLASS_FSCALE<<8)+0, + XED_IFORM_FSETPM287_NOP=(XED_ICLASS_FSETPM287_NOP<<8)+0, + XED_IFORM_FSIN_ST0=(XED_ICLASS_FSIN<<8)+0, + XED_IFORM_FSINCOS_ST0_ST1=(XED_ICLASS_FSINCOS<<8)+0, + XED_IFORM_FSQRT_ST0=(XED_ICLASS_FSQRT<<8)+0, + XED_IFORM_FST_X87_ST0=(XED_ICLASS_FST<<8)+0, + XED_IFORM_FST_MEMmem32real_ST0=(XED_ICLASS_FST<<8)+1, + XED_IFORM_FST_MEMm64real_ST0=(XED_ICLASS_FST<<8)+2, + XED_IFORM_FSTP_MEMmem32real_ST0=(XED_ICLASS_FSTP<<8)+0, + XED_IFORM_FSTP_X87_ST0=(XED_ICLASS_FSTP<<8)+1, + XED_IFORM_FSTP_MEMmem80real_ST0=(XED_ICLASS_FSTP<<8)+2, + XED_IFORM_FSTP_MEMm64real_ST0=(XED_ICLASS_FSTP<<8)+3, + XED_IFORM_FSUB_ST0_X87=(XED_ICLASS_FSUB<<8)+0, + XED_IFORM_FSUB_X87_ST0=(XED_ICLASS_FSUB<<8)+1, + XED_IFORM_FSUB_ST0_MEMm64real=(XED_ICLASS_FSUB<<8)+2, + XED_IFORM_FSUB_ST0_MEMmem32real=(XED_ICLASS_FSUB<<8)+3, + XED_IFORM_FSUBP_X87_ST0=(XED_ICLASS_FSUBP<<8)+0, + XED_IFORM_FSUBR_ST0_MEMmem32real=(XED_ICLASS_FSUBR<<8)+0, + XED_IFORM_FSUBR_X87_ST0=(XED_ICLASS_FSUBR<<8)+1, + XED_IFORM_FSUBR_ST0_X87=(XED_ICLASS_FSUBR<<8)+2, + XED_IFORM_FSUBR_ST0_MEMm64real=(XED_ICLASS_FSUBR<<8)+3, + XED_IFORM_FSUBRP_X87_ST0=(XED_ICLASS_FSUBRP<<8)+0, + XED_IFORM_FTST_ST0=(XED_ICLASS_FTST<<8)+0, + XED_IFORM_FUCOM_ST0_X87=(XED_ICLASS_FUCOM<<8)+0, + XED_IFORM_FUCOMI_ST0_X87=(XED_ICLASS_FUCOMI<<8)+0, + XED_IFORM_FUCOMIP_ST0_X87=(XED_ICLASS_FUCOMIP<<8)+0, + XED_IFORM_FUCOMP_ST0_X87=(XED_ICLASS_FUCOMP<<8)+0, + XED_IFORM_FUCOMPP_ST0_ST1=(XED_ICLASS_FUCOMPP<<8)+0, + XED_IFORM_FWAIT=(XED_ICLASS_FWAIT<<8)+0, + XED_IFORM_FXAM_ST0=(XED_ICLASS_FXAM<<8)+0, + XED_IFORM_FXCH_ST0_X87=(XED_ICLASS_FXCH<<8)+0, + XED_IFORM_FXRSTOR_MEMmfpxenv=(XED_ICLASS_FXRSTOR<<8)+0, + XED_IFORM_FXSAVE_MEMmfpxenv=(XED_ICLASS_FXSAVE<<8)+0, + XED_IFORM_FXTRACT_ST0_ST1=(XED_ICLASS_FXTRACT<<8)+0, + XED_IFORM_FYL2X_ST0_ST1=(XED_ICLASS_FYL2X<<8)+0, + XED_IFORM_FYL2XP1_ST0_ST1=(XED_ICLASS_FYL2XP1<<8)+0, + XED_IFORM_HADDPD_XMMpd_MEMpd=(XED_ICLASS_HADDPD<<8)+0, + XED_IFORM_HADDPD_XMMpd_XMMpd=(XED_ICLASS_HADDPD<<8)+1, + XED_IFORM_HADDPS_XMMps_XMMps=(XED_ICLASS_HADDPS<<8)+0, + XED_IFORM_HADDPS_XMMps_MEMps=(XED_ICLASS_HADDPS<<8)+1, + XED_IFORM_HLT=(XED_ICLASS_HLT<<8)+0, + XED_IFORM_HSUBPD_XMMpd_XMMpd=(XED_ICLASS_HSUBPD<<8)+0, + XED_IFORM_HSUBPD_XMMpd_MEMpd=(XED_ICLASS_HSUBPD<<8)+1, + XED_IFORM_HSUBPS_XMMps_MEMps=(XED_ICLASS_HSUBPS<<8)+0, + XED_IFORM_HSUBPS_XMMps_XMMps=(XED_ICLASS_HSUBPS<<8)+1, + XED_IFORM_IDIV_MEMb=(XED_ICLASS_IDIV<<8)+0, + XED_IFORM_IDIV_GPR8=(XED_ICLASS_IDIV<<8)+1, + XED_IFORM_IDIV_GPRv=(XED_ICLASS_IDIV<<8)+2, + XED_IFORM_IDIV_MEMv=(XED_ICLASS_IDIV<<8)+3, + XED_IFORM_IMUL_MEMv=(XED_ICLASS_IMUL<<8)+0, + XED_IFORM_IMUL_GPRv_GPRv=(XED_ICLASS_IMUL<<8)+1, + XED_IFORM_IMUL_GPRv_GPRv_IMM=(XED_ICLASS_IMUL<<8)+2, + XED_IFORM_IMUL_GPR8=(XED_ICLASS_IMUL<<8)+3, + XED_IFORM_IMUL_MEMb=(XED_ICLASS_IMUL<<8)+4, + XED_IFORM_IMUL_GPRv_MEMv_IMM=(XED_ICLASS_IMUL<<8)+5, + XED_IFORM_IMUL_GPRv_MEMv=(XED_ICLASS_IMUL<<8)+6, + XED_IFORM_IMUL_GPRv=(XED_ICLASS_IMUL<<8)+7, + XED_IFORM_IN_OeAX_DX=(XED_ICLASS_IN<<8)+0, + XED_IFORM_IN_OeAX_IMM=(XED_ICLASS_IN<<8)+1, + XED_IFORM_IN_AL_IMM=(XED_ICLASS_IN<<8)+2, + XED_IFORM_IN_AL_DX=(XED_ICLASS_IN<<8)+3, + XED_IFORM_INC_MEMb=(XED_ICLASS_INC<<8)+0, + XED_IFORM_INC_MEMv=(XED_ICLASS_INC<<8)+1, + XED_IFORM_INC_GPRv=(XED_ICLASS_INC<<8)+2, + XED_IFORM_INC_GPR8=(XED_ICLASS_INC<<8)+3, + XED_IFORM_INSB=(XED_ICLASS_INSB<<8)+0, + XED_IFORM_INSD=(XED_ICLASS_INSD<<8)+0, + XED_IFORM_INSERTPS_XMMps_XMMps_IMM=(XED_ICLASS_INSERTPS<<8)+0, + XED_IFORM_INSERTPS_XMMps_MEMd_IMM=(XED_ICLASS_INSERTPS<<8)+1, + XED_IFORM_INSERTQ_XMMq_XMMdq=(XED_ICLASS_INSERTQ<<8)+0, + XED_IFORM_INSERTQ_XMMq_XMMq_IMM_IMM=(XED_ICLASS_INSERTQ<<8)+1, + XED_IFORM_INSW=(XED_ICLASS_INSW<<8)+0, + XED_IFORM_INT_IMM=(XED_ICLASS_INT<<8)+0, + XED_IFORM_INT1=(XED_ICLASS_INT1<<8)+0, + XED_IFORM_INT3=(XED_ICLASS_INT3<<8)+0, + XED_IFORM_INTO=(XED_ICLASS_INTO<<8)+0, + XED_IFORM_INVD=(XED_ICLASS_INVD<<8)+0, + XED_IFORM_INVLPG_MEMb=(XED_ICLASS_INVLPG<<8)+0, + XED_IFORM_INVLPGA_OrAX_ECX=(XED_ICLASS_INVLPGA<<8)+0, + XED_IFORM_IRET=(XED_ICLASS_IRET<<8)+0, + XED_IFORM_IRETD=(XED_ICLASS_IRETD<<8)+0, + XED_IFORM_IRETQ=(XED_ICLASS_IRETQ<<8)+0, + XED_IFORM_JB_RELBR=(XED_ICLASS_JB<<8)+0, + XED_IFORM_JBE_RELBR=(XED_ICLASS_JBE<<8)+0, + XED_IFORM_JL_RELBR=(XED_ICLASS_JL<<8)+0, + XED_IFORM_JLE_RELBR=(XED_ICLASS_JLE<<8)+0, + XED_IFORM_JMP_RELBR=(XED_ICLASS_JMP<<8)+0, + XED_IFORM_JMP_MEMv=(XED_ICLASS_JMP<<8)+1, + XED_IFORM_JMP_GPRv=(XED_ICLASS_JMP<<8)+2, + XED_IFORM_JMP_FAR_PTR_IMM=(XED_ICLASS_JMP_FAR<<8)+0, + XED_IFORM_JMP_FAR_MEMp=(XED_ICLASS_JMP_FAR<<8)+1, + XED_IFORM_JNB_RELBR=(XED_ICLASS_JNB<<8)+0, + XED_IFORM_JNBE_RELBR=(XED_ICLASS_JNBE<<8)+0, + XED_IFORM_JNL_RELBR=(XED_ICLASS_JNL<<8)+0, + XED_IFORM_JNLE_RELBR=(XED_ICLASS_JNLE<<8)+0, + XED_IFORM_JNO_RELBR=(XED_ICLASS_JNO<<8)+0, + XED_IFORM_JNP_RELBR=(XED_ICLASS_JNP<<8)+0, + XED_IFORM_JNS_RELBR=(XED_ICLASS_JNS<<8)+0, + XED_IFORM_JNZ_RELBR=(XED_ICLASS_JNZ<<8)+0, + XED_IFORM_JO_RELBR=(XED_ICLASS_JO<<8)+0, + XED_IFORM_JP_RELBR=(XED_ICLASS_JP<<8)+0, + XED_IFORM_JRCXZ_RELBR=(XED_ICLASS_JRCXZ<<8)+0, + XED_IFORM_JS_RELBR=(XED_ICLASS_JS<<8)+0, + XED_IFORM_JZ_RELBR=(XED_ICLASS_JZ<<8)+0, + XED_IFORM_LAHF=(XED_ICLASS_LAHF<<8)+0, + XED_IFORM_LAR_GPRv_GPR16=(XED_ICLASS_LAR<<8)+0, + XED_IFORM_LAR_GPRv_MEMw=(XED_ICLASS_LAR<<8)+1, + XED_IFORM_LDDQU_XMMpd_MEMdq=(XED_ICLASS_LDDQU<<8)+0, + XED_IFORM_LDMXCSR_MEMd=(XED_ICLASS_LDMXCSR<<8)+0, + XED_IFORM_LDS_GPRz_MEMp=(XED_ICLASS_LDS<<8)+0, + XED_IFORM_LEA_GPRv_AGEN=(XED_ICLASS_LEA<<8)+0, + XED_IFORM_LEAVE=(XED_ICLASS_LEAVE<<8)+0, + XED_IFORM_LES_GPRz_MEMp=(XED_ICLASS_LES<<8)+0, + XED_IFORM_LFENCE=(XED_ICLASS_LFENCE<<8)+0, + XED_IFORM_LFS_GPRv_MEMp2=(XED_ICLASS_LFS<<8)+0, + XED_IFORM_LGDT_MEMs=(XED_ICLASS_LGDT<<8)+0, + XED_IFORM_LGS_GPRv_MEMp2=(XED_ICLASS_LGS<<8)+0, + XED_IFORM_LIDT_MEMs=(XED_ICLASS_LIDT<<8)+0, + XED_IFORM_LLDT_MEMw=(XED_ICLASS_LLDT<<8)+0, + XED_IFORM_LLDT_GPR16=(XED_ICLASS_LLDT<<8)+1, + XED_IFORM_LMSW_GPR16=(XED_ICLASS_LMSW<<8)+0, + XED_IFORM_LMSW_MEMw=(XED_ICLASS_LMSW<<8)+1, + XED_IFORM_LODSB=(XED_ICLASS_LODSB<<8)+0, + XED_IFORM_LODSD=(XED_ICLASS_LODSD<<8)+0, + XED_IFORM_LODSQ=(XED_ICLASS_LODSQ<<8)+0, + XED_IFORM_LODSW=(XED_ICLASS_LODSW<<8)+0, + XED_IFORM_LOOP_RELBR=(XED_ICLASS_LOOP<<8)+0, + XED_IFORM_LOOPE_RELBR=(XED_ICLASS_LOOPE<<8)+0, + XED_IFORM_LOOPNE_RELBR=(XED_ICLASS_LOOPNE<<8)+0, + XED_IFORM_LSL_GPRv_GPR16=(XED_ICLASS_LSL<<8)+0, + XED_IFORM_LSL_GPRv_MEMw=(XED_ICLASS_LSL<<8)+1, + XED_IFORM_LSS_GPRv_MEMp2=(XED_ICLASS_LSS<<8)+0, + XED_IFORM_LTR_GPR16=(XED_ICLASS_LTR<<8)+0, + XED_IFORM_LTR_MEMw=(XED_ICLASS_LTR<<8)+1, + XED_IFORM_LZCNT_GPRv_GPRv=(XED_ICLASS_LZCNT<<8)+0, + XED_IFORM_LZCNT_GPRv_MEMv=(XED_ICLASS_LZCNT<<8)+1, + XED_IFORM_MASKMOVDQU_XMMdq_XMMdq=(XED_ICLASS_MASKMOVDQU<<8)+0, + XED_IFORM_MASKMOVQ_MMXq_MMXq=(XED_ICLASS_MASKMOVQ<<8)+0, + XED_IFORM_MAXPD_XMMpd_MEMpd=(XED_ICLASS_MAXPD<<8)+0, + XED_IFORM_MAXPD_XMMpd_XMMpd=(XED_ICLASS_MAXPD<<8)+1, + XED_IFORM_MAXPS_XMMps_XMMps=(XED_ICLASS_MAXPS<<8)+0, + XED_IFORM_MAXPS_XMMps_MEMps=(XED_ICLASS_MAXPS<<8)+1, + XED_IFORM_MAXSD_XMMsd_XMMsd=(XED_ICLASS_MAXSD<<8)+0, + XED_IFORM_MAXSD_XMMsd_MEMsd=(XED_ICLASS_MAXSD<<8)+1, + XED_IFORM_MAXSS_XMMss_MEMss=(XED_ICLASS_MAXSS<<8)+0, + XED_IFORM_MAXSS_XMMss_XMMss=(XED_ICLASS_MAXSS<<8)+1, + XED_IFORM_MFENCE=(XED_ICLASS_MFENCE<<8)+0, + XED_IFORM_MINPD_XMMpd_MEMpd=(XED_ICLASS_MINPD<<8)+0, + XED_IFORM_MINPD_XMMpd_XMMpd=(XED_ICLASS_MINPD<<8)+1, + XED_IFORM_MINPS_XMMps_XMMps=(XED_ICLASS_MINPS<<8)+0, + XED_IFORM_MINPS_XMMps_MEMps=(XED_ICLASS_MINPS<<8)+1, + XED_IFORM_MINSD_XMMsd_XMMsd=(XED_ICLASS_MINSD<<8)+0, + XED_IFORM_MINSD_XMMsd_MEMsd=(XED_ICLASS_MINSD<<8)+1, + XED_IFORM_MINSS_XMMss_MEMss=(XED_ICLASS_MINSS<<8)+0, + XED_IFORM_MINSS_XMMss_XMMss=(XED_ICLASS_MINSS<<8)+1, + XED_IFORM_MONITOR_EAX_ECX_EDX=(XED_ICLASS_MONITOR<<8)+0, + XED_IFORM_MOV_GPRv_GPRv=(XED_ICLASS_MOV<<8)+0, + XED_IFORM_MOV_GPR8_GPR8=(XED_ICLASS_MOV<<8)+1, + XED_IFORM_MOV_GPR8_IMM=(XED_ICLASS_MOV<<8)+2, + XED_IFORM_MOV_GPR8_MEMb=(XED_ICLASS_MOV<<8)+3, + XED_IFORM_MOV_MEMv_GPRv=(XED_ICLASS_MOV<<8)+4, + XED_IFORM_MOV_MEMb_GPR8=(XED_ICLASS_MOV<<8)+5, + XED_IFORM_MOV_MEMv_OrAX=(XED_ICLASS_MOV<<8)+6, + XED_IFORM_MOV_AL_MEMb=(XED_ICLASS_MOV<<8)+7, + XED_IFORM_MOV_MEMb_AL=(XED_ICLASS_MOV<<8)+8, + XED_IFORM_MOV_OrAX_MEMv=(XED_ICLASS_MOV<<8)+9, + XED_IFORM_MOV_MEMw_SEG=(XED_ICLASS_MOV<<8)+10, + XED_IFORM_MOV_GPRv_MEMv=(XED_ICLASS_MOV<<8)+11, + XED_IFORM_MOV_SEG_MEMw=(XED_ICLASS_MOV<<8)+12, + XED_IFORM_MOV_MEMv_IMM=(XED_ICLASS_MOV<<8)+13, + XED_IFORM_MOV_SEG_GPR16=(XED_ICLASS_MOV<<8)+14, + XED_IFORM_MOV_GPRv_IMM=(XED_ICLASS_MOV<<8)+15, + XED_IFORM_MOV_MEMb_IMM=(XED_ICLASS_MOV<<8)+16, + XED_IFORM_MOV_GPRv_SEG=(XED_ICLASS_MOV<<8)+17, + XED_IFORM_MOVAPD_XMMpd_MEMpd=(XED_ICLASS_MOVAPD<<8)+0, + XED_IFORM_MOVAPD_XMMpd_XMMpd=(XED_ICLASS_MOVAPD<<8)+1, + XED_IFORM_MOVAPD_MEMpd_XMMpd=(XED_ICLASS_MOVAPD<<8)+2, + XED_IFORM_MOVAPS_XMMps_XMMps=(XED_ICLASS_MOVAPS<<8)+0, + XED_IFORM_MOVAPS_XMMps_MEMps=(XED_ICLASS_MOVAPS<<8)+1, + XED_IFORM_MOVAPS_MEMps_XMMps=(XED_ICLASS_MOVAPS<<8)+2, + XED_IFORM_MOVD_MEMd_XMMd=(XED_ICLASS_MOVD<<8)+0, + XED_IFORM_MOVD_GPR32_MMXd=(XED_ICLASS_MOVD<<8)+1, + XED_IFORM_MOVD_MMXq_MEMd=(XED_ICLASS_MOVD<<8)+2, + XED_IFORM_MOVD_XMMdq_MEMd=(XED_ICLASS_MOVD<<8)+3, + XED_IFORM_MOVD_XMMdq_GPR32=(XED_ICLASS_MOVD<<8)+4, + XED_IFORM_MOVD_GPR32_XMMd=(XED_ICLASS_MOVD<<8)+5, + XED_IFORM_MOVD_MMXq_GPR32=(XED_ICLASS_MOVD<<8)+6, + XED_IFORM_MOVD_MEMd_MMXd=(XED_ICLASS_MOVD<<8)+7, + XED_IFORM_MOVDDUP_XMMq_XMMq=(XED_ICLASS_MOVDDUP<<8)+0, + XED_IFORM_MOVDDUP_XMMq_MEMq=(XED_ICLASS_MOVDDUP<<8)+1, + XED_IFORM_MOVDQ2Q_MMXq_XMMq=(XED_ICLASS_MOVDQ2Q<<8)+0, + XED_IFORM_MOVDQA_XMMdq_XMMdq=(XED_ICLASS_MOVDQA<<8)+0, + XED_IFORM_MOVDQA_XMMdq_MEMdq=(XED_ICLASS_MOVDQA<<8)+1, + XED_IFORM_MOVDQA_MEMdq_XMMdq=(XED_ICLASS_MOVDQA<<8)+2, + XED_IFORM_MOVDQU_MEMdq_XMMdq=(XED_ICLASS_MOVDQU<<8)+0, + XED_IFORM_MOVDQU_XMMdq_XMMdq=(XED_ICLASS_MOVDQU<<8)+1, + XED_IFORM_MOVDQU_XMMdq_MEMdq=(XED_ICLASS_MOVDQU<<8)+2, + XED_IFORM_MOVHLPS_XMMq_XMMq=(XED_ICLASS_MOVHLPS<<8)+0, + XED_IFORM_MOVHPD_MEMq_XMMsd=(XED_ICLASS_MOVHPD<<8)+0, + XED_IFORM_MOVHPD_XMMsd_MEMq=(XED_ICLASS_MOVHPD<<8)+1, + XED_IFORM_MOVHPS_MEMq_XMMps=(XED_ICLASS_MOVHPS<<8)+0, + XED_IFORM_MOVHPS_XMMq_MEMq=(XED_ICLASS_MOVHPS<<8)+1, + XED_IFORM_MOVLHPS_XMMq_XMMq=(XED_ICLASS_MOVLHPS<<8)+0, + XED_IFORM_MOVLPD_XMMsd_MEMq=(XED_ICLASS_MOVLPD<<8)+0, + XED_IFORM_MOVLPD_MEMq_XMMsd=(XED_ICLASS_MOVLPD<<8)+1, + XED_IFORM_MOVLPS_MEMq_XMMps=(XED_ICLASS_MOVLPS<<8)+0, + XED_IFORM_MOVLPS_XMMq_MEMq=(XED_ICLASS_MOVLPS<<8)+1, + XED_IFORM_MOVMSKPD_GPR32_XMMpd=(XED_ICLASS_MOVMSKPD<<8)+0, + XED_IFORM_MOVMSKPS_GPR32_XMMps=(XED_ICLASS_MOVMSKPS<<8)+0, + XED_IFORM_MOVNTDQ_MEMdq_XMMdq=(XED_ICLASS_MOVNTDQ<<8)+0, + XED_IFORM_MOVNTDQA_XMMdq_MEMdq=(XED_ICLASS_MOVNTDQA<<8)+0, + XED_IFORM_MOVNTI_MEMq_GPR64=(XED_ICLASS_MOVNTI<<8)+0, + XED_IFORM_MOVNTI_MEMd_GPR32=(XED_ICLASS_MOVNTI<<8)+1, + XED_IFORM_MOVNTPD_MEMdq_XMMpd=(XED_ICLASS_MOVNTPD<<8)+0, + XED_IFORM_MOVNTPS_MEMdq_XMMps=(XED_ICLASS_MOVNTPS<<8)+0, + XED_IFORM_MOVNTQ_MEMq_MMXq=(XED_ICLASS_MOVNTQ<<8)+0, + XED_IFORM_MOVNTSD_MEMq_XMMq=(XED_ICLASS_MOVNTSD<<8)+0, + XED_IFORM_MOVNTSS_MEMd_XMMd=(XED_ICLASS_MOVNTSS<<8)+0, + XED_IFORM_MOVQ_MMXq_MMXq=(XED_ICLASS_MOVQ<<8)+0, + XED_IFORM_MOVQ_XMMdq_GPR64=(XED_ICLASS_MOVQ<<8)+1, + XED_IFORM_MOVQ_GPR64_MMXq=(XED_ICLASS_MOVQ<<8)+2, + XED_IFORM_MOVQ_MEMq_XMMq=(XED_ICLASS_MOVQ<<8)+3, + XED_IFORM_MOVQ_MMXq_GPR64=(XED_ICLASS_MOVQ<<8)+4, + XED_IFORM_MOVQ_MMXq_MEMq=(XED_ICLASS_MOVQ<<8)+5, + XED_IFORM_MOVQ_XMMdq_MEMq=(XED_ICLASS_MOVQ<<8)+6, + XED_IFORM_MOVQ_XMMdq_XMMq=(XED_ICLASS_MOVQ<<8)+7, + XED_IFORM_MOVQ_GPR64_XMMq=(XED_ICLASS_MOVQ<<8)+8, + XED_IFORM_MOVQ_MEMq_MMXq=(XED_ICLASS_MOVQ<<8)+9, + XED_IFORM_MOVQ2DQ_XMMdq_MMXq=(XED_ICLASS_MOVQ2DQ<<8)+0, + XED_IFORM_MOVSB=(XED_ICLASS_MOVSB<<8)+0, + XED_IFORM_MOVSD=(XED_ICLASS_MOVSD<<8)+0, + XED_IFORM_MOVSD_XMM_XMMsd_XMMsd=(XED_ICLASS_MOVSD_XMM<<8)+0, + XED_IFORM_MOVSD_XMM_MEMsd_XMMsd=(XED_ICLASS_MOVSD_XMM<<8)+1, + XED_IFORM_MOVSD_XMM_XMMdq_MEMsd=(XED_ICLASS_MOVSD_XMM<<8)+2, + XED_IFORM_MOVSHDUP_XMMps_XMMps=(XED_ICLASS_MOVSHDUP<<8)+0, + XED_IFORM_MOVSHDUP_XMMps_MEMps=(XED_ICLASS_MOVSHDUP<<8)+1, + XED_IFORM_MOVSLDUP_XMMps_XMMps=(XED_ICLASS_MOVSLDUP<<8)+0, + XED_IFORM_MOVSLDUP_XMMps_MEMps=(XED_ICLASS_MOVSLDUP<<8)+1, + XED_IFORM_MOVSQ=(XED_ICLASS_MOVSQ<<8)+0, + XED_IFORM_MOVSS_MEMss_XMMss=(XED_ICLASS_MOVSS<<8)+0, + XED_IFORM_MOVSS_XMMss_XMMss=(XED_ICLASS_MOVSS<<8)+1, + XED_IFORM_MOVSS_XMMdq_MEMss=(XED_ICLASS_MOVSS<<8)+2, + XED_IFORM_MOVSW=(XED_ICLASS_MOVSW<<8)+0, + XED_IFORM_MOVSX_GPRv_GPR16=(XED_ICLASS_MOVSX<<8)+0, + XED_IFORM_MOVSX_GPRv_MEMb=(XED_ICLASS_MOVSX<<8)+1, + XED_IFORM_MOVSX_GPRv_GPR8=(XED_ICLASS_MOVSX<<8)+2, + XED_IFORM_MOVSX_GPRv_MEMw=(XED_ICLASS_MOVSX<<8)+3, + XED_IFORM_MOVSXD_GPRv_MEMd=(XED_ICLASS_MOVSXD<<8)+0, + XED_IFORM_MOVSXD_GPRv_GPR32=(XED_ICLASS_MOVSXD<<8)+1, + XED_IFORM_MOVUPD_MEMpd_XMMpd=(XED_ICLASS_MOVUPD<<8)+0, + XED_IFORM_MOVUPD_XMMpd_MEMpd=(XED_ICLASS_MOVUPD<<8)+1, + XED_IFORM_MOVUPD_XMMpd_XMMpd=(XED_ICLASS_MOVUPD<<8)+2, + XED_IFORM_MOVUPS_MEMps_XMMps=(XED_ICLASS_MOVUPS<<8)+0, + XED_IFORM_MOVUPS_XMMps_XMMps=(XED_ICLASS_MOVUPS<<8)+1, + XED_IFORM_MOVUPS_XMMps_MEMps=(XED_ICLASS_MOVUPS<<8)+2, + XED_IFORM_MOVZX_GPRv_MEMb=(XED_ICLASS_MOVZX<<8)+0, + XED_IFORM_MOVZX_GPRv_GPR16=(XED_ICLASS_MOVZX<<8)+1, + XED_IFORM_MOVZX_GPRv_MEMw=(XED_ICLASS_MOVZX<<8)+2, + XED_IFORM_MOVZX_GPRv_GPR8=(XED_ICLASS_MOVZX<<8)+3, + XED_IFORM_MOV_CR_CR_GPR32=(XED_ICLASS_MOV_CR<<8)+0, + XED_IFORM_MOV_CR_GPR64_CR=(XED_ICLASS_MOV_CR<<8)+1, + XED_IFORM_MOV_CR_GPR32_CR=(XED_ICLASS_MOV_CR<<8)+2, + XED_IFORM_MOV_CR_CR_GPR64=(XED_ICLASS_MOV_CR<<8)+3, + XED_IFORM_MOV_DR_GPR64_DR=(XED_ICLASS_MOV_DR<<8)+0, + XED_IFORM_MOV_DR_DR_GPR32=(XED_ICLASS_MOV_DR<<8)+1, + XED_IFORM_MOV_DR_GPR32_DR=(XED_ICLASS_MOV_DR<<8)+2, + XED_IFORM_MOV_DR_DR_GPR64=(XED_ICLASS_MOV_DR<<8)+3, + XED_IFORM_MPSADBW_XMMdq_XMMdq_IMM=(XED_ICLASS_MPSADBW<<8)+0, + XED_IFORM_MPSADBW_XMMdq_MEMdq_IMM=(XED_ICLASS_MPSADBW<<8)+1, + XED_IFORM_MUL_MEMb=(XED_ICLASS_MUL<<8)+0, + XED_IFORM_MUL_GPRv=(XED_ICLASS_MUL<<8)+1, + XED_IFORM_MUL_GPR8=(XED_ICLASS_MUL<<8)+2, + XED_IFORM_MUL_MEMv=(XED_ICLASS_MUL<<8)+3, + XED_IFORM_MULPD_XMMpd_MEMpd=(XED_ICLASS_MULPD<<8)+0, + XED_IFORM_MULPD_XMMpd_XMMpd=(XED_ICLASS_MULPD<<8)+1, + XED_IFORM_MULPS_XMMps_XMMps=(XED_ICLASS_MULPS<<8)+0, + XED_IFORM_MULPS_XMMps_MEMps=(XED_ICLASS_MULPS<<8)+1, + XED_IFORM_MULSD_XMMsd_XMMsd=(XED_ICLASS_MULSD<<8)+0, + XED_IFORM_MULSD_XMMsd_MEMsd=(XED_ICLASS_MULSD<<8)+1, + XED_IFORM_MULSS_XMMss_MEMss=(XED_ICLASS_MULSS<<8)+0, + XED_IFORM_MULSS_XMMss_XMMss=(XED_ICLASS_MULSS<<8)+1, + XED_IFORM_MWAIT_EAX_ECX=(XED_ICLASS_MWAIT<<8)+0, + XED_IFORM_NEG_GPR8=(XED_ICLASS_NEG<<8)+0, + XED_IFORM_NEG_GPRv=(XED_ICLASS_NEG<<8)+1, + XED_IFORM_NEG_MEMb=(XED_ICLASS_NEG<<8)+2, + XED_IFORM_NEG_MEMv=(XED_ICLASS_NEG<<8)+3, + XED_IFORM_NOP=(XED_ICLASS_NOP<<8)+0, + XED_IFORM_NOP_GPRv_GPRv=(XED_ICLASS_NOP<<8)+1, + XED_IFORM_NOP_MEMv_GPRv=(XED_ICLASS_NOP<<8)+2, + XED_IFORM_NOT_MEMv=(XED_ICLASS_NOT<<8)+0, + XED_IFORM_NOT_GPRv=(XED_ICLASS_NOT<<8)+1, + XED_IFORM_NOT_GPR8=(XED_ICLASS_NOT<<8)+2, + XED_IFORM_NOT_MEMb=(XED_ICLASS_NOT<<8)+3, + XED_IFORM_OR_GPRv_MEMv=(XED_ICLASS_OR<<8)+0, + XED_IFORM_OR_GPRv_GPRv=(XED_ICLASS_OR<<8)+1, + XED_IFORM_OR_MEMv_IMM=(XED_ICLASS_OR<<8)+2, + XED_IFORM_OR_GPR8_GPR8=(XED_ICLASS_OR<<8)+3, + XED_IFORM_OR_MEMb_IMM=(XED_ICLASS_OR<<8)+4, + XED_IFORM_OR_MEMv_GPRv=(XED_ICLASS_OR<<8)+5, + XED_IFORM_OR_GPRv_IMM=(XED_ICLASS_OR<<8)+6, + XED_IFORM_OR_MEMb_GPR8=(XED_ICLASS_OR<<8)+7, + XED_IFORM_OR_GPR8_IMM=(XED_ICLASS_OR<<8)+8, + XED_IFORM_OR_AL_IMM=(XED_ICLASS_OR<<8)+9, + XED_IFORM_OR_GPR8_MEMb=(XED_ICLASS_OR<<8)+10, + XED_IFORM_OR_OrAX_IMM=(XED_ICLASS_OR<<8)+11, + XED_IFORM_ORPD_XMMpd_MEMpd=(XED_ICLASS_ORPD<<8)+0, + XED_IFORM_ORPD_XMMpd_XMMpd=(XED_ICLASS_ORPD<<8)+1, + XED_IFORM_ORPS_XMMps_XMMps=(XED_ICLASS_ORPS<<8)+0, + XED_IFORM_ORPS_XMMps_MEMps=(XED_ICLASS_ORPS<<8)+1, + XED_IFORM_OUT_IMM_AL=(XED_ICLASS_OUT<<8)+0, + XED_IFORM_OUT_DX_AL=(XED_ICLASS_OUT<<8)+1, + XED_IFORM_OUT_IMM_OeAX=(XED_ICLASS_OUT<<8)+2, + XED_IFORM_OUT_DX_OeAX=(XED_ICLASS_OUT<<8)+3, + XED_IFORM_OUTSB=(XED_ICLASS_OUTSB<<8)+0, + XED_IFORM_OUTSD=(XED_ICLASS_OUTSD<<8)+0, + XED_IFORM_OUTSW=(XED_ICLASS_OUTSW<<8)+0, + XED_IFORM_PABSB_MMXq_MEMq=(XED_ICLASS_PABSB<<8)+0, + XED_IFORM_PABSB_XMMdq_MEMdq=(XED_ICLASS_PABSB<<8)+1, + XED_IFORM_PABSB_MMXq_MMXq=(XED_ICLASS_PABSB<<8)+2, + XED_IFORM_PABSB_XMMdq_XMMdq=(XED_ICLASS_PABSB<<8)+3, + XED_IFORM_PABSD_MMXq_MEMq=(XED_ICLASS_PABSD<<8)+0, + XED_IFORM_PABSD_MMXq_MMXq=(XED_ICLASS_PABSD<<8)+1, + XED_IFORM_PABSD_XMMdq_MEMdq=(XED_ICLASS_PABSD<<8)+2, + XED_IFORM_PABSD_XMMdq_XMMdq=(XED_ICLASS_PABSD<<8)+3, + XED_IFORM_PABSW_XMMdq_MEMdq=(XED_ICLASS_PABSW<<8)+0, + XED_IFORM_PABSW_MMXq_MMXq=(XED_ICLASS_PABSW<<8)+1, + XED_IFORM_PABSW_XMMdq_XMMdq=(XED_ICLASS_PABSW<<8)+2, + XED_IFORM_PABSW_MMXq_MEMq=(XED_ICLASS_PABSW<<8)+3, + XED_IFORM_PACKSSDW_XMMdq_MEMdq=(XED_ICLASS_PACKSSDW<<8)+0, + XED_IFORM_PACKSSDW_MMXq_MEMq=(XED_ICLASS_PACKSSDW<<8)+1, + XED_IFORM_PACKSSDW_MMXq_MMXq=(XED_ICLASS_PACKSSDW<<8)+2, + XED_IFORM_PACKSSDW_XMMdq_XMMdq=(XED_ICLASS_PACKSSDW<<8)+3, + XED_IFORM_PACKSSWB_MMXq_MMXq=(XED_ICLASS_PACKSSWB<<8)+0, + XED_IFORM_PACKSSWB_XMMdq_MEMdq=(XED_ICLASS_PACKSSWB<<8)+1, + XED_IFORM_PACKSSWB_XMMdq_XMMdq=(XED_ICLASS_PACKSSWB<<8)+2, + XED_IFORM_PACKSSWB_MMXq_MEMq=(XED_ICLASS_PACKSSWB<<8)+3, + XED_IFORM_PACKUSDW_XMMdq_XMMdq=(XED_ICLASS_PACKUSDW<<8)+0, + XED_IFORM_PACKUSDW_XMMdq_MEMdq=(XED_ICLASS_PACKUSDW<<8)+1, + XED_IFORM_PACKUSWB_XMMdq_XMMdq=(XED_ICLASS_PACKUSWB<<8)+0, + XED_IFORM_PACKUSWB_XMMdq_MEMdq=(XED_ICLASS_PACKUSWB<<8)+1, + XED_IFORM_PACKUSWB_MMXq_MEMq=(XED_ICLASS_PACKUSWB<<8)+2, + XED_IFORM_PACKUSWB_MMXq_MMXq=(XED_ICLASS_PACKUSWB<<8)+3, + XED_IFORM_PADDB_XMMdq_XMMdq=(XED_ICLASS_PADDB<<8)+0, + XED_IFORM_PADDB_XMMdq_MEMdq=(XED_ICLASS_PADDB<<8)+1, + XED_IFORM_PADDB_MMXq_MMXq=(XED_ICLASS_PADDB<<8)+2, + XED_IFORM_PADDB_MMXq_MEMq=(XED_ICLASS_PADDB<<8)+3, + XED_IFORM_PADDD_XMMdq_MEMdq=(XED_ICLASS_PADDD<<8)+0, + XED_IFORM_PADDD_MMXq_MMXq=(XED_ICLASS_PADDD<<8)+1, + XED_IFORM_PADDD_XMMdq_XMMdq=(XED_ICLASS_PADDD<<8)+2, + XED_IFORM_PADDD_MMXq_MEMq=(XED_ICLASS_PADDD<<8)+3, + XED_IFORM_PADDQ_MMXq_MEMq=(XED_ICLASS_PADDQ<<8)+0, + XED_IFORM_PADDQ_XMMdq_MEMdq=(XED_ICLASS_PADDQ<<8)+1, + XED_IFORM_PADDQ_MMXq_MMXq=(XED_ICLASS_PADDQ<<8)+2, + XED_IFORM_PADDQ_XMMdq_XMMdq=(XED_ICLASS_PADDQ<<8)+3, + XED_IFORM_PADDSB_XMMdq_XMMdq=(XED_ICLASS_PADDSB<<8)+0, + XED_IFORM_PADDSB_XMMdq_MEMdq=(XED_ICLASS_PADDSB<<8)+1, + XED_IFORM_PADDSB_MMXq_MMXq=(XED_ICLASS_PADDSB<<8)+2, + XED_IFORM_PADDSB_MMXq_MEMq=(XED_ICLASS_PADDSB<<8)+3, + XED_IFORM_PADDSW_MMXq_MEMq=(XED_ICLASS_PADDSW<<8)+0, + XED_IFORM_PADDSW_MMXq_MMXq=(XED_ICLASS_PADDSW<<8)+1, + XED_IFORM_PADDSW_XMMdq_MEMdq=(XED_ICLASS_PADDSW<<8)+2, + XED_IFORM_PADDSW_XMMdq_XMMdq=(XED_ICLASS_PADDSW<<8)+3, + XED_IFORM_PADDUSB_XMMdq_XMMdq=(XED_ICLASS_PADDUSB<<8)+0, + XED_IFORM_PADDUSB_MMXq_MEMq=(XED_ICLASS_PADDUSB<<8)+1, + XED_IFORM_PADDUSB_MMXq_MMXq=(XED_ICLASS_PADDUSB<<8)+2, + XED_IFORM_PADDUSB_XMMdq_MEMdq=(XED_ICLASS_PADDUSB<<8)+3, + XED_IFORM_PADDUSW_XMMdq_MEMdq=(XED_ICLASS_PADDUSW<<8)+0, + XED_IFORM_PADDUSW_MMXq_MMXq=(XED_ICLASS_PADDUSW<<8)+1, + XED_IFORM_PADDUSW_MMXq_MEMq=(XED_ICLASS_PADDUSW<<8)+2, + XED_IFORM_PADDUSW_XMMdq_XMMdq=(XED_ICLASS_PADDUSW<<8)+3, + XED_IFORM_PADDW_MMXq_MEMq=(XED_ICLASS_PADDW<<8)+0, + XED_IFORM_PADDW_MMXq_MMXq=(XED_ICLASS_PADDW<<8)+1, + XED_IFORM_PADDW_XMMdq_MEMdq=(XED_ICLASS_PADDW<<8)+2, + XED_IFORM_PADDW_XMMdq_XMMdq=(XED_ICLASS_PADDW<<8)+3, + XED_IFORM_PALIGNR_XMMdq_XMMdq_IMM=(XED_ICLASS_PALIGNR<<8)+0, + XED_IFORM_PALIGNR_MMXq_MEMq_IMM=(XED_ICLASS_PALIGNR<<8)+1, + XED_IFORM_PALIGNR_MMXq_MMXq_IMM=(XED_ICLASS_PALIGNR<<8)+2, + XED_IFORM_PALIGNR_XMMdq_MEMdq_IMM=(XED_ICLASS_PALIGNR<<8)+3, + XED_IFORM_PAND_MMXq_MMXq=(XED_ICLASS_PAND<<8)+0, + XED_IFORM_PAND_MMXq_MEMq=(XED_ICLASS_PAND<<8)+1, + XED_IFORM_PAND_XMMdq_XMMdq=(XED_ICLASS_PAND<<8)+2, + XED_IFORM_PAND_XMMdq_MEMdq=(XED_ICLASS_PAND<<8)+3, + XED_IFORM_PANDN_XMMdq_MEMdq=(XED_ICLASS_PANDN<<8)+0, + XED_IFORM_PANDN_MMXq_MMXq=(XED_ICLASS_PANDN<<8)+1, + XED_IFORM_PANDN_XMMdq_XMMdq=(XED_ICLASS_PANDN<<8)+2, + XED_IFORM_PANDN_MMXq_MEMq=(XED_ICLASS_PANDN<<8)+3, + XED_IFORM_PAUSE=(XED_ICLASS_PAUSE<<8)+0, + XED_IFORM_PAVGB_XMMdq_MEMdq=(XED_ICLASS_PAVGB<<8)+0, + XED_IFORM_PAVGB_MMXq_MEMq=(XED_ICLASS_PAVGB<<8)+1, + XED_IFORM_PAVGB_XMMdq_XMMdq=(XED_ICLASS_PAVGB<<8)+2, + XED_IFORM_PAVGB_MMXq_MMXq=(XED_ICLASS_PAVGB<<8)+3, + XED_IFORM_PAVGUSB_MMXq_MEMq=(XED_ICLASS_PAVGUSB<<8)+0, + XED_IFORM_PAVGUSB_MMXq_MMXq=(XED_ICLASS_PAVGUSB<<8)+1, + XED_IFORM_PAVGW_XMMdq_MEMdq=(XED_ICLASS_PAVGW<<8)+0, + XED_IFORM_PAVGW_MMXq_MMXq=(XED_ICLASS_PAVGW<<8)+1, + XED_IFORM_PAVGW_XMMdq_XMMdq=(XED_ICLASS_PAVGW<<8)+2, + XED_IFORM_PAVGW_MMXq_MEMq=(XED_ICLASS_PAVGW<<8)+3, + XED_IFORM_PBLENDVB_XMMdq_XMMdq_XMM0dq=(XED_ICLASS_PBLENDVB<<8)+0, + XED_IFORM_PBLENDVB_XMMdq_MEMdq_XMM0dq=(XED_ICLASS_PBLENDVB<<8)+1, + XED_IFORM_PBLENDW_XMMdq_MEMdq_IMM=(XED_ICLASS_PBLENDW<<8)+0, + XED_IFORM_PBLENDW_XMMdq_XMMdq_IMM=(XED_ICLASS_PBLENDW<<8)+1, + XED_IFORM_PCMPEQB_XMMdq_MEMdq=(XED_ICLASS_PCMPEQB<<8)+0, + XED_IFORM_PCMPEQB_MMXq_MMXq=(XED_ICLASS_PCMPEQB<<8)+1, + XED_IFORM_PCMPEQB_MMXq_MEMq=(XED_ICLASS_PCMPEQB<<8)+2, + XED_IFORM_PCMPEQB_XMMdq_XMMdq=(XED_ICLASS_PCMPEQB<<8)+3, + XED_IFORM_PCMPEQD_XMMdq_MEMdq=(XED_ICLASS_PCMPEQD<<8)+0, + XED_IFORM_PCMPEQD_XMMdq_XMMdq=(XED_ICLASS_PCMPEQD<<8)+1, + XED_IFORM_PCMPEQD_MMXq_MMXq=(XED_ICLASS_PCMPEQD<<8)+2, + XED_IFORM_PCMPEQD_MMXq_MEMq=(XED_ICLASS_PCMPEQD<<8)+3, + XED_IFORM_PCMPEQQ_XMMdq_XMMdq=(XED_ICLASS_PCMPEQQ<<8)+0, + XED_IFORM_PCMPEQQ_XMMdq_MEMdq=(XED_ICLASS_PCMPEQQ<<8)+1, + XED_IFORM_PCMPEQW_XMMdq_XMMdq=(XED_ICLASS_PCMPEQW<<8)+0, + XED_IFORM_PCMPEQW_MMXq_MEMq=(XED_ICLASS_PCMPEQW<<8)+1, + XED_IFORM_PCMPEQW_MMXq_MMXq=(XED_ICLASS_PCMPEQW<<8)+2, + XED_IFORM_PCMPEQW_XMMdq_MEMdq=(XED_ICLASS_PCMPEQW<<8)+3, + XED_IFORM_PCMPESTRI_XMMdq_XMMdq_IMM=(XED_ICLASS_PCMPESTRI<<8)+0, + XED_IFORM_PCMPESTRI_XMMdq_MEMdq_IMM=(XED_ICLASS_PCMPESTRI<<8)+1, + XED_IFORM_PCMPESTRM_XMMdq_MEMdq_IMM=(XED_ICLASS_PCMPESTRM<<8)+0, + XED_IFORM_PCMPESTRM_XMMdq_XMMdq_IMM=(XED_ICLASS_PCMPESTRM<<8)+1, + XED_IFORM_PCMPGTB_MMXq_MMXq=(XED_ICLASS_PCMPGTB<<8)+0, + XED_IFORM_PCMPGTB_XMMdq_MEMdq=(XED_ICLASS_PCMPGTB<<8)+1, + XED_IFORM_PCMPGTB_XMMdq_XMMdq=(XED_ICLASS_PCMPGTB<<8)+2, + XED_IFORM_PCMPGTB_MMXq_MEMq=(XED_ICLASS_PCMPGTB<<8)+3, + XED_IFORM_PCMPGTD_XMMdq_XMMdq=(XED_ICLASS_PCMPGTD<<8)+0, + XED_IFORM_PCMPGTD_XMMdq_MEMdq=(XED_ICLASS_PCMPGTD<<8)+1, + XED_IFORM_PCMPGTD_MMXq_MEMq=(XED_ICLASS_PCMPGTD<<8)+2, + XED_IFORM_PCMPGTD_MMXq_MMXq=(XED_ICLASS_PCMPGTD<<8)+3, + XED_IFORM_PCMPGTQ_XMMdq_MEMdq=(XED_ICLASS_PCMPGTQ<<8)+0, + XED_IFORM_PCMPGTQ_XMMdq_XMMdq=(XED_ICLASS_PCMPGTQ<<8)+1, + XED_IFORM_PCMPGTW_MMXq_MMXq=(XED_ICLASS_PCMPGTW<<8)+0, + XED_IFORM_PCMPGTW_MMXq_MEMq=(XED_ICLASS_PCMPGTW<<8)+1, + XED_IFORM_PCMPGTW_XMMdq_XMMdq=(XED_ICLASS_PCMPGTW<<8)+2, + XED_IFORM_PCMPGTW_XMMdq_MEMdq=(XED_ICLASS_PCMPGTW<<8)+3, + XED_IFORM_PCMPISTRI_XMMdq_MEMdq_IMM=(XED_ICLASS_PCMPISTRI<<8)+0, + XED_IFORM_PCMPISTRI_XMMdq_XMMdq_IMM=(XED_ICLASS_PCMPISTRI<<8)+1, + XED_IFORM_PCMPISTRM_XMMdq_XMMdq_IMM=(XED_ICLASS_PCMPISTRM<<8)+0, + XED_IFORM_PCMPISTRM_XMMdq_MEMdq_IMM=(XED_ICLASS_PCMPISTRM<<8)+1, + XED_IFORM_PEXTRB_MEMb_XMMdq_IMM=(XED_ICLASS_PEXTRB<<8)+0, + XED_IFORM_PEXTRB_GPR32d_XMMdq_IMM=(XED_ICLASS_PEXTRB<<8)+1, + XED_IFORM_PEXTRD_MEMd_XMMdq_IMM=(XED_ICLASS_PEXTRD<<8)+0, + XED_IFORM_PEXTRD_GPR32d_XMMdq_IMM=(XED_ICLASS_PEXTRD<<8)+1, + XED_IFORM_PEXTRQ_MEMq_XMMdq_IMM=(XED_ICLASS_PEXTRQ<<8)+0, + XED_IFORM_PEXTRQ_GPR64q_XMMdq_IMM=(XED_ICLASS_PEXTRQ<<8)+1, + XED_IFORM_PEXTRW_GPRy_XMMdq_IMM=(XED_ICLASS_PEXTRW<<8)+0, + XED_IFORM_PEXTRW_MEMw_XMMdq_IMM=(XED_ICLASS_PEXTRW<<8)+1, + XED_IFORM_PEXTRW_GPRy_MMXq_IMM=(XED_ICLASS_PEXTRW<<8)+2, + XED_IFORM_PEXTRW_GPR32d_XMMdq_IMM=(XED_ICLASS_PEXTRW<<8)+3, + XED_IFORM_PF2ID_MMXq_MMXq=(XED_ICLASS_PF2ID<<8)+0, + XED_IFORM_PF2ID_MMXq_MEMq=(XED_ICLASS_PF2ID<<8)+1, + XED_IFORM_PF2IW_MMXq_MEMq=(XED_ICLASS_PF2IW<<8)+0, + XED_IFORM_PF2IW_MMXq_MMXq=(XED_ICLASS_PF2IW<<8)+1, + XED_IFORM_PFACC_MMXq_MEMq=(XED_ICLASS_PFACC<<8)+0, + XED_IFORM_PFACC_MMXq_MMXq=(XED_ICLASS_PFACC<<8)+1, + XED_IFORM_PFADD_MMXq_MMXq=(XED_ICLASS_PFADD<<8)+0, + XED_IFORM_PFADD_MMXq_MEMq=(XED_ICLASS_PFADD<<8)+1, + XED_IFORM_PFCMPEQ_MMXq_MMXq=(XED_ICLASS_PFCMPEQ<<8)+0, + XED_IFORM_PFCMPEQ_MMXq_MEMq=(XED_ICLASS_PFCMPEQ<<8)+1, + XED_IFORM_PFCMPGE_MMXq_MEMq=(XED_ICLASS_PFCMPGE<<8)+0, + XED_IFORM_PFCMPGE_MMXq_MMXq=(XED_ICLASS_PFCMPGE<<8)+1, + XED_IFORM_PFCMPGT_MMXq_MEMq=(XED_ICLASS_PFCMPGT<<8)+0, + XED_IFORM_PFCMPGT_MMXq_MMXq=(XED_ICLASS_PFCMPGT<<8)+1, + XED_IFORM_PFCPIT1_MMXq_MMXq=(XED_ICLASS_PFCPIT1<<8)+0, + XED_IFORM_PFCPIT1_MMXq_MEMq=(XED_ICLASS_PFCPIT1<<8)+1, + XED_IFORM_PFMAX_MMXq_MEMq=(XED_ICLASS_PFMAX<<8)+0, + XED_IFORM_PFMAX_MMXq_MMXq=(XED_ICLASS_PFMAX<<8)+1, + XED_IFORM_PFMIN_MMXq_MEMq=(XED_ICLASS_PFMIN<<8)+0, + XED_IFORM_PFMIN_MMXq_MMXq=(XED_ICLASS_PFMIN<<8)+1, + XED_IFORM_PFMUL_MMXq_MEMq=(XED_ICLASS_PFMUL<<8)+0, + XED_IFORM_PFMUL_MMXq_MMXq=(XED_ICLASS_PFMUL<<8)+1, + XED_IFORM_PFNACC_MMXq_MEMq=(XED_ICLASS_PFNACC<<8)+0, + XED_IFORM_PFNACC_MMXq_MMXq=(XED_ICLASS_PFNACC<<8)+1, + XED_IFORM_PFPNACC_MMXq_MEMq=(XED_ICLASS_PFPNACC<<8)+0, + XED_IFORM_PFPNACC_MMXq_MMXq=(XED_ICLASS_PFPNACC<<8)+1, + XED_IFORM_PFRCP_MMXq_MMXq=(XED_ICLASS_PFRCP<<8)+0, + XED_IFORM_PFRCP_MMXq_MEMq=(XED_ICLASS_PFRCP<<8)+1, + XED_IFORM_PFRCPIT2_MMXq_MEMq=(XED_ICLASS_PFRCPIT2<<8)+0, + XED_IFORM_PFRCPIT2_MMXq_MMXq=(XED_ICLASS_PFRCPIT2<<8)+1, + XED_IFORM_PFRSQIT1_MMXq_MEMq=(XED_ICLASS_PFRSQIT1<<8)+0, + XED_IFORM_PFRSQIT1_MMXq_MMXq=(XED_ICLASS_PFRSQIT1<<8)+1, + XED_IFORM_PFSQRT_MMXq_MMXq=(XED_ICLASS_PFSQRT<<8)+0, + XED_IFORM_PFSQRT_MMXq_MEMq=(XED_ICLASS_PFSQRT<<8)+1, + XED_IFORM_PFSUB_MMXq_MEMq=(XED_ICLASS_PFSUB<<8)+0, + XED_IFORM_PFSUB_MMXq_MMXq=(XED_ICLASS_PFSUB<<8)+1, + XED_IFORM_PFSUBR_MMXq_MMXq=(XED_ICLASS_PFSUBR<<8)+0, + XED_IFORM_PFSUBR_MMXq_MEMq=(XED_ICLASS_PFSUBR<<8)+1, + XED_IFORM_PHADDD_MMXq_MEMq=(XED_ICLASS_PHADDD<<8)+0, + XED_IFORM_PHADDD_MMXq_MMXq=(XED_ICLASS_PHADDD<<8)+1, + XED_IFORM_PHADDD_XMMdq_MEMdq=(XED_ICLASS_PHADDD<<8)+2, + XED_IFORM_PHADDD_XMMdq_XMMdq=(XED_ICLASS_PHADDD<<8)+3, + XED_IFORM_PHADDSW_MMXq_MEMq=(XED_ICLASS_PHADDSW<<8)+0, + XED_IFORM_PHADDSW_MMXq_MMXq=(XED_ICLASS_PHADDSW<<8)+1, + XED_IFORM_PHADDSW_XMMdq_XMMdq=(XED_ICLASS_PHADDSW<<8)+2, + XED_IFORM_PHADDSW_XMMdq_MEMdq=(XED_ICLASS_PHADDSW<<8)+3, + XED_IFORM_PHADDW_XMMdq_MEMdq=(XED_ICLASS_PHADDW<<8)+0, + XED_IFORM_PHADDW_MMXq_MMXq=(XED_ICLASS_PHADDW<<8)+1, + XED_IFORM_PHADDW_XMMdq_XMMdq=(XED_ICLASS_PHADDW<<8)+2, + XED_IFORM_PHADDW_MMXq_MEMq=(XED_ICLASS_PHADDW<<8)+3, + XED_IFORM_PHMINPOSUW_XMMdq_XMMdq=(XED_ICLASS_PHMINPOSUW<<8)+0, + XED_IFORM_PHMINPOSUW_XMMdq_MEMdq=(XED_ICLASS_PHMINPOSUW<<8)+1, + XED_IFORM_PHSUBD_MMXq_MEMq=(XED_ICLASS_PHSUBD<<8)+0, + XED_IFORM_PHSUBD_XMMdq_XMMdq=(XED_ICLASS_PHSUBD<<8)+1, + XED_IFORM_PHSUBD_XMMdq_MEMdq=(XED_ICLASS_PHSUBD<<8)+2, + XED_IFORM_PHSUBD_MMXq_MMXq=(XED_ICLASS_PHSUBD<<8)+3, + XED_IFORM_PHSUBSW_XMMdq_MEMdq=(XED_ICLASS_PHSUBSW<<8)+0, + XED_IFORM_PHSUBSW_MMXq_MMXq=(XED_ICLASS_PHSUBSW<<8)+1, + XED_IFORM_PHSUBSW_MMXq_MEMq=(XED_ICLASS_PHSUBSW<<8)+2, + XED_IFORM_PHSUBSW_XMMdq_XMMdq=(XED_ICLASS_PHSUBSW<<8)+3, + XED_IFORM_PHSUBW_MMXq_MMXq=(XED_ICLASS_PHSUBW<<8)+0, + XED_IFORM_PHSUBW_XMMdq_MEMdq=(XED_ICLASS_PHSUBW<<8)+1, + XED_IFORM_PHSUBW_MMXq_MEMq=(XED_ICLASS_PHSUBW<<8)+2, + XED_IFORM_PHSUBW_XMMdq_XMMdq=(XED_ICLASS_PHSUBW<<8)+3, + XED_IFORM_PI2FD_MMXq_MMXq=(XED_ICLASS_PI2FD<<8)+0, + XED_IFORM_PI2FD_MMXq_MEMq=(XED_ICLASS_PI2FD<<8)+1, + XED_IFORM_PI2FW_MMXq_MEMq=(XED_ICLASS_PI2FW<<8)+0, + XED_IFORM_PI2FW_MMXq_MMXq=(XED_ICLASS_PI2FW<<8)+1, + XED_IFORM_PINSRB_XMMdq_MEMb_IMM=(XED_ICLASS_PINSRB<<8)+0, + XED_IFORM_PINSRB_XMMdq_GPR32d_IMM=(XED_ICLASS_PINSRB<<8)+1, + XED_IFORM_PINSRD_XMMdq_GPR32d_IMM=(XED_ICLASS_PINSRD<<8)+0, + XED_IFORM_PINSRD_XMMdq_MEMd_IMM=(XED_ICLASS_PINSRD<<8)+1, + XED_IFORM_PINSRQ_XMMdq_GPR64q_IMM=(XED_ICLASS_PINSRQ<<8)+0, + XED_IFORM_PINSRQ_XMMdq_MEMq_IMM=(XED_ICLASS_PINSRQ<<8)+1, + XED_IFORM_PINSRW_MMXq_MEMw_IMM=(XED_ICLASS_PINSRW<<8)+0, + XED_IFORM_PINSRW_XMMdq_GPRy_IMM=(XED_ICLASS_PINSRW<<8)+1, + XED_IFORM_PINSRW_MMXq_GPRy_IMM=(XED_ICLASS_PINSRW<<8)+2, + XED_IFORM_PINSRW_XMMdq_MEMw_IMM=(XED_ICLASS_PINSRW<<8)+3, + XED_IFORM_PMADDUBSW_XMMdq_XMMdq=(XED_ICLASS_PMADDUBSW<<8)+0, + XED_IFORM_PMADDUBSW_XMMdq_MEMdq=(XED_ICLASS_PMADDUBSW<<8)+1, + XED_IFORM_PMADDUBSW_MMXq_MMXq=(XED_ICLASS_PMADDUBSW<<8)+2, + XED_IFORM_PMADDUBSW_MMXq_MEMq=(XED_ICLASS_PMADDUBSW<<8)+3, + XED_IFORM_PMADDWD_XMMdq_XMMdq=(XED_ICLASS_PMADDWD<<8)+0, + XED_IFORM_PMADDWD_XMMdq_MEMdq=(XED_ICLASS_PMADDWD<<8)+1, + XED_IFORM_PMADDWD_MMXq_MEMq=(XED_ICLASS_PMADDWD<<8)+2, + XED_IFORM_PMADDWD_MMXq_MMXq=(XED_ICLASS_PMADDWD<<8)+3, + XED_IFORM_PMAXSB_XMMdq_MEMdq=(XED_ICLASS_PMAXSB<<8)+0, + XED_IFORM_PMAXSB_XMMdq_XMMdq=(XED_ICLASS_PMAXSB<<8)+1, + XED_IFORM_PMAXSD_XMMdq_MEMdq=(XED_ICLASS_PMAXSD<<8)+0, + XED_IFORM_PMAXSD_XMMdq_XMMdq=(XED_ICLASS_PMAXSD<<8)+1, + XED_IFORM_PMAXSW_MMXq_MMXq=(XED_ICLASS_PMAXSW<<8)+0, + XED_IFORM_PMAXSW_XMMdq_XMMdq=(XED_ICLASS_PMAXSW<<8)+1, + XED_IFORM_PMAXSW_MMXq_MEMq=(XED_ICLASS_PMAXSW<<8)+2, + XED_IFORM_PMAXSW_XMMdq_MEMdq=(XED_ICLASS_PMAXSW<<8)+3, + XED_IFORM_PMAXUB_XMMdq_MEMdq=(XED_ICLASS_PMAXUB<<8)+0, + XED_IFORM_PMAXUB_XMMdq_XMMdq=(XED_ICLASS_PMAXUB<<8)+1, + XED_IFORM_PMAXUB_MMXq_MEMq=(XED_ICLASS_PMAXUB<<8)+2, + XED_IFORM_PMAXUB_MMXq_MMXq=(XED_ICLASS_PMAXUB<<8)+3, + XED_IFORM_PMAXUD_XMMdq_MEMdq=(XED_ICLASS_PMAXUD<<8)+0, + XED_IFORM_PMAXUD_XMMdq_XMMdq=(XED_ICLASS_PMAXUD<<8)+1, + XED_IFORM_PMAXUW_XMMdq_XMMdq=(XED_ICLASS_PMAXUW<<8)+0, + XED_IFORM_PMAXUW_XMMdq_MEMdq=(XED_ICLASS_PMAXUW<<8)+1, + XED_IFORM_PMINSB_XMMdq_MEMdq=(XED_ICLASS_PMINSB<<8)+0, + XED_IFORM_PMINSB_XMMdq_XMMdq=(XED_ICLASS_PMINSB<<8)+1, + XED_IFORM_PMINSD_XMMdq_MEMdq=(XED_ICLASS_PMINSD<<8)+0, + XED_IFORM_PMINSD_XMMdq_XMMdq=(XED_ICLASS_PMINSD<<8)+1, + XED_IFORM_PMINSW_XMMdq_XMMdq=(XED_ICLASS_PMINSW<<8)+0, + XED_IFORM_PMINSW_XMMdq_MEMdq=(XED_ICLASS_PMINSW<<8)+1, + XED_IFORM_PMINSW_MMXq_MMXq=(XED_ICLASS_PMINSW<<8)+2, + XED_IFORM_PMINSW_MMXq_MEMq=(XED_ICLASS_PMINSW<<8)+3, + XED_IFORM_PMINUB_MMXq_MEMq=(XED_ICLASS_PMINUB<<8)+0, + XED_IFORM_PMINUB_XMMdq_XMMdq=(XED_ICLASS_PMINUB<<8)+1, + XED_IFORM_PMINUB_XMMdq_MEMdq=(XED_ICLASS_PMINUB<<8)+2, + XED_IFORM_PMINUB_MMXq_MMXq=(XED_ICLASS_PMINUB<<8)+3, + XED_IFORM_PMINUD_XMMdq_MEMdq=(XED_ICLASS_PMINUD<<8)+0, + XED_IFORM_PMINUD_XMMdq_XMMdq=(XED_ICLASS_PMINUD<<8)+1, + XED_IFORM_PMINUW_XMMdq_XMMdq=(XED_ICLASS_PMINUW<<8)+0, + XED_IFORM_PMINUW_XMMdq_MEMdq=(XED_ICLASS_PMINUW<<8)+1, + XED_IFORM_PMOVMSKB_GPR32_XMMdq=(XED_ICLASS_PMOVMSKB<<8)+0, + XED_IFORM_PMOVMSKB_GPR32_MMXq=(XED_ICLASS_PMOVMSKB<<8)+1, + XED_IFORM_PMOVSXBD_XMMdq_MEMd=(XED_ICLASS_PMOVSXBD<<8)+0, + XED_IFORM_PMOVSXBD_XMMdq_XMMd=(XED_ICLASS_PMOVSXBD<<8)+1, + XED_IFORM_PMOVSXBQ_XMMdq_MEMw=(XED_ICLASS_PMOVSXBQ<<8)+0, + XED_IFORM_PMOVSXBQ_XMMdq_XMMw=(XED_ICLASS_PMOVSXBQ<<8)+1, + XED_IFORM_PMOVSXBW_XMMdq_XMMq=(XED_ICLASS_PMOVSXBW<<8)+0, + XED_IFORM_PMOVSXBW_XMMdq_MEMq=(XED_ICLASS_PMOVSXBW<<8)+1, + XED_IFORM_PMOVSXDQ_XMMdq_XMMq=(XED_ICLASS_PMOVSXDQ<<8)+0, + XED_IFORM_PMOVSXDQ_XMMdq_MEMq=(XED_ICLASS_PMOVSXDQ<<8)+1, + XED_IFORM_PMOVSXWD_XMMdq_XMMq=(XED_ICLASS_PMOVSXWD<<8)+0, + XED_IFORM_PMOVSXWD_XMMdq_MEMq=(XED_ICLASS_PMOVSXWD<<8)+1, + XED_IFORM_PMOVSXWQ_XMMdq_MEMd=(XED_ICLASS_PMOVSXWQ<<8)+0, + XED_IFORM_PMOVSXWQ_XMMdq_XMMd=(XED_ICLASS_PMOVSXWQ<<8)+1, + XED_IFORM_PMOVZXBD_XMMdq_XMMd=(XED_ICLASS_PMOVZXBD<<8)+0, + XED_IFORM_PMOVZXBD_XMMdq_MEMd=(XED_ICLASS_PMOVZXBD<<8)+1, + XED_IFORM_PMOVZXBQ_XMMdq_XMMw=(XED_ICLASS_PMOVZXBQ<<8)+0, + XED_IFORM_PMOVZXBQ_XMMdq_MEMw=(XED_ICLASS_PMOVZXBQ<<8)+1, + XED_IFORM_PMOVZXBW_XMMdq_MEMq=(XED_ICLASS_PMOVZXBW<<8)+0, + XED_IFORM_PMOVZXBW_XMMdq_XMMq=(XED_ICLASS_PMOVZXBW<<8)+1, + XED_IFORM_PMOVZXDQ_XMMdq_MEMq=(XED_ICLASS_PMOVZXDQ<<8)+0, + XED_IFORM_PMOVZXDQ_XMMdq_XMMq=(XED_ICLASS_PMOVZXDQ<<8)+1, + XED_IFORM_PMOVZXWD_XMMdq_MEMq=(XED_ICLASS_PMOVZXWD<<8)+0, + XED_IFORM_PMOVZXWD_XMMdq_XMMq=(XED_ICLASS_PMOVZXWD<<8)+1, + XED_IFORM_PMOVZXWQ_XMMdq_XMMd=(XED_ICLASS_PMOVZXWQ<<8)+0, + XED_IFORM_PMOVZXWQ_XMMdq_MEMd=(XED_ICLASS_PMOVZXWQ<<8)+1, + XED_IFORM_PMULDQ_XMMdq_MEMdq=(XED_ICLASS_PMULDQ<<8)+0, + XED_IFORM_PMULDQ_XMMdq_XMMdq=(XED_ICLASS_PMULDQ<<8)+1, + XED_IFORM_PMULHRSW_XMMdq_MEMdq=(XED_ICLASS_PMULHRSW<<8)+0, + XED_IFORM_PMULHRSW_XMMdq_XMMdq=(XED_ICLASS_PMULHRSW<<8)+1, + XED_IFORM_PMULHRSW_MMXq_MEMq=(XED_ICLASS_PMULHRSW<<8)+2, + XED_IFORM_PMULHRSW_MMXq_MMXq=(XED_ICLASS_PMULHRSW<<8)+3, + XED_IFORM_PMULHRW_MMXq_MEMq=(XED_ICLASS_PMULHRW<<8)+0, + XED_IFORM_PMULHRW_MMXq_MMXq=(XED_ICLASS_PMULHRW<<8)+1, + XED_IFORM_PMULHUW_XMMdq_MEMdq=(XED_ICLASS_PMULHUW<<8)+0, + XED_IFORM_PMULHUW_XMMdq_XMMdq=(XED_ICLASS_PMULHUW<<8)+1, + XED_IFORM_PMULHUW_MMXq_MMXq=(XED_ICLASS_PMULHUW<<8)+2, + XED_IFORM_PMULHUW_MMXq_MEMq=(XED_ICLASS_PMULHUW<<8)+3, + XED_IFORM_PMULHW_MMXq_MMXq=(XED_ICLASS_PMULHW<<8)+0, + XED_IFORM_PMULHW_XMMdq_MEMdq=(XED_ICLASS_PMULHW<<8)+1, + XED_IFORM_PMULHW_MMXq_MEMq=(XED_ICLASS_PMULHW<<8)+2, + XED_IFORM_PMULHW_XMMdq_XMMdq=(XED_ICLASS_PMULHW<<8)+3, + XED_IFORM_PMULLD_XMMdq_XMMdq=(XED_ICLASS_PMULLD<<8)+0, + XED_IFORM_PMULLD_XMMdq_MEMdq=(XED_ICLASS_PMULLD<<8)+1, + XED_IFORM_PMULLW_MMXq_MEMq=(XED_ICLASS_PMULLW<<8)+0, + XED_IFORM_PMULLW_XMMdq_XMMdq=(XED_ICLASS_PMULLW<<8)+1, + XED_IFORM_PMULLW_MMXq_MMXq=(XED_ICLASS_PMULLW<<8)+2, + XED_IFORM_PMULLW_XMMdq_MEMdq=(XED_ICLASS_PMULLW<<8)+3, + XED_IFORM_PMULUDQ_MMXq_MEMq=(XED_ICLASS_PMULUDQ<<8)+0, + XED_IFORM_PMULUDQ_XMMdq_MEMdq=(XED_ICLASS_PMULUDQ<<8)+1, + XED_IFORM_PMULUDQ_XMMdq_XMMdq=(XED_ICLASS_PMULUDQ<<8)+2, + XED_IFORM_PMULUDQ_MMXq_MMXq=(XED_ICLASS_PMULUDQ<<8)+3, + XED_IFORM_POP_SS=(XED_ICLASS_POP<<8)+0, + XED_IFORM_POP_DS=(XED_ICLASS_POP<<8)+1, + XED_IFORM_POP_MEMv=(XED_ICLASS_POP<<8)+2, + XED_IFORM_POP_GPRv=(XED_ICLASS_POP<<8)+3, + XED_IFORM_POP_ES=(XED_ICLASS_POP<<8)+4, + XED_IFORM_POP_GS=(XED_ICLASS_POP<<8)+5, + XED_IFORM_POP_FS=(XED_ICLASS_POP<<8)+6, + XED_IFORM_POPA=(XED_ICLASS_POPA<<8)+0, + XED_IFORM_POPAD=(XED_ICLASS_POPAD<<8)+0, + XED_IFORM_POPCNT_GPRv_GPRv=(XED_ICLASS_POPCNT<<8)+0, + XED_IFORM_POPCNT_GPRv_MEMv=(XED_ICLASS_POPCNT<<8)+1, + XED_IFORM_POPF=(XED_ICLASS_POPF<<8)+0, + XED_IFORM_POPFD=(XED_ICLASS_POPFD<<8)+0, + XED_IFORM_POPFQ=(XED_ICLASS_POPFQ<<8)+0, + XED_IFORM_POR_XMMdq_XMMdq=(XED_ICLASS_POR<<8)+0, + XED_IFORM_POR_XMMdq_MEMdq=(XED_ICLASS_POR<<8)+1, + XED_IFORM_POR_MMXq_MEMq=(XED_ICLASS_POR<<8)+2, + XED_IFORM_POR_MMXq_MMXq=(XED_ICLASS_POR<<8)+3, + XED_IFORM_PREFETCHNTA_MEMmprefetch=(XED_ICLASS_PREFETCHNTA<<8)+0, + XED_IFORM_PREFETCHT0_MEMmprefetch=(XED_ICLASS_PREFETCHT0<<8)+0, + XED_IFORM_PREFETCHT1_MEMmprefetch=(XED_ICLASS_PREFETCHT1<<8)+0, + XED_IFORM_PREFETCHT2_MEMmprefetch=(XED_ICLASS_PREFETCHT2<<8)+0, + XED_IFORM_PREFETCH_EXCLUSIVE_MEMmprefetch=(XED_ICLASS_PREFETCH_EXCLUSIVE<<8)+0, + XED_IFORM_PREFETCH_MODIFIED_MEMmprefetch=(XED_ICLASS_PREFETCH_MODIFIED<<8)+0, + XED_IFORM_PREFETCH_RESERVED_MEMmprefetch=(XED_ICLASS_PREFETCH_RESERVED<<8)+0, + XED_IFORM_PSADBW_MMXq_MMXq=(XED_ICLASS_PSADBW<<8)+0, + XED_IFORM_PSADBW_XMMdq_MEMdq=(XED_ICLASS_PSADBW<<8)+1, + XED_IFORM_PSADBW_MMXq_MEMq=(XED_ICLASS_PSADBW<<8)+2, + XED_IFORM_PSADBW_XMMdq_XMMdq=(XED_ICLASS_PSADBW<<8)+3, + XED_IFORM_PSHUFB_MMXq_MEMq=(XED_ICLASS_PSHUFB<<8)+0, + XED_IFORM_PSHUFB_XMMdq_XMMdq=(XED_ICLASS_PSHUFB<<8)+1, + XED_IFORM_PSHUFB_XMMdq_MEMdq=(XED_ICLASS_PSHUFB<<8)+2, + XED_IFORM_PSHUFB_MMXq_MMXq=(XED_ICLASS_PSHUFB<<8)+3, + XED_IFORM_PSHUFD_XMMdq_XMMdq_IMM=(XED_ICLASS_PSHUFD<<8)+0, + XED_IFORM_PSHUFD_XMMdq_MEMdq_IMM=(XED_ICLASS_PSHUFD<<8)+1, + XED_IFORM_PSHUFHW_XMMdq_MEMdq_IMM=(XED_ICLASS_PSHUFHW<<8)+0, + XED_IFORM_PSHUFHW_XMMdq_XMMdq_IMM=(XED_ICLASS_PSHUFHW<<8)+1, + XED_IFORM_PSHUFLW_XMMdq_XMMdq_IMM=(XED_ICLASS_PSHUFLW<<8)+0, + XED_IFORM_PSHUFLW_XMMdq_MEMdq_IMM=(XED_ICLASS_PSHUFLW<<8)+1, + XED_IFORM_PSHUFW_MMXq_MMXq_IMM=(XED_ICLASS_PSHUFW<<8)+0, + XED_IFORM_PSHUFW_MMXq_MEMq_IMM=(XED_ICLASS_PSHUFW<<8)+1, + XED_IFORM_PSIGNB_XMMdq_MEMdq=(XED_ICLASS_PSIGNB<<8)+0, + XED_IFORM_PSIGNB_XMMdq_XMMdq=(XED_ICLASS_PSIGNB<<8)+1, + XED_IFORM_PSIGNB_MMXq_MEMq=(XED_ICLASS_PSIGNB<<8)+2, + XED_IFORM_PSIGNB_MMXq_MMXq=(XED_ICLASS_PSIGNB<<8)+3, + XED_IFORM_PSIGND_MMXq_MMXq=(XED_ICLASS_PSIGND<<8)+0, + XED_IFORM_PSIGND_XMMdq_MEMdq=(XED_ICLASS_PSIGND<<8)+1, + XED_IFORM_PSIGND_MMXq_MEMq=(XED_ICLASS_PSIGND<<8)+2, + XED_IFORM_PSIGND_XMMdq_XMMdq=(XED_ICLASS_PSIGND<<8)+3, + XED_IFORM_PSIGNW_MMXq_MEMq=(XED_ICLASS_PSIGNW<<8)+0, + XED_IFORM_PSIGNW_XMMdq_XMMdq=(XED_ICLASS_PSIGNW<<8)+1, + XED_IFORM_PSIGNW_XMMdq_MEMdq=(XED_ICLASS_PSIGNW<<8)+2, + XED_IFORM_PSIGNW_MMXq_MMXq=(XED_ICLASS_PSIGNW<<8)+3, + XED_IFORM_PSLLD_XMMdq_XMMdq=(XED_ICLASS_PSLLD<<8)+0, + XED_IFORM_PSLLD_XMMdq_MEMdq=(XED_ICLASS_PSLLD<<8)+1, + XED_IFORM_PSLLD_XMMdq_IMM=(XED_ICLASS_PSLLD<<8)+2, + XED_IFORM_PSLLD_MMXq_MEMq=(XED_ICLASS_PSLLD<<8)+3, + XED_IFORM_PSLLD_MMXq_MMXq=(XED_ICLASS_PSLLD<<8)+4, + XED_IFORM_PSLLD_MMXq_IMM=(XED_ICLASS_PSLLD<<8)+5, + XED_IFORM_PSLLDQ_XMMdq_IMM=(XED_ICLASS_PSLLDQ<<8)+0, + XED_IFORM_PSLLQ_XMMdq_MEMdq=(XED_ICLASS_PSLLQ<<8)+0, + XED_IFORM_PSLLQ_XMMdq_IMM=(XED_ICLASS_PSLLQ<<8)+1, + XED_IFORM_PSLLQ_XMMdq_XMMdq=(XED_ICLASS_PSLLQ<<8)+2, + XED_IFORM_PSLLQ_MMXq_MEMq=(XED_ICLASS_PSLLQ<<8)+3, + XED_IFORM_PSLLQ_MMXq_IMM=(XED_ICLASS_PSLLQ<<8)+4, + XED_IFORM_PSLLQ_MMXq_MMXq=(XED_ICLASS_PSLLQ<<8)+5, + XED_IFORM_PSLLW_MMXq_MMXq=(XED_ICLASS_PSLLW<<8)+0, + XED_IFORM_PSLLW_MMXq_IMM=(XED_ICLASS_PSLLW<<8)+1, + XED_IFORM_PSLLW_MMXq_MEMq=(XED_ICLASS_PSLLW<<8)+2, + XED_IFORM_PSLLW_XMMdq_XMMdq=(XED_ICLASS_PSLLW<<8)+3, + XED_IFORM_PSLLW_XMMdq_IMM=(XED_ICLASS_PSLLW<<8)+4, + XED_IFORM_PSLLW_XMMdq_MEMdq=(XED_ICLASS_PSLLW<<8)+5, + XED_IFORM_PSRAD_XMMdq_MEMdq=(XED_ICLASS_PSRAD<<8)+0, + XED_IFORM_PSRAD_MMXq_MEMq=(XED_ICLASS_PSRAD<<8)+1, + XED_IFORM_PSRAD_MMXq_IMM=(XED_ICLASS_PSRAD<<8)+2, + XED_IFORM_PSRAD_XMMdq_IMM=(XED_ICLASS_PSRAD<<8)+3, + XED_IFORM_PSRAD_XMMdq_XMMdq=(XED_ICLASS_PSRAD<<8)+4, + XED_IFORM_PSRAD_MMXq_MMXq=(XED_ICLASS_PSRAD<<8)+5, + XED_IFORM_PSRAW_XMMdq_IMM=(XED_ICLASS_PSRAW<<8)+0, + XED_IFORM_PSRAW_MMXq_MEMq=(XED_ICLASS_PSRAW<<8)+1, + XED_IFORM_PSRAW_MMXq_MMXq=(XED_ICLASS_PSRAW<<8)+2, + XED_IFORM_PSRAW_XMMdq_MEMdq=(XED_ICLASS_PSRAW<<8)+3, + XED_IFORM_PSRAW_MMXq_IMM=(XED_ICLASS_PSRAW<<8)+4, + XED_IFORM_PSRAW_XMMdq_XMMdq=(XED_ICLASS_PSRAW<<8)+5, + XED_IFORM_PSRLD_MMXq_MEMq=(XED_ICLASS_PSRLD<<8)+0, + XED_IFORM_PSRLD_MMXq_IMM=(XED_ICLASS_PSRLD<<8)+1, + XED_IFORM_PSRLD_MMXq_MMXq=(XED_ICLASS_PSRLD<<8)+2, + XED_IFORM_PSRLD_XMMdq_XMMdq=(XED_ICLASS_PSRLD<<8)+3, + XED_IFORM_PSRLD_XMMdq_IMM=(XED_ICLASS_PSRLD<<8)+4, + XED_IFORM_PSRLD_XMMdq_MEMdq=(XED_ICLASS_PSRLD<<8)+5, + XED_IFORM_PSRLDQ_XMMdq_IMM=(XED_ICLASS_PSRLDQ<<8)+0, + XED_IFORM_PSRLQ_MMXq_MMXq=(XED_ICLASS_PSRLQ<<8)+0, + XED_IFORM_PSRLQ_XMMdq_IMM=(XED_ICLASS_PSRLQ<<8)+1, + XED_IFORM_PSRLQ_XMMdq_MEMdq=(XED_ICLASS_PSRLQ<<8)+2, + XED_IFORM_PSRLQ_MMXq_IMM=(XED_ICLASS_PSRLQ<<8)+3, + XED_IFORM_PSRLQ_MMXq_MEMq=(XED_ICLASS_PSRLQ<<8)+4, + XED_IFORM_PSRLQ_XMMdq_XMMdq=(XED_ICLASS_PSRLQ<<8)+5, + XED_IFORM_PSRLW_XMMdq_XMMdq=(XED_ICLASS_PSRLW<<8)+0, + XED_IFORM_PSRLW_MMXq_MEMq=(XED_ICLASS_PSRLW<<8)+1, + XED_IFORM_PSRLW_MMXq_MMXq=(XED_ICLASS_PSRLW<<8)+2, + XED_IFORM_PSRLW_XMMdq_MEMdq=(XED_ICLASS_PSRLW<<8)+3, + XED_IFORM_PSRLW_MMXq_IMM=(XED_ICLASS_PSRLW<<8)+4, + XED_IFORM_PSRLW_XMMdq_IMM=(XED_ICLASS_PSRLW<<8)+5, + XED_IFORM_PSUBB_XMMdq_MEMdq=(XED_ICLASS_PSUBB<<8)+0, + XED_IFORM_PSUBB_XMMdq_XMMdq=(XED_ICLASS_PSUBB<<8)+1, + XED_IFORM_PSUBB_MMXq_MEMq=(XED_ICLASS_PSUBB<<8)+2, + XED_IFORM_PSUBB_MMXq_MMXq=(XED_ICLASS_PSUBB<<8)+3, + XED_IFORM_PSUBD_MMXq_MMXq=(XED_ICLASS_PSUBD<<8)+0, + XED_IFORM_PSUBD_XMMdq_MEMdq=(XED_ICLASS_PSUBD<<8)+1, + XED_IFORM_PSUBD_MMXq_MEMq=(XED_ICLASS_PSUBD<<8)+2, + XED_IFORM_PSUBD_XMMdq_XMMdq=(XED_ICLASS_PSUBD<<8)+3, + XED_IFORM_PSUBQ_MMXq_MMXq=(XED_ICLASS_PSUBQ<<8)+0, + XED_IFORM_PSUBQ_XMMdq_XMMdq=(XED_ICLASS_PSUBQ<<8)+1, + XED_IFORM_PSUBQ_MMXq_MEMq=(XED_ICLASS_PSUBQ<<8)+2, + XED_IFORM_PSUBQ_XMMdq_MEMdq=(XED_ICLASS_PSUBQ<<8)+3, + XED_IFORM_PSUBSB_XMMdq_MEMdq=(XED_ICLASS_PSUBSB<<8)+0, + XED_IFORM_PSUBSB_MMXq_MEMq=(XED_ICLASS_PSUBSB<<8)+1, + XED_IFORM_PSUBSB_XMMdq_XMMdq=(XED_ICLASS_PSUBSB<<8)+2, + XED_IFORM_PSUBSB_MMXq_MMXq=(XED_ICLASS_PSUBSB<<8)+3, + XED_IFORM_PSUBSW_XMMdq_MEMdq=(XED_ICLASS_PSUBSW<<8)+0, + XED_IFORM_PSUBSW_MMXq_MMXq=(XED_ICLASS_PSUBSW<<8)+1, + XED_IFORM_PSUBSW_XMMdq_XMMdq=(XED_ICLASS_PSUBSW<<8)+2, + XED_IFORM_PSUBSW_MMXq_MEMq=(XED_ICLASS_PSUBSW<<8)+3, + XED_IFORM_PSUBUSB_MMXq_MMXq=(XED_ICLASS_PSUBUSB<<8)+0, + XED_IFORM_PSUBUSB_MMXq_MEMq=(XED_ICLASS_PSUBUSB<<8)+1, + XED_IFORM_PSUBUSB_XMMdq_XMMdq=(XED_ICLASS_PSUBUSB<<8)+2, + XED_IFORM_PSUBUSB_XMMdq_MEMdq=(XED_ICLASS_PSUBUSB<<8)+3, + XED_IFORM_PSUBUSW_MMXq_MMXq=(XED_ICLASS_PSUBUSW<<8)+0, + XED_IFORM_PSUBUSW_XMMdq_MEMdq=(XED_ICLASS_PSUBUSW<<8)+1, + XED_IFORM_PSUBUSW_XMMdq_XMMdq=(XED_ICLASS_PSUBUSW<<8)+2, + XED_IFORM_PSUBUSW_MMXq_MEMq=(XED_ICLASS_PSUBUSW<<8)+3, + XED_IFORM_PSUBW_MMXq_MEMq=(XED_ICLASS_PSUBW<<8)+0, + XED_IFORM_PSUBW_XMMdq_XMMdq=(XED_ICLASS_PSUBW<<8)+1, + XED_IFORM_PSUBW_XMMdq_MEMdq=(XED_ICLASS_PSUBW<<8)+2, + XED_IFORM_PSUBW_MMXq_MMXq=(XED_ICLASS_PSUBW<<8)+3, + XED_IFORM_PSWAPD_MMXq_MEMq=(XED_ICLASS_PSWAPD<<8)+0, + XED_IFORM_PSWAPD_MMXq_MMXq=(XED_ICLASS_PSWAPD<<8)+1, + XED_IFORM_PTEST_XMMdq_MEMdq=(XED_ICLASS_PTEST<<8)+0, + XED_IFORM_PTEST_XMMdq_XMMdq=(XED_ICLASS_PTEST<<8)+1, + XED_IFORM_PUNPCKHBW_XMMdq_XMMq=(XED_ICLASS_PUNPCKHBW<<8)+0, + XED_IFORM_PUNPCKHBW_MMXq_MMXd=(XED_ICLASS_PUNPCKHBW<<8)+1, + XED_IFORM_PUNPCKHBW_XMMdq_MEMdq=(XED_ICLASS_PUNPCKHBW<<8)+2, + XED_IFORM_PUNPCKHBW_MMXq_MEMq=(XED_ICLASS_PUNPCKHBW<<8)+3, + XED_IFORM_PUNPCKHDQ_XMMdq_XMMq=(XED_ICLASS_PUNPCKHDQ<<8)+0, + XED_IFORM_PUNPCKHDQ_MMXq_MMXd=(XED_ICLASS_PUNPCKHDQ<<8)+1, + XED_IFORM_PUNPCKHDQ_XMMdq_MEMdq=(XED_ICLASS_PUNPCKHDQ<<8)+2, + XED_IFORM_PUNPCKHDQ_MMXq_MEMq=(XED_ICLASS_PUNPCKHDQ<<8)+3, + XED_IFORM_PUNPCKHQDQ_XMMdq_XMMq=(XED_ICLASS_PUNPCKHQDQ<<8)+0, + XED_IFORM_PUNPCKHQDQ_XMMdq_MEMdq=(XED_ICLASS_PUNPCKHQDQ<<8)+1, + XED_IFORM_PUNPCKHWD_XMMdq_XMMq=(XED_ICLASS_PUNPCKHWD<<8)+0, + XED_IFORM_PUNPCKHWD_MMXq_MMXd=(XED_ICLASS_PUNPCKHWD<<8)+1, + XED_IFORM_PUNPCKHWD_XMMdq_MEMdq=(XED_ICLASS_PUNPCKHWD<<8)+2, + XED_IFORM_PUNPCKHWD_MMXq_MEMq=(XED_ICLASS_PUNPCKHWD<<8)+3, + XED_IFORM_PUNPCKLBW_MMXq_MMXd=(XED_ICLASS_PUNPCKLBW<<8)+0, + XED_IFORM_PUNPCKLBW_XMMdq_MEMq=(XED_ICLASS_PUNPCKLBW<<8)+1, + XED_IFORM_PUNPCKLBW_XMMdq_XMMq=(XED_ICLASS_PUNPCKLBW<<8)+2, + XED_IFORM_PUNPCKLBW_MMXq_MEMd=(XED_ICLASS_PUNPCKLBW<<8)+3, + XED_IFORM_PUNPCKLDQ_MMXq_MMXd=(XED_ICLASS_PUNPCKLDQ<<8)+0, + XED_IFORM_PUNPCKLDQ_XMMdq_MEMq=(XED_ICLASS_PUNPCKLDQ<<8)+1, + XED_IFORM_PUNPCKLDQ_XMMdq_XMMq=(XED_ICLASS_PUNPCKLDQ<<8)+2, + XED_IFORM_PUNPCKLDQ_MMXq_MEMd=(XED_ICLASS_PUNPCKLDQ<<8)+3, + XED_IFORM_PUNPCKLQDQ_XMMdq_XMMq=(XED_ICLASS_PUNPCKLQDQ<<8)+0, + XED_IFORM_PUNPCKLQDQ_XMMdq_MEMq=(XED_ICLASS_PUNPCKLQDQ<<8)+1, + XED_IFORM_PUNPCKLWD_MMXq_MMXd=(XED_ICLASS_PUNPCKLWD<<8)+0, + XED_IFORM_PUNPCKLWD_XMMdq_MEMq=(XED_ICLASS_PUNPCKLWD<<8)+1, + XED_IFORM_PUNPCKLWD_XMMdq_XMMq=(XED_ICLASS_PUNPCKLWD<<8)+2, + XED_IFORM_PUNPCKLWD_MMXq_MEMd=(XED_ICLASS_PUNPCKLWD<<8)+3, + XED_IFORM_PUSH_FS=(XED_ICLASS_PUSH<<8)+0, + XED_IFORM_PUSH_SS=(XED_ICLASS_PUSH<<8)+1, + XED_IFORM_PUSH_GPRv=(XED_ICLASS_PUSH<<8)+2, + XED_IFORM_PUSH_GS=(XED_ICLASS_PUSH<<8)+3, + XED_IFORM_PUSH_CS=(XED_ICLASS_PUSH<<8)+4, + XED_IFORM_PUSH_MEMv=(XED_ICLASS_PUSH<<8)+5, + XED_IFORM_PUSH_ES=(XED_ICLASS_PUSH<<8)+6, + XED_IFORM_PUSH_IMM=(XED_ICLASS_PUSH<<8)+7, + XED_IFORM_PUSH_DS=(XED_ICLASS_PUSH<<8)+8, + XED_IFORM_PUSHA=(XED_ICLASS_PUSHA<<8)+0, + XED_IFORM_PUSHAD=(XED_ICLASS_PUSHAD<<8)+0, + XED_IFORM_PUSHF=(XED_ICLASS_PUSHF<<8)+0, + XED_IFORM_PUSHFD=(XED_ICLASS_PUSHFD<<8)+0, + XED_IFORM_PUSHFQ=(XED_ICLASS_PUSHFQ<<8)+0, + XED_IFORM_PXOR_XMMdq_MEMdq=(XED_ICLASS_PXOR<<8)+0, + XED_IFORM_PXOR_MMXq_MMXq=(XED_ICLASS_PXOR<<8)+1, + XED_IFORM_PXOR_MMXq_MEMq=(XED_ICLASS_PXOR<<8)+2, + XED_IFORM_PXOR_XMMdq_XMMdq=(XED_ICLASS_PXOR<<8)+3, + XED_IFORM_RCL_MEMv_CL=(XED_ICLASS_RCL<<8)+0, + XED_IFORM_RCL_MEMb_CL=(XED_ICLASS_RCL<<8)+1, + XED_IFORM_RCL_GPRv_CL=(XED_ICLASS_RCL<<8)+2, + XED_IFORM_RCL_MEMb_IMM=(XED_ICLASS_RCL<<8)+3, + XED_IFORM_RCL_MEMv_ONE=(XED_ICLASS_RCL<<8)+4, + XED_IFORM_RCL_GPR8_ONE=(XED_ICLASS_RCL<<8)+5, + XED_IFORM_RCL_GPR8_IMM=(XED_ICLASS_RCL<<8)+6, + XED_IFORM_RCL_MEMv_IMM=(XED_ICLASS_RCL<<8)+7, + XED_IFORM_RCL_MEMb_ONE=(XED_ICLASS_RCL<<8)+8, + XED_IFORM_RCL_GPRv_ONE=(XED_ICLASS_RCL<<8)+9, + XED_IFORM_RCL_GPRv_IMM=(XED_ICLASS_RCL<<8)+10, + XED_IFORM_RCL_GPR8_CL=(XED_ICLASS_RCL<<8)+11, + XED_IFORM_RCPPS_XMMps_MEMps=(XED_ICLASS_RCPPS<<8)+0, + XED_IFORM_RCPPS_XMMps_XMMps=(XED_ICLASS_RCPPS<<8)+1, + XED_IFORM_RCPSS_XMMss_XMMss=(XED_ICLASS_RCPSS<<8)+0, + XED_IFORM_RCPSS_XMMss_MEMss=(XED_ICLASS_RCPSS<<8)+1, + XED_IFORM_RCR_GPR8_CL=(XED_ICLASS_RCR<<8)+0, + XED_IFORM_RCR_MEMv_ONE=(XED_ICLASS_RCR<<8)+1, + XED_IFORM_RCR_GPR8_IMM=(XED_ICLASS_RCR<<8)+2, + XED_IFORM_RCR_MEMb_ONE=(XED_ICLASS_RCR<<8)+3, + XED_IFORM_RCR_GPRv_ONE=(XED_ICLASS_RCR<<8)+4, + XED_IFORM_RCR_MEMb_IMM=(XED_ICLASS_RCR<<8)+5, + XED_IFORM_RCR_GPR8_ONE=(XED_ICLASS_RCR<<8)+6, + XED_IFORM_RCR_MEMv_IMM=(XED_ICLASS_RCR<<8)+7, + XED_IFORM_RCR_GPRv_IMM=(XED_ICLASS_RCR<<8)+8, + XED_IFORM_RCR_MEMv_CL=(XED_ICLASS_RCR<<8)+9, + XED_IFORM_RCR_GPRv_CL=(XED_ICLASS_RCR<<8)+10, + XED_IFORM_RCR_MEMb_CL=(XED_ICLASS_RCR<<8)+11, + XED_IFORM_RDMSR=(XED_ICLASS_RDMSR<<8)+0, + XED_IFORM_RDPMC=(XED_ICLASS_RDPMC<<8)+0, + XED_IFORM_RDTSC=(XED_ICLASS_RDTSC<<8)+0, + XED_IFORM_RDTSCP=(XED_ICLASS_RDTSCP<<8)+0, + XED_IFORM_RET_FAR_IMM=(XED_ICLASS_RET_FAR<<8)+0, + XED_IFORM_RET_FAR=(XED_ICLASS_RET_FAR<<8)+1, + XED_IFORM_RET_NEAR_IMM=(XED_ICLASS_RET_NEAR<<8)+0, + XED_IFORM_RET_NEAR=(XED_ICLASS_RET_NEAR<<8)+1, + XED_IFORM_ROL_GPRv_IMM=(XED_ICLASS_ROL<<8)+0, + XED_IFORM_ROL_GPR8_ONE=(XED_ICLASS_ROL<<8)+1, + XED_IFORM_ROL_MEMv_CL=(XED_ICLASS_ROL<<8)+2, + XED_IFORM_ROL_MEMb_IMM=(XED_ICLASS_ROL<<8)+3, + XED_IFORM_ROL_MEMv_ONE=(XED_ICLASS_ROL<<8)+4, + XED_IFORM_ROL_MEMb_CL=(XED_ICLASS_ROL<<8)+5, + XED_IFORM_ROL_GPRv_CL=(XED_ICLASS_ROL<<8)+6, + XED_IFORM_ROL_GPR8_CL=(XED_ICLASS_ROL<<8)+7, + XED_IFORM_ROL_GPRv_ONE=(XED_ICLASS_ROL<<8)+8, + XED_IFORM_ROL_MEMv_IMM=(XED_ICLASS_ROL<<8)+9, + XED_IFORM_ROL_MEMb_ONE=(XED_ICLASS_ROL<<8)+10, + XED_IFORM_ROL_GPR8_IMM=(XED_ICLASS_ROL<<8)+11, + XED_IFORM_ROR_MEMb_ONE=(XED_ICLASS_ROR<<8)+0, + XED_IFORM_ROR_MEMv_ONE=(XED_ICLASS_ROR<<8)+1, + XED_IFORM_ROR_GPR8_CL=(XED_ICLASS_ROR<<8)+2, + XED_IFORM_ROR_MEMv_IMM=(XED_ICLASS_ROR<<8)+3, + XED_IFORM_ROR_GPRv_ONE=(XED_ICLASS_ROR<<8)+4, + XED_IFORM_ROR_MEMb_IMM=(XED_ICLASS_ROR<<8)+5, + XED_IFORM_ROR_GPRv_IMM=(XED_ICLASS_ROR<<8)+6, + XED_IFORM_ROR_MEMb_CL=(XED_ICLASS_ROR<<8)+7, + XED_IFORM_ROR_GPR8_ONE=(XED_ICLASS_ROR<<8)+8, + XED_IFORM_ROR_MEMv_CL=(XED_ICLASS_ROR<<8)+9, + XED_IFORM_ROR_GPR8_IMM=(XED_ICLASS_ROR<<8)+10, + XED_IFORM_ROR_GPRv_CL=(XED_ICLASS_ROR<<8)+11, + XED_IFORM_ROUNDPD_XMMpd_XMMpd_IMM=(XED_ICLASS_ROUNDPD<<8)+0, + XED_IFORM_ROUNDPD_XMMpd_MEMpd_IMM=(XED_ICLASS_ROUNDPD<<8)+1, + XED_IFORM_ROUNDPS_XMMps_MEMps_IMM=(XED_ICLASS_ROUNDPS<<8)+0, + XED_IFORM_ROUNDPS_XMMps_XMMps_IMM=(XED_ICLASS_ROUNDPS<<8)+1, + XED_IFORM_ROUNDSD_XMMq_MEMq_IMM=(XED_ICLASS_ROUNDSD<<8)+0, + XED_IFORM_ROUNDSD_XMMq_XMMq_IMM=(XED_ICLASS_ROUNDSD<<8)+1, + XED_IFORM_ROUNDSS_XMMd_MEMd_IMM=(XED_ICLASS_ROUNDSS<<8)+0, + XED_IFORM_ROUNDSS_XMMd_XMMd_IMM=(XED_ICLASS_ROUNDSS<<8)+1, + XED_IFORM_RSM=(XED_ICLASS_RSM<<8)+0, + XED_IFORM_RSQRTPS_XMMps_XMMps=(XED_ICLASS_RSQRTPS<<8)+0, + XED_IFORM_RSQRTPS_XMMps_MEMps=(XED_ICLASS_RSQRTPS<<8)+1, + XED_IFORM_RSQRTSS_XMMss_MEMss=(XED_ICLASS_RSQRTSS<<8)+0, + XED_IFORM_RSQRTSS_XMMss_XMMss=(XED_ICLASS_RSQRTSS<<8)+1, + XED_IFORM_SAHF=(XED_ICLASS_SAHF<<8)+0, + XED_IFORM_SALC=(XED_ICLASS_SALC<<8)+0, + XED_IFORM_SAR_MEMv_CL=(XED_ICLASS_SAR<<8)+0, + XED_IFORM_SAR_GPRv_IMM=(XED_ICLASS_SAR<<8)+1, + XED_IFORM_SAR_GPR8_ONE=(XED_ICLASS_SAR<<8)+2, + XED_IFORM_SAR_GPR8_IMM=(XED_ICLASS_SAR<<8)+3, + XED_IFORM_SAR_MEMv_ONE=(XED_ICLASS_SAR<<8)+4, + XED_IFORM_SAR_MEMb_CL=(XED_ICLASS_SAR<<8)+5, + XED_IFORM_SAR_MEMb_IMM=(XED_ICLASS_SAR<<8)+6, + XED_IFORM_SAR_MEMv_IMM=(XED_ICLASS_SAR<<8)+7, + XED_IFORM_SAR_GPR8_CL=(XED_ICLASS_SAR<<8)+8, + XED_IFORM_SAR_GPRv_CL=(XED_ICLASS_SAR<<8)+9, + XED_IFORM_SAR_GPRv_ONE=(XED_ICLASS_SAR<<8)+10, + XED_IFORM_SAR_MEMb_ONE=(XED_ICLASS_SAR<<8)+11, + XED_IFORM_SBB_AL_IMM=(XED_ICLASS_SBB<<8)+0, + XED_IFORM_SBB_MEMv_GPRv=(XED_ICLASS_SBB<<8)+1, + XED_IFORM_SBB_MEMb_IMM=(XED_ICLASS_SBB<<8)+2, + XED_IFORM_SBB_GPRv_GPRv=(XED_ICLASS_SBB<<8)+3, + XED_IFORM_SBB_OrAX_IMM=(XED_ICLASS_SBB<<8)+4, + XED_IFORM_SBB_GPR8_GPR8=(XED_ICLASS_SBB<<8)+5, + XED_IFORM_SBB_GPR8_IMM=(XED_ICLASS_SBB<<8)+6, + XED_IFORM_SBB_MEMv_IMM=(XED_ICLASS_SBB<<8)+7, + XED_IFORM_SBB_MEMb_GPR8=(XED_ICLASS_SBB<<8)+8, + XED_IFORM_SBB_GPRv_MEMv=(XED_ICLASS_SBB<<8)+9, + XED_IFORM_SBB_GPRv_IMM=(XED_ICLASS_SBB<<8)+10, + XED_IFORM_SBB_GPR8_MEMb=(XED_ICLASS_SBB<<8)+11, + XED_IFORM_SCASB=(XED_ICLASS_SCASB<<8)+0, + XED_IFORM_SCASD=(XED_ICLASS_SCASD<<8)+0, + XED_IFORM_SCASQ=(XED_ICLASS_SCASQ<<8)+0, + XED_IFORM_SCASW=(XED_ICLASS_SCASW<<8)+0, + XED_IFORM_SETB_GPR8=(XED_ICLASS_SETB<<8)+0, + XED_IFORM_SETB_MEMb=(XED_ICLASS_SETB<<8)+1, + XED_IFORM_SETBE_GPR8=(XED_ICLASS_SETBE<<8)+0, + XED_IFORM_SETBE_MEMb=(XED_ICLASS_SETBE<<8)+1, + XED_IFORM_SETL_MEMb=(XED_ICLASS_SETL<<8)+0, + XED_IFORM_SETL_GPR8=(XED_ICLASS_SETL<<8)+1, + XED_IFORM_SETLE_GPR8=(XED_ICLASS_SETLE<<8)+0, + XED_IFORM_SETLE_MEMb=(XED_ICLASS_SETLE<<8)+1, + XED_IFORM_SETNB_GPR8=(XED_ICLASS_SETNB<<8)+0, + XED_IFORM_SETNB_MEMb=(XED_ICLASS_SETNB<<8)+1, + XED_IFORM_SETNBE_MEMb=(XED_ICLASS_SETNBE<<8)+0, + XED_IFORM_SETNBE_GPR8=(XED_ICLASS_SETNBE<<8)+1, + XED_IFORM_SETNL_GPR8=(XED_ICLASS_SETNL<<8)+0, + XED_IFORM_SETNL_MEMb=(XED_ICLASS_SETNL<<8)+1, + XED_IFORM_SETNLE_MEMb=(XED_ICLASS_SETNLE<<8)+0, + XED_IFORM_SETNLE_GPR8=(XED_ICLASS_SETNLE<<8)+1, + XED_IFORM_SETNO_MEMb=(XED_ICLASS_SETNO<<8)+0, + XED_IFORM_SETNO_GPR8=(XED_ICLASS_SETNO<<8)+1, + XED_IFORM_SETNP_MEMb=(XED_ICLASS_SETNP<<8)+0, + XED_IFORM_SETNP_GPR8=(XED_ICLASS_SETNP<<8)+1, + XED_IFORM_SETNS_GPR8=(XED_ICLASS_SETNS<<8)+0, + XED_IFORM_SETNS_MEMb=(XED_ICLASS_SETNS<<8)+1, + XED_IFORM_SETNZ_GPR8=(XED_ICLASS_SETNZ<<8)+0, + XED_IFORM_SETNZ_MEMb=(XED_ICLASS_SETNZ<<8)+1, + XED_IFORM_SETO_MEMb=(XED_ICLASS_SETO<<8)+0, + XED_IFORM_SETO_GPR8=(XED_ICLASS_SETO<<8)+1, + XED_IFORM_SETP_GPR8=(XED_ICLASS_SETP<<8)+0, + XED_IFORM_SETP_MEMb=(XED_ICLASS_SETP<<8)+1, + XED_IFORM_SETS_GPR8=(XED_ICLASS_SETS<<8)+0, + XED_IFORM_SETS_MEMb=(XED_ICLASS_SETS<<8)+1, + XED_IFORM_SETZ_GPR8=(XED_ICLASS_SETZ<<8)+0, + XED_IFORM_SETZ_MEMb=(XED_ICLASS_SETZ<<8)+1, + XED_IFORM_SFENCE=(XED_ICLASS_SFENCE<<8)+0, + XED_IFORM_SGDT_MEMs=(XED_ICLASS_SGDT<<8)+0, + XED_IFORM_SHL_MEMv_ONE=(XED_ICLASS_SHL<<8)+0, + XED_IFORM_SHL_GPRv_CL=(XED_ICLASS_SHL<<8)+1, + XED_IFORM_SHL_MEMb_CL=(XED_ICLASS_SHL<<8)+2, + XED_IFORM_SHL_MEMv_IMM=(XED_ICLASS_SHL<<8)+3, + XED_IFORM_SHL_GPRv_IMM=(XED_ICLASS_SHL<<8)+4, + XED_IFORM_SHL_GPR8_ONE=(XED_ICLASS_SHL<<8)+5, + XED_IFORM_SHL_GPRv_ONE=(XED_ICLASS_SHL<<8)+6, + XED_IFORM_SHL_MEMb_IMM=(XED_ICLASS_SHL<<8)+7, + XED_IFORM_SHL_MEMb_ONE=(XED_ICLASS_SHL<<8)+8, + XED_IFORM_SHL_MEMv_CL=(XED_ICLASS_SHL<<8)+9, + XED_IFORM_SHL_GPR8_IMM=(XED_ICLASS_SHL<<8)+10, + XED_IFORM_SHL_GPR8_CL=(XED_ICLASS_SHL<<8)+11, + XED_IFORM_SHLD_GPRv_GPRv_CL=(XED_ICLASS_SHLD<<8)+0, + XED_IFORM_SHLD_GPRv_GPRv_IMM=(XED_ICLASS_SHLD<<8)+1, + XED_IFORM_SHLD_MEMv_GPRv_IMM=(XED_ICLASS_SHLD<<8)+2, + XED_IFORM_SHLD_MEMv_GPRv_CL=(XED_ICLASS_SHLD<<8)+3, + XED_IFORM_SHR_MEMb_CL=(XED_ICLASS_SHR<<8)+0, + XED_IFORM_SHR_GPR8_CL=(XED_ICLASS_SHR<<8)+1, + XED_IFORM_SHR_GPR8_IMM=(XED_ICLASS_SHR<<8)+2, + XED_IFORM_SHR_GPRv_CL=(XED_ICLASS_SHR<<8)+3, + XED_IFORM_SHR_MEMb_IMM=(XED_ICLASS_SHR<<8)+4, + XED_IFORM_SHR_GPRv_IMM=(XED_ICLASS_SHR<<8)+5, + XED_IFORM_SHR_MEMv_ONE=(XED_ICLASS_SHR<<8)+6, + XED_IFORM_SHR_MEMb_ONE=(XED_ICLASS_SHR<<8)+7, + XED_IFORM_SHR_GPR8_ONE=(XED_ICLASS_SHR<<8)+8, + XED_IFORM_SHR_GPRv_ONE=(XED_ICLASS_SHR<<8)+9, + XED_IFORM_SHR_MEMv_CL=(XED_ICLASS_SHR<<8)+10, + XED_IFORM_SHR_MEMv_IMM=(XED_ICLASS_SHR<<8)+11, + XED_IFORM_SHRD_MEMv_GPRv_CL=(XED_ICLASS_SHRD<<8)+0, + XED_IFORM_SHRD_MEMv_GPRv_IMM=(XED_ICLASS_SHRD<<8)+1, + XED_IFORM_SHRD_GPRv_GPRv_CL=(XED_ICLASS_SHRD<<8)+2, + XED_IFORM_SHRD_GPRv_GPRv_IMM=(XED_ICLASS_SHRD<<8)+3, + XED_IFORM_SHUFPD_XMMpd_MEMpd_IMM=(XED_ICLASS_SHUFPD<<8)+0, + XED_IFORM_SHUFPD_XMMpd_XMMpd_IMM=(XED_ICLASS_SHUFPD<<8)+1, + XED_IFORM_SHUFPS_XMMps_XMMps_IMM=(XED_ICLASS_SHUFPS<<8)+0, + XED_IFORM_SHUFPS_XMMps_MEMps_IMM=(XED_ICLASS_SHUFPS<<8)+1, + XED_IFORM_SIDT_MEMs=(XED_ICLASS_SIDT<<8)+0, + XED_IFORM_SKINIT_EAX=(XED_ICLASS_SKINIT<<8)+0, + XED_IFORM_SLDT_GPRv=(XED_ICLASS_SLDT<<8)+0, + XED_IFORM_SLDT_MEMw=(XED_ICLASS_SLDT<<8)+1, + XED_IFORM_SMSW_GPRv=(XED_ICLASS_SMSW<<8)+0, + XED_IFORM_SMSW_MEMw=(XED_ICLASS_SMSW<<8)+1, + XED_IFORM_SQRTPD_XMMpd_XMMpd=(XED_ICLASS_SQRTPD<<8)+0, + XED_IFORM_SQRTPD_XMMpd_MEMpd=(XED_ICLASS_SQRTPD<<8)+1, + XED_IFORM_SQRTPS_XMMps_MEMps=(XED_ICLASS_SQRTPS<<8)+0, + XED_IFORM_SQRTPS_XMMps_XMMps=(XED_ICLASS_SQRTPS<<8)+1, + XED_IFORM_SQRTSD_XMMsd_MEMsd=(XED_ICLASS_SQRTSD<<8)+0, + XED_IFORM_SQRTSD_XMMsd_XMMsd=(XED_ICLASS_SQRTSD<<8)+1, + XED_IFORM_SQRTSS_XMMss_XMMss=(XED_ICLASS_SQRTSS<<8)+0, + XED_IFORM_SQRTSS_XMMss_MEMss=(XED_ICLASS_SQRTSS<<8)+1, + XED_IFORM_STC=(XED_ICLASS_STC<<8)+0, + XED_IFORM_STD=(XED_ICLASS_STD<<8)+0, + XED_IFORM_STGI=(XED_ICLASS_STGI<<8)+0, + XED_IFORM_STI=(XED_ICLASS_STI<<8)+0, + XED_IFORM_STMXCSR_MEMd=(XED_ICLASS_STMXCSR<<8)+0, + XED_IFORM_STOSB=(XED_ICLASS_STOSB<<8)+0, + XED_IFORM_STOSD=(XED_ICLASS_STOSD<<8)+0, + XED_IFORM_STOSQ=(XED_ICLASS_STOSQ<<8)+0, + XED_IFORM_STOSW=(XED_ICLASS_STOSW<<8)+0, + XED_IFORM_STR_GPRv=(XED_ICLASS_STR<<8)+0, + XED_IFORM_STR_MEMw=(XED_ICLASS_STR<<8)+1, + XED_IFORM_SUB_MEMv_IMM=(XED_ICLASS_SUB<<8)+0, + XED_IFORM_SUB_GPRv_IMM=(XED_ICLASS_SUB<<8)+1, + XED_IFORM_SUB_MEMb_GPR8=(XED_ICLASS_SUB<<8)+2, + XED_IFORM_SUB_MEMb_IMM=(XED_ICLASS_SUB<<8)+3, + XED_IFORM_SUB_OrAX_IMM=(XED_ICLASS_SUB<<8)+4, + XED_IFORM_SUB_GPR8_GPR8=(XED_ICLASS_SUB<<8)+5, + XED_IFORM_SUB_MEMv_GPRv=(XED_ICLASS_SUB<<8)+6, + XED_IFORM_SUB_GPRv_GPRv=(XED_ICLASS_SUB<<8)+7, + XED_IFORM_SUB_GPR8_MEMb=(XED_ICLASS_SUB<<8)+8, + XED_IFORM_SUB_AL_IMM=(XED_ICLASS_SUB<<8)+9, + XED_IFORM_SUB_GPR8_IMM=(XED_ICLASS_SUB<<8)+10, + XED_IFORM_SUB_GPRv_MEMv=(XED_ICLASS_SUB<<8)+11, + XED_IFORM_SUBPD_XMMpd_MEMpd=(XED_ICLASS_SUBPD<<8)+0, + XED_IFORM_SUBPD_XMMpd_XMMpd=(XED_ICLASS_SUBPD<<8)+1, + XED_IFORM_SUBPS_XMMps_XMMps=(XED_ICLASS_SUBPS<<8)+0, + XED_IFORM_SUBPS_XMMps_MEMps=(XED_ICLASS_SUBPS<<8)+1, + XED_IFORM_SUBSD_XMMsd_XMMsd=(XED_ICLASS_SUBSD<<8)+0, + XED_IFORM_SUBSD_XMMsd_MEMsd=(XED_ICLASS_SUBSD<<8)+1, + XED_IFORM_SUBSS_XMMss_MEMss=(XED_ICLASS_SUBSS<<8)+0, + XED_IFORM_SUBSS_XMMss_XMMss=(XED_ICLASS_SUBSS<<8)+1, + XED_IFORM_SWAPGS=(XED_ICLASS_SWAPGS<<8)+0, + XED_IFORM_SYSCALL=(XED_ICLASS_SYSCALL<<8)+0, + XED_IFORM_SYSENTER=(XED_ICLASS_SYSENTER<<8)+0, + XED_IFORM_SYSEXIT=(XED_ICLASS_SYSEXIT<<8)+0, + XED_IFORM_SYSRET=(XED_ICLASS_SYSRET<<8)+0, + XED_IFORM_TEST_OrAX_IMM=(XED_ICLASS_TEST<<8)+0, + XED_IFORM_TEST_MEMv_GPRv=(XED_ICLASS_TEST<<8)+1, + XED_IFORM_TEST_AL_IMM=(XED_ICLASS_TEST<<8)+2, + XED_IFORM_TEST_GPRv_GPRv=(XED_ICLASS_TEST<<8)+3, + XED_IFORM_TEST_MEMb_IMM=(XED_ICLASS_TEST<<8)+4, + XED_IFORM_TEST_GPR8_GPR8=(XED_ICLASS_TEST<<8)+5, + XED_IFORM_TEST_MEMb_GPR8=(XED_ICLASS_TEST<<8)+6, + XED_IFORM_TEST_GPR8_IMM=(XED_ICLASS_TEST<<8)+7, + XED_IFORM_TEST_GPRv_IMM=(XED_ICLASS_TEST<<8)+8, + XED_IFORM_TEST_MEMv_IMM=(XED_ICLASS_TEST<<8)+9, + XED_IFORM_UCOMISD_XMMsd_MEMsd=(XED_ICLASS_UCOMISD<<8)+0, + XED_IFORM_UCOMISD_XMMsd_XMMsd=(XED_ICLASS_UCOMISD<<8)+1, + XED_IFORM_UCOMISS_XMMss_XMMss=(XED_ICLASS_UCOMISS<<8)+0, + XED_IFORM_UCOMISS_XMMss_MEMss=(XED_ICLASS_UCOMISS<<8)+1, + XED_IFORM_UD2=(XED_ICLASS_UD2<<8)+0, + XED_IFORM_UNPCKHPD_XMMpd_MEMdq=(XED_ICLASS_UNPCKHPD<<8)+0, + XED_IFORM_UNPCKHPD_XMMpd_XMMq=(XED_ICLASS_UNPCKHPD<<8)+1, + XED_IFORM_UNPCKHPS_XMMps_XMMdq=(XED_ICLASS_UNPCKHPS<<8)+0, + XED_IFORM_UNPCKHPS_XMMps_MEMdq=(XED_ICLASS_UNPCKHPS<<8)+1, + XED_IFORM_UNPCKLPD_XMMpd_MEMq=(XED_ICLASS_UNPCKLPD<<8)+0, + XED_IFORM_UNPCKLPD_XMMpd_XMMq=(XED_ICLASS_UNPCKLPD<<8)+1, + XED_IFORM_UNPCKLPS_XMMps_XMMq=(XED_ICLASS_UNPCKLPS<<8)+0, + XED_IFORM_UNPCKLPS_XMMps_MEMq=(XED_ICLASS_UNPCKLPS<<8)+1, + XED_IFORM_VERR_GPR16=(XED_ICLASS_VERR<<8)+0, + XED_IFORM_VERR_MEMw=(XED_ICLASS_VERR<<8)+1, + XED_IFORM_VERW_GPR16=(XED_ICLASS_VERW<<8)+0, + XED_IFORM_VERW_MEMw=(XED_ICLASS_VERW<<8)+1, + XED_IFORM_VMCALL=(XED_ICLASS_VMCALL<<8)+0, + XED_IFORM_VMCLEAR_MEMq=(XED_ICLASS_VMCLEAR<<8)+0, + XED_IFORM_VMLAUNCH=(XED_ICLASS_VMLAUNCH<<8)+0, + XED_IFORM_VMLOAD_OrAX=(XED_ICLASS_VMLOAD<<8)+0, + XED_IFORM_VMMCALL=(XED_ICLASS_VMMCALL<<8)+0, + XED_IFORM_VMPTRLD_MEMq=(XED_ICLASS_VMPTRLD<<8)+0, + XED_IFORM_VMPTRST_MEMq=(XED_ICLASS_VMPTRST<<8)+0, + XED_IFORM_VMREAD_MEMq_GPR64=(XED_ICLASS_VMREAD<<8)+0, + XED_IFORM_VMREAD_GPR32_GPR32=(XED_ICLASS_VMREAD<<8)+1, + XED_IFORM_VMREAD_MEMd_GPR32=(XED_ICLASS_VMREAD<<8)+2, + XED_IFORM_VMREAD_GPR64_GPR64=(XED_ICLASS_VMREAD<<8)+3, + XED_IFORM_VMRESUME=(XED_ICLASS_VMRESUME<<8)+0, + XED_IFORM_VMRUN_OrAX=(XED_ICLASS_VMRUN<<8)+0, + XED_IFORM_VMSAVE=(XED_ICLASS_VMSAVE<<8)+0, + XED_IFORM_VMWRITE_GPR64_MEMq=(XED_ICLASS_VMWRITE<<8)+0, + XED_IFORM_VMWRITE_GPR32_GPR32=(XED_ICLASS_VMWRITE<<8)+1, + XED_IFORM_VMWRITE_GPR32_MEMd=(XED_ICLASS_VMWRITE<<8)+2, + XED_IFORM_VMWRITE_GPR64_GPR64=(XED_ICLASS_VMWRITE<<8)+3, + XED_IFORM_VMXOFF=(XED_ICLASS_VMXOFF<<8)+0, + XED_IFORM_VMXON_MEMq=(XED_ICLASS_VMXON<<8)+0, + XED_IFORM_WBINVD=(XED_ICLASS_WBINVD<<8)+0, + XED_IFORM_WRMSR=(XED_ICLASS_WRMSR<<8)+0, + XED_IFORM_XADD_GPRv_GPRv=(XED_ICLASS_XADD<<8)+0, + XED_IFORM_XADD_GPR8_GPR8=(XED_ICLASS_XADD<<8)+1, + XED_IFORM_XADD_MEMv_GPRv=(XED_ICLASS_XADD<<8)+2, + XED_IFORM_XADD_MEMb_GPR8=(XED_ICLASS_XADD<<8)+3, + XED_IFORM_XCHG_GPR8_GPR8=(XED_ICLASS_XCHG<<8)+0, + XED_IFORM_XCHG_MEMv_GPRv=(XED_ICLASS_XCHG<<8)+1, + XED_IFORM_XCHG_GPRv_GPRv=(XED_ICLASS_XCHG<<8)+2, + XED_IFORM_XCHG_MEMb_GPR8=(XED_ICLASS_XCHG<<8)+3, + XED_IFORM_XCHG_GPRv_OrAX=(XED_ICLASS_XCHG<<8)+4, + XED_IFORM_XGETBV=(XED_ICLASS_XGETBV<<8)+0, + XED_IFORM_XLAT_FINAL_DSEG=(XED_ICLASS_XLAT<<8)+0, + XED_IFORM_XLAT=(XED_ICLASS_XLAT<<8)+1, + XED_IFORM_XOR_GPRv_IMM=(XED_ICLASS_XOR<<8)+0, + XED_IFORM_XOR_MEMv_GPRv=(XED_ICLASS_XOR<<8)+1, + XED_IFORM_XOR_MEMb_IMM=(XED_ICLASS_XOR<<8)+2, + XED_IFORM_XOR_GPR8_MEMb=(XED_ICLASS_XOR<<8)+3, + XED_IFORM_XOR_MEMb_GPR8=(XED_ICLASS_XOR<<8)+4, + XED_IFORM_XOR_GPRv_MEMv=(XED_ICLASS_XOR<<8)+5, + XED_IFORM_XOR_AL_IMM=(XED_ICLASS_XOR<<8)+6, + XED_IFORM_XOR_GPRv_GPRv=(XED_ICLASS_XOR<<8)+7, + XED_IFORM_XOR_MEMv_IMM=(XED_ICLASS_XOR<<8)+8, + XED_IFORM_XOR_OrAX_IMM=(XED_ICLASS_XOR<<8)+9, + XED_IFORM_XOR_GPR8_GPR8=(XED_ICLASS_XOR<<8)+10, + XED_IFORM_XOR_GPR8_IMM=(XED_ICLASS_XOR<<8)+11, + XED_IFORM_XORPD_XMMpd_XMMpd=(XED_ICLASS_XORPD<<8)+0, + XED_IFORM_XORPD_XMMpd_MEMpd=(XED_ICLASS_XORPD<<8)+1, + XED_IFORM_XORPS_XMMps_MEMps=(XED_ICLASS_XORPS<<8)+0, + XED_IFORM_XORPS_XMMps_XMMps=(XED_ICLASS_XORPS<<8)+1, + XED_IFORM_XRSTOR_MEMmxsave=(XED_ICLASS_XRSTOR<<8)+0, + XED_IFORM_XSAVE_MEMmxsave=(XED_ICLASS_XSAVE<<8)+0, + XED_IFORM_XSETBV=(XED_ICLASS_XSETBV<<8)+0, + XED_IFORM_LAST +} xed_iform_enum_t; + +XED_DLL_EXPORT xed_iform_enum_t +str2xed_iform_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_iform_enum_t2str(const xed_iform_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-immdis.h b/palacios/include/xed/xed-immdis.h new file mode 100644 index 0000000..f05cd2a --- /dev/null +++ b/palacios/include/xed/xed-immdis.h @@ -0,0 +1,217 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-immdis.h +/// @author Mark Charney + + + +#ifndef _XED_IMMDIS_H_ +# define _XED_IMMDIS_H_ + +#include +#include +#include + + +//////////////////////////////////////////////////////////////////////////// +// DEFINES +//////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////// +// TYPES +//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// PROTOTYPES +//////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////// +// GLOBALS +//////////////////////////////////////////////////////////////////////////// + +#define XED_MAX_IMMDIS_BYTES 8 + +// A union for speed of zeroing +union xed_immdis_values_t +{ + xed_uint8_t x[XED_MAX_IMMDIS_BYTES];// STORED LITTLE ENDIAN. BYTE 0 is LSB + xed_uint64_t q; +}; + +/// Stores immediates and displacements for the encoder & decoder. +typedef struct XED_DLL_EXPORT xed_immdis_s { + union xed_immdis_values_t value; + unsigned int currently_used_space :4; // current number of assigned bytes + unsigned int max_allocated_space :4; // max allocation, 4 or 8 + xed_bool_t present : 1; + xed_bool_t immediate_is_unsigned : 1; +} xed_immdis_t; + +XED_DLL_EXPORT void xed_immdis__check(xed_immdis_t* q, int p) ; + + +XED_DLL_EXPORT void xed_immdis_init(xed_immdis_t* p, int max_bytes); + +/// @name Sizes and lengths +//@{ +/// return the number of bytes added +XED_DLL_EXPORT unsigned int xed_immdis_get_bytes(const xed_immdis_t* p) ; + +//@} + +/// @name Accessors for the value of the immediate or displacement +//@{ +XED_DLL_EXPORT xed_int64_t +xed_immdis_get_signed64(const xed_immdis_t* p); + +XED_DLL_EXPORT xed_uint64_t +xed_immdis_get_unsigned64(const xed_immdis_t* p); + +XED_DLL_EXPORT xed_bool_t +xed_immdis_is_zero(const xed_immdis_t* p) ; + +XED_DLL_EXPORT xed_bool_t +xed_immdis_is_one(const xed_immdis_t* p) ; + +/// Access the i'th byte of the immediate +XED_DLL_EXPORT xed_uint8_t xed_immdis_get_byte(const xed_immdis_t* p, unsigned int i) ; +//@} + +/// @name Presence / absence of an immediate or displacement +//@{ +XED_DLL_EXPORT void xed_immdis_set_present(xed_immdis_t* p) ; + +/// True if the object has had a value or individual bytes added to it. +XED_DLL_EXPORT xed_bool_t xed_immdis_is_present(const xed_immdis_t* p) ; +//@} + + +/// @name Initialization and setup +//@{ +XED_DLL_EXPORT void xed_immdis_set_max_len(xed_immdis_t* p, unsigned int mx) ; +XED_DLL_EXPORT void +xed_immdis_zero(xed_immdis_t* p); + +XED_DLL_EXPORT unsigned int xed_immdis_get_max_length(const xed_immdis_t* p) ; + +//@} + +/// @name Signed vs Unsigned +//@{ +/// Return true if signed. +XED_DLL_EXPORT xed_bool_t +xed_immdis_is_unsigned(const xed_immdis_t* p) ; +/// Return true if signed. +XED_DLL_EXPORT xed_bool_t +xed_immdis_is_signed(const xed_immdis_t* p) ; + +/// Set the immediate to be signed; For decoder use only. +XED_DLL_EXPORT void +xed_immdis_set_signed(xed_immdis_t* p) ; +/// Set the immediate to be unsigned; For decoder use only. +XED_DLL_EXPORT void +xed_immdis_set_unsigned( xed_immdis_t* p) ; +//@} + + +/// @name Adding / setting values +//@{ +XED_DLL_EXPORT void +xed_immdis_add_byte(xed_immdis_t* p, xed_uint8_t b); + + +XED_DLL_EXPORT void +xed_immdis_add_byte_array(xed_immdis_t* p, int nb, xed_uint8_t* ba); + +/// Add 1, 2, 4 or 8 bytes depending on the value x and the mask of +/// legal_widths. The default value of legal_widths = 0x5 only stops +/// adding bytes only on 1 or 4 byte quantities - depending on which +/// bytes of x are zero -- as is used for most memory addressing. You +/// can set legal_widths to 0x7 for branches (1, 2 or 4 byte branch +/// displacements). Or if you have an 8B displacement, you can set +/// legal_widths to 0x8. NOTE: add_shortest_width will add up to +/// XED_MAX_IMMDIS_BYTES if the x value requires it. NOTE: 16b memory +/// addressing can have 16b immediates. +XED_DLL_EXPORT void +xed_immdis_add_shortest_width_signed(xed_immdis_t* p, xed_int64_t x, xed_uint8_t legal_widths); + +/// See add_shortest_width_signed() +XED_DLL_EXPORT void +xed_immdis_add_shortest_width_unsigned(xed_immdis_t* p, xed_uint64_t x, xed_uint8_t legal_widths ); + + +/// add an 8 bit value to the byte array +XED_DLL_EXPORT void +xed_immdis_add8(xed_immdis_t* p, xed_int8_t d); + +/// add a 16 bit value to the byte array +XED_DLL_EXPORT void +xed_immdis_add16(xed_immdis_t* p, xed_int16_t d); + +/// add a 32 bit value to the byte array +XED_DLL_EXPORT void +xed_immdis_add32(xed_immdis_t* p, xed_int32_t d); + +/// add a 64 bit value to the byte array. +XED_DLL_EXPORT void +xed_immdis_add64(xed_immdis_t* p, xed_int64_t d); + +//@} + + +/// @name printing / debugging +//@{ + +/// just print the raw bytes in hex with a leading 0x +XED_DLL_EXPORT int xed_immdis_print(const xed_immdis_t* p, char* buf, int buflen); + +/// Print the value as a signed or unsigned number depending on the +/// value of the immediate_is_unsigned variable. +XED_DLL_EXPORT int +xed_immdis_print_signed_or_unsigned(const xed_immdis_t* p, char* buf, int buflen); + +/// print the signed value, appropriate width, with a leading 0x +XED_DLL_EXPORT int +xed_immdis_print_value_signed(const xed_immdis_t* p, char* buf, int buflen); + +/// print the unsigned value, appropriate width, with a leading 0x +XED_DLL_EXPORT int +xed_immdis_print_value_unsigned(const xed_immdis_t* p, char* buf, int buflen); + +int xed_immdis__print_ptr(const xed_immdis_t* p, char* buf, int buflen); +#endif + +//@} + + +//////////////////////////////////////////////////////////////////////////// +//Local Variables: +//pref: "../../xed-immdis.c" +//End: diff --git a/palacios/include/xed/xed-immed.h b/palacios/include/xed/xed-immed.h new file mode 100644 index 0000000..1d6e0ac --- /dev/null +++ b/palacios/include/xed/xed-immed.h @@ -0,0 +1,64 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-immed.h +/// @author Mark Charney + +#ifndef _XED_IMMED_H_ +# define _XED_IMMED_H_ + +#include +#include +#include + +XED_DLL_EXPORT xed_int64_t xed_immed_from_bytes(xed_int8_t* bytes, xed_uint_t n); + /* + Convert an array of bytes representing a Little Endian byte ordering + of a number (11 22 33 44 55.. 88), in to a a 64b SIGNED number. That gets + stored in memory in little endian format of course. + + Input 11 22 33 44 55 66 77 88, 8 + Ouptut 0x8877665544332211 (stored in memory as (lsb) 11 22 33 44 55 66 77 88 (msb)) + + Input f0, 1 + Output 0xffff_ffff_ffff_fff0 (stored in memory as f0 ff ff ff ff ff ff ff) + + Input f0 00, 2 + Output 0x0000_0000_0000_00F0 (stored in memory a f0 00 00 00 00 00 00 00) + + Input 03, 1 + Output 0x0000_0000_0000_0030 (stored in memory a 30 00 00 00 00 00 00 00) + */ + + +#endif +//Local Variables: +//pref: "../../xed-immed.c" +//End: diff --git a/palacios/include/xed/xed-init-pointer-names.h b/palacios/include/xed/xed-init-pointer-names.h new file mode 100644 index 0000000..04379fb --- /dev/null +++ b/palacios/include/xed/xed-init-pointer-names.h @@ -0,0 +1,41 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-init-pointer-names.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_INIT_POINTER_NAMES_H_) +# define _XED_INIT_POINTER_NAMES_H_ +#include +#define XED_MAX_POINTER_NAMES 17 +#endif diff --git a/palacios/include/xed/xed-init.h b/palacios/include/xed/xed-init.h new file mode 100644 index 0000000..34c9b7c --- /dev/null +++ b/palacios/include/xed/xed-init.h @@ -0,0 +1,57 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-init.h +/// @author Mark Charney + + + + +#if !defined(_XED_INIT_H_) +# define _XED_INIT_H_ + + +/// @ingroup INIT +/// This is the call to initialize the XED encode and decode tables. It must be called +/// once before using XED. +void XED_DLL_EXPORT xed_tables_init(); +/// @ingroup INIT +/// This is the call to initialize the XED decode tables. It must be called +/// once before using XED. +void XED_DLL_EXPORT xed_decode_init(); +/// @ingroup INIT +/// This is the call to initialize the XED encode tables. It must be called +/// once before using XED's encoder. +void XED_DLL_EXPORT xed_encode_init(); + + +//////////////////////////////////////////////////////////////////////////// + +#endif diff --git a/palacios/include/xed/xed-inst-printer.h b/palacios/include/xed/xed-inst-printer.h new file mode 100644 index 0000000..bb722f7 --- /dev/null +++ b/palacios/include/xed/xed-inst-printer.h @@ -0,0 +1,172 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-inst-printer.h +/// @author Mark Charney + + +#ifndef _XED_INST_PRINTER_H_ +# define _XED_INST_PRINTER_H_ +#include +#include +#include + +/// @name Legacy printers without context parameter +//@{ +/// Disassemble the decoded instruction using the ATT SYSV syntax. The +/// output buffer must be at least 16 bytes long. Returns true if +/// disassembly proceeded without errors. +/// @param xedd a #xed_decoded_inst_t for a decoded instruction +/// @param out_buffer a buffer to write the disassembly in to. +/// @param buffer_len maximum length of the disassembly buffer +/// @param runtime_instruction_address the address of the instruction being disassembled +/// @return Returns 0 if the disassembly fails, 1 otherwise. +///@ingroup PRINT +XED_DLL_EXPORT xed_bool_t +xed_format_att(xed_decoded_inst_t* xedd, + char* out_buffer, + xed_uint32_t buffer_len, + xed_uint64_t runtime_instruction_address); + +/// Disassemble the decoded instruction using the Intel syntax. The +/// output buffer must be at least 16 bytes long. Returns true if +/// disassembly proceeded without errors. +/// @param xedd a #xed_decoded_inst_t for a decoded instruction +/// @param out_buffer a buffer to write the disassembly in to. +/// @param buffer_len maximum length of the disassembly buffer +/// @param runtime_instruction_address the address of the instruction being disassembled +/// @return Returns 0 if the disassembly fails, 1 otherwise. +///@ingroup PRINT +XED_DLL_EXPORT xed_bool_t +xed_format_intel(xed_decoded_inst_t* xedd, + char* out_buffer, + xed_uint32_t buffer_len, + xed_uint64_t runtime_instruction_address); + +/// Disassemble the decoded instruction using the XED syntax providing all +/// operand resources (implicit, explicit, suppressed). The output buffer +/// must be at least 25 bytes long. Returns true if disassembly proceeded +/// without errors. +/// @param xedd a #xed_decoded_inst_t for a decoded instruction +/// @param out_buffer a buffer to write the disassembly in to. +/// @param buffer_len maximum length of the disassembly buffer +/// @param runtime_instruction_address the address of the instruction being disassembled +/// @return Returns 0 if the disassembly fails, 1 otherwise. +///@ingroup PRINT +XED_DLL_EXPORT xed_bool_t +xed_format_xed(xed_decoded_inst_t* xedd, + char* out_buffer, + xed_uint32_t buffer_len, + xed_uint64_t runtime_instruction_address); + + +/// Disassemble the decoded instruction using the specified syntax. +/// The output buffer must be at least 25 bytes long. Returns true if +/// disassembly proceeded without errors. +/// @param syntax a #xed_syntax_enum_t the specifies the disassembly format +/// @param xedd a #xed_decoded_inst_t for a decoded instruction +/// @param out_buffer a buffer to write the disassembly in to. +/// @param buffer_len maximum length of the disassembly buffer +/// @param runtime_instruction_address the address of the instruction being disassembled +/// @return Returns 0 if the disassembly fails, 1 otherwise. +///@ingroup PRINT +XED_DLL_EXPORT xed_bool_t +xed_format(xed_syntax_enum_t syntax, + xed_decoded_inst_t* xedd, + char* out_buffer, + int buffer_len, + xed_uint64_t runtime_instruction_address); + + +//@} +////////////////////////////////////////////////////////////////////////// + + +/// @name Printers with context parameter +//@{ +/// Disassemble the decoded instruction using the ATT SYSV syntax. The +/// output buffer must be at least 16 bytes long. Returns true if +/// disassembly proceeded without errors. +/// @param xedd a #xed_decoded_inst_t for a decoded instruction +/// @param out_buffer a buffer to write the disassembly in to. +/// @param buffer_len maximum length of the disassembly buffer +/// @param runtime_instruction_address the address of the instruction being disassembled +/// @param context A void* used only for the call back routine for symbolic disassembly if one is registered. +/// @return Returns 0 if the disassembly fails, 1 otherwise. +///@ingroup PRINT +XED_DLL_EXPORT xed_bool_t +xed_format_att_context(xed_decoded_inst_t* xedd, + char* out_buffer, + xed_uint32_t buffer_len, + xed_uint64_t runtime_instruction_address, + void* context); + +/// Disassemble the decoded instruction using the Intel syntax. The +/// output buffer must be at least 16 bytes long. Returns true if +/// disassembly proceeded without errors. +/// @param xedd a #xed_decoded_inst_t for a decoded instruction +/// @param out_buffer a buffer to write the disassembly in to. +/// @param buffer_len maximum length of the disassembly buffer +/// @param runtime_instruction_address the address of the instruction being disassembled +/// @param context A void* used only for the call back routine for symbolic disassembly if one is registered. +/// @return Returns 0 if the disassembly fails, 1 otherwise. +///@ingroup PRINT +XED_DLL_EXPORT xed_bool_t +xed_format_intel_context(xed_decoded_inst_t* xedd, + char* out_buffer, + xed_uint32_t buffer_len, + xed_uint64_t runtime_instruction_address, + void* context); + + +/// Disassemble the decoded instruction using the specified syntax. +/// The output buffer must be at least 25 bytes long. Returns true if +/// disassembly proceeded without errors. +/// @param syntax a #xed_syntax_enum_t the specifies the disassembly format +/// @param xedd a #xed_decoded_inst_t for a decoded instruction +/// @param out_buffer a buffer to write the disassembly in to. +/// @param buffer_len maximum length of the disassembly buffer +/// @param runtime_instruction_address the address of the instruction being disassembled +/// @param context A void* used only for the call back routine for symbolic disassembly if one is registered. +/// @return Returns 0 if the disassembly fails, 1 otherwise. +///@ingroup PRINT +XED_DLL_EXPORT xed_bool_t +xed_format_context(xed_syntax_enum_t syntax, + xed_decoded_inst_t* xedd, + char* out_buffer, + int buffer_len, + xed_uint64_t runtime_instruction_address, + void* context); +//@} +#endif +//////////////////////////////////////////////////////////////////////////// +//Local Variables: +//pref: "../../xed-inst-printer.c" +//End: diff --git a/palacios/include/xed/xed-inst.h b/palacios/include/xed/xed-inst.h new file mode 100644 index 0000000..9ad0931 --- /dev/null +++ b/palacios/include/xed/xed-inst.h @@ -0,0 +1,323 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-inst.h +/// @author Mark Charney + +#if !defined(_XED_INST_H_) +# define _XED_INST_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // a generated file +#include // a generated file +#include // a generated file +#include // a generated file +#include // a generated file +#include // a generated file + + +struct xed_decoded_inst_s; //fwd-decl + +typedef void (*xed_operand_extractor_fn_t)(struct xed_decoded_inst_s* xds); +//typedef xed_bool_t (*xed_instruction_fixed_bit_confirmer_fn_t)(struct xed_decoded_inst_s* xds); + + +/// @ingroup DEC +/// Constant information about an individual generic operand, like an operand template, describing the operand properties. See @ref DEC for API information. +typedef struct XED_DLL_EXPORT xed_operand_s +{ + xed_operand_enum_t _name; + + xed_operand_visibility_enum_t _operand_visibility; + + xed_operand_action_enum_t _rw; + xed_operand_width_enum_t _oc2; + + xed_operand_type_enum_t _type; + union { + xed_uint32_t _imm; + xed_nonterminal_enum_t _nt; // for nt_lookup_fn's + xed_reg_enum_t _reg; + } _u; +} xed_operand_t; + +/// @name xed_inst_t Template Operands Access +//@{ +/// @ingroup DEC +static XED_INLINE xed_operand_enum_t xed_operand_name(const xed_operand_t* p) { + return p->_name; +} + + +/// @ingroup DEC +static XED_INLINE xed_operand_visibility_enum_t xed_operand_operand_visibility( const xed_operand_t* p) { + return p->_operand_visibility; +} + + +/// @ingroup DEC +/// @return The #xed_operand_type_enum_t of the operand template. +/// This is probably not what you want. +static XED_INLINE xed_operand_type_enum_t xed_operand_type(const xed_operand_t* p) { + return p->_type; +} + + +/// @ingroup DEC +static XED_INLINE xed_operand_width_enum_t xed_operand_width(const xed_operand_t* p) { + return p->_oc2; +} + +/// @ingroup DEC +static XED_INLINE +xed_nonterminal_enum_t xed_operand_nonterminal_name(const xed_operand_t* p) { + return p->_u._nt; +} + +/// @ingroup DEC +/// Careful with this one -- use #xed_decoded_inst_get_reg()! This one is +/// probably not what you think it is. It is only used for hard-coded +/// registers implicit in the instruction encoding. Most likely you want to +/// get the #xed_operand_enum_t and then look up the instruction using +/// #xed_decoded_inst_get_reg(). The hard-coded registers are also available +/// that way. +/// @param p an operand template, #xed_operand_t. +/// @return the hard-wired (implicit or suppressed) registers, type #xed_reg_enum_t +static XED_INLINE xed_reg_enum_t xed_operand_reg(const xed_operand_t* p) { + return p->_u._reg; +} + + + +/// @ingroup DEC +/// Careful with this one; See #xed_operand_is_register(). +/// @param p an operand template, #xed_operand_t. +/// @return 1 if the operand template represents are register-type +/// operand. +/// +/// Related functions: +/// Use #xed_decoded_inst_get_reg() to get the decoded name of /// the +/// register, #xed_reg_enum_t. Use #xed_operand_is_register() to test +/// #xed_operand_enum_t names. +static XED_INLINE xed_uint_t xed_operand_template_is_register(const xed_operand_t* p) { + return p->_type == XED_OPERAND_TYPE_NT_LOOKUP_FN || p->_type == XED_OPERAND_TYPE_REG; +} + +/// @ingroup DEC +/// @param p an operand template, #xed_operand_t. +/// These operands represent branch displacements, memory displacements and various immediates +static XED_INLINE xed_uint32_t xed_operand_imm(const xed_operand_t* p) { + return p->_u._imm; +} + +/// @ingroup DEC +/// Print the operand p into the buffer buf, of length buflen. +/// @param p an operand template, #xed_operand_t. +/// @param buf buffer that gets filled in +/// @param buflen maximum buffer length +XED_DLL_EXPORT void xed_operand_print(const xed_operand_t* p, char* buf, int buflen); +//@} +/// @name xed_inst_t Template Operand Enum Name Classification +//@{ +/// @ingroup DEC +/// Tests the enum for inclusion in XED_OPERAND_REG0 through XED_OPERAND_REG15. +/// @param name the operand name, type #xed_operand_enum_t +/// @return 1 if the operand name is REG0...REG15, 0 otherwise. +/// +///Note there are other registers for memory addressing; See +/// #xed_operand_is_memory_addressing_register . +static XED_INLINE xed_uint_t xed_operand_is_register(xed_operand_enum_t name) { + return name >= XED_OPERAND_REG0 && name <= XED_OPERAND_REG15; +} +/// @ingroup DEC +/// Tests the enum for inclusion in XED_OPERAND_{BASE0,BASE1,INDEX,SEG0,SEG1} +/// @param name the operand name, type #xed_operand_enum_t +/// @return 1 if the operand name is for a memory addressing register operand, 0 +/// otherwise. See also #xed_operand_is_register . +static XED_INLINE xed_uint_t xed_operand_is_memory_addressing_register(xed_operand_enum_t name) { + return ( name == XED_OPERAND_BASE0 || + name == XED_OPERAND_INDEX || + name == XED_OPERAND_SEG0 || + name == XED_OPERAND_BASE1 || + name == XED_OPERAND_SEG1 ); +} + +//@} + +/// @name xed_inst_t Template Operand Read/Written +//@{ +/// @ingroup DEC +/// Returns the raw R/W action. There are many cases for conditional reads +/// and writes. +static XED_INLINE xed_operand_action_enum_t xed_operand_rw(const xed_operand_t* p) { + return p->_rw; +} + +/// @ingroup DEC +/// If the operand is read, including conditional reads +XED_DLL_EXPORT xed_uint_t xed_operand_read(const xed_operand_t* p); +/// @ingroup DEC +/// If the operand is read-only, including conditional reads +XED_DLL_EXPORT xed_uint_t xed_operand_read_only(const xed_operand_t* p); +/// @ingroup DEC +/// If the operand is written, including conditional writes +XED_DLL_EXPORT xed_uint_t xed_operand_written(const xed_operand_t* p); +/// @ingroup DEC +/// If the operand is written-only, including conditional writes +XED_DLL_EXPORT xed_uint_t xed_operand_written_only(const xed_operand_t* p); +/// @ingroup DEC +/// If the operand is read-and-written, conditional reads and conditional writes +XED_DLL_EXPORT xed_uint_t xed_operand_read_and_written(const xed_operand_t* p); +/// @ingroup DEC +/// If the operand has a conditional read (may also write) +XED_DLL_EXPORT xed_uint_t xed_operand_conditional_read(const xed_operand_t* p); +/// @ingroup DEC +/// If the operand has a conditional write (may also read) +XED_DLL_EXPORT xed_uint_t xed_operand_conditional_write(const xed_operand_t* p); +//@} + + +#include +XED_DLL_GLOBAL extern const xed_operand_t xed_operand[XED_MAX_OPERAND_TABLE_NODES]; + +/// @ingroup DEC +/// constant information about a decoded instruction form, including the pointer to the constant operand properties #xed_operand_t for this instruction form. +typedef struct XED_DLL_EXPORT xed_inst_s { + xed_iclass_enum_t _iclass; + xed_category_enum_t _category; + xed_extension_enum_t _extension; + xed_operand_bitvec_t _operand_bitvec; + // The instruction form for this iclass. The iform is a zero-based dense sequence for each iclass. + xed_uint8_t _iform; + xed_iform_enum_t _iform_enum; + + //xed_instruction_fixed_bit_confirmer_fn_t _confirmer; + + // number of operands in the operands array + xed_uint8_t _noperands; + + // index into the xed_operand[] array of xed_operand_t structures + xed_uint32_t _operand_base; + // bit vector of values from the xed_attribute_enum_t + xed_uint32_t _attributes; + + // rflags info -- index in to the 2 tables of flags information. + // If _flag_complex is true, then the data are in the + // xed_flags_complex_table[]. Otherwise, the data are in the + // xed_flags_simple_table[]. + xed_uint16_t _flag_info_index; + xed_bool_t _flag_complex; + + xed_uint8_t _cpl; // the nominal CPL for the instruction. +} xed_inst_t; + +/// @name xed_inst_t Template Instruction Information +//@{ +/// @ingroup DEC +/// Return the current privilege level (CPL). +XED_DLL_EXPORT unsigned int xed_inst_cpl(const xed_inst_t* p) ; + + +//These next few are not doxygen commented because I want people to use the higher +//level interface in xed-decoded-inst.h. +static XED_INLINE xed_iclass_enum_t xed_inst_iclass(const xed_inst_t* p) { + return p->_iclass; +} + +static XED_INLINE xed_category_enum_t xed_inst_category(const xed_inst_t* p) { + return p->_category; +} + +static XED_INLINE xed_extension_enum_t xed_inst_extension(const xed_inst_t* p) { + return p->_extension; +} + +static XED_INLINE xed_uint_t xed_inst_iform(const xed_inst_t* p) { + return p->_iform; +} +static XED_INLINE xed_iform_enum_t xed_inst_iform_enum(const xed_inst_t* p) { + return p->_iform_enum; +} + + +///@ingroup DEC +/// Number of instruction operands +static XED_INLINE unsigned int xed_inst_noperands(const xed_inst_t* p) { + return p->_noperands; +} + +///@ingroup DEC +/// Obtain a pointer to an individual operand +static XED_INLINE const xed_operand_t* xed_inst_operand(const xed_inst_t* p, unsigned int i) { + xed_assert(i < p->_noperands); + return &(xed_operand[p->_operand_base + i]); +} + + + +XED_DLL_EXPORT xed_uint32_t xed_inst_flag_info_index(const xed_inst_t* p); + +//@} + +/// @name xed_inst_t Attribute access +//@{ +/// @ingroup DEC +/// Scan for the attribute attr and return 1 if it is found, 0 otherwise. +static XED_INLINE xed_uint32_t xed_inst_get_attribute(const xed_inst_t* p, xed_attribute_enum_t attr) { + if (p->_attributes & attr) + return 1; + return 0; +} + +/// @ingroup DEC +/// Return the attributes bit vector +static XED_INLINE xed_uint32_t xed_inst_get_attributes(const xed_inst_t* p) { + return p->_attributes; +} +/// @ingroup DEC +/// Return the maximum number of defined attributes, independent of any instruction. +XED_DLL_EXPORT unsigned int xed_attribute_max(); + +/// @ingroup DEC +/// Return the i'th global attribute in a linear sequence, independent of +/// any instruction. This is used for scanning and printing all attributes. +XED_DLL_EXPORT xed_attribute_enum_t xed_attribute(unsigned int i); + +//@} + +#endif diff --git a/palacios/include/xed/xed-interface.h b/palacios/include/xed/xed-interface.h new file mode 100644 index 0000000..705ebee --- /dev/null +++ b/palacios/include/xed/xed-interface.h @@ -0,0 +1,72 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-interface.h +/// @author Mark Charney + + + + +#if !defined(_XED_INTERFACE_H_) +# define _XED_INTERFACE_H_ + +//////////////////////////////////////////////////////////////////////////// +#include +#include +//#include +#include + +#include +#include + +#include // dstate, legacy +#include +#include // generated +#include +#include + +#include +#include +//#include +#include +#include + +#include +#include +#include +#include // generated +#include // generated +#include // generated +#include // generated + +#include // callbacks for disassembly +//////////////////////////////////////////////////////////////////////////// + +#endif diff --git a/palacios/include/xed/xed-machine-mode-enum.h b/palacios/include/xed/xed-machine-mode-enum.h new file mode 100644 index 0000000..233cf27 --- /dev/null +++ b/palacios/include/xed/xed-machine-mode-enum.h @@ -0,0 +1,55 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-machine-mode-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_MACHINE_MODE_ENUM_H_) +# define _XED_MACHINE_MODE_ENUM_H_ +#include +typedef enum { + XED_MACHINE_MODE_INVALID, + XED_MACHINE_MODE_LONG_64, ///< 64b operating mode + XED_MACHINE_MODE_LONG_COMPAT_32, ///< 32b operating mode + XED_MACHINE_MODE_LONG_COMPAT_16, ///< 16b operating mode + XED_MACHINE_MODE_LEGACY_32, ///< 32b operating mode + XED_MACHINE_MODE_LEGACY_16, ///< 16b operating mode + XED_MACHINE_MODE_LAST +} xed_machine_mode_enum_t; + +XED_DLL_EXPORT xed_machine_mode_enum_t +str2xed_machine_mode_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_machine_mode_enum_t2str(const xed_machine_mode_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-nonterminal-enum.h b/palacios/include/xed/xed-nonterminal-enum.h new file mode 100644 index 0000000..ffbd459 --- /dev/null +++ b/palacios/include/xed/xed-nonterminal-enum.h @@ -0,0 +1,163 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-nonterminal-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_NONTERMINAL_ENUM_H_) +# define _XED_NONTERMINAL_ENUM_H_ +#include +typedef enum { + XED_NONTERMINAL_INVALID, + XED_NONTERMINAL_AR10, + XED_NONTERMINAL_AR11, + XED_NONTERMINAL_AR12, + XED_NONTERMINAL_AR13, + XED_NONTERMINAL_AR14, + XED_NONTERMINAL_AR15, + XED_NONTERMINAL_AR8, + XED_NONTERMINAL_AR9, + XED_NONTERMINAL_ARAX, + XED_NONTERMINAL_ARBP, + XED_NONTERMINAL_ARBX, + XED_NONTERMINAL_ARCX, + XED_NONTERMINAL_ARDI, + XED_NONTERMINAL_ARDX, + XED_NONTERMINAL_ARSI, + XED_NONTERMINAL_ARSP, + XED_NONTERMINAL_ASZ_NONTERM, + XED_NONTERMINAL_BRANCH_HINT, + XED_NONTERMINAL_BRDISP8, + XED_NONTERMINAL_BRDISPZ, + XED_NONTERMINAL_CR_B, + XED_NONTERMINAL_CR_R, + XED_NONTERMINAL_DF64, + XED_NONTERMINAL_DR_B, + XED_NONTERMINAL_DR_R, + XED_NONTERMINAL_FINAL_DSEG, + XED_NONTERMINAL_FINAL_DSEG1, + XED_NONTERMINAL_FINAL_DSEG1_MODE64, + XED_NONTERMINAL_FINAL_DSEG1_NOT64, + XED_NONTERMINAL_FINAL_DSEG_MODE64, + XED_NONTERMINAL_FINAL_DSEG_NOT64, + XED_NONTERMINAL_FINAL_ESEG, + XED_NONTERMINAL_FINAL_SSEG, + XED_NONTERMINAL_FINAL_SSEG1, + XED_NONTERMINAL_FINAL_SSEG_MODE64, + XED_NONTERMINAL_FINAL_SSEG_NOT64, + XED_NONTERMINAL_GPR16_B, + XED_NONTERMINAL_GPR16_R, + XED_NONTERMINAL_GPR32_B, + XED_NONTERMINAL_GPR32_R, + XED_NONTERMINAL_GPR32_X, + XED_NONTERMINAL_GPR64_B, + XED_NONTERMINAL_GPR64_R, + XED_NONTERMINAL_GPR64_X, + XED_NONTERMINAL_GPR8_B, + XED_NONTERMINAL_GPR8_R, + XED_NONTERMINAL_GPRV_B, + XED_NONTERMINAL_GPRV_R, + XED_NONTERMINAL_GPRY_B, + XED_NONTERMINAL_GPRY_R, + XED_NONTERMINAL_GPRZ_B, + XED_NONTERMINAL_GPRZ_R, + XED_NONTERMINAL_GPR_ERROR_B, + XED_NONTERMINAL_GPR_ERROR_R, + XED_NONTERMINAL_INSTRUCTIONS, + XED_NONTERMINAL_ISA, + XED_NONTERMINAL_LOCK_VALIDATE, + XED_NONTERMINAL_MEMDISP16, + XED_NONTERMINAL_MEMDISP32, + XED_NONTERMINAL_MEMDISP8, + XED_NONTERMINAL_MEMDISPV, + XED_NONTERMINAL_MMX_B, + XED_NONTERMINAL_MMX_R, + XED_NONTERMINAL_MODRM, + XED_NONTERMINAL_MODRM16, + XED_NONTERMINAL_MODRM32, + XED_NONTERMINAL_MODRM64ALT32, + XED_NONTERMINAL_OEAX, + XED_NONTERMINAL_OEBP, + XED_NONTERMINAL_OEBX, + XED_NONTERMINAL_OECX, + XED_NONTERMINAL_OEDI, + XED_NONTERMINAL_OEDX, + XED_NONTERMINAL_OESI, + XED_NONTERMINAL_OESP, + XED_NONTERMINAL_OR10, + XED_NONTERMINAL_OR11, + XED_NONTERMINAL_OR12, + XED_NONTERMINAL_OR13, + XED_NONTERMINAL_OR14, + XED_NONTERMINAL_OR15, + XED_NONTERMINAL_OR8, + XED_NONTERMINAL_OR9, + XED_NONTERMINAL_ORAX, + XED_NONTERMINAL_ORBP, + XED_NONTERMINAL_ORBX, + XED_NONTERMINAL_ORCX, + XED_NONTERMINAL_ORDI, + XED_NONTERMINAL_ORDX, + XED_NONTERMINAL_ORSI, + XED_NONTERMINAL_ORSP, + XED_NONTERMINAL_OSZ_NONTERM, + XED_NONTERMINAL_PREFIXES, + XED_NONTERMINAL_REFINING66, + XED_NONTERMINAL_REMOVE_SEGMENT, + XED_NONTERMINAL_REP_VALIDATE, + XED_NONTERMINAL_RFLAGS, + XED_NONTERMINAL_RIP, + XED_NONTERMINAL_SEG, + XED_NONTERMINAL_SIB, + XED_NONTERMINAL_SIB_BASE0, + XED_NONTERMINAL_SIMM8, + XED_NONTERMINAL_SIMMZ, + XED_NONTERMINAL_TMP_B, + XED_NONTERMINAL_TMP_R, + XED_NONTERMINAL_UIMM16, + XED_NONTERMINAL_UIMM32, + XED_NONTERMINAL_UIMM8, + XED_NONTERMINAL_UIMM8_1, + XED_NONTERMINAL_UIMMV, + XED_NONTERMINAL_X87, + XED_NONTERMINAL_XMM_B, + XED_NONTERMINAL_XMM_R, + XED_NONTERMINAL_LAST +} xed_nonterminal_enum_t; + +XED_DLL_EXPORT xed_nonterminal_enum_t +str2xed_nonterminal_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_nonterminal_enum_t2str(const xed_nonterminal_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-operand-action-enum.h b/palacios/include/xed/xed-operand-action-enum.h new file mode 100644 index 0000000..0368128 --- /dev/null +++ b/palacios/include/xed/xed-operand-action-enum.h @@ -0,0 +1,57 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-action-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_OPERAND_ACTION_ENUM_H_) +# define _XED_OPERAND_ACTION_ENUM_H_ +#include +typedef enum { + XED_OPERAND_ACTION_INVALID, + XED_OPERAND_ACTION_RW, ///< Read and written (must write) + XED_OPERAND_ACTION_R, ///< Read-only + XED_OPERAND_ACTION_W, ///< Write-only (must write) + XED_OPERAND_ACTION_RCW, ///< Read and conditionlly written (may write) + XED_OPERAND_ACTION_CW, ///< Conditionlly written (may write) + XED_OPERAND_ACTION_CRW, ///< Conditionlly read, always written (must write) + XED_OPERAND_ACTION_CR, ///< Conditional read + XED_OPERAND_ACTION_LAST +} xed_operand_action_enum_t; + +XED_DLL_EXPORT xed_operand_action_enum_t +str2xed_operand_action_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_operand_action_enum_t2str(const xed_operand_action_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-operand-action.h b/palacios/include/xed/xed-operand-action.h new file mode 100644 index 0000000..aa0129a --- /dev/null +++ b/palacios/include/xed/xed-operand-action.h @@ -0,0 +1,52 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-action.h +/// @author Mark Charney + +#if !defined(_XED_OPERAND_ACTION_H_) +# define _XED_OPERAND_ACTION_H_ + +#include +#include + +XED_DLL_EXPORT xed_uint_t xed_operand_action_read(const xed_operand_action_enum_t rw); +XED_DLL_EXPORT xed_uint_t xed_operand_action_read_only(const xed_operand_action_enum_t rw); +XED_DLL_EXPORT xed_uint_t xed_operand_action_written(const xed_operand_action_enum_t rw); +XED_DLL_EXPORT xed_uint_t xed_operand_action_written_only(const xed_operand_action_enum_t rw); +XED_DLL_EXPORT xed_uint_t xed_operand_action_read_and_written(const xed_operand_action_enum_t rw); +XED_DLL_EXPORT xed_uint_t xed_operand_action_conditional_read(const xed_operand_action_enum_t rw); +XED_DLL_EXPORT xed_uint_t xed_operand_action_conditional_write(const xed_operand_action_enum_t rw); + +#endif + +//Local Variables: +//pref: "../../xed-operand-action.c" +//End: diff --git a/palacios/include/xed/xed-operand-bitvec.h b/palacios/include/xed/xed-operand-bitvec.h new file mode 100644 index 0000000..57284b8 --- /dev/null +++ b/palacios/include/xed/xed-operand-bitvec.h @@ -0,0 +1,127 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-bitvec.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_OPERAND_BITVEC_H_) +# define _XED_OPERAND_BITVEC_H_ +#include +typedef union { + xed_uint32_t i[4]; + struct { + xed_uint32_t x_AGEN : 1; /* 00:00 */ + xed_uint32_t x_AMODE : 1; /* 00:01 */ + xed_uint32_t x_ASZ : 1; /* 00:02 */ + xed_uint32_t x_BASE0 : 1; /* 00:03 */ + xed_uint32_t x_BASE1 : 1; /* 00:04 */ + xed_uint32_t x_BRDISP_WIDTH : 1; /* 00:05 */ + xed_uint32_t x_BRDISP0 : 1; /* 00:06 */ + xed_uint32_t x_BRDISP1 : 1; /* 00:07 */ + xed_uint32_t x_DEFAULT_SEG : 1; /* 00:08 */ + xed_uint32_t x_DF64 : 1; /* 00:09 */ + xed_uint32_t x_DISP_WIDTH : 1; /* 00:10 */ + xed_uint32_t x_DISP0 : 1; /* 00:11 */ + xed_uint32_t x_DISP1 : 1; /* 00:12 */ + xed_uint32_t x_DISP2 : 1; /* 00:13 */ + xed_uint32_t x_DISP3 : 1; /* 00:14 */ + xed_uint32_t x_EASZ : 1; /* 00:15 */ + xed_uint32_t x_ENCODER_PREFERRED : 1; /* 00:16 */ + xed_uint32_t x_EOSZ : 1; /* 00:17 */ + xed_uint32_t x_ERROR : 1; /* 00:18 */ + xed_uint32_t x_HINT_TAKEN : 1; /* 00:19 */ + xed_uint32_t x_HINT_NOT_TAKEN : 1; /* 00:20 */ + xed_uint32_t x_ICLASS : 1; /* 00:21 */ + xed_uint32_t x_IMM_WIDTH : 1; /* 00:22 */ + xed_uint32_t x_IMM0 : 1; /* 00:23 */ + xed_uint32_t x_IMM0SIGNED : 1; /* 00:24 */ + xed_uint32_t x_IMM1 : 1; /* 00:25 */ + xed_uint32_t x_INDEX : 1; /* 00:26 */ + xed_uint32_t x_LOCK : 1; /* 00:27 */ + xed_uint32_t x_LOCKABLE : 1; /* 00:28 */ + xed_uint32_t x_MEM_WIDTH : 1; /* 00:29 */ + xed_uint32_t x_MEM0 : 1; /* 00:30 */ + xed_uint32_t x_MEM1 : 1; /* 00:31 */ + xed_uint32_t x_MOD : 1; /* 01:00 */ + xed_uint32_t x_MODE : 1; /* 01:01 */ + xed_uint32_t x_MODRM : 1; /* 01:02 */ + xed_uint32_t x_NOREX : 1; /* 01:03 */ + xed_uint32_t x_OSZ : 1; /* 01:04 */ + xed_uint32_t x_OUTREG : 1; /* 01:05 */ + xed_uint32_t x_PTR : 1; /* 01:06 */ + xed_uint32_t x_REFINING : 1; /* 01:07 */ + xed_uint32_t x_REG : 1; /* 01:08 */ + xed_uint32_t x_REG0 : 1; /* 01:09 */ + xed_uint32_t x_REG1 : 1; /* 01:10 */ + xed_uint32_t x_REG2 : 1; /* 01:11 */ + xed_uint32_t x_REG3 : 1; /* 01:12 */ + xed_uint32_t x_REG4 : 1; /* 01:13 */ + xed_uint32_t x_REG5 : 1; /* 01:14 */ + xed_uint32_t x_REG6 : 1; /* 01:15 */ + xed_uint32_t x_REG7 : 1; /* 01:16 */ + xed_uint32_t x_REG8 : 1; /* 01:17 */ + xed_uint32_t x_REG9 : 1; /* 01:18 */ + xed_uint32_t x_REG10 : 1; /* 01:19 */ + xed_uint32_t x_REG11 : 1; /* 01:20 */ + xed_uint32_t x_REG12 : 1; /* 01:21 */ + xed_uint32_t x_REG13 : 1; /* 01:22 */ + xed_uint32_t x_REG14 : 1; /* 01:23 */ + xed_uint32_t x_REG15 : 1; /* 01:24 */ + xed_uint32_t x_RELBR : 1; /* 01:25 */ + xed_uint32_t x_REP : 1; /* 01:26 */ + xed_uint32_t x_REP_ABLE : 1; /* 01:27 */ + xed_uint32_t x_REX : 1; /* 01:28 */ + xed_uint32_t x_REXB : 1; /* 01:29 */ + xed_uint32_t x_REXR : 1; /* 01:30 */ + xed_uint32_t x_REXW : 1; /* 01:31 */ + xed_uint32_t x_REXX : 1; /* 02:00 */ + xed_uint32_t x_RM : 1; /* 02:01 */ + xed_uint32_t x_SCALE : 1; /* 02:02 */ + xed_uint32_t x_SEG_OVD : 1; /* 02:03 */ + xed_uint32_t x_SEG0 : 1; /* 02:04 */ + xed_uint32_t x_SEG1 : 1; /* 02:05 */ + xed_uint32_t x_SIB : 1; /* 02:06 */ + xed_uint32_t x_SIBBASE : 1; /* 02:07 */ + xed_uint32_t x_SIBINDEX : 1; /* 02:08 */ + xed_uint32_t x_SIBSCALE : 1; /* 02:09 */ + xed_uint32_t x_SMODE : 1; /* 02:10 */ + xed_uint32_t x_UIMM00 : 1; /* 02:11 */ + xed_uint32_t x_UIMM1 : 1; /* 02:12 */ + xed_uint32_t x_UIMM01 : 1; /* 02:13 */ + xed_uint32_t x_UIMM02 : 1; /* 02:14 */ + xed_uint32_t x_UIMM03 : 1; /* 02:15 */ + xed_uint32_t x_USING_DEFAULT_SEGMENT0 : 1; /* 02:16 */ + xed_uint32_t x_USING_DEFAULT_SEGMENT1 : 1; /* 02:17 */ + } s; +} xed_operand_bitvec_t; +#endif diff --git a/palacios/include/xed/xed-operand-ctype-enum.h b/palacios/include/xed/xed-operand-ctype-enum.h new file mode 100644 index 0000000..95edaa2 --- /dev/null +++ b/palacios/include/xed/xed-operand-ctype-enum.h @@ -0,0 +1,57 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-ctype-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_OPERAND_CTYPE_ENUM_H_) +# define _XED_OPERAND_CTYPE_ENUM_H_ +#include +typedef enum { + XED_OPERAND_CTYPE_INVALID, + XED_OPERAND_CTYPE_XED_BITS_T, + XED_OPERAND_CTYPE_XED_ERROR_ENUM_T, + XED_OPERAND_CTYPE_XED_ICLASS_ENUM_T, + XED_OPERAND_CTYPE_XED_INT16_T, + XED_OPERAND_CTYPE_XED_REG_ENUM_T, + XED_OPERAND_CTYPE_XED_UINT16_T, + XED_OPERAND_CTYPE_XED_UINT8_T, + XED_OPERAND_CTYPE_LAST +} xed_operand_ctype_enum_t; + +XED_DLL_EXPORT xed_operand_ctype_enum_t +str2xed_operand_ctype_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_operand_ctype_enum_t2str(const xed_operand_ctype_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-operand-ctype-map.h b/palacios/include/xed/xed-operand-ctype-map.h new file mode 100644 index 0000000..b836ffe --- /dev/null +++ b/palacios/include/xed/xed-operand-ctype-map.h @@ -0,0 +1,42 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-ctype-map.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_OPERAND_CTYPE_MAP_H_) +# define _XED_OPERAND_CTYPE_MAP_H_ +#include +xed_operand_ctype_enum_t xed_operand_get_ctype(xed_operand_enum_t opname); +unsigned int xed_operand_get_width(xed_operand_enum_t opname); +#endif diff --git a/palacios/include/xed/xed-operand-enum.h b/palacios/include/xed/xed-operand-enum.h new file mode 100644 index 0000000..492c205 --- /dev/null +++ b/palacios/include/xed/xed-operand-enum.h @@ -0,0 +1,132 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_OPERAND_ENUM_H_) +# define _XED_OPERAND_ENUM_H_ +#include +typedef enum { + XED_OPERAND_INVALID, + XED_OPERAND_AGEN, + XED_OPERAND_AMODE, + XED_OPERAND_ASZ, + XED_OPERAND_BASE0, + XED_OPERAND_BASE1, + XED_OPERAND_BRDISP_WIDTH, + XED_OPERAND_BRDISP0, + XED_OPERAND_BRDISP1, + XED_OPERAND_DEFAULT_SEG, + XED_OPERAND_DF64, + XED_OPERAND_DISP_WIDTH, + XED_OPERAND_DISP0, + XED_OPERAND_DISP1, + XED_OPERAND_DISP2, + XED_OPERAND_DISP3, + XED_OPERAND_EASZ, + XED_OPERAND_ENCODER_PREFERRED, + XED_OPERAND_EOSZ, + XED_OPERAND_ERROR, + XED_OPERAND_HINT_TAKEN, + XED_OPERAND_HINT_NOT_TAKEN, + XED_OPERAND_ICLASS, + XED_OPERAND_IMM_WIDTH, + XED_OPERAND_IMM0, + XED_OPERAND_IMM0SIGNED, + XED_OPERAND_IMM1, + XED_OPERAND_INDEX, + XED_OPERAND_LOCK, + XED_OPERAND_LOCKABLE, + XED_OPERAND_MEM_WIDTH, + XED_OPERAND_MEM0, + XED_OPERAND_MEM1, + XED_OPERAND_MOD, + XED_OPERAND_MODE, + XED_OPERAND_MODRM, + XED_OPERAND_NOREX, + XED_OPERAND_OSZ, + XED_OPERAND_OUTREG, + XED_OPERAND_PTR, + XED_OPERAND_REFINING, + XED_OPERAND_REG, + XED_OPERAND_REG0, + XED_OPERAND_REG1, + XED_OPERAND_REG2, + XED_OPERAND_REG3, + XED_OPERAND_REG4, + XED_OPERAND_REG5, + XED_OPERAND_REG6, + XED_OPERAND_REG7, + XED_OPERAND_REG8, + XED_OPERAND_REG9, + XED_OPERAND_REG10, + XED_OPERAND_REG11, + XED_OPERAND_REG12, + XED_OPERAND_REG13, + XED_OPERAND_REG14, + XED_OPERAND_REG15, + XED_OPERAND_RELBR, + XED_OPERAND_REP, + XED_OPERAND_REP_ABLE, + XED_OPERAND_REX, + XED_OPERAND_REXB, + XED_OPERAND_REXR, + XED_OPERAND_REXW, + XED_OPERAND_REXX, + XED_OPERAND_RM, + XED_OPERAND_SCALE, + XED_OPERAND_SEG_OVD, + XED_OPERAND_SEG0, + XED_OPERAND_SEG1, + XED_OPERAND_SIB, + XED_OPERAND_SIBBASE, + XED_OPERAND_SIBINDEX, + XED_OPERAND_SIBSCALE, + XED_OPERAND_SMODE, + XED_OPERAND_UIMM00, + XED_OPERAND_UIMM1, + XED_OPERAND_UIMM01, + XED_OPERAND_UIMM02, + XED_OPERAND_UIMM03, + XED_OPERAND_USING_DEFAULT_SEGMENT0, + XED_OPERAND_USING_DEFAULT_SEGMENT1, + XED_OPERAND_LAST +} xed_operand_enum_t; + +XED_DLL_EXPORT xed_operand_enum_t +str2xed_operand_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_operand_enum_t2str(const xed_operand_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-operand-storage.h b/palacios/include/xed/xed-operand-storage.h new file mode 100644 index 0000000..16ca0e5 --- /dev/null +++ b/palacios/include/xed/xed-operand-storage.h @@ -0,0 +1,49 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-storage.h +/// @author Mark Charney + + + +#ifndef _XED_OPERAND_STORAGE_H_ +# define _XED_OPERAND_STORAGE_H_ + +#include +#include +#include + +typedef xed_uint16_t xed_operand_values_t; + +//////////////////////////////////////////////////////////////////////////// +#endif +//Local Variables: +//pref: "../../xed-operand-storage.c" +//End: diff --git a/palacios/include/xed/xed-operand-type-enum.h b/palacios/include/xed/xed-operand-type-enum.h new file mode 100644 index 0000000..7572695 --- /dev/null +++ b/palacios/include/xed/xed-operand-type-enum.h @@ -0,0 +1,55 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-type-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_OPERAND_TYPE_ENUM_H_) +# define _XED_OPERAND_TYPE_ENUM_H_ +#include +typedef enum { + XED_OPERAND_TYPE_INVALID, + XED_OPERAND_TYPE_ERROR, + XED_OPERAND_TYPE_IMM, + XED_OPERAND_TYPE_IMM_CONST, + XED_OPERAND_TYPE_NT_LOOKUP_FN, + XED_OPERAND_TYPE_REG, + XED_OPERAND_TYPE_LAST +} xed_operand_type_enum_t; + +XED_DLL_EXPORT xed_operand_type_enum_t +str2xed_operand_type_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_operand_type_enum_t2str(const xed_operand_type_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-operand-values-interface.h b/palacios/include/xed/xed-operand-values-interface.h new file mode 100644 index 0000000..bce7bdc --- /dev/null +++ b/palacios/include/xed/xed-operand-values-interface.h @@ -0,0 +1,431 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-values-interface.h +/// @author Mark Charney + +#if !defined(_XED_OPERAND_VALUES_INTERFACE_H_) +# define _XED_OPERAND_VALUES_INTERFACE_H_ + +#include +#include +#include +#include +#include +#include // a generated file +#include // a generated file +#include +#include // generated +#include // generated +/// @name Initialization +//@{ +/// @ingroup OPERANDS +/// Initializes operand structure +XED_DLL_EXPORT void xed_operand_values_init(xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Initializes operand structure and sets state values +XED_DLL_EXPORT void xed_operand_values_init_set_mode(xed_operand_values_t* p, + const xed_state_t* dstate); +/// @ingroup OPERANDS +/// Initializes dst operand structure but preserves the existing +/// MODE/SMODE/AMODE values from the src operand structure. +XED_DLL_EXPORT void xed_operand_values_init_keep_mode( xed_operand_values_t* dst, + const xed_operand_values_t* src ); +//@} + +// Returns the raw operand fields. Do not use this. +XED_DLL_EXPORT xed_uint32_t +xed_operand_values_get_operand_decider(const xed_operand_values_t* p, + xed_operand_enum_t operand_decider_index) ; + + +/////////////////////////////////////////////////////////// +/// @name String output +//@{ +/// @ingroup OPERANDS +/// Dump all the information about the operands to buf. +XED_DLL_EXPORT void xed_operand_values_dump(const xed_operand_values_t* ov, char* buf, int buflen); +/// @ingroup OPERANDS +/// More tersely dump all the information about the operands to buf. +XED_DLL_EXPORT void xed_operand_values_print_short(const xed_operand_values_t* ov, char* buf, int buflen); +//@} + +/// @name REP/REPNE Prefixes +//@{ +/// @ingroup OPERANDS +/// True if the instruction has a real REP prefix. This returns false if +/// there is no F2/F3 prefix or the F2/F3 prefix is used to refine the +/// opcode as in some SSE operations. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_real_rep(const xed_operand_values_t* p); +/// @ingroup OPERANDS +/// True if the instruction as a real F3 REP prefix. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_rep_prefix(const xed_operand_values_t* p); +/// @ingroup OPERANDS +/// True if the instruction as a real F2 REP prefix. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_repne_prefix(const xed_operand_values_t* p); +//@} + +/// @ingroup OPERANDS +/// Returns true if the memory operation has atomic read-modify-write +/// semantics. An XCHG accessing memory is atomic with or without a +/// LOCK prefix. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_get_atomic(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Returns true if the memory operatoin has a valid lock prefix. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_lock_prefix(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Indicates if the default segment is being used. +/// @param[in] p the pointer to the #xed_operand_values_t structure. +/// @param[in] i 0 or 1, indicating which memory operation. +/// @return true if the memory operation is using the default segment for the associated addressing mode base register. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_using_default_segment(const xed_operand_values_t* p, unsigned int i); + + + +/// @ingroup OPERANDS +/// Returns The effective operand width in bits: 16/32/64. Note this is not +/// the same as the width of the operand! For 8 bit operations, the +/// effective operand width is the machine mode's default width. +XED_DLL_EXPORT xed_uint32_t xed_operand_values_get_effective_operand_width(const xed_operand_values_t* p); +/// @ingroup OPERANDS +/// Returns The effective address width in bits: 16/32/64. +XED_DLL_EXPORT xed_uint32_t xed_operand_values_get_effective_address_width(const xed_operand_values_t* p); + + +/// @ingroup OPERANDS +/// True if there is a memory displacement +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_memory_displacement(const xed_operand_values_t* p); +/// @ingroup OPERANDS +/// True if there is a branch displacement +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_branch_displacement(const xed_operand_values_t* p); +/// @ingroup OPERANDS +/// True if there is a memory or branch displacement +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_displacement(const xed_operand_values_t* p); + + +/// @ingroup OPERANDS +/// Deprecated. Compatibility function for XED0. See has_memory_displacement(). +XED_DLL_EXPORT xed_bool_t +xed_operand_values_get_displacement_for_memop(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Return true if there is an immediate operand +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_immediate(const xed_operand_values_t* p); + + +/// @ingroup OPERANDS +/// ALIAS for has_displacement(). +/// Deprecated. See has_memory_displacement() and +/// has_branch_displacement(). +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_disp(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_address_size_prefix(const xed_operand_values_t* p); +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_operand_size_prefix(const xed_operand_values_t* p); + +#if 0 +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_refining_66_prefix(const xed_operand_values_t* p); +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_refining_f2_prefix(const xed_operand_values_t* p); +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_refining_f3_prefix(const xed_operand_values_t* p); +#endif + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_segment_prefix(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Return the segment prefix, if any, as a #xed_reg_enum_t value. +XED_DLL_EXPORT xed_reg_enum_t +xed_operand_values_segment_prefix(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t +xed_operand_values_is_prefetch(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t xed_operand_values_get_long_mode(const xed_operand_values_t* p); + +/// @name Memory Addressing +//@{ +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t +xed_operand_values_accesses_memory(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT unsigned int +xed_operand_values_number_of_memory_operands(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT unsigned int +xed_operand_values_get_memory_operand_length(const xed_operand_values_t* p, + unsigned int memop_idx); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_reg_enum_t +xed_operand_values_get_base_reg(const xed_operand_values_t* p,unsigned int memop_idx); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_reg_enum_t +xed_operand_values_get_index_reg(const xed_operand_values_t* p,unsigned int memop_idx); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_reg_enum_t +xed_operand_values_get_seg_reg(const xed_operand_values_t* p,unsigned int memop_idx); + +/// @ingroup OPERANDS +XED_DLL_EXPORT unsigned int +xed_operand_values_get_scale(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Returns true if the instruction access memory but without using a MODRM +/// byte limiting its addressing modes. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_memop_without_modrm(const xed_operand_values_t* p); +/// @ingroup OPERANDS +/// Returns true if the instruction has a MODRM byte. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_modrm_byte(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Returns true if the instruction has a SIB byte. +XED_DLL_EXPORT xed_bool_t +xed_operand_values_has_sib_byte(const xed_operand_values_t* p); +//@} + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t +xed_operand_values_branch_not_taken_hint(const xed_operand_values_t* p); +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t +xed_operand_values_branch_taken_hint(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_bool_t +xed_operand_values_is_nop(const xed_operand_values_t* p); + + +/// @name Immediates +//@{ +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_int64_t +xed_operand_values_get_immediate_int64(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_uint64_t +xed_operand_values_get_immediate_uint64(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Return true if the first immediate (IMM0) is signed +XED_DLL_EXPORT xed_uint_t xed_operand_values_get_immediate_is_signed(const xed_operand_values_t* p); + + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_uint8_t +xed_operand_values_get_immediate_byte(const xed_operand_values_t* p,unsigned int i); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_uint8_t +xed_operand_values_get_second_immediate(const xed_operand_values_t* p); +//@} + +/// @name Memory Displacements +//@{ +/// @ingroup OPERANDS +/// Return the memory displacement width in BYTES +XED_DLL_EXPORT xed_uint32_t +xed_operand_values_get_memory_displacement_length(const xed_operand_values_t* p); +/// @ingroup OPERANDS +/// Return the memory displacement width in BITS +XED_DLL_EXPORT xed_uint32_t +xed_operand_values_get_memory_displacement_length_bits(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_int64_t +xed_operand_values_get_memory_displacement_int64(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_uint8_t +xed_operand_values_get_memory_displacement_byte(const xed_operand_values_t* p,unsigned int i); +//@} + +/// @name Branch Displacements +//@{ +/// @ingroup OPERANDS +/// Return the branch displacement width in bytes +XED_DLL_EXPORT xed_uint32_t +xed_operand_values_get_branch_displacement_length(const xed_operand_values_t* p); +/// @ingroup OPERANDS +/// Return the branch displacement width in bits +XED_DLL_EXPORT xed_uint32_t +xed_operand_values_get_branch_displacement_length_bits(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_int32_t +xed_operand_values_get_branch_displacement_int32(const xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_uint8_t +xed_operand_values_get_branch_displacement_byte(const xed_operand_values_t* p,unsigned int i); +//@} + + +/// @ingroup OPERANDS +XED_DLL_EXPORT xed_iclass_enum_t +xed_operand_values_get_iclass(const xed_operand_values_t* p); + +//////////////////////////////////////////////////// +// ENCODE API +//////////////////////////////////////////////////// +/// @name Encoding +//@{ +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_zero_immediate(xed_operand_values_t* p); +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_zero_branch_displacement(xed_operand_values_t* p); +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_zero_memory_displacement(xed_operand_values_t* p); + +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_set_lock(xed_operand_values_t* p); +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_zero_segment_override(xed_operand_values_t* p); + + +/// @ingroup OPERANDS +XED_DLL_EXPORT void +xed_operand_values_set_iclass(xed_operand_values_t* p,xed_iclass_enum_t iclass); + +/// @ingroup OPERANDS +XED_DLL_EXPORT void +xed_operand_values_set_effective_operand_width(xed_operand_values_t* p,unsigned int width); + +/// @ingroup OPERANDS +XED_DLL_EXPORT void +xed_operand_values_set_memory_operand_length(xed_operand_values_t* p,unsigned int memop_length); + + +/// @ingroup OPERANDS +/// Set the memory displacement using a BYTES length +XED_DLL_EXPORT void +xed_operand_values_set_memory_displacement(xed_operand_values_t* p,xed_int64_t x, unsigned int len); +/// @ingroup OPERANDS +/// Set the memory displacement using a BITS length +XED_DLL_EXPORT void +xed_operand_values_set_memory_displacement_bits(xed_operand_values_t* p,xed_int64_t x, unsigned int len_bits); + +/// @ingroup OPERANDS +/// Indicate that we have a relative branch. +XED_DLL_EXPORT void xed_operand_values_set_relbr(xed_operand_values_t* p); + +/// @ingroup OPERANDS +/// Set the branch displacement using a BYTES length +XED_DLL_EXPORT void +xed_operand_values_set_branch_displacement(xed_operand_values_t* p,xed_int32_t x, unsigned int len); +/// @ingroup OPERANDS +/// Set the branch displacement using a BITS length +XED_DLL_EXPORT void +xed_operand_values_set_branch_displacement_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int len_bits); + +/// @ingroup OPERANDS +/// Set the signed immediate using a BYTES length +XED_DLL_EXPORT void +xed_operand_values_set_immediate_signed(xed_operand_values_t* p,xed_int32_t x, unsigned int bytes); +/// @ingroup OPERANDS +/// Set the signed immediate using a BITS length +XED_DLL_EXPORT void +xed_operand_values_set_immediate_signed_bits(xed_operand_values_t* p,xed_int32_t x, unsigned int bits); + + +/// @ingroup OPERANDS +/// Set the unsigned immediate using a BYTE length. +XED_DLL_EXPORT void +xed_operand_values_set_immediate_unsigned(xed_operand_values_t* p,xed_uint64_t x, unsigned int bytes); +/// @ingroup OPERANDS +/// Set the unsigned immediate using a BIT length. +XED_DLL_EXPORT void +xed_operand_values_set_immediate_unsigned_bits(xed_operand_values_t* p,xed_uint64_t x, unsigned int bits); + + + +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_set_base_reg(xed_operand_values_t* p, + unsigned int memop_idx, + xed_reg_enum_t new_base); + +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_set_seg_reg(xed_operand_values_t* p, + unsigned int memop_idx, + xed_reg_enum_t new_seg); + +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_set_index_reg(xed_operand_values_t* p, + unsigned int memop_idx, + xed_reg_enum_t new_index); + +/// @ingroup OPERANDS +XED_DLL_EXPORT void xed_operand_values_set_scale(xed_operand_values_t* p, + xed_uint_t memop_idx, + xed_uint_t new_scale); + + +/// @ingroup OPERANDS +/// Set the operand storage field entry named 'operand_name' to the +/// register value specified by 'reg_name'. +XED_DLL_EXPORT void +xed_operand_values_set_operand_reg(xed_operand_values_t* p, + xed_operand_enum_t operand_name, + xed_reg_enum_t reg_name); + +//@} +#endif + +//Local Variables: +//pref: "../../xed-operand-values-interface.c" +//End: diff --git a/palacios/include/xed/xed-operand-visibility-enum.h b/palacios/include/xed/xed-operand-visibility-enum.h new file mode 100644 index 0000000..7e2d907 --- /dev/null +++ b/palacios/include/xed/xed-operand-visibility-enum.h @@ -0,0 +1,53 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-visibility-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_OPERAND_VISIBILITY_ENUM_H_) +# define _XED_OPERAND_VISIBILITY_ENUM_H_ +#include +typedef enum { + XED_OPVIS_INVALID, + XED_OPVIS_EXPLICIT, ///< Shows up in operand encoding + XED_OPVIS_IMPLICIT, ///< Part of the opcode, but listed as an operand + XED_OPVIS_SUPPRESSED, ///< Part of the opcode, but not typically listed as an operand + XED_OPVIS_LAST +} xed_operand_visibility_enum_t; + +XED_DLL_EXPORT xed_operand_visibility_enum_t +str2xed_operand_visibility_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_operand_visibility_enum_t2str(const xed_operand_visibility_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-operand-width-enum.h b/palacios/include/xed/xed-operand-width-enum.h new file mode 100644 index 0000000..1c8cc66 --- /dev/null +++ b/palacios/include/xed/xed-operand-width-enum.h @@ -0,0 +1,87 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-operand-width-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_OPERAND_WIDTH_ENUM_H_) +# define _XED_OPERAND_WIDTH_ENUM_H_ +#include +typedef enum { + XED_OPERAND_WIDTH_INVALID, + XED_OPERAND_WIDTH_1, + XED_OPERAND_WIDTH_A, + XED_OPERAND_WIDTH_B, + XED_OPERAND_WIDTH_D, + XED_OPERAND_WIDTH_DQ, + XED_OPERAND_WIDTH_M64INT, + XED_OPERAND_WIDTH_M64REAL, + XED_OPERAND_WIDTH_MEM108, + XED_OPERAND_WIDTH_MEM14, + XED_OPERAND_WIDTH_MEM16, + XED_OPERAND_WIDTH_MEM16INT, + XED_OPERAND_WIDTH_MEM28, + XED_OPERAND_WIDTH_MEM32INT, + XED_OPERAND_WIDTH_MEM32REAL, + XED_OPERAND_WIDTH_MEM80DEC, + XED_OPERAND_WIDTH_MEM80REAL, + XED_OPERAND_WIDTH_MEM98, + XED_OPERAND_WIDTH_MFPXENV, + XED_OPERAND_WIDTH_MXSAVE, + XED_OPERAND_WIDTH_MPREFETCH, + XED_OPERAND_WIDTH_P, + XED_OPERAND_WIDTH_P2, + XED_OPERAND_WIDTH_PD, + XED_OPERAND_WIDTH_PS, + XED_OPERAND_WIDTH_PI, + XED_OPERAND_WIDTH_Q, + XED_OPERAND_WIDTH_S, + XED_OPERAND_WIDTH_SD, + XED_OPERAND_WIDTH_SI, + XED_OPERAND_WIDTH_SS, + XED_OPERAND_WIDTH_V, + XED_OPERAND_WIDTH_W, + XED_OPERAND_WIDTH_Z, + XED_OPERAND_WIDTH_Z8, + XED_OPERAND_WIDTH_SPW, + XED_OPERAND_WIDTH_V3, + XED_OPERAND_WIDTH_SPW2, + XED_OPERAND_WIDTH_LAST +} xed_operand_width_enum_t; + +XED_DLL_EXPORT xed_operand_width_enum_t +str2xed_operand_width_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_operand_width_enum_t2str(const xed_operand_width_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-portability.h b/palacios/include/xed/xed-portability.h new file mode 100644 index 0000000..c24fb95 --- /dev/null +++ b/palacios/include/xed/xed-portability.h @@ -0,0 +1,135 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-portability.h +/// @author Mark Charney + +#ifndef _XED_PORTABILITY_H_ +# define _XED_PORTABILITY_H_ +# include + +#define STATIC_CAST(x,y) ((x) (y)) +#define REINTERPRET_CAST(x,y) ((x) (y)) + +XED_DLL_EXPORT xed_uint_t xed_strlen(const char* s); +XED_DLL_EXPORT void xed_strcat(char* dst, const char* src); +XED_DLL_EXPORT void xed_strcpy(char* dst, const char* src); +/// returns the number of bytes remaining for the next use of #xed_strncpy() or #xed_strncat() . +XED_DLL_EXPORT int xed_strncpy(char* dst, const char* src, int len); +/// returns the number of bytes remaining for the next use of #xed_strncpy() or #xed_strncat() . +XED_DLL_EXPORT int xed_strncat(char* dst, const char* src, int len); + + +/* recognize VC98 */ +#if !defined(__INTEL_COMPILER) +# if defined(_WIN32) && defined(_MSC_VER) +# if _MSC_VER == 1200 +# define XED_MSVC6 1 +# endif +# endif +# if defined(_WIN32) && defined(_MSC_VER) +# if _MSC_VER == 1310 +# define XED_MSVC7 1 +# endif +# endif +# if defined(_WIN32) && defined(_MSC_VER) +# if _MSC_VER == 1400 +# define XED_MSVC8 1 +# endif +# endif +#endif + +/* I've had compatibilty problems here so I'm using a trivial indirection */ +#if defined(__GNUC__) +# if defined(__CYGWIN__) + /* cygwin's gcc 3.4.4 on windows complains */ +# define XED_FMT_X "%lx" +# define XED_FMT_08X "%08lx" +# define XED_FMT_D "%ld" +# define XED_FMT_U "%lu" +# define XED_FMT_9U "%9lu" +# else +# define XED_FMT_X "%x" +# define XED_FMT_08X "%08x" +# define XED_FMT_D "%d" +# define XED_FMT_U "%u" +# define XED_FMT_9U "%9u" +# endif +#else +# define XED_FMT_X "%x" +# define XED_FMT_08X "%08x" +# define XED_FMT_D "%d" +# define XED_FMT_U "%u" +# define XED_FMT_9U "%9u" +#endif + +#if defined(__GNUC__) && defined(__LP64__) && !defined(__APPLE__) +# define XED_FMT_LX "%lx" +# define XED_FMT_LU "%lu" +# define XED_FMT_LD "%ld" +# define XED_FMT_LX16 "%016lx" +#else +# define XED_FMT_LX "%llx" +# define XED_FMT_LU "%llu" +# define XED_FMT_LD "%lld" +# define XED_FMT_LX16 "%016llx" +#endif + +#if defined(_M_IA64) +# define XED_IPF +# define XED_FMT_SIZET "%ld" +#else +# define XED_FMT_SIZET "%d" +#endif + +#if defined(__GNUC__) +# define XED_INLINE inline +# define XED_NORETURN __attribute__ ((noreturn)) +# if __GNUC__ == 2 +# define XED_NOINLINE +# else +# define XED_NOINLINE __attribute__ ((noinline)) +# endif +#else +# define XED_INLINE __inline +# if defined(XED_MSVC6) +# define XED_NOINLINE +# else +# define XED_NOINLINE __declspec(noinline) +# endif +# define XED_NORETURN __declspec(noreturn) +#endif + +#endif // _XED_PORTABILITY_H_ + +//////////////////////////////////////////////////////////////////////////// +//Local Variables: +//pref: "../../xed-portability.c" +//End: diff --git a/palacios/include/xed/xed-reg-class-enum.h b/palacios/include/xed/xed-reg-class-enum.h new file mode 100644 index 0000000..99c16f6 --- /dev/null +++ b/palacios/include/xed/xed-reg-class-enum.h @@ -0,0 +1,65 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-reg-class-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_REG_CLASS_ENUM_H_) +# define _XED_REG_CLASS_ENUM_H_ +#include +typedef enum { + XED_REG_CLASS_INVALID, + XED_REG_CLASS_CR, + XED_REG_CLASS_DR, + XED_REG_CLASS_FLAGS, + XED_REG_CLASS_GPR, + XED_REG_CLASS_GPR16, + XED_REG_CLASS_GPR32, + XED_REG_CLASS_GPR64, + XED_REG_CLASS_GPR8, + XED_REG_CLASS_IP, + XED_REG_CLASS_MMX, + XED_REG_CLASS_PSEUDO, + XED_REG_CLASS_SR, + XED_REG_CLASS_TMP, + XED_REG_CLASS_X87, + XED_REG_CLASS_XMM, + XED_REG_CLASS_LAST +} xed_reg_class_enum_t; + +XED_DLL_EXPORT xed_reg_class_enum_t +str2xed_reg_class_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_reg_class_enum_t2str(const xed_reg_class_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-reg-class.h b/palacios/include/xed/xed-reg-class.h new file mode 100644 index 0000000..5a6963c --- /dev/null +++ b/palacios/include/xed/xed-reg-class.h @@ -0,0 +1,57 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-reg-class.h +/// @author Mark Charney + +#ifndef _XED_REG_CLASS_H_ +# define _XED_REG_CLASS_H_ + +#include +#include // a generated file +#include // a generated file + +/// Returns the register class of the given input register. +///@ingroup REGINTFC +XED_DLL_EXPORT xed_reg_class_enum_t xed_reg_class(xed_reg_enum_t r); + +/// Returns the specific width GPR reg class (like XED_REG_CLASS_GPR32 or XED_REG_CLASS_GPR64) +/// for a given GPR register. Or XED_REG_INVALID if not a GPR. +///@ingroup REGINTFC +XED_DLL_EXPORT xed_reg_class_enum_t xed_gpr_reg_class(xed_reg_enum_t r); + +/// Returns the largest enclosing register for any kind of register; This is mostly useful for GPRs. +///@ingroup REGINTFC +XED_DLL_EXPORT xed_reg_enum_t xed_get_largest_enclosing_register(xed_reg_enum_t r); + + +//////////////////////////////////////////////////////////////////////////// + +#endif diff --git a/palacios/include/xed/xed-reg-enum.h b/palacios/include/xed/xed-reg-enum.h new file mode 100644 index 0000000..e6d4187 --- /dev/null +++ b/palacios/include/xed/xed-reg-enum.h @@ -0,0 +1,229 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-reg-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_REG_ENUM_H_) +# define _XED_REG_ENUM_H_ +#include +typedef enum { + XED_REG_INVALID, + XED_REG_ERROR, + XED_REG_RAX, + XED_REG_EAX, + XED_REG_AX, + XED_REG_AH, + XED_REG_AL, + XED_REG_RCX, + XED_REG_ECX, + XED_REG_CX, + XED_REG_CH, + XED_REG_CL, + XED_REG_RDX, + XED_REG_EDX, + XED_REG_DX, + XED_REG_DH, + XED_REG_DL, + XED_REG_RBX, + XED_REG_EBX, + XED_REG_BX, + XED_REG_BH, + XED_REG_BL, + XED_REG_RSP, + XED_REG_ESP, + XED_REG_SP, + XED_REG_SPL, + XED_REG_RBP, + XED_REG_EBP, + XED_REG_BP, + XED_REG_BPL, + XED_REG_RSI, + XED_REG_ESI, + XED_REG_SI, + XED_REG_SIL, + XED_REG_RDI, + XED_REG_EDI, + XED_REG_DI, + XED_REG_DIL, + XED_REG_R8, + XED_REG_R8D, + XED_REG_R8W, + XED_REG_R8B, + XED_REG_R9, + XED_REG_R9D, + XED_REG_R9W, + XED_REG_R9B, + XED_REG_R10, + XED_REG_R10D, + XED_REG_R10W, + XED_REG_R10B, + XED_REG_R11, + XED_REG_R11D, + XED_REG_R11W, + XED_REG_R11B, + XED_REG_R12, + XED_REG_R12D, + XED_REG_R12W, + XED_REG_R12B, + XED_REG_R13, + XED_REG_R13D, + XED_REG_R13W, + XED_REG_R13B, + XED_REG_R14, + XED_REG_R14D, + XED_REG_R14W, + XED_REG_R14B, + XED_REG_R15, + XED_REG_R15D, + XED_REG_R15W, + XED_REG_R15B, + XED_REG_RIP, + XED_REG_EIP, + XED_REG_IP, + XED_REG_FLAGS, + XED_REG_EFLAGS, + XED_REG_RFLAGS, + XED_REG_CS, + XED_REG_DS, + XED_REG_ES, + XED_REG_SS, + XED_REG_FS, + XED_REG_GS, + XED_REG_XMM0, + XED_REG_XMM1, + XED_REG_XMM2, + XED_REG_XMM3, + XED_REG_XMM4, + XED_REG_XMM5, + XED_REG_XMM6, + XED_REG_XMM7, + XED_REG_XMM8, + XED_REG_XMM9, + XED_REG_XMM10, + XED_REG_XMM11, + XED_REG_XMM12, + XED_REG_XMM13, + XED_REG_XMM14, + XED_REG_XMM15, + XED_REG_MMX0, + XED_REG_MMX1, + XED_REG_MMX2, + XED_REG_MMX3, + XED_REG_MMX4, + XED_REG_MMX5, + XED_REG_MMX6, + XED_REG_MMX7, + XED_REG_ST0, + XED_REG_ST1, + XED_REG_ST2, + XED_REG_ST3, + XED_REG_ST4, + XED_REG_ST5, + XED_REG_ST6, + XED_REG_ST7, + XED_REG_CR0, + XED_REG_CR1, + XED_REG_CR2, + XED_REG_CR3, + XED_REG_CR4, + XED_REG_CR5, + XED_REG_CR6, + XED_REG_CR7, + XED_REG_CR8, + XED_REG_CR9, + XED_REG_CR10, + XED_REG_CR11, + XED_REG_CR12, + XED_REG_CR13, + XED_REG_CR14, + XED_REG_CR15, + XED_REG_DR0, + XED_REG_DR1, + XED_REG_DR2, + XED_REG_DR3, + XED_REG_DR4, + XED_REG_DR5, + XED_REG_DR6, + XED_REG_DR7, + XED_REG_DR8, + XED_REG_DR9, + XED_REG_DR10, + XED_REG_DR11, + XED_REG_DR12, + XED_REG_DR13, + XED_REG_DR14, + XED_REG_DR15, + XED_REG_ONE, + XED_REG_STACKPUSH, + XED_REG_STACKPOP, + XED_REG_GDTR, + XED_REG_LDTR, + XED_REG_IDTR, + XED_REG_TR, + XED_REG_TSC, + XED_REG_TSCAUX, + XED_REG_MSRS, + XED_REG_X87CONTROL, + XED_REG_X87STATUS, + XED_REG_X87TOP, + XED_REG_X87TAG, + XED_REG_X87PUSH, + XED_REG_X87POP, + XED_REG_X87POP2, + XED_REG_MXCSR, + XED_REG_TMP0, + XED_REG_TMP1, + XED_REG_TMP2, + XED_REG_TMP3, + XED_REG_TMP4, + XED_REG_TMP5, + XED_REG_TMP6, + XED_REG_TMP7, + XED_REG_TMP8, + XED_REG_TMP9, + XED_REG_TMP10, + XED_REG_TMP11, + XED_REG_TMP12, + XED_REG_TMP13, + XED_REG_TMP14, + XED_REG_TMP15, + XED_REG_LAST +} xed_reg_enum_t; + +XED_DLL_EXPORT xed_reg_enum_t +str2xed_reg_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_reg_enum_t2str(const xed_reg_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-reg-role-enum.h b/palacios/include/xed/xed-reg-role-enum.h new file mode 100644 index 0000000..3452b14 --- /dev/null +++ b/palacios/include/xed/xed-reg-role-enum.h @@ -0,0 +1,56 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-reg-role-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_REG_ROLE_ENUM_H_) +# define _XED_REG_ROLE_ENUM_H_ +#include +typedef enum { + XED_REG_ROLE_INVALID, + XED_REG_ROLE_NORMAL, ///< Register is a normal register + XED_REG_ROLE_SEGREG0, ///< The segment register associated with the first memop + XED_REG_ROLE_SEGREG1, ///< The segment register associated with the second memop + XED_REG_ROLE_BASE0, ///< The base register associated with the first memop + XED_REG_ROLE_BASE1, ///< The base register associated with the second memop + XED_REG_ROLE_INDEX, ///< The index register associated with the first memop + XED_REG_ROLE_LAST +} xed_reg_role_enum_t; + +XED_DLL_EXPORT xed_reg_role_enum_t +str2xed_reg_role_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_reg_role_enum_t2str(const xed_reg_role_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-state.h b/palacios/include/xed/xed-state.h new file mode 100644 index 0000000..8fc7ebc --- /dev/null +++ b/palacios/include/xed/xed-state.h @@ -0,0 +1,172 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-state.h +/// @author Mark Charney + + + +#ifndef _XED_STATE_H_ +# define _XED_STATE_H_ +#include +#include +#include // generated +#include // generated + + +/// Encapsulates machine modes for decoder/encoder requests. +/// It specifies the machine operating mode as a +/// #xed_machine_mode_enum_t +/// for decoding and encoding. For all modes other than the 64b long mode +/// (XED_MACHINE_MODE_LONG_64), a default addressing width, and a stack +/// addressing width must be supplied of type #xed_address_width_enum_t . +/// @ingroup INIT +typedef struct XED_DLL_EXPORT xed_state_s { + /// real architected machine modes + xed_machine_mode_enum_t mmode; + + /// the current default addressing width. + xed_address_width_enum_t addr_width; + + /// for 16b/32b modes + xed_address_width_enum_t stack_addr_width; +} xed_state_t; + +/// @name Initialization +//@{ +/// Constructor. +/// The mode, and addresses widths are enumerations that specify the number +/// of bits. In 64b mode (#XED_MACHINE_MODE_LONG_64) the address width and +/// stack address widths are 64b (#XED_ADDRESS_WIDTH_64b). In other machine +/// modes, you must specify valid addressing widths. +/// +/// @param p the pointer to the #xed_state_t type +/// @param arg_mmode the machine mode of type #xed_machine_mode_enum_t +/// @param arg_addr_width the address width of type #xed_address_width_enum_t (only required if not the mode is not #XED_MACHINE_MODE_LONG_64) +/// @param arg_stack_addr_width the stack address width of type #xed_address_width_enum_t (only required if not the mode is not #XED_MACHINE_MODE_LONG_64) +/// @ingroup INIT +static XED_INLINE void xed_state_init(xed_state_t* p, + xed_machine_mode_enum_t arg_mmode, + xed_address_width_enum_t arg_addr_width, + xed_address_width_enum_t arg_stack_addr_width) { + p->mmode=arg_mmode; + p->addr_width=arg_addr_width; + p->stack_addr_width=arg_stack_addr_width; +} + +/// clear the xed_state_t +/// @ingroup INIT +static XED_INLINE void xed_state_zero(xed_state_t* p) { + p->mmode= XED_MACHINE_MODE_INVALID; + p->addr_width=XED_ADDRESS_WIDTH_INVALID; + p->stack_addr_width=XED_ADDRESS_WIDTH_INVALID; +} + +//@} + +/// @name Machine mode +//@{ +/// return the machine mode +/// @ingroup INIT +static XED_INLINE xed_machine_mode_enum_t xed_state_get_machine_mode(const xed_state_t* p) { + return p->mmode; +} + + +/// true iff the machine is in LONG_64 mode +/// @ingroup INIT +static XED_INLINE xed_bool_t xed_state_long64_mode(const xed_state_t* p) { + return xed_state_get_machine_mode(p) == XED_MACHINE_MODE_LONG_64; +} + +/// @ingroup INIT +static XED_INLINE xed_bool_t xed_state_mode_width_16(const xed_state_t* p) { + return (xed_state_get_machine_mode(p) == XED_MACHINE_MODE_LEGACY_16) || + (xed_state_get_machine_mode(p) == XED_MACHINE_MODE_LONG_COMPAT_16); +} + +/// @ingroup INIT +static XED_INLINE xed_bool_t xed_state_mode_width_32(const xed_state_t* p) { + return (xed_state_get_machine_mode(p) == XED_MACHINE_MODE_LEGACY_32) || + (xed_state_get_machine_mode(p) == XED_MACHINE_MODE_LONG_COMPAT_32); +} + + +/// Set the machine mode +/// @ingroup INIT +static XED_INLINE void xed_state_set_machine_mode( xed_state_t* p, + xed_machine_mode_enum_t arg_mode) { + p->mmode = arg_mode; +} +//@} + +/// @name Address width +//@{ +/// Set the address width +/// @ingroup INIT +static XED_INLINE void xed_state_set_address_width(xed_state_t* p, + xed_address_width_enum_t arg_addr_width) { + p->addr_width = arg_addr_width; +} + +/// return the address width +/// @ingroup INIT +static XED_INLINE xed_address_width_enum_t xed_state_get_address_width(const xed_state_t* p) { + return p->addr_width; +} + +//@} + +/// @name Stack address width +//@{ +/// set the STACK address width +/// @ingroup INIT +static XED_INLINE void xed_state_set_stack_address_width(xed_state_t* p, + xed_address_width_enum_t arg_addr_width) { + p->stack_addr_width = arg_addr_width; +} + + +/// Return the STACK address width +/// @ingroup INIT +static XED_INLINE xed_address_width_enum_t xed_state_get_stack_address_width(const xed_state_t* p) { + return p->stack_addr_width; +} +//@} + +/// @ingroup INIT +XED_DLL_EXPORT int xed_state_print(const xed_state_t* p, char* buf, int buflen); + +#endif + +//////////////////////////////////////////////////////////////////////////// +//Local Variables: +//pref: "../../xed-state.c" +//End: diff --git a/palacios/include/xed/xed-syntax-enum.h b/palacios/include/xed/xed-syntax-enum.h new file mode 100644 index 0000000..b303d1a --- /dev/null +++ b/palacios/include/xed/xed-syntax-enum.h @@ -0,0 +1,53 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-syntax-enum.h +/// @author Mark Charney + +// This file was automatically generated. +// Do not edit this file. + +#if !defined(_XED_SYNTAX_ENUM_H_) +# define _XED_SYNTAX_ENUM_H_ +#include +typedef enum { + XED_SYNTAX_INVALID, + XED_SYNTAX_XED, ///< XED disassembly syntax + XED_SYNTAX_ATT, ///< ATT SYSV disassembly syntax + XED_SYNTAX_INTEL, ///< Intel disassembly syntax + XED_SYNTAX_LAST +} xed_syntax_enum_t; + +XED_DLL_EXPORT xed_syntax_enum_t +str2xed_syntax_enum_t(const char* s); +XED_DLL_EXPORT const char* +xed_syntax_enum_t2str(const xed_syntax_enum_t p); + +#endif diff --git a/palacios/include/xed/xed-types.h b/palacios/include/xed/xed-types.h new file mode 100644 index 0000000..95eb199 --- /dev/null +++ b/palacios/include/xed/xed-types.h @@ -0,0 +1,83 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-types.h +/// @author Mark Charney + + +#ifndef _XED_TYPES_H_ +# define _XED_TYPES_H_ + +//////////////////////////////////////////////////////////////////////////// + +#include + + +typedef unsigned char uint8_t; +typedef unsigned short int uint16_t; +//typedef unsigned int uint32_t; +//typedef unsigned long int uint64_t; + +typedef signed char int8_t; +typedef short int int16_t; +typedef int int32_t; +typedef long int int64_t; + + +#if defined(__GNUC__) || defined(__ICC) +//# include +# define xed_uint8_t uint8_t +# define xed_uint16_t uint16_t +# define xed_uint32_t uint32_t +# define xed_uint64_t uint64_t +# define xed_int8_t int8_t +# define xed_int16_t int16_t +# define xed_int32_t int32_t +# define xed_int64_t int64_t +#elif defined(_WIN32) +# define xed_uint8_t unsigned __int8 +# define xed_uint16_t unsigned __int16 +# define xed_uint32_t unsigned __int32 +# define xed_uint64_t unsigned __int64 +# define xed_int8_t __int8 +# define xed_int16_t __int16 +# define xed_int32_t __int32 +# define xed_int64_t __int64 +#else +# error "XED types unsupported platform? Need windows, gcc, or icc." +#endif + +typedef unsigned int xed_uint_t; +typedef unsigned int xed_bits_t; +typedef unsigned int xed_bool_t; + + +//////////////////////////////////////////////////////////////////////////// +#endif diff --git a/palacios/include/xed/xed-util.h b/palacios/include/xed/xed-util.h new file mode 100644 index 0000000..770ae51 --- /dev/null +++ b/palacios/include/xed/xed-util.h @@ -0,0 +1,276 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ +/// @file xed-util.h +/// @author Mark Charney + + + +#ifndef _XED_UTIL_H_ +#define _XED_UTIL_H_ + + //#include +#include +#include +#include + + +//////////////////////////////////////////////////////////////////////////// +// DEFINES +//////////////////////////////////////////////////////////////////////////// +extern int xed_verbose; +#define XED_MESSAGES 0 + +#if defined(XED_MESSAGES) +//# include // only with XED_MESSAGES defined + +//#include + +extern void *xed_log_file; + +//extern int fprintf(struct file_struct *file, char *s, const char *fmt, ...); + +#endif + +#define XED_EMIT_MESSAGES (XED_MESSAGES==1 && xed_verbose >= 1) +#define XED_INFO_VERBOSE (XED_MESSAGES==1 && xed_verbose >= 2) +#define XED_INFO2_VERBOSE (XED_MESSAGES==1 && xed_verbose >= 3) +#define XED_VERBOSE (XED_MESSAGES==1 && xed_verbose >= 4) +#define XED_MORE_VERBOSE (XED_MESSAGES==1 && xed_verbose >= 5) +#define XED_VERY_VERBOSE (XED_MESSAGES==1 && xed_verbose >= 6) + +#if defined(__GNUC__) +# define XED_FUNCNAME __func__ +#else +# define XED_FUNCNAME "" +#endif + +#if XED_MESSAGES==1 +#define XED2IMSG(x) \ + do { \ + if (XED_EMIT_MESSAGES) { \ + if (XED_VERY_VERBOSE) { \ + fprintf(xed_log_file,"%s:%d:%s: ", \ + __FILE__, __LINE__, XED_FUNCNAME); \ + } \ + fprintf x; \ + fflush(xed_log_file); \ + } \ + } while(0) + +#define XED2TMSG(x) \ + do { \ + if (XED_VERBOSE) { \ + if (XED_VERY_VERBOSE) { \ + fprintf(xed_log_file,"%s:%d:%s: ", \ + __FILE__, __LINE__, XED_FUNCNAME); \ + } \ + fprintf x; \ + fflush(xed_log_file); \ + } \ + } while(0) + +#define XED2VMSG(x) \ + do { \ + if (XED_VERY_VERBOSE) { \ + fprintf(xed_log_file,"%s:%d:%s: ", \ + __FILE__, __LINE__, XED_FUNCNAME); \ + fprintf x; \ + fflush(xed_log_file); \ + } \ + } while(0) + +#define XED2DIE(x) \ + do { \ + if (XED_EMIT_MESSAGES) { \ + fprintf(xed_log_file,"%s:%d:%s: ", \ + __FILE__, __LINE__, XED_FUNCNAME); \ + fprintf x; \ + fflush(xed_log_file); \ + } \ + xed_assert(0); \ + } while(0) + + + +#else +# define XED2IMSG(x) +# define XED2TMSG(x) +# define XED2VMSG(x) +# define XED2DIE(x) do { xed_assert(0); } while(0) +#endif + +#if defined(XED_ASSERTS) +# define xed_assert(x) do { if (( x )== 0) xed_internal_assert( #x, __FILE__, __LINE__); } while(0) +#else +# define xed_assert(x) do { } while(0) +#endif +XED_NORETURN XED_NOINLINE XED_DLL_EXPORT void xed_internal_assert(const char* s, const char* file, int line); + +/// @ingroup INIT +/// This is for registering a function to be called during XED's assert +/// processing. If you do not register an abort function, then the system's +/// abort function will be called. If your supplied function returns, then +/// abort() will still be called. +/// +/// @param fn This is a function pointer for a function that should handle the +/// assertion reporting. The function pointer points to a function that +/// takes 4 arguments: +/// (1) msg, the assertion message, +/// (2) file, the file name, +/// (3) line, the line number (as an integer), and +/// (4) other, a void pointer that is supplied as thei +/// 2nd argument to this registration. +/// @param other This is a void* that is passed back to your supplied function fn +/// as its 4th argument. It can be zero if you don't need this +/// feature. You can used this to convey whatever additional context +/// to your assertion handler (like FILE* pointers etc.). +/// +XED_DLL_EXPORT void xed_register_abort_function(void (*fn)(const char* msg, + const char* file, int line, void* other), + void* other); + + +//////////////////////////////////////////////////////////////////////////// +// PROTOTYPES +//////////////////////////////////////////////////////////////////////////// +char* xed_downcase_buf(char* s); + +int xed_itoa(char* buf, xed_uint64_t f, int buflen); +int xed_itoa_hex_zeros(char* buf, xed_uint64_t f, xed_uint_t xed_bits_to_print, xed_bool_t leading_zeros, int buflen); +int xed_itoa_hex(char* buf, xed_uint64_t f, xed_uint_t xed_bits_to_print, int buflen); +int xed_itoa_signed(char* buf, xed_int64_t f, int buflen); + +char xed_to_ascii_hex_nibble(xed_uint_t x); + +int xed_sprintf_uint8_hex(char* buf, xed_uint8_t x, int buflen); +int xed_sprintf_uint16_hex(char* buf, xed_uint16_t x, int buflen); +int xed_sprintf_uint32_hex(char* buf, xed_uint32_t x, int buflen); +int xed_sprintf_uint64_hex(char* buf, xed_uint64_t x, int buflen); +int xed_sprintf_uint8(char* buf, xed_uint8_t x, int buflen); +int xed_sprintf_uint16(char* buf, xed_uint16_t x, int buflen); +int xed_sprintf_uint32(char* buf, xed_uint32_t x, int buflen); +int xed_sprintf_uint64(char* buf, xed_uint64_t x, int buflen); +int xed_sprintf_int8(char* buf, xed_int8_t x, int buflen); +int xed_sprintf_int16(char* buf, xed_int16_t x, int buflen); +int xed_sprintf_int32(char* buf, xed_int32_t x, int buflen); +int xed_sprintf_int64(char* buf, xed_int64_t x, int buflen); + + +//typedef struct file_struct *FILE; + +/// Set the FILE* for XED's log msgs +XED_DLL_EXPORT void xed_set_log_file(void* o); + + +/// Set the verbosity level for XED +XED_DLL_EXPORT void xed_set_verbosity(int v); + +void xed_derror(const char* s); +void xed_dwarn(const char* s); + +XED_DLL_EXPORT xed_int64_t xed_sign_extend32_64(xed_int32_t x); +XED_DLL_EXPORT xed_int64_t xed_sign_extend16_64(xed_int16_t x); +XED_DLL_EXPORT xed_int64_t xed_sign_extend8_64(xed_int8_t x); + +XED_DLL_EXPORT xed_int32_t xed_sign_extend16_32(xed_int16_t x); +XED_DLL_EXPORT xed_int32_t xed_sign_extend8_32(xed_int8_t x); + +XED_DLL_EXPORT xed_int16_t xed_sign_extend8_16(xed_int8_t x); + +///arbitrary sign extension from a qty of "bits" length to 32b +XED_DLL_EXPORT xed_int32_t xed_sign_extend_arbitrary_to_32(xed_uint32_t x, unsigned int bits); + +///arbitrary sign extension from a qty of "bits" length to 64b +XED_DLL_EXPORT xed_int64_t xed_sign_extend_arbitrary_to_64(xed_uint64_t x, unsigned int bits); + + +XED_DLL_EXPORT xed_uint64_t xed_zero_extend32_64(xed_uint32_t x); +XED_DLL_EXPORT xed_uint64_t xed_zero_extend16_64(xed_uint16_t x); +XED_DLL_EXPORT xed_uint64_t xed_zero_extend8_64(xed_uint8_t x); + +XED_DLL_EXPORT xed_uint32_t xed_zero_extend16_32(xed_uint16_t x); +XED_DLL_EXPORT xed_uint32_t xed_zero_extend8_32(xed_uint8_t x); + +XED_DLL_EXPORT xed_uint16_t xed_zero_extend8_16(xed_uint8_t x); + +XED_DLL_EXPORT xed_int32_t +xed_little_endian_to_int32(xed_uint64_t x, unsigned int len); + +XED_DLL_EXPORT xed_int64_t +xed_little_endian_to_int64(xed_uint64_t x, unsigned int len); +XED_DLL_EXPORT xed_uint64_t +xed_little_endian_to_uint64(xed_uint64_t x, unsigned int len); + +XED_DLL_EXPORT xed_int64_t +xed_little_endian_hilo_to_int64(xed_uint32_t hi_le, xed_uint32_t lo_le, unsigned int len); +XED_DLL_EXPORT xed_uint64_t +xed_little_endian_hilo_to_uint64(xed_uint32_t hi_le, xed_uint32_t lo_le, unsigned int len); + +XED_DLL_EXPORT xed_uint8_t +xed_get_byte(xed_uint64_t x, unsigned int i, unsigned int len); + +static XED_INLINE xed_uint64_t xed_make_uint64(xed_uint32_t hi, xed_uint32_t lo) { + xed_uint64_t x,y; + x=hi; + y= (x<<32) | lo; + return y; +} +static XED_INLINE xed_int64_t xed_make_int64(xed_uint32_t hi, xed_uint32_t lo) { + xed_uint64_t x,y; + x=hi; + y= (x<<32) | lo; + return STATIC_CAST(xed_int64_t,y); +} + +/// returns the number of bytes required to store the UNSIGNED number x +/// given a mask of legal lengths. For the legal_widths argument, bit 0 +/// implies 1 byte is a legal return width, bit 1 implies that 2 bytes is a +/// legal return width, bit 2 implies that 4 bytes is a legal return width. +/// This returns 8 (indicating 8B) if none of the provided legal widths +/// applies. +XED_DLL_EXPORT xed_uint_t xed_shortest_width_unsigned(xed_uint64_t x, xed_uint8_t legal_widths); + +/// returns the number of bytes required to store the SIGNED number x +/// given a mask of legal lengths. For the legal_widths argument, bit 0 implies 1 +/// byte is a legal return width, bit 1 implies that 2 bytes is a legal +/// return width, bit 2 implies that 4 bytes is a legal return width. This +/// returns 8 (indicating 8B) if none of the provided legal widths applies. +XED_DLL_EXPORT xed_uint_t xed_shortest_width_signed(xed_int64_t x, xed_uint8_t legal_widths); + +//////////////////////////////////////////////////////////////////////////// +// GLOBALS +//////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////// +#endif +//Local Variables: +//pref: "../../xed-util.c" +//End: diff --git a/palacios/include/xed/xed-version.h b/palacios/include/xed/xed-version.h new file mode 100644 index 0000000..058486e --- /dev/null +++ b/palacios/include/xed/xed-version.h @@ -0,0 +1,39 @@ +/*BEGIN_LEGAL +Intel Open Source License + +Copyright (c) 2002-2007 Intel Corporation +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the Intel Corporation nor the names of its contributors may be used to +endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``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 THE INTEL OR +ITS CONTRIBUTORS 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. +END_LEGAL */ + +#if !defined(_XED_VERSION_H_) +# define _XED_VERSION_H_ +#include + +///@ingroup INIT +/// Returns a string representing XED svn commit revision and time stamp. +XED_DLL_EXPORT char* xed_get_version(); +#endif