mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-21 23:31:24 +00:00
OpcodeDispatcher: Add jump wrappers
These should always be used in the dispatcher rather than the raw jumps they translate to, as they ensure that flags are flushed. Eliminates a class of bugs that will become a lot easier to hit with the new nzcv work. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
parent
bbad06f81a
commit
367e1658ad
@ -135,6 +135,27 @@ public:
|
||||
ClearCachedNamedConstants();
|
||||
}
|
||||
|
||||
IRPair<IROp_Jump> Jump() {
|
||||
CalculateDeferredFlags();
|
||||
return _Jump();
|
||||
}
|
||||
IRPair<IROp_Jump> Jump(OrderedNode *_TargetBlock) {
|
||||
CalculateDeferredFlags();
|
||||
return _Jump(_TargetBlock);
|
||||
}
|
||||
IRPair<IROp_CondJump> CondJump(OrderedNode *_Cmp1, OrderedNode *_Cmp2, OrderedNode *_TrueBlock, OrderedNode *_FalseBlock, CondClassType _Cond = {COND_NEQ}, uint8_t _CompareSize = 0) {
|
||||
CalculateDeferredFlags();
|
||||
return _CondJump(_Cmp1, _Cmp2, _TrueBlock, _FalseBlock, _Cond, _CompareSize);
|
||||
}
|
||||
IRPair<IROp_CondJump> CondJump(OrderedNode *ssa0, CondClassType cond = {COND_NEQ}) {
|
||||
CalculateDeferredFlags();
|
||||
return _CondJump(ssa0, cond);
|
||||
}
|
||||
IRPair<IROp_CondJump> CondJump(OrderedNode *ssa0, OrderedNode *ssa1, OrderedNode *ssa2, CondClassType cond = {COND_NEQ}) {
|
||||
CalculateDeferredFlags();
|
||||
return _CondJump(ssa0, ssa1, ssa2, cond);
|
||||
}
|
||||
|
||||
bool FinishOp(uint64_t NextRIP, bool LastOp) {
|
||||
// If we are switching to a new block and this current block has yet to set a RIP
|
||||
// Then we need to insert an unconditional jump from the current block to the one we are going to
|
||||
|
Loading…
x
Reference in New Issue
Block a user