OpcodeDispatcher: optimize IncrementByCarry

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig 2024-08-10 11:49:42 -04:00
parent 8eac3198b6
commit 34301319bf

View File

@ -271,8 +271,9 @@ void OpDispatchBuilder::CalculateDeferredFlags() {
}
Ref OpDispatchBuilder::IncrementByCarry(OpSize OpSize, Ref Src) {
RectifyCarryInvert(false);
return _Adc(OpSize, _Constant(0), Src);
// If CF not inverted, we use .cc since the increment happens when the
// condition is false. If CF inverted, invert to use .cs. A bit mindbendy.
return _NZCVSelectIncrement(OpSize, {CFInverted ? COND_UGE : COND_ULT}, Src, Src);
}
Ref OpDispatchBuilder::CalculateFlags_ADC(uint8_t SrcSize, Ref Src1, Ref Src2) {