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.

91 lines
2.1 KiB

3 years ago
/// @file xed-mapu-enum.c
// This file was automatically generated.
// Do not edit this file.
#include <string.h>
#include <assert.h>
#include "xed-mapu-enum.h"
typedef struct {
const char* name;
xed_mapu_enum_t value;
} name_table_xed_mapu_enum_t;
static const name_table_xed_mapu_enum_t name_array_xed_mapu_enum_t[] = {
{"INVALID", XED_MAPU_INVALID},
{"AMD_3DNOW", XED_MAPU_AMD_3DNOW},
{"AMD_XOP8", XED_MAPU_AMD_XOP8},
{"AMD_XOP9", XED_MAPU_AMD_XOP9},
{"AMD_XOPA", XED_MAPU_AMD_XOPA},
{"EVEX_MAP1", XED_MAPU_EVEX_MAP1},
{"EVEX_MAP2", XED_MAPU_EVEX_MAP2},
{"EVEX_MAP3", XED_MAPU_EVEX_MAP3},
{"EVEX_MAP5", XED_MAPU_EVEX_MAP5},
{"EVEX_MAP6", XED_MAPU_EVEX_MAP6},
{"LEGACY_MAP0", XED_MAPU_LEGACY_MAP0},
{"LEGACY_MAP1", XED_MAPU_LEGACY_MAP1},
{"LEGACY_MAP2", XED_MAPU_LEGACY_MAP2},
{"LEGACY_MAP3", XED_MAPU_LEGACY_MAP3},
{"VEX_MAP1", XED_MAPU_VEX_MAP1},
{"VEX_MAP2", XED_MAPU_VEX_MAP2},
{"VEX_MAP3", XED_MAPU_VEX_MAP3},
{"LAST", XED_MAPU_LAST},
{0, XED_MAPU_LAST},
};
xed_mapu_enum_t str2xed_mapu_enum_t(const char* s)
{
const name_table_xed_mapu_enum_t* p = name_array_xed_mapu_enum_t;
while( p->name ) {
if (strcmp(p->name,s) == 0) {
return p->value;
}
p++;
}
return XED_MAPU_INVALID;
}
const char* xed_mapu_enum_t2str(const xed_mapu_enum_t p)
{
xed_mapu_enum_t type_idx = p;
if ( p > XED_MAPU_LAST) type_idx = XED_MAPU_LAST;
return name_array_xed_mapu_enum_t[type_idx].name;
}
xed_mapu_enum_t xed_mapu_enum_t_last(void) {
return XED_MAPU_LAST;
}
/*
Here is a skeleton switch statement embedded in a comment
switch(p) {
case XED_MAPU_INVALID:
case XED_MAPU_AMD_3DNOW:
case XED_MAPU_AMD_XOP8:
case XED_MAPU_AMD_XOP9:
case XED_MAPU_AMD_XOPA:
case XED_MAPU_EVEX_MAP1:
case XED_MAPU_EVEX_MAP2:
case XED_MAPU_EVEX_MAP3:
case XED_MAPU_EVEX_MAP5:
case XED_MAPU_EVEX_MAP6:
case XED_MAPU_LEGACY_MAP0:
case XED_MAPU_LEGACY_MAP1:
case XED_MAPU_LEGACY_MAP2:
case XED_MAPU_LEGACY_MAP3:
case XED_MAPU_VEX_MAP1:
case XED_MAPU_VEX_MAP2:
case XED_MAPU_VEX_MAP3:
case XED_MAPU_LAST:
default:
xed_assert(0);
}
*/