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.

67 lines
1.7 KiB

/// @file xed-operand-convert-enum.c
// This file was automatically generated.
// Do not edit this file.
#include <string.h>
#include <assert.h>
#include "xed-operand-convert-enum.h"
typedef struct {
const char* name;
xed_operand_convert_enum_t value;
} name_table_xed_operand_convert_enum_t;
static const name_table_xed_operand_convert_enum_t name_array_xed_operand_convert_enum_t[] = {
{"INVALID", XED_OPERAND_CONVERT_INVALID},
{"ZEROSTR", XED_OPERAND_CONVERT_ZEROSTR},
{"SAESTR", XED_OPERAND_CONVERT_SAESTR},
{"ROUNDC", XED_OPERAND_CONVERT_ROUNDC},
{"BCASTSTR", XED_OPERAND_CONVERT_BCASTSTR},
{"LAST", XED_OPERAND_CONVERT_LAST},
{0, XED_OPERAND_CONVERT_LAST},
};
xed_operand_convert_enum_t str2xed_operand_convert_enum_t(const char* s)
{
const name_table_xed_operand_convert_enum_t* p = name_array_xed_operand_convert_enum_t;
while( p->name ) {
if (strcmp(p->name,s) == 0) {
return p->value;
}
p++;
}
return XED_OPERAND_CONVERT_INVALID;
}
const char* xed_operand_convert_enum_t2str(const xed_operand_convert_enum_t p)
{
xed_operand_convert_enum_t type_idx = p;
if ( p > XED_OPERAND_CONVERT_LAST) type_idx = XED_OPERAND_CONVERT_LAST;
return name_array_xed_operand_convert_enum_t[type_idx].name;
}
xed_operand_convert_enum_t xed_operand_convert_enum_t_last(void) {
return XED_OPERAND_CONVERT_LAST;
}
/*
Here is a skeleton switch statement embedded in a comment
switch(p) {
case XED_OPERAND_CONVERT_INVALID:
case XED_OPERAND_CONVERT_ZEROSTR:
case XED_OPERAND_CONVERT_SAESTR:
case XED_OPERAND_CONVERT_ROUNDC:
case XED_OPERAND_CONVERT_BCASTSTR:
case XED_OPERAND_CONVERT_LAST:
default:
xed_assert(0);
}
*/