diff options
Diffstat (limited to 'src/id.cc')
-rw-r--r-- | src/id.cc | 41 |
1 files changed, 24 insertions, 17 deletions
@@ -105,33 +105,41 @@ void ID::decode_R_type(signed int &s1) r2 = this->read_guard<signed int>( s2, this->curr_instr->operands.integer.slot_two); r3 = OK; - } else { + } else if (this->curr_instr->type == R_VECT) { r1 = this->read_guard<std::array<signed int, V_R_LIMIT>>( s1, this->curr_instr->operands.vector.slot_one); r2 = this->read_guard<std::array<signed int, V_R_LIMIT>>( s2, this->curr_instr->operands.vector.slot_two); r3 = this->set_vlen(); + } else { + // store the second field in s1, to keep execute+mem consistent + r1 = this->read_guard<std::array<signed int, V_R_LIMIT>>( + s2, this->curr_instr->operands.s_vector.slot_one); + r2 = this->read_guard<signed int>( + s1, this->curr_instr->operands.s_vector.slot_two); + r3 = this->set_vlen(); } this->status = (r1 == OK && r2 == OK && r3 == OK) ? OK : STALLED; - switch (this->curr_instr->mnemonic) { - case CMP: - case CEV: - break; - case ADDV: - case SUBV: - case MULV: - case DIVV: - case SRDL: - case SRDS: - if (this->status == OK) { + if (this->status == OK) { + switch (this->curr_instr->mnemonic) { + case CMP: + case CEV: + break; + case ADDV: + case SUBV: + case MULV: + case DIVV: this->curr_instr->operands.vector.slot_three = this->write_guard<std::array<signed int, V_R_LIMIT>>(s3); - } - break; - default: - if (this->status == OK) { + break; + case SRDL: + case SRDS: + this->curr_instr->operands.s_vector.slot_three = + this->write_guard<std::array<signed int, V_R_LIMIT>>(s3); + break; + default: this->curr_instr->operands.integer.slot_three = this->write_guard<signed int>(s3); } @@ -143,7 +151,6 @@ void ID::decode_I_type(signed int &s1) unsigned int s0b, s1b, s2b; signed int s2, s3; Response r1, r2; - Response r3 = OK; s0b = REG_SIZE; s1b = s0b + REG_SIZE; |