Simplified extension check

This commit is contained in:
Màrius Montón 2021-07-04 22:46:41 +02:00
parent 5f47a8a906
commit 34a8f66035
1 changed files with 9 additions and 12 deletions

View File

@ -18,8 +18,6 @@ extension_t Instruction::check_extension() const {
return M_EXTENSION; return M_EXTENSION;
} else if ((m_instr & 0x0000007F) == 0b0101111) { } else if ((m_instr & 0x0000007F) == 0b0101111) {
return A_EXTENSION; return A_EXTENSION;
} else if ((m_instr & 0x00000003) == 0b11) {
return BASE_EXTENSION;
} else if ((m_instr & 0x00000003) == 0b00) { } else if ((m_instr & 0x00000003) == 0b00) {
return C_EXTENSION; return C_EXTENSION;
} else if ((m_instr & 0x00000003) == 0b01) { } else if ((m_instr & 0x00000003) == 0b01) {
@ -27,8 +25,7 @@ extension_t Instruction::check_extension() const {
} else if ((m_instr & 0x00000003) == 0b10) { } else if ((m_instr & 0x00000003) == 0b10) {
return C_EXTENSION; return C_EXTENSION;
} else { } else {
std::cout << "Unknown\n"; return BASE_EXTENSION;
return UNKNOWN_EXTENSION;
} }
} }