summaryrefslogtreecommitdiff
path: root/Source/UnitTests/AudioJitTests.cpp
diff options
context:
space:
mode:
authorj4ck.fr0st <j4ck.fr0st@gmail.com>2010-04-09 19:18:50 +0000
committerj4ck.fr0st <j4ck.fr0st@gmail.com>2010-04-09 19:18:50 +0000
commit57a3c878158d56565e42164a2c23e01d07050dd3 (patch)
tree26891c2af2e91bbdb2565f3830a65b3f1fbcb687 /Source/UnitTests/AudioJitTests.cpp
parentb513e2d2c9a0caa4d91d801c4108ae5bc199b542 (diff)
DSPJit: disabled NR again until we fix DSPEmitter::increase_addr_reg.
And to help test things like that: DSPJitTester (use with caution on x64, most likely fails there; r5250 might be why) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5306 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/UnitTests/AudioJitTests.cpp')
-rw-r--r--Source/UnitTests/AudioJitTests.cpp84
1 files changed, 84 insertions, 0 deletions
diff --git a/Source/UnitTests/AudioJitTests.cpp b/Source/UnitTests/AudioJitTests.cpp
new file mode 100644
index 0000000000..2247f529b5
--- /dev/null
+++ b/Source/UnitTests/AudioJitTests.cpp
@@ -0,0 +1,84 @@
+#include "DSPJitTester.h"
+
+void nx_dr()
+{
+ SDSP test_dsp;
+ DSPJitTester tester(0x40, 0x04);
+
+ for (u16 input_reg = 0; input_reg < 50; input_reg++)
+ for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
+ {
+ memset(&test_dsp, 0, sizeof(SDSP));
+ test_dsp.r[DSP_REG_WR0] = input_wr0;
+ test_dsp.r[0] = input_reg;
+ if (!tester.Test(test_dsp))
+ {
+ printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
+ tester.GetInstructionName(),
+ input_reg, input_wr0,
+ tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
+ }
+ }
+ tester.Report();
+}
+
+void nx_ir()
+{
+ SDSP test_dsp;
+ DSPJitTester tester(0x40, 0x08);
+
+ for (u16 input_reg = 0; input_reg < 50; input_reg++)
+ for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
+ {
+ memset(&test_dsp, 0, sizeof(SDSP));
+ test_dsp.r[DSP_REG_WR0] = input_wr0;
+ test_dsp.r[0] = input_reg;
+ if (!tester.Test(test_dsp))
+ {
+ printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
+ tester.GetInstructionName(),
+ input_reg, input_wr0,
+ tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
+ }
+ }
+ tester.Report();
+}
+
+void nx_nr()
+{
+ SDSP test_dsp;
+ DSPJitTester tester(0x40, 0x0c);
+
+ for (u16 input_reg = 0; input_reg < 50; input_reg++)
+ for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
+ {
+ memset(&test_dsp, 0, sizeof(SDSP));
+ test_dsp.r[DSP_REG_WR0] = input_wr0;
+ test_dsp.r[0] = input_reg;
+ if (!tester.Test(test_dsp))
+ {
+ printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
+ tester.GetInstructionName(),
+ input_reg, input_wr0,
+ tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
+ }
+ }
+ tester.Report();
+}
+
+void AudioJitTests()
+{
+ DSPJitTester::Initialize();
+
+ nx_ir();
+ nx_dr();
+ //nx_nr();
+}
+
+//required to be able to link against DSPCore
+void DSPHost_UpdateDebugger() { }
+unsigned int DSPHost_CodeLoaded(unsigned const char*, int) { return 0; }
+void DSPHost_InterruptRequest() { }
+bool DSPHost_OnThread() { return false; }
+void DSPHost_WriteHostMemory(unsigned char, unsigned int) { }
+unsigned char DSPHost_ReadHostMemory(unsigned int) { return 0; } \ No newline at end of file