aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorMerry <[email protected]>2023-02-05 17:19:08 +0000
committerMerry <[email protected]>2023-02-05 17:19:08 +0000
commit7d3b4f913b52d563eb6067ca0ea709468fe03de0 (patch)
tree4f54b75693e613e11ed3812b3076a6b2c3c743c7 /tests
parent2636da8821491bae7e2dc576214b896155b230f4 (diff)
downloaddynarmic-7d3b4f913b52d563eb6067ca0ea709468fe03de0.tar.gz
dynarmic-7d3b4f913b52d563eb6067ca0ea709468fe03de0.zip
a32_get_set_elimination_pass: Fix bugs in A32 get/set algorithm
Diffstat (limited to 'tests')
-rw-r--r--tests/test_generator.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/test_generator.cpp b/tests/test_generator.cpp
index 35f8ff39..90c2d635 100644
--- a/tests/test_generator.cpp
+++ b/tests/test_generator.cpp
@@ -406,26 +406,6 @@ void RunTestInstance(Dynarmic::A32::Jit& jit,
const u32 num_words = initial_pc / sizeof(typename TestEnv::InstructionType);
const u32 code_mem_size = num_words + static_cast<u32>(instructions.size());
- jit.ClearCache();
-
- for (size_t jit_rerun_count = 0; jit_rerun_count < num_jit_reruns; ++jit_rerun_count) {
- jit_env.code_mem.resize(code_mem_size);
- std::fill(jit_env.code_mem.begin(), jit_env.code_mem.end(), TestEnv::infinite_loop);
-
- std::copy(instructions.begin(), instructions.end(), jit_env.code_mem.begin() + num_words);
- jit_env.PadCodeMem();
- jit_env.modified_memory.clear();
- jit_env.interrupts.clear();
-
- jit.Regs() = regs;
- jit.ExtRegs() = vecs;
- jit.SetFpscr(fpscr);
- jit.SetCpsr(cpsr);
-
- jit_env.ticks_left = ticks_left;
- jit.Run();
- }
-
fmt::print("instructions:");
for (auto instruction : instructions) {
if constexpr (sizeof(decltype(instruction)) == 2) {
@@ -449,6 +429,26 @@ void RunTestInstance(Dynarmic::A32::Jit& jit,
fmt::print("initial_cpsr: {:08x}\n", cpsr);
fmt::print("initial_fpcr: {:08x}\n", fpscr);
+ jit.ClearCache();
+
+ for (size_t jit_rerun_count = 0; jit_rerun_count < num_jit_reruns; ++jit_rerun_count) {
+ jit_env.code_mem.resize(code_mem_size);
+ std::fill(jit_env.code_mem.begin(), jit_env.code_mem.end(), TestEnv::infinite_loop);
+
+ std::copy(instructions.begin(), instructions.end(), jit_env.code_mem.begin() + num_words);
+ jit_env.PadCodeMem();
+ jit_env.modified_memory.clear();
+ jit_env.interrupts.clear();
+
+ jit.Regs() = regs;
+ jit.ExtRegs() = vecs;
+ jit.SetFpscr(fpscr);
+ jit.SetCpsr(cpsr);
+
+ jit_env.ticks_left = ticks_left;
+ jit.Run();
+ }
+
fmt::print("final_regs:");
for (u32 i : jit.Regs()) {
fmt::print(" {:08x}", i);