summaryrefslogtreecommitdiff
path: root/Source/UnitTests/DSPJitTester.cpp
diff options
context:
space:
mode:
authorj4ck.fr0st <j4ck.fr0st@gmail.com>2010-04-11 14:06:46 +0000
committerj4ck.fr0st <j4ck.fr0st@gmail.com>2010-04-11 14:06:46 +0000
commit945f8089b84c1baa679edaeab671c5b0b4f65f07 (patch)
tree0fe1c8f1ec4063a4af1b03c4fcb561ff857c7f2c /Source/UnitTests/DSPJitTester.cpp
parent800595980e0bea5a8da5bfe4124369f89c2bf8af (diff)
Removed a stray MOV in increase_addr_reg, fixed decrease_addr_reg. NR should work now.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5329 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/UnitTests/DSPJitTester.cpp')
-rw-r--r--Source/UnitTests/DSPJitTester.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/UnitTests/DSPJitTester.cpp b/Source/UnitTests/DSPJitTester.cpp
index 4be7ccf50b..2c1467f485 100644
--- a/Source/UnitTests/DSPJitTester.cpp
+++ b/Source/UnitTests/DSPJitTester.cpp
@@ -1,5 +1,15 @@
#include "DSPJitTester.h"
+DSPJitTester::DSPJitTester(u16 opcode, u16 opcode_ext, bool verbose)
+ : be_verbose(verbose), run_count(0), fail_count(0)
+{
+ instruction = opcode << 9 | opcode_ext;
+ opcode_template = GetOpTemplate(instruction);
+ sprintf(instruction_name, "%s", opcode_template->name);
+ if (opcode_template->extended)
+ sprintf(&instruction_name[strlen(instruction_name)], "'%s",
+ extOpTable[instruction & (((instruction >> 12) == 0x3) ? 0x7F : 0xFF)]->name);
+}
bool DSPJitTester::Test(SDSP dsp_settings)
{
if (be_verbose)
@@ -64,6 +74,18 @@ void DSPJitTester::Report()
{
printf("%s (0x%04x): Ran %d times, Failed %d times.\n", instruction_name, instruction, run_count, fail_count);
}
+void DSPJitTester::DumpJittedCode()
+{
+ ResetJit();
+ const u8* code = jit.GetCodePtr();
+ jit.WriteCallInterpreter(instruction);
+ int code_size = jit.GetCodePtr() - code;
+
+ printf("%s emitted: ", instruction_name);
+ for (int i = 0; i < code_size; i++)
+ printf("%02x ", code[i]);
+ printf("\n");
+}
void DSPJitTester::Initialize()
{
//init int