From 7e74b98d5b2b30cad79c930962f041a4337462f8 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 19 Dec 2024 21:59:42 +1030 Subject: [PATCH] Core: Fix up labels in CX86RecompilerOps::COP1_S_CVT --- .../N64System/Recompiler/x86/x86RecompilerOps.cpp | 14 ++++++++------ .../N64System/Recompiler/x86/x86RegInfo.cpp | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index 6974e0090..08ff58400 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -11590,13 +11590,14 @@ void CX86RecompilerOps::COP1_S_CVT(CRegBase::FPU_ROUND RoundMethod, CRegInfo::FP m_Assembler.mov(asmjit::x86::eax, asmjit::x86::dword_ptr(fsRegPointer, 4)); m_Assembler.adc(asmjit::x86::eax, 0x800000); m_Assembler.cmp(asmjit::x86::eax, 0xFFFFFF); - asmjit::Label UnimplementedOperationLabel = m_Assembler.newLabel(); asmjit::Label ValidValueLabel = m_Assembler.newLabel(); - m_Assembler.JaLabel("ValidValue", UnimplementedOperationLabel); - m_Assembler.JbLabel("UnimplementedOperationLabel", ValidValueLabel); + asmjit::Label ValidValueLabel2 = m_Assembler.newLabel(); + asmjit::Label UnimplementedOperationLabel = m_Assembler.newLabel(); + m_Assembler.JaLabel("ValidValue", ValidValueLabel); + m_Assembler.JbLabel("UnimplementedOperationLabel", UnimplementedOperationLabel); m_Assembler.cmp(asmjit::x86::eax, 0xFFFFFFFF); - m_Assembler.JbeLabel("ValidValue", ValidValueLabel); - m_Assembler.bind(UnimplementedOperationLabel); + m_Assembler.JbeLabel("ValidValue", ValidValueLabel2); + m_Assembler.bind(ValidValueLabel); CRegInfo ExitRegSet = m_RegWorkingSet; if (ExitRegSet.IsFPStatusRegMapped()) { @@ -11608,7 +11609,8 @@ void CX86RecompilerOps::COP1_S_CVT(CRegBase::FPU_ROUND RoundMethod, CRegInfo::FP } ExitRegSet.SetBlockCycleCount(ExitRegSet.GetBlockCycleCount() + g_System->CountPerOp()); CompileExit(m_CompilePC, m_CompilePC, ExitRegSet, ExitReason_ExceptionFloatingPoint, false, &CX86Ops::JmpLabel); - m_Assembler.bind(ValidValueLabel); + m_Assembler.bind(UnimplementedOperationLabel); + m_Assembler.bind(ValidValueLabel2); m_Assembler.fpuLoadIntegerQwordFromX86Reg(m_RegWorkingSet.StackTopPos(), fsRegPointer); } else diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp index e2c895d66..e06e1ed97 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp @@ -1259,7 +1259,7 @@ void CX86RegInfo::PrepareFPTopToBe(int32_t Reg, int32_t RegToLoad, FPU_STATE For case FPU_Float: m_Assembler.MoveVariableToX86reg(TempReg, &g_Reg->m_FPR_S[RegToLoad], stdstr_f("m_FPR_S[%d]", RegToLoad).c_str()); m_Assembler.fpuLoadDwordFromX86Reg(StackTopPos(), TempReg); - break; + break; case FPU_FloatLow: m_Assembler.MoveVariableToX86reg(TempReg, &g_Reg->m_FPR_S_L[RegToLoad], stdstr_f("m_FPR_S_L[%d]", RegToLoad).c_str()); m_Assembler.fpuLoadDwordFromX86Reg(StackTopPos(), TempReg);