diff options
author | Karel Kočí <cynerd@email.cz> | 2018-02-16 16:24:35 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-03-06 21:58:49 +0100 |
commit | 1a20d908b6eefe32807f906b7294c562256a7518 (patch) | |
tree | 38cd063d902767d637b65426eecff538c9233672 /qtmips_machine/instruction.h | |
parent | a56b25212865c57251719a1d4a5d9d6a79b339c5 (diff) | |
download | qtmips-1a20d908b6eefe32807f906b7294c562256a7518.tar.gz qtmips-1a20d908b6eefe32807f906b7294c562256a7518.tar.bz2 qtmips-1a20d908b6eefe32807f906b7294c562256a7518.zip |
Fix forwarding checker for I and J and S* instructions
THere are exceptions when we care about forwarding and when we don't.
Diffstat (limited to 'qtmips_machine/instruction.h')
-rw-r--r-- | qtmips_machine/instruction.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qtmips_machine/instruction.h b/qtmips_machine/instruction.h index d84b0cb..1e44a1a 100644 --- a/qtmips_machine/instruction.h +++ b/qtmips_machine/instruction.h @@ -15,6 +15,13 @@ public: Instruction(std::uint8_t opcode, std::uint32_t address); // Type J Instruction(const Instruction&); + enum Type { + T_R, + T_I, + T_J, + T_UNKNOWN + }; + std::uint8_t opcode() const; std::uint8_t rs() const; std::uint8_t rt() const; @@ -24,6 +31,8 @@ public: std::uint16_t immediate() const; std::uint32_t address() const; std::uint32_t data() const; + enum Type type() const; + bool is_store() const; // Store instructions requires some additional handling so identify them bool operator==(const Instruction &c) const; bool operator!=(const Instruction &c) const; |