1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-08-09 05:25:01 +00:00

Update DBcc, DIVU/DIVS, EOR.

This commit is contained in:
Thomas Harte
2022-04-25 09:49:18 -04:00
parent dda0c0e097
commit 27f8db6e8b

View File

@@ -254,12 +254,14 @@ template <uint8_t op> uint32_t Predecoder<model>::invalid_operands() {
case OpT(Operation::BCHG): case OpT(Operation::BCHG):
case OpT(Operation::BCLR): case OpT(Operation::BCLR):
case OpT(Operation::BSET): case OpT(Operation::BSET):
case OpT(Operation::EORb): case OpT(Operation::EORw): case OpT(Operation::EORl):
return ~TwoOperandMask< return ~TwoOperandMask<
Dn, Dn,
AlterableAddressingModesNoAn AlterableAddressingModesNoAn
>::value; >::value;
case BCHGI: case BCLRI: case BSETI: case BCHGI: case BCLRI: case BSETI:
case EORIb: case EORIw: case EORIl:
return ~TwoOperandMask< return ~TwoOperandMask<
Imm, Imm,
AlterableAddressingModesNoAn AlterableAddressingModesNoAn
@@ -291,7 +293,7 @@ template <uint8_t op> uint32_t Predecoder<model>::invalid_operands() {
AlterableAddressingModesNoAn AlterableAddressingModesNoAn
>::value; >::value;
case OpT(Operation::CMPAw): case OpT(Operation::CMPAl): case OpT(Operation::CMPAw): case OpT(Operation::CMPAl):
return ~TwoOperandMask< return ~TwoOperandMask<
AllModes, AllModes,
An An
@@ -303,6 +305,17 @@ template <uint8_t op> uint32_t Predecoder<model>::invalid_operands() {
PostInc PostInc
>::value; >::value;
case OpT(Operation::DBcc):
return ~TwoOperandMask<
Dn,
Imm
>::value;
case OpT(Operation::DIVU): case OpT(Operation::DIVS):
return ~TwoOperandMask<
AllModesNoAn,
Dn
>::value;
} }
} }
@@ -344,6 +357,10 @@ template <uint8_t op, bool validate> Preinstruction Predecoder<model>::validated
case OpT(Operation::CMPAw): case OpT(Operation::CMPAl): case OpT(Operation::CMPAw): case OpT(Operation::CMPAl):
case CMPIb: case CMPIl: case CMPIw: case CMPIb: case CMPIl: case CMPIw:
case CMPMb: case CMPMw: case CMPMl: case CMPMb: case CMPMw: case CMPMl:
case OpT(Operation::DBcc):
case OpT(Operation::DIVS): case OpT(Operation::DIVU):
case OpT(Operation::EORb): case OpT(Operation::EORw): case OpT(Operation::EORl):
case EORIb: case EORIw: case EORIl:
case OpT(Operation::NBCD): { case OpT(Operation::NBCD): {
const auto invalid = invalid_operands<op>(); const auto invalid = invalid_operands<op>();
const auto observed = operand_mask(original); const auto observed = operand_mask(original);
@@ -374,7 +391,6 @@ template <uint8_t op, bool validate> Preinstruction Predecoder<model>::validated
} }
// The various immediates. // The various immediates.
case EORIb: case EORIl: case EORIw:
case ORIb: case ORIl: case ORIw: case ORIb: case ORIl: case ORIw:
case SUBIb: case SUBIl: case SUBIw: case SUBIb: case SUBIl: case SUBIw:
switch(original.mode<1>()) { switch(original.mode<1>()) {
@@ -392,7 +408,6 @@ template <uint8_t op, bool validate> Preinstruction Predecoder<model>::validated
case SUBQb: case SUBQw: case SUBQl: case SUBQb: case SUBQw: case SUBQl:
case OpT(Operation::MOVEb): case OpT(Operation::MOVEw): case OpT(Operation::MOVEl): case OpT(Operation::MOVEb): case OpT(Operation::MOVEw): case OpT(Operation::MOVEl):
case OpT(Operation::MOVEAw): case OpT(Operation::MOVEAl): case OpT(Operation::MOVEAw): case OpT(Operation::MOVEAl):
case OpT(Operation::EORb): case OpT(Operation::EORw): case OpT(Operation::EORl):
case OpT(Operation::ORb): case OpT(Operation::ORw): case OpT(Operation::ORl): { case OpT(Operation::ORb): case OpT(Operation::ORw): case OpT(Operation::ORl): {
// TODO: I'm going to need get-size-by-operation elsewhere; use that here when implemented. // TODO: I'm going to need get-size-by-operation elsewhere; use that here when implemented.
constexpr bool is_byte = constexpr bool is_byte =
@@ -635,7 +650,6 @@ template <uint8_t op, bool validate> Preinstruction Predecoder<model>::validated
return Preinstruction(); return Preinstruction();
} }
case OpT(Operation::DIVU): case OpT(Operation::DIVS):
case OpT(Operation::MULU): case OpT(Operation::MULS): case OpT(Operation::MULU): case OpT(Operation::MULS):
switch(original.mode<0>()) { switch(original.mode<0>()) {
default: return original; default: return original;