summaryrefslogtreecommitdiff
path: root/src/id.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-05-10 21:24:41 -0400
committerbd <bdunahu@operationnull.com>2025-05-10 21:24:41 -0400
commit2269a338f9e5ad7a29bef5ff73bbb4d72489a92e (patch)
tree84ddbe28cfe6080d368c29c71490e073e99d4d85 /src/id.cc
parent714622080d510de1591de2c689d8bd319b54f432 (diff)
Fix off-by-one in CEV equal
Diffstat (limited to 'src/id.cc')
-rw-r--r--src/id.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/id.cc b/src/id.cc
index 2645aeb..85637a6 100644
--- a/src/id.cc
+++ b/src/id.cc
@@ -52,7 +52,6 @@ void ID::get_instr_fields(signed int instr_bits)
case 0b11:
this->status = OK;
}
-
}
void ID::split_instr(signed int &raw, unsigned int &type, Mnemonic &m)
@@ -91,8 +90,7 @@ void ID::decode_R_type(signed int &s1)
{
unsigned int s0b, s1b, s2b;
signed int s2, s3;
- Response r1, r2;
- Response r3 = OK;
+ Response r1, r2, r3;
s0b = REG_SIZE;
s1b = s0b + REG_SIZE;
@@ -102,10 +100,11 @@ void ID::decode_R_type(signed int &s1)
s1 = GET_LS_BITS(s1, s0b);
if (this->curr_instr->type == SI_INT) {
- r1 = this->read_guard<signed int>(s1, s1);
- this->curr_instr->operands.integer.slot_one = s1;
- r2 = this->read_guard<signed int>(s2, s2);
- this->curr_instr->operands.integer.slot_two = s2;
+ r1 = this->read_guard<signed int>(
+ s1, this->curr_instr->operands.integer.slot_one);
+ r2 = this->read_guard<signed int>(
+ s2, this->curr_instr->operands.integer.slot_two);
+ r3 = OK;
} else {
r1 = this->read_guard<std::array<signed int, V_R_LIMIT>>(
s1, this->curr_instr->operands.vector.slot_one);