Better disassembly of FLOP instructions.

- Annotate FLOP instructions with the name of the floating point operation
  indicated by the C field.
This commit is contained in:
Randy Heit 2013-07-25 22:29:59 -05:00
parent 070c0a9e30
commit 57bb9c2f7a

View file

@ -97,6 +97,27 @@ const VMOpInfo OpInfo[NUM_OPS] =
#include "vmops.h"
};
static const char *const FlopNames[] =
{
"abs",
"neg",
"acos",
"asin",
"atan",
"cos",
"cosh",
"exp",
"log",
"log10",
"sin",
"sinh",
"tan",
"tanh",
"sqrt",
"ceil",
"floor"
};
static int print_reg(FILE *out, int col, int arg, int mode, int immshift, const VMScriptFunction *func);
static int printf_wrapper(FILE *f, const char *fmt, ...)
@ -263,6 +284,14 @@ void VMDisasm(FILE *out, const VMOP *code, int codesize, const VMScriptFunction
}
break;
case OP_FLOP:
col = printf_wrapper(out, "f%d,f%d,%d", code[i].a, code[i].b, code[i].c);
if (code[i].c < countof(FlopNames))
{
col +=printf_wrapper(out, " [%s]", FlopNames[code[i].c]);
}
break;
default:
if ((mode & MODE_BCTYPE) == MODE_BCCAST)
{