CPU/Recompiler: Fix hang in AArch32/armv7

This commit is contained in:
Connor McLaughlin 2021-01-21 13:09:11 +10:00
parent 0dee202095
commit 4433197665
2 changed files with 8 additions and 8 deletions

View File

@ -1090,7 +1090,7 @@ void CodeGenerator::EmitAddCPUStructField(u32 offset, const Value& value)
// do we need temporary storage for the constant, if it won't fit in an immediate?
Assert(value.IsConstant());
const s32 constant_value = value.GetS32ConstantValue();
if (a32::ImmediateA32::IsImmediateA32(static_cast<u32>(constant_value)))
if (!a32::ImmediateA32::IsImmediateA32(static_cast<u32>(constant_value)))
{
real_value.SetHostReg(&m_register_cache, RARG2, value.size);
EmitCopyValue(real_value.host_reg, value);
@ -1107,7 +1107,7 @@ void CodeGenerator::EmitAddCPUStructField(u32 offset, const Value& value)
case RegSize_8:
{
m_emit->Ldrb(GetHostReg8(RARG1), o_offset);
if (value.IsConstant())
if (real_value.IsConstant())
m_emit->Add(GetHostReg8(RARG1), GetHostReg8(RARG1), real_value.GetS32ConstantValue());
else
m_emit->Add(GetHostReg8(RARG1), GetHostReg8(RARG1), GetHostReg8(real_value));
@ -1118,7 +1118,7 @@ void CodeGenerator::EmitAddCPUStructField(u32 offset, const Value& value)
case RegSize_16:
{
m_emit->Ldrh(GetHostReg16(RARG1), o_offset);
if (value.IsConstant())
if (real_value.IsConstant())
m_emit->Add(GetHostReg16(RARG1), GetHostReg16(RARG1), real_value.GetS32ConstantValue());
else
m_emit->Add(GetHostReg16(RARG1), GetHostReg16(RARG1), GetHostReg16(real_value));
@ -1129,7 +1129,7 @@ void CodeGenerator::EmitAddCPUStructField(u32 offset, const Value& value)
case RegSize_32:
{
m_emit->Ldr(GetHostReg32(RARG1), o_offset);
if (value.IsConstant())
if (real_value.IsConstant())
m_emit->Add(GetHostReg32(RARG1), GetHostReg32(RARG1), real_value.GetS32ConstantValue());
else
m_emit->Add(GetHostReg32(RARG1), GetHostReg32(RARG1), GetHostReg32(real_value));

View File

@ -1278,7 +1278,7 @@ void CodeGenerator::EmitAddCPUStructField(u32 offset, const Value& value)
case RegSize_8:
{
m_emit->Ldrb(GetHostReg8(RSCRATCH), o_offset);
if (value.IsConstant())
if (real_value.IsConstant())
m_emit->Add(GetHostReg8(RSCRATCH), GetHostReg8(RSCRATCH), real_value.GetS64ConstantValue());
else
m_emit->Add(GetHostReg8(RSCRATCH), GetHostReg8(RSCRATCH), GetHostReg8(real_value));
@ -1289,7 +1289,7 @@ void CodeGenerator::EmitAddCPUStructField(u32 offset, const Value& value)
case RegSize_16:
{
m_emit->Ldrh(GetHostReg16(RSCRATCH), o_offset);
if (value.IsConstant())
if (real_value.IsConstant())
m_emit->Add(GetHostReg16(RSCRATCH), GetHostReg16(RSCRATCH), real_value.GetS64ConstantValue());
else
m_emit->Add(GetHostReg16(RSCRATCH), GetHostReg16(RSCRATCH), GetHostReg16(real_value));
@ -1300,7 +1300,7 @@ void CodeGenerator::EmitAddCPUStructField(u32 offset, const Value& value)
case RegSize_32:
{
m_emit->Ldr(GetHostReg32(RSCRATCH), o_offset);
if (value.IsConstant())
if (real_value.IsConstant())
m_emit->Add(GetHostReg32(RSCRATCH), GetHostReg32(RSCRATCH), real_value.GetS64ConstantValue());
else
m_emit->Add(GetHostReg32(RSCRATCH), GetHostReg32(RSCRATCH), GetHostReg32(real_value));
@ -1311,7 +1311,7 @@ void CodeGenerator::EmitAddCPUStructField(u32 offset, const Value& value)
case RegSize_64:
{
m_emit->Ldr(GetHostReg64(RSCRATCH), o_offset);
if (value.IsConstant())
if (real_value.IsConstant())
m_emit->Add(GetHostReg64(RSCRATCH), GetHostReg64(RSCRATCH), s64(real_value.constant_value));
else
m_emit->Add(GetHostReg64(RSCRATCH), GetHostReg64(RSCRATCH), GetHostReg64(real_value));