diff options
author | bd <bdunahu@operationnull.com> | 2025-03-30 20:08:59 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-30 20:08:59 -0400 |
commit | 4e0d121beed51c75221ef883e0fd7ec7b0ec24f2 (patch) | |
tree | f5acda502230f630117e5f82ec52e4ce324bb734 /src/sim/ex.cc | |
parent | ea5ce07be45c1a2d953e44ac122fbc96d18fc658 (diff) |
Implementation and tests for J types
Diffstat (limited to 'src/sim/ex.cc')
-rw-r--r-- | src/sim/ex.cc | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/src/sim/ex.cc b/src/sim/ex.cc index b4e86ac..b043eb3 100644 --- a/src/sim/ex.cc +++ b/src/sim/ex.cc @@ -227,23 +227,50 @@ EX::EX(Stage *stage) : Stage(stage) }), /* J type instructions */ - INIT_INSTRUCTION(JMP, {}), + INIT_INSTRUCTION( + JMP, + { + s1 = s1 + s2; + (void)this; + }), - INIT_INSTRUCTION(JRL, {}), + INIT_INSTRUCTION( + JRL, + { + s1 = this->pc + s2; + (void)this; + }), - INIT_INSTRUCTION(JAL, {}), + INIT_INSTRUCTION( + JAL, + { + s1 = s1 + s2; + (void)this; + }), - INIT_INSTRUCTION(BEQ, {}), + INIT_INSTRUCTION(BEQ, { s1 = this->pc + s2; }), - INIT_INSTRUCTION(BGT, {}), + INIT_INSTRUCTION(BGT, { s1 = this->pc + s2; }), - INIT_INSTRUCTION(BUF, {}), + INIT_INSTRUCTION(BUF, { s1 = this->pc + s2; }), - INIT_INSTRUCTION(BOF, {}), + INIT_INSTRUCTION(BOF, { s1 = this->pc + s2; }), - INIT_INSTRUCTION(PUSH, {}), + INIT_INSTRUCTION( + PUSH, + { + (void)s2; + (void)s1; + (void)this; + }), - INIT_INSTRUCTION(POP, {}), + INIT_INSTRUCTION( + POP, + { + (void)s2; + (void)s1; + (void)this; + }), /* NOP */ INIT_INSTRUCTION( |