From 43588597069587f6846a7d64a1957435bec5429d Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 11 May 2025 22:04:46 -0400 Subject: Add ROTV instruction --- src/ex.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ex.cc') diff --git a/src/ex.cc b/src/ex.cc index 22cd092..f36ea4b 100644 --- a/src/ex.cc +++ b/src/ex.cc @@ -249,6 +249,13 @@ void EX::handle_s_vector_operations( unsigned int i, inc1, inc2; switch (m) { + case ROTV: + s2 = s2 % v_len; + if (s2 < 0) + s2 += v_len; + + std::rotate(s1.begin(), s1.begin() + s2, s1.begin() + v_len); + break; case SRDL: case SRDS: inc1 = s1[0]; @@ -286,7 +293,6 @@ void EX::advance_helper() handle_s_vector_operations( this->curr_instr->operands.s_vector.slot_one, this->curr_instr->operands.s_vector.slot_two, m, v_len_or_pc); - printArray(this->curr_instr->operands.s_vector.slot_three); } this->status = OK; -- cgit v1.2.3