diff options
author | Karel Kočí <cynerd@email.cz> | 2017-12-12 18:53:02 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-12-12 18:53:02 +0100 |
commit | 15398c34d38489bf14a100bbf01fb9fb4c7e46cb (patch) | |
tree | 7121325d9ba6d1166b7faa4b8664bdcac875d995 /qtmips_machine/alu.cpp | |
parent | 36853877b262bd47417be1637a1854ae3145384e (diff) | |
download | qtmips-15398c34d38489bf14a100bbf01fb9fb4c7e46cb.tar.gz qtmips-15398c34d38489bf14a100bbf01fb9fb4c7e46cb.tar.bz2 qtmips-15398c34d38489bf14a100bbf01fb9fb4c7e46cb.zip |
Implement branch and jump instructions
Diffstat (limited to 'qtmips_machine/alu.cpp')
-rw-r--r-- | qtmips_machine/alu.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qtmips_machine/alu.cpp b/qtmips_machine/alu.cpp index 0350412..73c49e4 100644 --- a/qtmips_machine/alu.cpp +++ b/qtmips_machine/alu.cpp @@ -17,6 +17,10 @@ std::uint32_t alu_operate(enum AluOp operation, std::uint32_t s, std::uint32_t t case ALU_OP_SRAV: // TODO is this correct implementation? (Should we be masking top most bit?) return ((t & 0x7fffffff) >> s) | (t & 0x80000000); + case ALU_OP_JR: + case ALU_OP_JALR: + // Do nothing as we solve this when we are handling program counter in instruction decode (handle_pc) + return 0; case ALU_OP_MOVZ: // We do this just to implement valid alu operation but we have to evaluate comparison way before this to disable register write return t == 0 ? s : 0; |