From 511729ab767a45118c73d6a82b16f1aa484311cc Mon Sep 17 00:00:00 2001 From: QQeg <78740113+QQeg@users.noreply.github.com> Date: Thu, 18 Jan 2024 00:45:08 +0800 Subject: [PATCH] arch-riscv: Fix issue when vl=0 in VectorIntMaskMacroConstructor (#715) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’ve been working on a fix for the issue #759 where ‘vd’ incorrectly stores all zeros when ‘vl’ is set to 0 in VectorIntMaskMacroConstructor. My solution seems to work, but it behaves differently from other macros when ‘vl’ = 0. Instead of pushing a ‘nop’ to ‘microops’, it pushes a micro operation that remains ineffective due to ‘vl’ being 0. --- src/arch/riscv/isa/templates/vector_arith.isa | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/arch/riscv/isa/templates/vector_arith.isa b/src/arch/riscv/isa/templates/vector_arith.isa index bce4e2c55e..12eab95246 100644 --- a/src/arch/riscv/isa/templates/vector_arith.isa +++ b/src/arch/riscv/isa/templates/vector_arith.isa @@ -1097,11 +1097,7 @@ template int32_t micro_vl = std::min(tmp_vl, micro_vlmax); StaticInstPtr microop; - if (micro_vl == 0) { - microop = new VectorNopMicroInst(_machInst); - this->microops.push_back(microop); - } - for (int i = 0; i < num_microops && micro_vl > 0; ++i) { + for (int i = 0; i < num_microops && micro_vl >= 0; ++i) { microop = new %(class_name)sMicro(_machInst, micro_vl, i); microop->setDelayedCommit(); this->microops.push_back(microop);