1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Eliminate redundant CMPSD, CDQ, CWDE.

Also removes IBTS for now, as I'm unclear where it should sit in the opcode map.
This commit is contained in:
Thomas Harte 2022-03-12 12:24:44 -05:00
parent fd4f85eb19
commit 1725894fe9
2 changed files with 9 additions and 14 deletions

View File

@ -301,7 +301,7 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
case 0x96: Complete(XCHG, eAX, eSI, data_size_); break;
case 0x97: Complete(XCHG, eAX, eDI, data_size_); break;
case 0x98: Complete(CBW, eAX, AH, DataSize::Byte); break;
case 0x98: Complete(CBW, eAX, AH, data_size_); break;
case 0x99: Complete(CWD, eAX, eDX, data_size_); break;
case 0x9a: Far(CALLfar); break;
case 0x9b: Complete(WAIT, None, None, DataSize::None); break;
@ -823,7 +823,9 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
default: undefined();
case 0: operation_ = Operation::SGDT; break;
case 1: operation_ = Operation::SIDT; break;
case 2: operation_ = Operation::LGDT; break;
case 3: operation_ = Operation::LIDT; break;
case 4: operation_ = Operation::SMSW; break;
case 6: operation_ = Operation::LMSW; break;
}

View File

@ -42,9 +42,13 @@ enum class Operation: uint8_t {
/// Decimal adjust after subtraction; source and destination will be AL.
DAS,
/// Convert byte into word; source will be AL, destination will be AH.
/// If data size is word, convert byte into word; source will be AL, destination will be AH.
/// If data size is DWord, convert word to dword; AX will be expanded to fill EAX.
/// In both cases, conversion will be by sign extension.
CBW,
/// Convert word to double word; source will be AX and destination will be DX.
/// If data size is Word, converts word to double word; source will be AX and destination will be DX.
/// If data size is DWord, converts double word to quad word (i.e. CDW); source will be EAX and destination will be EDX:EAX.
/// In both cases, conversion will be by sign extension.
CWD,
/// Escape, for a coprocessor; perform the bus cycles necessary to read the source and destination and perform a NOP.
@ -310,17 +314,6 @@ enum class Operation: uint8_t {
/// Bit test and set.
BTS,
/// Compare string double word.
CMPSD,
/// [Early 80386s only] Insert bit string.
IBTS,
/// Convert dword to qword; fills EDX with the sign bit of EAX.
CDQ,
/// Convert word to dword; AX will be expanded to fill EAX.
/// Compare and contrast to CWD which would expand AX to DX:AX.
CWDE,
/// Move from the source to the destination, extending the source with zeros.
/// The instruction data size dictates the size of the source; the destination will
/// be either 16- or 32-bit depending on the current processor operating mode.