1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-21 21:33:54 +00:00

Fix MUL ambiguity.

This commit is contained in:
Thomas Harte 2024-03-07 11:45:39 -05:00
parent d380cecdb7
commit 15ee84b2eb
2 changed files with 9 additions and 7 deletions

View File

@ -408,13 +408,9 @@ struct OperationMapper {
// page references are provided were more detailed versions of the
// decoding are depicted.
// Data processing; cf. p.17.
if constexpr (((partial >> 26) & 0b11) == 0b00) {
scheduler.template perform<i>(DataProcessing(instruction));
return;
}
// Multiply and multiply-accumulate (MUL, MLA); cf. p.23.
//
// This usurps a potential data processing decoding, so needs priority.
if constexpr (((partial >> 22) & 0b111'111) == 0b000'000) {
// This implementation provides only eight bits baked into the template parameters so
// an additional dynamic test is required to check whether this is really, really MUL or MLA.
@ -424,6 +420,12 @@ struct OperationMapper {
}
}
// Data processing; cf. p.17.
if constexpr (((partial >> 26) & 0b11) == 0b00) {
scheduler.template perform<i>(DataProcessing(instruction));
return;
}
// Single data transfer (LDR, STR); cf. p.25.
if constexpr (((partial >> 26) & 0b11) == 0b01) {
scheduler.template perform<i>(SingleDataTransfer(instruction));

View File

@ -702,7 +702,7 @@ class ConcreteMachine:
static bool log = false;
if(log) {
logger.info().append("%08x: %08x [r14:%08x]", executor_.pc(), instruction, executor_.registers()[14]);
logger.info().append("%08x: %08x [r0:%08x]", executor_.pc(), instruction, executor_.registers()[0]);
}
InstructionSet::ARM::execute<arm_model>(instruction, executor_);
}