mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
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:
parent
070c0a9e30
commit
57bb9c2f7a
1 changed files with 29 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue