mirror of
https://github.com/Ed94/perfaware.git
synced 2026-08-14 11:28:08 +00:00
wip, the urge to finish the lookup table is real...
This commit is contained in:
+51
@@ -0,0 +1,51 @@
|
||||
#include "bloat.hpp"
|
||||
|
||||
namespace Op
|
||||
{
|
||||
enum Code : u8
|
||||
{
|
||||
#define D_Entry( Entry_ ) Entry,
|
||||
#include "opcodes.inline"
|
||||
Num,
|
||||
#undef D_Entry
|
||||
};
|
||||
|
||||
char const* str( Code code )
|
||||
{
|
||||
static
|
||||
char const* code_to_str[ Num] =
|
||||
{
|
||||
#define D_Entry( Entry_ ) ZPL_STRINGIFY( Entry_ ),
|
||||
#include "opcodes.inline"
|
||||
#undef D_Entry
|
||||
};
|
||||
|
||||
return code_to_str[ code ];
|
||||
}
|
||||
|
||||
char const* meumonic( Code code )
|
||||
{
|
||||
static
|
||||
char const* code_to_str[ Num] =
|
||||
{
|
||||
#define D_Entry( Entry_ ) ZPL_STRINGIFY( Entry_ ),
|
||||
#include "opcodes.meumonics.inline"
|
||||
#undef D_Entry
|
||||
};
|
||||
|
||||
return code_to_str[ code ];
|
||||
}
|
||||
|
||||
char const* intuitive( Code code )
|
||||
{
|
||||
static
|
||||
char const* code_to_str[ Num] =
|
||||
{
|
||||
#define D_Entry( Entry_ ) ZPL_STRINGIFY( Entry_ ),
|
||||
#include "opcodes.intuitive.inline"
|
||||
#undef D_Entry
|
||||
};
|
||||
|
||||
return code_to_str[ Num];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user