aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/core.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-15 15:22:44 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-15 15:22:44 +0100
commitd7d9860051a9a9eb2c6f11684535ac65cce38eb8 (patch)
tree55976fdbfcac8fd34bb073258c5fc32506c11022 /qtmips_machine/core.cpp
parenta8d4f0d2c7ec70f22b1fb4a7614ebd076a2916cd (diff)
downloadqtmips-d7d9860051a9a9eb2c6f11684535ac65cce38eb8.tar.gz
qtmips-d7d9860051a9a9eb2c6f11684535ac65cce38eb8.tar.bz2
qtmips-d7d9860051a9a9eb2c6f11684535ac65cce38eb8.zip
Cleanup some todos in code
Diffstat (limited to 'qtmips_machine/core.cpp')
-rw-r--r--qtmips_machine/core.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/qtmips_machine/core.cpp b/qtmips_machine/core.cpp
index 264e871..9ca7b9d 100644
--- a/qtmips_machine/core.cpp
+++ b/qtmips_machine/core.cpp
@@ -107,8 +107,7 @@ struct Core::dtDecode Core::decode(const struct dtFetch &dt) {
emit instruction_decoded(dt.inst);
const struct DecodeMap &dec = dmap[dt.inst.opcode()];
if (!(dec.flags & DM_SUPPORTED))
- // TODO message
- throw QTMIPS_EXCEPTION(UnsupportedInstruction, "", "");
+ throw QTMIPS_EXCEPTION(UnsupportedInstruction, "Instruction with following opcode is not supported", QString::number(dt.inst.opcode(), 16));
return {
.inst = dt.inst,
@@ -122,16 +121,14 @@ struct Core::dtDecode Core::decode(const struct dtFetch &dt) {
.val_rs = regs->read_gp(dt.inst.rs()),
.val_rt = regs->read_gp(dt.inst.rt()),
};
- // TODO on jump there should be delay slot. Does processor addes it or compiler. And do we care?
}
struct Core::dtExecute Core::execute(const struct dtDecode &dt) {
emit instruction_executed(dt.inst);
// Handle conditional move (we have to change regwrite signal if conditional is not met)
- // TODO can't we do this some cleaner way?
bool regwrite = dt.regwrite;
- if (dt.inst.opcode() == 0 && ((dt.inst.funct() == 10 && dt.val_rt != 0) || (dt.inst.funct() == 11 && dt.val_rt == 0)))
+ if (dt.inst.opcode() == 0 && ((dt.inst.funct() == ALU_OP_MOVZ && dt.val_rt != 0) || (dt.inst.funct() == ALU_OP_MOVN && dt.val_rt == 0)))
regwrite = false;
std::uint32_t alu_sec = dt.val_rt;