tests: add execution tests

all but data processing

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-09-18 18:23:52 +05:30
parent dd9dd5f116
commit fa96a4d09f
31 changed files with 2076 additions and 1265 deletions

View File

@@ -1,4 +1,4 @@
#include "cpu/utility.hh"
#include "utility.hh"
#include "util/bits.hh"
#include <bit>
@@ -102,13 +102,11 @@ eval_shift(ShiftType shift_type, uint32_t value, uint8_t amount, bool& carry) {
break;
case ShiftType::ROR:
if (amount == 0) {
bool old_carry = carry;
eval = (value >> 1) | (carry << 31);
carry = get_bit(value, 0);
eval = (value >> 1) | (old_carry << 31);
} else {
carry = get_bit(value, (amount % 32 + 31) % 32);
eval = std::rotr(value, amount);
carry = get_bit(value, (amount % 32 + 31) % 32);
}
break;
}