diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index 4471a4e8c..144e3ff5f 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -1110,16 +1110,16 @@ void OpDispatchBuilder::CondJUMPOp(OpcodeArgs) { // Fallback { - auto CondJump = _CondJump(SrcCond); + auto CondJump_ = CondJump(SrcCond); // Taking branch block if (TrueBlock != JumpTargets.end()) { - SetTrueJumpTarget(CondJump, TrueBlock->second.BlockEntry); + SetTrueJumpTarget(CondJump_, TrueBlock->second.BlockEntry); } else { // Make sure to start a new block after ending this one auto JumpTarget = CreateNewCodeBlockAtEnd(); - SetTrueJumpTarget(CondJump, JumpTarget); + SetTrueJumpTarget(CondJump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); @@ -1131,13 +1131,13 @@ void OpDispatchBuilder::CondJUMPOp(OpcodeArgs) { // Failure to take branch if (FalseBlock != JumpTargets.end()) { - SetFalseJumpTarget(CondJump, FalseBlock->second.BlockEntry); + SetFalseJumpTarget(CondJump_, FalseBlock->second.BlockEntry); } else { // Make sure to start a new block after ending this one // Place it after this block for fallthrough optimization auto JumpTarget = CreateNewCodeBlockAfter(CurrentBlock); - SetFalseJumpTarget(CondJump, JumpTarget); + SetFalseJumpTarget(CondJump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); @@ -1175,16 +1175,16 @@ void OpDispatchBuilder::CondJUMPRCXOp(OpcodeArgs) { auto CurrentBlock = GetCurrentBlock(); { - auto CondJump = _CondJump(CondReg, {COND_EQ}); + auto CondJump_ = CondJump(CondReg, {COND_EQ}); // Taking branch block if (TrueBlock != JumpTargets.end()) { - SetTrueJumpTarget(CondJump, TrueBlock->second.BlockEntry); + SetTrueJumpTarget(CondJump_, TrueBlock->second.BlockEntry); } else { // Make sure to start a new block after ending this one auto JumpTarget = CreateNewCodeBlockAtEnd(); - SetTrueJumpTarget(CondJump, JumpTarget); + SetTrueJumpTarget(CondJump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); @@ -1196,13 +1196,13 @@ void OpDispatchBuilder::CondJUMPRCXOp(OpcodeArgs) { // Failure to take branch if (FalseBlock != JumpTargets.end()) { - SetFalseJumpTarget(CondJump, FalseBlock->second.BlockEntry); + SetFalseJumpTarget(CondJump_, FalseBlock->second.BlockEntry); } else { // Make sure to start a new block after ending this one // Place it after the current block for fallthrough behavior auto JumpTarget = CreateNewCodeBlockAfter(CurrentBlock); - SetFalseJumpTarget(CondJump, JumpTarget); + SetFalseJumpTarget(CondJump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); @@ -1257,16 +1257,16 @@ void OpDispatchBuilder::LoopOp(OpcodeArgs) { auto FalseBlock = JumpTargets.find(Op->PC + Op->InstSize); { - auto CondJump = _CondJump(SrcCond); + auto CondJump_ = CondJump(SrcCond); // Taking branch block if (TrueBlock != JumpTargets.end()) { - SetTrueJumpTarget(CondJump, TrueBlock->second.BlockEntry); + SetTrueJumpTarget(CondJump_, TrueBlock->second.BlockEntry); } else { // Make sure to start a new block after ending this one auto JumpTarget = CreateNewCodeBlockAtEnd(); - SetTrueJumpTarget(CondJump, JumpTarget); + SetTrueJumpTarget(CondJump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); @@ -1278,13 +1278,13 @@ void OpDispatchBuilder::LoopOp(OpcodeArgs) { // Failure to take branch if (FalseBlock != JumpTargets.end()) { - SetFalseJumpTarget(CondJump, FalseBlock->second.BlockEntry); + SetFalseJumpTarget(CondJump_, FalseBlock->second.BlockEntry); } else { // Make sure to start a new block after ending this one // Place after this block for fallthrough behavior auto JumpTarget = CreateNewCodeBlockAfter(GetCurrentBlock()); - SetFalseJumpTarget(CondJump, JumpTarget); + SetFalseJumpTarget(CondJump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); @@ -1328,15 +1328,15 @@ void OpDispatchBuilder::JUMPOp(OpcodeArgs) { if (Multiblock) { auto JumpBlock = JumpTargets.find(TargetRIP); if (JumpBlock != JumpTargets.end()) { - _Jump(GetNewJumpBlock(TargetRIP)); + Jump(GetNewJumpBlock(TargetRIP)); } else { // If the block isn't a jump target then we need to create an exit block - auto Jump = _Jump(); + auto Jump_ = Jump(); // Place after this block for fallthrough behavior auto JumpTarget = CreateNewCodeBlockAfter(GetCurrentBlock()); - SetJumpTarget(Jump, JumpTarget); + SetJumpTarget(Jump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); _ExitFunction(GetRelocatedPC(Op, TargetOffset)); @@ -3416,12 +3416,12 @@ void OpDispatchBuilder::DAAOp(OpcodeArgs) { auto EndBlock = CreateNewCodeBlockAfter(TrueBlock); CalculateDeferredFlags(); - _CondJump(Cond, TrueBlock, FalseBlock); + CondJump(Cond, TrueBlock, FalseBlock); SetCurrentCodeBlock(FalseBlock); StartNewBlock(); { SetAF(0); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(TrueBlock); StartNewBlock(); @@ -3437,7 +3437,7 @@ void OpDispatchBuilder::DAAOp(OpcodeArgs) { SetRFLAG(_Or(OpSize::i64Bit, CF, NewCF)); SetAF(1); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(EndBlock); StartNewBlock(); @@ -3446,13 +3446,13 @@ void OpDispatchBuilder::DAAOp(OpcodeArgs) { FalseBlock = CreateNewCodeBlockAfter(GetCurrentBlock()); TrueBlock = CreateNewCodeBlockAfter(FalseBlock); EndBlock = CreateNewCodeBlockAfter(TrueBlock); - _CondJump(Cond, TrueBlock, FalseBlock); + CondJump(Cond, TrueBlock, FalseBlock); SetCurrentCodeBlock(FalseBlock); StartNewBlock(); { SetRFLAG(_Constant(0)); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(TrueBlock); StartNewBlock(); @@ -3463,7 +3463,7 @@ void OpDispatchBuilder::DAAOp(OpcodeArgs) { StoreGPRRegister(X86State::REG_RAX, NewAL, 1); SetRFLAG(_Constant(1)); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(EndBlock); StartNewBlock(); @@ -3491,12 +3491,12 @@ void OpDispatchBuilder::DASOp(OpcodeArgs) { auto EndBlock = CreateNewCodeBlockAfter(TrueBlock); CalculateDeferredFlags(); - _CondJump(Cond, TrueBlock, FalseBlock); + CondJump(Cond, TrueBlock, FalseBlock); SetCurrentCodeBlock(FalseBlock); StartNewBlock(); { SetAF(0); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(TrueBlock); StartNewBlock(); @@ -3512,7 +3512,7 @@ void OpDispatchBuilder::DASOp(OpcodeArgs) { SetRFLAG(_Or(OpSize::i64Bit, CF, NewCF)); SetAF(1); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(EndBlock); StartNewBlock(); @@ -3521,13 +3521,13 @@ void OpDispatchBuilder::DASOp(OpcodeArgs) { FalseBlock = CreateNewCodeBlockAfter(GetCurrentBlock()); TrueBlock = CreateNewCodeBlockAfter(FalseBlock); EndBlock = CreateNewCodeBlockAfter(TrueBlock); - _CondJump(Cond, TrueBlock, FalseBlock); + CondJump(Cond, TrueBlock, FalseBlock); SetCurrentCodeBlock(FalseBlock); StartNewBlock(); { SetRFLAG(_Constant(0)); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(TrueBlock); StartNewBlock(); @@ -3537,7 +3537,7 @@ void OpDispatchBuilder::DASOp(OpcodeArgs) { StoreGPRRegister(X86State::REG_RAX, NewAL, 1); SetRFLAG(_Constant(1)); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(EndBlock); StartNewBlock(); @@ -3560,7 +3560,7 @@ void OpDispatchBuilder::AAAOp(OpcodeArgs) { auto FalseBlock = CreateNewCodeBlockAfter(GetCurrentBlock()); auto TrueBlock = CreateNewCodeBlockAfter(FalseBlock); auto EndBlock = CreateNewCodeBlockAfter(TrueBlock); - _CondJump(Cond, TrueBlock, FalseBlock); + CondJump(Cond, TrueBlock, FalseBlock); SetCurrentCodeBlock(FalseBlock); StartNewBlock(); @@ -3570,7 +3570,7 @@ void OpDispatchBuilder::AAAOp(OpcodeArgs) { ZeroNZCV(); SetAF(0); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(TrueBlock); StartNewBlock(); @@ -3583,7 +3583,7 @@ void OpDispatchBuilder::AAAOp(OpcodeArgs) { SetRFLAG(_Constant(1)); SetAF(1); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(EndBlock); StartNewBlock(); @@ -3600,7 +3600,7 @@ void OpDispatchBuilder::AASOp(OpcodeArgs) { auto FalseBlock = CreateNewCodeBlockAfter(GetCurrentBlock()); auto TrueBlock = CreateNewCodeBlockAfter(FalseBlock); auto EndBlock = CreateNewCodeBlockAfter(TrueBlock); - _CondJump(Cond, TrueBlock, FalseBlock); + CondJump(Cond, TrueBlock, FalseBlock); SetCurrentCodeBlock(FalseBlock); StartNewBlock(); @@ -3610,7 +3610,7 @@ void OpDispatchBuilder::AASOp(OpcodeArgs) { ZeroNZCV(); SetAF(0); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(TrueBlock); StartNewBlock(); @@ -3623,7 +3623,7 @@ void OpDispatchBuilder::AASOp(OpcodeArgs) { SetRFLAG(_Constant(1)); SetAF(1); CalculateDeferredFlags(); - _Jump(EndBlock); + Jump(EndBlock); } SetCurrentCodeBlock(EndBlock); StartNewBlock(); @@ -3991,7 +3991,7 @@ void OpDispatchBuilder::CMPSOp(OpcodeArgs) { auto SizeConst = _Constant(Size); auto PtrDir = _SubShift(IR::SizeToOpSize(CTX->GetGPRSize()), SizeConst, DF, ShiftType::LSL, FEXCore::ilog2(Size) + 1); - auto JumpStart = _Jump(); + auto JumpStart = Jump(); // Make sure to start a new block after ending this one auto LoopStart = CreateNewCodeBlockAfter(GetCurrentBlock()); SetJumpTarget(JumpStart, LoopStart); @@ -4001,11 +4001,11 @@ void OpDispatchBuilder::CMPSOp(OpcodeArgs) { OrderedNode *Counter = LoadGPRRegister(X86State::REG_RCX); // Can we end the block? - auto CondJump = _CondJump(Counter, {COND_EQ}); + auto CondJump_ = CondJump(Counter, {COND_EQ}); IRPair InternalCondJump; auto LoopTail = CreateNewCodeBlockAfter(LoopStart); - SetFalseJumpTarget(CondJump, LoopTail); + SetFalseJumpTarget(CondJump_, LoopTail); SetCurrentCodeBlock(LoopTail); StartNewBlock(); @@ -4046,7 +4046,7 @@ void OpDispatchBuilder::CMPSOp(OpcodeArgs) { OrderedNode *ZF = GetRFLAG(FEXCore::X86State::RFLAG_ZF_RAW_LOC); CalculateDeferredFlags(); - InternalCondJump = _CondJump(ZF, {REPE ? COND_NEQ : COND_EQ}); + InternalCondJump = CondJump(ZF, {REPE ? COND_NEQ : COND_EQ}); // Jump back to the start if we have more work to do SetTrueJumpTarget(InternalCondJump, LoopStart); @@ -4054,7 +4054,7 @@ void OpDispatchBuilder::CMPSOp(OpcodeArgs) { // Make sure to start a new block after ending this one auto LoopEnd = CreateNewCodeBlockAfter(LoopTail); - SetTrueJumpTarget(CondJump, LoopEnd); + SetTrueJumpTarget(CondJump_, LoopEnd); SetFalseJumpTarget(InternalCondJump, LoopEnd); @@ -4106,7 +4106,7 @@ void OpDispatchBuilder::LODSOp(OpcodeArgs) { auto SizeConst = _Constant(Size); auto PtrDir = _SubShift(IR::SizeToOpSize(CTX->GetGPRSize()), SizeConst, DF, ShiftType::LSL, FEXCore::ilog2(Size) + 1); - auto JumpStart = _Jump(); + auto JumpStart = Jump(); // Make sure to start a new block after ending this one auto LoopStart = CreateNewCodeBlockAfter(GetCurrentBlock()); SetJumpTarget(JumpStart, LoopStart); @@ -4118,10 +4118,10 @@ void OpDispatchBuilder::LODSOp(OpcodeArgs) { // Can we end the block? // We leave if RCX = 0 - auto CondJump = _CondJump(Counter, {COND_EQ}); + auto CondJump_ = CondJump(Counter, {COND_EQ}); auto LoopTail = CreateNewCodeBlockAfter(LoopStart); - SetFalseJumpTarget(CondJump, LoopTail); + SetFalseJumpTarget(CondJump_, LoopTail); SetCurrentCodeBlock(LoopTail); StartNewBlock(); @@ -4149,11 +4149,11 @@ void OpDispatchBuilder::LODSOp(OpcodeArgs) { StoreGPRRegister(X86State::REG_RSI, TailDest_RSI); // Jump back to the start, we have more work to do - _Jump(LoopStart); + Jump(LoopStart); } // Make sure to start a new block after ending this one auto LoopEnd = CreateNewCodeBlockAfter(LoopTail); - SetTrueJumpTarget(CondJump, LoopEnd); + SetTrueJumpTarget(CondJump_, LoopEnd); SetCurrentCodeBlock(LoopEnd); StartNewBlock(); } @@ -4200,7 +4200,7 @@ void OpDispatchBuilder::SCASOp(OpcodeArgs) { auto SizeConst = _Constant(Size); auto PtrDir = _SubShift(IR::SizeToOpSize(CTX->GetGPRSize()), SizeConst, DF, ShiftType::LSL, FEXCore::ilog2(Size) + 1); - auto JumpStart = _Jump(); + auto JumpStart = Jump(); // Make sure to start a new block after ending this one auto LoopStart = CreateNewCodeBlockAfter(GetCurrentBlock()); SetJumpTarget(JumpStart, LoopStart); @@ -4211,11 +4211,11 @@ void OpDispatchBuilder::SCASOp(OpcodeArgs) { // Can we end the block? // We leave if RCX = 0 - auto CondJump = _CondJump(Counter, {COND_EQ}); + auto CondJump_ = CondJump(Counter, {COND_EQ}); IRPair InternalCondJump; auto LoopTail = CreateNewCodeBlockAfter(LoopStart); - SetFalseJumpTarget(CondJump, LoopTail); + SetFalseJumpTarget(CondJump_, LoopTail); SetCurrentCodeBlock(LoopTail); StartNewBlock(); @@ -4249,14 +4249,14 @@ void OpDispatchBuilder::SCASOp(OpcodeArgs) { OrderedNode *ZF = GetRFLAG(FEXCore::X86State::RFLAG_ZF_RAW_LOC); CalculateDeferredFlags(); - InternalCondJump = _CondJump(ZF, {REPE ? COND_NEQ : COND_EQ}); + InternalCondJump = CondJump(ZF, {REPE ? COND_NEQ : COND_EQ}); // Jump back to the start if we have more work to do SetTrueJumpTarget(InternalCondJump, LoopStart); } // Make sure to start a new block after ending this one auto LoopEnd = CreateNewCodeBlockAfter(LoopTail); - SetTrueJumpTarget(CondJump, LoopEnd); + SetTrueJumpTarget(CondJump_, LoopEnd); SetFalseJumpTarget(InternalCondJump, LoopEnd); @@ -4668,21 +4668,21 @@ void OpDispatchBuilder::CMPXCHGPairOp(OpcodeArgs) { SetRFLAG(ZFResult); CalculateDeferredFlags(); - auto CondJump = _CondJump(ZFResult); + auto CondJump_ = CondJump(ZFResult); // Make sure to start a new block after ending this one auto JumpTarget = CreateNewCodeBlockAfter(GetCurrentBlock()); - SetFalseJumpTarget(CondJump, JumpTarget); + SetFalseJumpTarget(CondJump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); StoreGPRRegister(X86State::REG_RAX, Result_Lower); StoreGPRRegister(X86State::REG_RDX, Result_Upper); - auto Jump = _Jump(); + auto Jump_ = Jump(); auto NextJumpTarget = CreateNewCodeBlockAfter(JumpTarget); - SetJumpTarget(Jump, NextJumpTarget); - SetTrueJumpTarget(CondJump, NextJumpTarget); + SetJumpTarget(Jump_, NextJumpTarget); + SetTrueJumpTarget(CondJump_, NextJumpTarget); SetCurrentCodeBlock(NextJumpTarget); StartNewBlock(); } @@ -5538,9 +5538,9 @@ void OpDispatchBuilder::INTOp(OpcodeArgs) { CalculateDeferredFlags(); // If condition doesn't hold then keep going - auto CondJump = _CondJump(Flag, {COND_EQ}); + auto CondJump_ = CondJump(Flag, {COND_EQ}); auto FalseBlock = CreateNewCodeBlockAfter(GetCurrentBlock()); - SetFalseJumpTarget(CondJump, FalseBlock); + SetFalseJumpTarget(CondJump_, FalseBlock); SetCurrentCodeBlock(FalseBlock); StartNewBlock(); @@ -5550,7 +5550,7 @@ void OpDispatchBuilder::INTOp(OpcodeArgs) { // Make sure to start a new block after ending this one auto JumpTarget = CreateNewCodeBlockAfter(FalseBlock); - SetTrueJumpTarget(CondJump, JumpTarget); + SetTrueJumpTarget(CondJump_, JumpTarget); SetCurrentCodeBlock(JumpTarget); StartNewBlock(); } diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.h b/FEXCore/Source/Interface/Core/OpcodeDispatcher.h index 488001565..67da2f5b1 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.h +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.h @@ -181,7 +181,7 @@ public: _ExitFunction(RelocatedNextRIP); } else if (it != JumpTargets.end()) { - _Jump(it->second.BlockEntry); + Jump(it->second.BlockEntry); return true; } } diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp index de61a2fd7..8017b60da 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp @@ -3034,19 +3034,19 @@ void OpDispatchBuilder::XSaveOpImpl(OpcodeArgs) { const auto StoreIfFlagSet = [&](uint32_t BitIndex, auto fn, uint32_t FieldSize = 1){ OrderedNode *BitFlag = _Bfe(OpSize, FieldSize, BitIndex, Mask); - auto CondJump = _CondJump(BitFlag, {COND_NEQ}); + auto CondJump_ = CondJump(BitFlag, {COND_NEQ}); auto StoreBlock = CreateNewCodeBlockAfter(GetCurrentBlock()); - SetTrueJumpTarget(CondJump, StoreBlock); + SetTrueJumpTarget(CondJump_, StoreBlock); SetCurrentCodeBlock(StoreBlock); StartNewBlock(); { fn(); } - auto Jump = _Jump(); + auto Jump_ = Jump(); auto NextJumpTarget = CreateNewCodeBlockAfter(StoreBlock); - SetJumpTarget(Jump, NextJumpTarget); - SetFalseJumpTarget(CondJump, NextJumpTarget); + SetJumpTarget(Jump_, NextJumpTarget); + SetFalseJumpTarget(CondJump_, NextJumpTarget); SetCurrentCodeBlock(NextJumpTarget); StartNewBlock(); }; @@ -3244,26 +3244,26 @@ void OpDispatchBuilder::XRstorOpImpl(OpcodeArgs) { // to it's defined initial configuration. const auto RestoreIfFlagSetOrDefault = [&](uint32_t BitIndex, auto restore_fn, auto default_fn, uint32_t FieldSize = 1){ OrderedNode *BitFlag = _Bfe(OpSize, FieldSize, BitIndex, Mask); - auto CondJump = _CondJump(BitFlag, {COND_NEQ}); + auto CondJump_ = CondJump(BitFlag, {COND_NEQ}); auto RestoreBlock = CreateNewCodeBlockAfter(GetCurrentBlock()); - SetTrueJumpTarget(CondJump, RestoreBlock); + SetTrueJumpTarget(CondJump_, RestoreBlock); SetCurrentCodeBlock(RestoreBlock); StartNewBlock(); { restore_fn(); } - auto RestoreExitJump = _Jump(); + auto RestoreExitJump = Jump(); auto DefaultBlock = CreateNewCodeBlockAfter(RestoreBlock); auto ExitBlock = CreateNewCodeBlockAfter(DefaultBlock); SetJumpTarget(RestoreExitJump, ExitBlock); - SetFalseJumpTarget(CondJump, DefaultBlock); + SetFalseJumpTarget(CondJump_, DefaultBlock); SetCurrentCodeBlock(DefaultBlock); StartNewBlock(); { default_fn(); } - auto DefaultExitJump = _Jump(); + auto DefaultExitJump = Jump(); SetJumpTarget(DefaultExitJump, ExitBlock); SetCurrentCodeBlock(ExitBlock); StartNewBlock();