1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-27 18:55:48 +00:00

Update CMPM, CMPI.

This commit is contained in:
Thomas Harte 2022-04-25 09:39:22 -04:00
parent f5ea5c26a3
commit dda0c0e097

View File

@ -271,6 +271,14 @@ template <uint8_t op> uint32_t Predecoder<model>::invalid_operands() {
AllModesNoAn
>::value;
case CMPIb: case CMPIl: case CMPIw:
if constexpr (model == Model::M68000) {
return ~TwoOperandMask<
Imm,
Dn | Ind | PostInc | PreDec | d16An | d8AnXn | XXXw | XXXl
>::value;
}
[[fallthrough]];
case BTSTI:
return ~TwoOperandMask<
Imm,
@ -288,6 +296,13 @@ template <uint8_t op> uint32_t Predecoder<model>::invalid_operands() {
AllModes,
An
>::value;
case CMPMb: case CMPMw: case CMPMl:
return ~TwoOperandMask<
PostInc,
PostInc
>::value;
}
}
@ -327,6 +342,8 @@ template <uint8_t op, bool validate> Preinstruction Predecoder<model>::validated
case OpT(Operation::CLRb): case OpT(Operation::CLRw): case OpT(Operation::CLRl):
case OpT(Operation::CMPb): case OpT(Operation::CMPw): case OpT(Operation::CMPl):
case OpT(Operation::CMPAw): case OpT(Operation::CMPAl):
case CMPIb: case CMPIl: case CMPIw:
case CMPMb: case CMPMw: case CMPMl:
case OpT(Operation::NBCD): {
const auto invalid = invalid_operands<op>();
const auto observed = operand_mask(original);
@ -371,23 +388,6 @@ template <uint8_t op, bool validate> Preinstruction Predecoder<model>::validated
return Preinstruction();
}
case CMPIb: case CMPIl: case CMPIw:
switch(original.mode<1>()) {
default: return original;
case AddressingMode::ProgramCounterIndirectWithDisplacement:
case AddressingMode::ProgramCounterIndirectWithIndex8bitDisplacement:
if constexpr (model >= Model::M68010) {
return original;
}
[[fallthrough]];
case AddressingMode::AddressRegisterDirect:
case AddressingMode::ImmediateData:
case AddressingMode::None:
return Preinstruction();
}
// ADD, SUB, MOVE, MOVEA
case SUBQb: case SUBQw: case SUBQl:
case OpT(Operation::MOVEb): case OpT(Operation::MOVEw): case OpT(Operation::MOVEl):