1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Fix ASL overflow test.

This commit is contained in:
Thomas Harte 2022-10-18 22:43:17 -04:00
parent d09473b66f
commit 979bf42541

View File

@ -359,7 +359,9 @@ template <Operation operation, typename IntT, typename FlowController> void shif
} else {
// For a shift of n places, overflow will be set if the top n bits were not
// all the same value.
const auto affected_bits = IntT(~0 << shift);
const auto affected_bits = IntT(
~((top_bit<IntT>() >> shift) - 1)
);
status.overflow_flag = (destination & affected_bits) && (destination & affected_bits) != affected_bits;
}
}