You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
245 lines
8.8 KiB
245 lines
8.8 KiB
3 years ago
|
/// @file xed-attribute-enum.c
|
||
|
|
||
|
// This file was automatically generated.
|
||
|
// Do not edit this file.
|
||
|
|
||
|
#include <string.h>
|
||
|
#include <assert.h>
|
||
|
#include "xed-attribute-enum.h"
|
||
|
|
||
|
typedef struct {
|
||
|
const char* name;
|
||
|
xed_attribute_enum_t value;
|
||
|
} name_table_xed_attribute_enum_t;
|
||
|
static const name_table_xed_attribute_enum_t name_array_xed_attribute_enum_t[] = {
|
||
|
{"INVALID", XED_ATTRIBUTE_INVALID},
|
||
|
{"AMDONLY", XED_ATTRIBUTE_AMDONLY},
|
||
|
{"ATT_OPERAND_ORDER_EXCEPTION", XED_ATTRIBUTE_ATT_OPERAND_ORDER_EXCEPTION},
|
||
|
{"BROADCAST_ENABLED", XED_ATTRIBUTE_BROADCAST_ENABLED},
|
||
|
{"BYTEOP", XED_ATTRIBUTE_BYTEOP},
|
||
|
{"DISP8_EIGHTHMEM", XED_ATTRIBUTE_DISP8_EIGHTHMEM},
|
||
|
{"DISP8_FULL", XED_ATTRIBUTE_DISP8_FULL},
|
||
|
{"DISP8_FULLMEM", XED_ATTRIBUTE_DISP8_FULLMEM},
|
||
|
{"DISP8_GPR_READER", XED_ATTRIBUTE_DISP8_GPR_READER},
|
||
|
{"DISP8_GPR_READER_BYTE", XED_ATTRIBUTE_DISP8_GPR_READER_BYTE},
|
||
|
{"DISP8_GPR_READER_WORD", XED_ATTRIBUTE_DISP8_GPR_READER_WORD},
|
||
|
{"DISP8_GPR_WRITER_LDOP_D", XED_ATTRIBUTE_DISP8_GPR_WRITER_LDOP_D},
|
||
|
{"DISP8_GPR_WRITER_LDOP_Q", XED_ATTRIBUTE_DISP8_GPR_WRITER_LDOP_Q},
|
||
|
{"DISP8_GPR_WRITER_STORE", XED_ATTRIBUTE_DISP8_GPR_WRITER_STORE},
|
||
|
{"DISP8_GPR_WRITER_STORE_BYTE", XED_ATTRIBUTE_DISP8_GPR_WRITER_STORE_BYTE},
|
||
|
{"DISP8_GPR_WRITER_STORE_WORD", XED_ATTRIBUTE_DISP8_GPR_WRITER_STORE_WORD},
|
||
|
{"DISP8_GSCAT", XED_ATTRIBUTE_DISP8_GSCAT},
|
||
|
{"DISP8_HALF", XED_ATTRIBUTE_DISP8_HALF},
|
||
|
{"DISP8_HALFMEM", XED_ATTRIBUTE_DISP8_HALFMEM},
|
||
|
{"DISP8_MEM128", XED_ATTRIBUTE_DISP8_MEM128},
|
||
|
{"DISP8_MOVDDUP", XED_ATTRIBUTE_DISP8_MOVDDUP},
|
||
|
{"DISP8_QUARTER", XED_ATTRIBUTE_DISP8_QUARTER},
|
||
|
{"DISP8_QUARTERMEM", XED_ATTRIBUTE_DISP8_QUARTERMEM},
|
||
|
{"DISP8_SCALAR", XED_ATTRIBUTE_DISP8_SCALAR},
|
||
|
{"DISP8_TUPLE1", XED_ATTRIBUTE_DISP8_TUPLE1},
|
||
|
{"DISP8_TUPLE1_4X", XED_ATTRIBUTE_DISP8_TUPLE1_4X},
|
||
|
{"DISP8_TUPLE1_BYTE", XED_ATTRIBUTE_DISP8_TUPLE1_BYTE},
|
||
|
{"DISP8_TUPLE1_WORD", XED_ATTRIBUTE_DISP8_TUPLE1_WORD},
|
||
|
{"DISP8_TUPLE2", XED_ATTRIBUTE_DISP8_TUPLE2},
|
||
|
{"DISP8_TUPLE4", XED_ATTRIBUTE_DISP8_TUPLE4},
|
||
|
{"DISP8_TUPLE8", XED_ATTRIBUTE_DISP8_TUPLE8},
|
||
|
{"DOUBLE_WIDE_MEMOP", XED_ATTRIBUTE_DOUBLE_WIDE_MEMOP},
|
||
|
{"DOUBLE_WIDE_OUTPUT", XED_ATTRIBUTE_DOUBLE_WIDE_OUTPUT},
|
||
|
{"DWORD_INDICES", XED_ATTRIBUTE_DWORD_INDICES},
|
||
|
{"ELEMENT_SIZE_D", XED_ATTRIBUTE_ELEMENT_SIZE_D},
|
||
|
{"ELEMENT_SIZE_Q", XED_ATTRIBUTE_ELEMENT_SIZE_Q},
|
||
|
{"EXCEPTION_BR", XED_ATTRIBUTE_EXCEPTION_BR},
|
||
|
{"FAR_XFER", XED_ATTRIBUTE_FAR_XFER},
|
||
|
{"FIXED_BASE0", XED_ATTRIBUTE_FIXED_BASE0},
|
||
|
{"FIXED_BASE1", XED_ATTRIBUTE_FIXED_BASE1},
|
||
|
{"GATHER", XED_ATTRIBUTE_GATHER},
|
||
|
{"HALF_WIDE_OUTPUT", XED_ATTRIBUTE_HALF_WIDE_OUTPUT},
|
||
|
{"HLE_ACQ_ABLE", XED_ATTRIBUTE_HLE_ACQ_ABLE},
|
||
|
{"HLE_REL_ABLE", XED_ATTRIBUTE_HLE_REL_ABLE},
|
||
|
{"IGNORES_OSFXSR", XED_ATTRIBUTE_IGNORES_OSFXSR},
|
||
|
{"IMPLICIT_ONE", XED_ATTRIBUTE_IMPLICIT_ONE},
|
||
|
{"INDEX_REG_IS_POINTER", XED_ATTRIBUTE_INDEX_REG_IS_POINTER},
|
||
|
{"INDIRECT_BRANCH", XED_ATTRIBUTE_INDIRECT_BRANCH},
|
||
|
{"KMASK", XED_ATTRIBUTE_KMASK},
|
||
|
{"LOCKABLE", XED_ATTRIBUTE_LOCKABLE},
|
||
|
{"LOCKED", XED_ATTRIBUTE_LOCKED},
|
||
|
{"MASKOP", XED_ATTRIBUTE_MASKOP},
|
||
|
{"MASKOP_EVEX", XED_ATTRIBUTE_MASKOP_EVEX},
|
||
|
{"MASK_AS_CONTROL", XED_ATTRIBUTE_MASK_AS_CONTROL},
|
||
|
{"MASK_VARIABLE_MEMOP", XED_ATTRIBUTE_MASK_VARIABLE_MEMOP},
|
||
|
{"MEMORY_FAULT_SUPPRESSION", XED_ATTRIBUTE_MEMORY_FAULT_SUPPRESSION},
|
||
|
{"MMX_EXCEPT", XED_ATTRIBUTE_MMX_EXCEPT},
|
||
|
{"MPX_PREFIX_ABLE", XED_ATTRIBUTE_MPX_PREFIX_ABLE},
|
||
|
{"MULTIDEST2", XED_ATTRIBUTE_MULTIDEST2},
|
||
|
{"MULTISOURCE4", XED_ATTRIBUTE_MULTISOURCE4},
|
||
|
{"MXCSR", XED_ATTRIBUTE_MXCSR},
|
||
|
{"MXCSR_RD", XED_ATTRIBUTE_MXCSR_RD},
|
||
|
{"NONTEMPORAL", XED_ATTRIBUTE_NONTEMPORAL},
|
||
|
{"NOP", XED_ATTRIBUTE_NOP},
|
||
|
{"NOTSX", XED_ATTRIBUTE_NOTSX},
|
||
|
{"NOTSX_COND", XED_ATTRIBUTE_NOTSX_COND},
|
||
|
{"NO_RIP_REL", XED_ATTRIBUTE_NO_RIP_REL},
|
||
|
{"NO_SRC_DEST_MATCH", XED_ATTRIBUTE_NO_SRC_DEST_MATCH},
|
||
|
{"PREFETCH", XED_ATTRIBUTE_PREFETCH},
|
||
|
{"PROTECTED_MODE", XED_ATTRIBUTE_PROTECTED_MODE},
|
||
|
{"QWORD_INDICES", XED_ATTRIBUTE_QWORD_INDICES},
|
||
|
{"REP", XED_ATTRIBUTE_REP},
|
||
|
{"REQUIRES_ALIGNMENT", XED_ATTRIBUTE_REQUIRES_ALIGNMENT},
|
||
|
{"RING0", XED_ATTRIBUTE_RING0},
|
||
|
{"SCALABLE", XED_ATTRIBUTE_SCALABLE},
|
||
|
{"SCATTER", XED_ATTRIBUTE_SCATTER},
|
||
|
{"SIMD_SCALAR", XED_ATTRIBUTE_SIMD_SCALAR},
|
||
|
{"SKIPLOW32", XED_ATTRIBUTE_SKIPLOW32},
|
||
|
{"SKIPLOW64", XED_ATTRIBUTE_SKIPLOW64},
|
||
|
{"SPECIAL_AGEN_REQUIRED", XED_ATTRIBUTE_SPECIAL_AGEN_REQUIRED},
|
||
|
{"STACKPOP0", XED_ATTRIBUTE_STACKPOP0},
|
||
|
{"STACKPOP1", XED_ATTRIBUTE_STACKPOP1},
|
||
|
{"STACKPUSH0", XED_ATTRIBUTE_STACKPUSH0},
|
||
|
{"STACKPUSH1", XED_ATTRIBUTE_STACKPUSH1},
|
||
|
{"USES_DAZ", XED_ATTRIBUTE_USES_DAZ},
|
||
|
{"USES_FTZ", XED_ATTRIBUTE_USES_FTZ},
|
||
|
{"X87_CONTROL", XED_ATTRIBUTE_X87_CONTROL},
|
||
|
{"X87_MMX_STATE_CW", XED_ATTRIBUTE_X87_MMX_STATE_CW},
|
||
|
{"X87_MMX_STATE_R", XED_ATTRIBUTE_X87_MMX_STATE_R},
|
||
|
{"X87_MMX_STATE_W", XED_ATTRIBUTE_X87_MMX_STATE_W},
|
||
|
{"X87_NOWAIT", XED_ATTRIBUTE_X87_NOWAIT},
|
||
|
{"XMM_STATE_CW", XED_ATTRIBUTE_XMM_STATE_CW},
|
||
|
{"XMM_STATE_R", XED_ATTRIBUTE_XMM_STATE_R},
|
||
|
{"XMM_STATE_W", XED_ATTRIBUTE_XMM_STATE_W},
|
||
|
{"LAST", XED_ATTRIBUTE_LAST},
|
||
|
{0, XED_ATTRIBUTE_LAST},
|
||
|
};
|
||
|
|
||
|
|
||
|
xed_attribute_enum_t str2xed_attribute_enum_t(const char* s)
|
||
|
{
|
||
|
const name_table_xed_attribute_enum_t* p = name_array_xed_attribute_enum_t;
|
||
|
while( p->name ) {
|
||
|
if (strcmp(p->name,s) == 0) {
|
||
|
return p->value;
|
||
|
}
|
||
|
p++;
|
||
|
}
|
||
|
|
||
|
|
||
|
return XED_ATTRIBUTE_INVALID;
|
||
|
}
|
||
|
|
||
|
|
||
|
const char* xed_attribute_enum_t2str(const xed_attribute_enum_t p)
|
||
|
{
|
||
|
xed_attribute_enum_t type_idx = p;
|
||
|
if ( p > XED_ATTRIBUTE_LAST) type_idx = XED_ATTRIBUTE_LAST;
|
||
|
return name_array_xed_attribute_enum_t[type_idx].name;
|
||
|
}
|
||
|
|
||
|
xed_attribute_enum_t xed_attribute_enum_t_last(void) {
|
||
|
return XED_ATTRIBUTE_LAST;
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
|
||
|
Here is a skeleton switch statement embedded in a comment
|
||
|
|
||
|
|
||
|
switch(p) {
|
||
|
case XED_ATTRIBUTE_INVALID:
|
||
|
case XED_ATTRIBUTE_AMDONLY:
|
||
|
case XED_ATTRIBUTE_ATT_OPERAND_ORDER_EXCEPTION:
|
||
|
case XED_ATTRIBUTE_BROADCAST_ENABLED:
|
||
|
case XED_ATTRIBUTE_BYTEOP:
|
||
|
case XED_ATTRIBUTE_DISP8_EIGHTHMEM:
|
||
|
case XED_ATTRIBUTE_DISP8_FULL:
|
||
|
case XED_ATTRIBUTE_DISP8_FULLMEM:
|
||
|
case XED_ATTRIBUTE_DISP8_GPR_READER:
|
||
|
case XED_ATTRIBUTE_DISP8_GPR_READER_BYTE:
|
||
|
case XED_ATTRIBUTE_DISP8_GPR_READER_WORD:
|
||
|
case XED_ATTRIBUTE_DISP8_GPR_WRITER_LDOP_D:
|
||
|
case XED_ATTRIBUTE_DISP8_GPR_WRITER_LDOP_Q:
|
||
|
case XED_ATTRIBUTE_DISP8_GPR_WRITER_STORE:
|
||
|
case XED_ATTRIBUTE_DISP8_GPR_WRITER_STORE_BYTE:
|
||
|
case XED_ATTRIBUTE_DISP8_GPR_WRITER_STORE_WORD:
|
||
|
case XED_ATTRIBUTE_DISP8_GSCAT:
|
||
|
case XED_ATTRIBUTE_DISP8_HALF:
|
||
|
case XED_ATTRIBUTE_DISP8_HALFMEM:
|
||
|
case XED_ATTRIBUTE_DISP8_MEM128:
|
||
|
case XED_ATTRIBUTE_DISP8_MOVDDUP:
|
||
|
case XED_ATTRIBUTE_DISP8_QUARTER:
|
||
|
case XED_ATTRIBUTE_DISP8_QUARTERMEM:
|
||
|
case XED_ATTRIBUTE_DISP8_SCALAR:
|
||
|
case XED_ATTRIBUTE_DISP8_TUPLE1:
|
||
|
case XED_ATTRIBUTE_DISP8_TUPLE1_4X:
|
||
|
case XED_ATTRIBUTE_DISP8_TUPLE1_BYTE:
|
||
|
case XED_ATTRIBUTE_DISP8_TUPLE1_WORD:
|
||
|
case XED_ATTRIBUTE_DISP8_TUPLE2:
|
||
|
case XED_ATTRIBUTE_DISP8_TUPLE4:
|
||
|
case XED_ATTRIBUTE_DISP8_TUPLE8:
|
||
|
case XED_ATTRIBUTE_DOUBLE_WIDE_MEMOP:
|
||
|
case XED_ATTRIBUTE_DOUBLE_WIDE_OUTPUT:
|
||
|
case XED_ATTRIBUTE_DWORD_INDICES:
|
||
|
case XED_ATTRIBUTE_ELEMENT_SIZE_D:
|
||
|
case XED_ATTRIBUTE_ELEMENT_SIZE_Q:
|
||
|
case XED_ATTRIBUTE_EXCEPTION_BR:
|
||
|
case XED_ATTRIBUTE_FAR_XFER:
|
||
|
case XED_ATTRIBUTE_FIXED_BASE0:
|
||
|
case XED_ATTRIBUTE_FIXED_BASE1:
|
||
|
case XED_ATTRIBUTE_GATHER:
|
||
|
case XED_ATTRIBUTE_HALF_WIDE_OUTPUT:
|
||
|
case XED_ATTRIBUTE_HLE_ACQ_ABLE:
|
||
|
case XED_ATTRIBUTE_HLE_REL_ABLE:
|
||
|
case XED_ATTRIBUTE_IGNORES_OSFXSR:
|
||
|
case XED_ATTRIBUTE_IMPLICIT_ONE:
|
||
|
case XED_ATTRIBUTE_INDEX_REG_IS_POINTER:
|
||
|
case XED_ATTRIBUTE_INDIRECT_BRANCH:
|
||
|
case XED_ATTRIBUTE_KMASK:
|
||
|
case XED_ATTRIBUTE_LOCKABLE:
|
||
|
case XED_ATTRIBUTE_LOCKED:
|
||
|
case XED_ATTRIBUTE_MASKOP:
|
||
|
case XED_ATTRIBUTE_MASKOP_EVEX:
|
||
|
case XED_ATTRIBUTE_MASK_AS_CONTROL:
|
||
|
case XED_ATTRIBUTE_MASK_VARIABLE_MEMOP:
|
||
|
case XED_ATTRIBUTE_MEMORY_FAULT_SUPPRESSION:
|
||
|
case XED_ATTRIBUTE_MMX_EXCEPT:
|
||
|
case XED_ATTRIBUTE_MPX_PREFIX_ABLE:
|
||
|
case XED_ATTRIBUTE_MULTIDEST2:
|
||
|
case XED_ATTRIBUTE_MULTISOURCE4:
|
||
|
case XED_ATTRIBUTE_MXCSR:
|
||
|
case XED_ATTRIBUTE_MXCSR_RD:
|
||
|
case XED_ATTRIBUTE_NONTEMPORAL:
|
||
|
case XED_ATTRIBUTE_NOP:
|
||
|
case XED_ATTRIBUTE_NOTSX:
|
||
|
case XED_ATTRIBUTE_NOTSX_COND:
|
||
|
case XED_ATTRIBUTE_NO_RIP_REL:
|
||
|
case XED_ATTRIBUTE_NO_SRC_DEST_MATCH:
|
||
|
case XED_ATTRIBUTE_PREFETCH:
|
||
|
case XED_ATTRIBUTE_PROTECTED_MODE:
|
||
|
case XED_ATTRIBUTE_QWORD_INDICES:
|
||
|
case XED_ATTRIBUTE_REP:
|
||
|
case XED_ATTRIBUTE_REQUIRES_ALIGNMENT:
|
||
|
case XED_ATTRIBUTE_RING0:
|
||
|
case XED_ATTRIBUTE_SCALABLE:
|
||
|
case XED_ATTRIBUTE_SCATTER:
|
||
|
case XED_ATTRIBUTE_SIMD_SCALAR:
|
||
|
case XED_ATTRIBUTE_SKIPLOW32:
|
||
|
case XED_ATTRIBUTE_SKIPLOW64:
|
||
|
case XED_ATTRIBUTE_SPECIAL_AGEN_REQUIRED:
|
||
|
case XED_ATTRIBUTE_STACKPOP0:
|
||
|
case XED_ATTRIBUTE_STACKPOP1:
|
||
|
case XED_ATTRIBUTE_STACKPUSH0:
|
||
|
case XED_ATTRIBUTE_STACKPUSH1:
|
||
|
case XED_ATTRIBUTE_USES_DAZ:
|
||
|
case XED_ATTRIBUTE_USES_FTZ:
|
||
|
case XED_ATTRIBUTE_X87_CONTROL:
|
||
|
case XED_ATTRIBUTE_X87_MMX_STATE_CW:
|
||
|
case XED_ATTRIBUTE_X87_MMX_STATE_R:
|
||
|
case XED_ATTRIBUTE_X87_MMX_STATE_W:
|
||
|
case XED_ATTRIBUTE_X87_NOWAIT:
|
||
|
case XED_ATTRIBUTE_XMM_STATE_CW:
|
||
|
case XED_ATTRIBUTE_XMM_STATE_R:
|
||
|
case XED_ATTRIBUTE_XMM_STATE_W:
|
||
|
case XED_ATTRIBUTE_LAST:
|
||
|
default:
|
||
|
xed_assert(0);
|
||
|
}
|
||
|
*/
|