1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Change mind about carry behaviour.

This commit is contained in:
Thomas Harte 2024-04-01 21:38:44 -04:00
parent 7de92a9457
commit 7c9715f00c

View File

@ -120,13 +120,8 @@ struct Executor {
operand2 = fields.immediate(); operand2 = fields.immediate();
if(fields.rotate()) { if(fields.rotate()) {
shift<ShiftType::RotateRight, shift_sets_carry>(operand2, fields.rotate(), rotate_carry); shift<ShiftType::RotateRight, shift_sets_carry>(operand2, fields.rotate(), rotate_carry);
} else {
// This is possibly clarified by later data sheets; take carry as if a rotate by 32
// had occurred.
if constexpr (shift_sets_carry) {
rotate_carry = operand2 & 0x8000'0000;
}
} }
// Complete guess: carry is unaffected by an immediate value that doesn't rotate.
} else { } else {
operand2 = decode_shift<true, shift_sets_carry>(fields, rotate_carry, shift_by_register ? 8 : 4); operand2 = decode_shift<true, shift_sets_carry>(fields, rotate_carry, shift_by_register ? 8 : 4);
} }