spu: allow branching to self on asmjit

This commit is contained in:
eladash 2018-03-12 21:11:40 +02:00 committed by Zangetsu38
parent 5f047034ae
commit 57f0ddd13c

View file

@ -9,6 +9,7 @@
#include "Utilities/sysinfo.h"
#include <cmath>
#include <thread>
#define ASMJIT_STATIC
#define ASMJIT_DEBUG
@ -2869,7 +2870,7 @@ void spu_recompiler::BRZ(spu_opcode_t op)
{
const u32 target = spu_branch_target(m_pos, op.i16);
if (target == m_pos) fmt::throw_exception("Branch-to-self (0x%05x)" HERE, target);
if (target == m_pos) std::this_thread::yield();
c->cmp(SPU_OFF_32(gpr, op.rt, &v128::_u32, 3), 0);
@ -2915,7 +2916,7 @@ void spu_recompiler::BRNZ(spu_opcode_t op)
{
const u32 target = spu_branch_target(m_pos, op.i16);
if (target == m_pos) fmt::throw_exception("Branch-to-self (0x%05x)" HERE, target);
if (target == m_pos) std::this_thread::yield();
c->cmp(SPU_OFF_32(gpr, op.rt, &v128::_u32, 3), 0);
@ -2940,7 +2941,7 @@ void spu_recompiler::BRHZ(spu_opcode_t op)
{
const u32 target = spu_branch_target(m_pos, op.i16);
if (target == m_pos) fmt::throw_exception("Branch-to-self (0x%05x)" HERE, target);
if (target == m_pos) std::this_thread::yield();
c->cmp(SPU_OFF_16(gpr, op.rt, &v128::_u16, 6), 0);
@ -2965,7 +2966,7 @@ void spu_recompiler::BRHNZ(spu_opcode_t op)
{
const u32 target = spu_branch_target(m_pos, op.i16);
if (target == m_pos) fmt::throw_exception("Branch-to-self (0x%05x)" HERE, target);
if (target == m_pos) std::this_thread::yield();
c->cmp(SPU_OFF_16(gpr, op.rt, &v128::_u16, 6), 0);
@ -3011,7 +3012,7 @@ void spu_recompiler::BRA(spu_opcode_t op)
{
const u32 target = spu_branch_target(0, op.i16);
if (target == m_pos) fmt::throw_exception("Branch-to-self (0x%05x)" HERE, target);
if (target == m_pos) std::this_thread::yield();
if (labels[target / 4].isValid())
{
@ -3056,7 +3057,7 @@ void spu_recompiler::BRASL(spu_opcode_t op)
{
const u32 target = spu_branch_target(0, op.i16);
if (target == m_pos) fmt::throw_exception("Branch-to-self (0x%05x)" HERE, target);
if (target == m_pos) std::this_thread::yield();
const XmmLink& vr = XmmAlloc();
c->movdqa(vr, XmmConst(_mm_set_epi32(spu_branch_target(m_pos + 4), 0, 0, 0)));
@ -3111,7 +3112,7 @@ void spu_recompiler::BRSL(spu_opcode_t op)
{
const u32 target = spu_branch_target(m_pos, op.i16);
if (target == m_pos) fmt::throw_exception("Branch-to-self (0x%05x)" HERE, target);
if (target == m_pos) std::this_thread::yield();
const XmmLink& vr = XmmAlloc();
c->movdqa(vr, XmmConst(_mm_set_epi32(spu_branch_target(m_pos + 4), 0, 0, 0)));