From 85059a369ecd1fcaab203a68b429be062e482b3b Mon Sep 17 00:00:00 2001 From: Chong-Teng Wang <78740113+QQeg@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:29:05 +0800 Subject: [PATCH] arch-riscv: Fix control flow in VectorFloatMaskMacroConstructor (#844) This commit adjusts the logic in VectorFloatMaskMacroConstructor to ensure the %(copy_old_vd)s section is not skipped when vl = 0, ensuring correct values in destination vector register. Change-Id: I2478722d6f003a0f2e4b3cd0ba3e845bed938ee6 This is the same problem as #715 . --- 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 c808f08ee4..4a6b27cc2e 100644 --- a/src/arch/riscv/isa/templates/vector_arith.isa +++ b/src/arch/riscv/isa/templates/vector_arith.isa @@ -1237,11 +1237,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);