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

Fix SUB. SBB still failing.

This commit is contained in:
Thomas Harte 2023-10-09 16:30:47 -04:00
parent 67d364cc89
commit 58aa1da649
2 changed files with 7 additions and 5 deletions

View File

@ -172,7 +172,7 @@ template <typename IntT> constexpr int bit_size() {
/// and the result was @c result. All other bits will be clear.
template <bool is_add, typename IntT>
IntT overflow(IntT lhs, IntT rhs, IntT result) {
const IntT output_changed = result ^ rhs;
const IntT output_changed = result ^ lhs;
const IntT input_differed = lhs ^ rhs;
if constexpr (is_add) {
@ -181,6 +181,8 @@ IntT overflow(IntT lhs, IntT rhs, IntT result) {
return top_bit<IntT>() & output_changed & input_differed;
}
}
// NOTE TO FUTURE SELF: the original 68k `overflow` treats lhs and rhs the other way
// around, affecting subtractive overflow. Be careful.
//
// END COPY AND PASTE SECTION.

View File

@ -304,12 +304,12 @@ struct FailedExecution {
// @"80.0.json.gz", @"81.0.json.gz", @"83.0.json.gz",
// SBB
// @"18.json.gz", @"19.json.gz", @"1A.json.gz", @"1B.json.gz", @"1C.json.gz", @"1D.json.gz",
// @"80.3.json.gz", @"81.3.json.gz", @"83.3.json.gz",
@"18.json.gz", @"19.json.gz", @"1A.json.gz", @"1B.json.gz", @"1C.json.gz", @"1D.json.gz",
@"80.3.json.gz", @"81.3.json.gz", @"83.3.json.gz",
// SUB
@"28.json.gz", //@"29.json.gz", @"2A.json.gz", @"2B.json.gz", @"2C.json.gz", @"2D.json.gz",
// @"80.5.json.gz", @"81.5.json.gz", @"83.5.json.gz",
@"28.json.gz", @"29.json.gz", @"2A.json.gz", @"2B.json.gz", @"2C.json.gz", @"2D.json.gz",
@"80.5.json.gz", @"81.5.json.gz", @"83.5.json.gz",
// AND
// @"20.json.gz", @"21.json.gz", @"22.json.gz", @"23.json.gz", @"24.json.gz", @"25.json.gz",