OpcodeDispatcher: add IncrementByCarry helper

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig 2024-08-10 12:54:14 -04:00
parent 3b8cd44ca4
commit a4545f493e
2 changed files with 7 additions and 0 deletions

View File

@ -2300,6 +2300,8 @@ private:
void CalculatePF(Ref Res);
void CalculateAF(Ref Src1, Ref Src2);
Ref IncrementByCarry(OpSize OpSize, Ref Src);
void CalculateOF(uint8_t SrcSize, Ref Res, Ref Src1, Ref Src2, bool Sub);
Ref CalculateFlags_ADC(uint8_t SrcSize, Ref Src1, Ref Src2);
Ref CalculateFlags_SBB(uint8_t SrcSize, Ref Src1, Ref Src2);

View File

@ -270,6 +270,11 @@ void OpDispatchBuilder::CalculateDeferredFlags() {
NZCVDirty = false;
}
Ref OpDispatchBuilder::IncrementByCarry(OpSize OpSize, Ref Src) {
RectifyCarryInvert(false);
return _Adc(OpSize, _Constant(0), Src);
}
Ref OpDispatchBuilder::CalculateFlags_ADC(uint8_t SrcSize, Ref Src1, Ref Src2) {
auto Zero = _Constant(0);
auto One = _Constant(1);