Fix Overflow handling in Subtraction DP Register, w/ T

This commit is contained in:
sBubshait 2024-06-06 00:47:06 +01:00
parent 95c74964b3
commit d73111515e

View File

@ -262,7 +262,7 @@ static void executeDPRegister(Machine *state, a64inst_instruction *inst) {
writeRegister(state, dest, regType, result); writeRegister(state, dest, regType, result);
updateCondNZ(state, result, regType); updateCondNZ(state, result, regType);
state->conditionCodes.Overflow = src1Val < result; state->conditionCodes.Overflow = getMSB(src1Val, regType) != getMSB(src2Val, regType) && getMSB(src1Val, regType) != getMSB(result, regType);
state->conditionCodes.Carry = src1Val >= src2Val; state->conditionCodes.Carry = src1Val >= src2Val;
break; break;