1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-17 06:29:28 +00:00

The test set doesn't seem to do word rotation.

This commit is contained in:
Thomas Harte 2024-03-10 22:40:37 -04:00
parent ccdd340c9a
commit bd62228cc6
2 changed files with 17 additions and 8 deletions

View File

@ -313,13 +313,18 @@ struct Executor {
} else {
did_read = bus.template read<uint32_t>(address, value, registers_.mode(), trans);
// "An address offset from a word boundary will cause the data to be rotated into the
// register so that the addressed byte occuplies bits 0 to 7."
switch(address & 3) {
case 0: break;
case 1: value = (value >> 8) | (value << 24); break;
case 2: value = (value >> 16) | (value << 16); break;
case 3: value = (value >> 24) | (value << 8); break;
if constexpr (model != Model::ARMv2with32bitAddressing) {
// "An address offset from a word boundary will cause the data to be rotated into the
// register so that the addressed byte occuplies bits 0 to 7."
//
// (though the test set that inspired 'ARMv2with32bitAddressing' appears not to honour this;
// test below assumes it went away by the version of ARM that set supports)
switch(address & 3) {
case 0: break;
case 1: value = (value >> 8) | (value << 24); break;
case 2: value = (value >> 16) | (value << 16); break;
case 3: value = (value >> 24) | (value << 8); break;
}
}
}

View File

@ -381,6 +381,7 @@ struct MemoryLedger {
}
uint32_t r15_mask = 0xffff'ffff;
bool ignore_test = false;
switch(instruction) {
case 0x03110002:
// tsteq r1, #2; per my reading this is LSL#0 so the original
@ -395,7 +396,7 @@ struct MemoryLedger {
// sheet specifically says for a shift-by-register that
// "LSL by more than 32 has result zero, carry out zero" so I think
// the test set is adrift on the following:
if(test_count == 15) continue;
ignore_test = test_count == 15 - 1;
break;
case 0xe090e00f:
@ -422,6 +423,9 @@ struct MemoryLedger {
} else {
// Execute test and compare.
++test_count;
if(ignore_test) {
continue;
}
if(instruction == 0xe4931000 && test_count == 3) {
printf("");