From f4a5db14436ddbb2820c0abefcb34e5482105a12 Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 8 May 2025 19:44:23 -0400 Subject: Move is_logical_type and is_vector_type to instr.h --- inc/stage.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'inc/stage.h') diff --git a/inc/stage.h b/inc/stage.h index 4e0c252..1afb8e5 100644 --- a/inc/stage.h +++ b/inc/stage.h @@ -83,10 +83,6 @@ class Stage */ static std::deque checked_out; - bool is_vector_type(Mnemonic m); - - bool is_logical(Mnemonic m); - protected: /** * The function expected to do the majority of the work. -- cgit v1.2.3 From a08582325ef39cb5dc1bbe14043b756b111899b1 Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 10 May 2025 15:07:58 -0400 Subject: Fix tests to use correct register indexes with vector addition --- inc/stage.h | 2 +- tests/id.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'inc/stage.h') diff --git a/inc/stage.h b/inc/stage.h index 1afb8e5..834b941 100644 --- a/inc/stage.h +++ b/inc/stage.h @@ -136,7 +136,7 @@ class Stage } else if constexpr (std::is_same_v>) { if (v < GPR_NUM || v >= GPR_NUM + V_NUM) { - throw std::out_of_range("Invalid vector register index"); + throw std::out_of_range("Invalid VRS index"); } return vrs[v % GPR_NUM]; } diff --git a/tests/id.cc b/tests/id.cc index a81e967..ca10677 100644 --- a/tests/id.cc +++ b/tests/id.cc @@ -118,7 +118,7 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary r-type # two", "[id]") signed int t; InstrDTO *i; - t = this->encode_R_type(0b10000, 0b01000, 0b00100, 0b10, 0b0); + t = this->encode_R_type(0b1000, 0b01000, 0b00100, 0b10, 0b0); i = this->decode_bits(t); CHECK(i->operands.integer.slot_one == 0x00000000); // registers are empty @@ -150,7 +150,7 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary i-type # two", "[id]") signed int t; InstrDTO *i; - t = this->encode_I_type(0xCC, 0b101, 0b110, 0b1011, 0b1); + t = this->encode_I_type(0xCC, 0b10101, 0b00110, 0b11011, 0b1); i = this->decode_bits(t); CHECK(i->operands.integer.slot_one == 0x00000000); // registers are empty @@ -166,7 +166,7 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary j-type # one", "[id]") signed int t; InstrDTO *i; - t = this->encode_J_type(0x3456, 0b10101, 0b0111, 0b10); + t = this->encode_J_type(0x3456, 0b101, 0b0111, 0b10); i = this->decode_bits(t); CHECK(i->operands.integer.slot_one == 0x00000000); // registers are empty @@ -181,7 +181,7 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary j-type # two", "[id]") signed int t; InstrDTO *i; - t = this->encode_J_type(0xBBCCF, 0b10101, 0b0011, 0b10); + t = this->encode_J_type(0xBBCCF, 0b00101, 0b0011, 0b10); i = this->decode_bits(t); t = 0xFFFBBCCF; -- cgit v1.2.3