summaryrefslogtreecommitdiff
path: root/src/id.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-05-11 13:08:16 -0400
committerbd <bdunahu@operationnull.com>2025-05-11 13:08:16 -0400
commit79a68cabb033530871a1dab259149480584b2586 (patch)
tree0d59680dba627eec789984ef265fc20f8e6b88c8 /src/id.cc
parent5326509d842c038a2d4f7dcf11fcadf960e437dd (diff)
Add I_VECT field type for SRDL, SRDS, with two vector reg 1 general
Diffstat (limited to 'src/id.cc')
-rw-r--r--src/id.cc41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/id.cc b/src/id.cc
index 3c974e9..12f509f 100644
--- a/src/id.cc
+++ b/src/id.cc
@@ -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;