aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/alu.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-01-31 11:02:03 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-01-31 11:02:03 +0100
commiteab6cf4fc5720b330ba89c38e9e6119a8a6fabfa (patch)
treee706c645c9ee51b1a9fcbf15fee6bda870d1cd54 /qtmips_machine/alu.cpp
parent6a6bd48da1f09be7dc7c53f13393b07889eea364 (diff)
downloadqtmips-eab6cf4fc5720b330ba89c38e9e6119a8a6fabfa.tar.gz
qtmips-eab6cf4fc5720b330ba89c38e9e6119a8a6fabfa.tar.bz2
qtmips-eab6cf4fc5720b330ba89c38e9e6119a8a6fabfa.zip
Initial support for JAL.
The JR, BEQ, BNE are most probably incorrect still. There is missing forwarding for pipelined execution. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/alu.cpp')
-rw-r--r--qtmips_machine/alu.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qtmips_machine/alu.cpp b/qtmips_machine/alu.cpp
index 2e36d4c..36b1ac7 100644
--- a/qtmips_machine/alu.cpp
+++ b/qtmips_machine/alu.cpp
@@ -71,6 +71,8 @@ std::uint32_t machine::alu_operate(enum AluOp operation, std::uint32_t s, std::u
return (s < t) ? 1 : 0;
case ALU_OP_LUI:
return t << 16;
+ case ALU_OP_PASS_S: // Pass s argument without change for JAL
+ return s;
default:
throw QTMIPS_EXCEPTION(UnsupportedAluOperation, "Unknown ALU operation", QString::number(operation, 16));
}