Fix V amd C flags for DPI subs instruction
This commit is contained in:
parent
460b19aaf4
commit
c2844ce0ec
@ -134,8 +134,8 @@ static void executeDPImmediate(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 = srcVal < result;
|
state->conditionCodes.Overflow = getMSB(srcVal, regType) != getMSB(arithmImm, regType) && getMSB(arithmImm, regType) == getMSB(result, regType);
|
||||||
state->conditionCodes.Carry = state->conditionCodes.Overflow;
|
state->conditionCodes.Carry = srcVal >= arithmImm;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case(a64inst_SUB):
|
case(a64inst_SUB):
|
||||||
@ -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 = getMSB(src1Val, regType) != getMSB(src2Val, regType) && getMSB(src1Val, regType) != getMSB(result, regType);
|
state->conditionCodes.Overflow = getMSB(src1Val, regType) != getMSB(src2Val, regType) && getMSB(src2Val, regType) == getMSB(result, regType);
|
||||||
state->conditionCodes.Carry = src1Val >= src2Val;
|
state->conditionCodes.Carry = src1Val >= src2Val;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user