summaryrefslogtreecommitdiff
path: root/src/wb.cc
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-05-11 23:39:06 -0400
committerGitHub <noreply@github.com>2025-05-11 23:39:06 -0400
commitf02bea04284d33a2d014f636baa6a861b73f6c41 (patch)
treece89a55af60b01f6b4129d7539d07c08bfaa1b9a /src/wb.cc
parenta35eb451889f0efa99ff7fe1c0a3a76afd5e7ad5 (diff)
parent43588597069587f6846a7d64a1957435bec5429d (diff)
Merge pull request #79 from bdunahu/bdunahuHEADmaster
Replace LOADV, STOREV, with strided load (SRDL), strided store (SRDS), add vector rotate (ROTV)
Diffstat (limited to 'src/wb.cc')
-rw-r--r--src/wb.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/wb.cc b/src/wb.cc
index bfdbc3a..7320f4f 100644
--- a/src/wb.cc
+++ b/src/wb.cc
@@ -58,15 +58,11 @@ void WB::write_handler()
this->store_register<signed int>(
reg, this->curr_instr->operands.integer.slot_one);
break;
+ case S_VECT:
case R_VECT:
this->store_register<std::array<signed int, V_R_LIMIT>>(
reg, this->copy_extra_vector_elements());
break;
- case I_VECT:
- this->store_register<std::array<signed int, V_R_LIMIT>>(
- reg, this->curr_instr->operands.i_vector.slot_three);
- // todo, use copy_extra_vector_elements
- break;
}
}
@@ -97,6 +93,13 @@ std::array<signed int, V_R_LIMIT> WB::copy_extra_vector_elements()
int i;
std::array<signed int, V_R_LIMIT> v;
+ if (this->curr_instr->type == R_VECT) {
+ if (this->curr_instr->slot_B == 0) {
+ v = {0};
+ return v;
+ }
+ }
+
v = this->curr_instr->operands.vector.slot_one;
for (i = V_R_LIMIT - 1; i >= this->curr_instr->slot_B; --i) {
v[i] = this->curr_instr->operands.vector.slot_three[i];