diff --git a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp index 4a7caa02ef..1d6f63aafe 100644 --- a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp @@ -181,17 +181,31 @@ bool spu_recompiler::compile(u64 last_reset_count, const std::vector& func) if (!g_cfg.core.spu_verification) { // Disable check (unsafe) + if (utils::has_avx()) + { + c->vzeroupper(); + } } else if (m_size == 4) { c->cmp(x86::dword_ptr(*ls, start), func[1]); c->jnz(label_diff); + + if (utils::has_avx()) + { + c->vzeroupper(); + } } else if (m_size == 8) { c->mov(*qw1, static_cast(func[2]) << 32 | func[1]); c->cmp(*qw1, x86::qword_ptr(*ls, start)); c->jnz(label_diff); + + if (utils::has_avx()) + { + c->vzeroupper(); + } } else if (utils::has_512() && false) { @@ -272,6 +286,7 @@ bool spu_recompiler::compile(u64 last_reset_count, const std::vector& func) c->ktestw(x86::k1, x86::k1); c->jnz(label_diff); + c->vzeroupper(); } else if (utils::has_512()) { @@ -392,6 +407,8 @@ bool spu_recompiler::compile(u64 last_reset_count, const std::vector& func) c->vptest(x86::ymm0, x86::ymm0); c->jnz(label_diff); } + + c->vzeroupper(); } else if (utils::has_avx()) { @@ -531,6 +548,8 @@ bool spu_recompiler::compile(u64 last_reset_count, const std::vector& func) c->vptest(x86::ymm0, x86::ymm0); c->jnz(label_diff); } + + c->vzeroupper(); } else { @@ -661,11 +680,6 @@ bool spu_recompiler::compile(u64 last_reset_count, const std::vector& func) } } - if (utils::has_avx()) - { - c->vzeroupper(); - } - // Acknowledge success and add statistics c->add(SPU_OFF_64(block_counter), ::size32(words) / (words_align / 4));