From 7eeac98b8d0dc61bb6b24844af9989c3c12231a3 Mon Sep 17 00:00:00 2001 From: QQeg <0909kfcmailo@gmail.com> Date: Wed, 7 Feb 2024 21:11:28 +0000 Subject: [PATCH] arch-riscv: Fix load and store to use EEW instead of SEW Vector unit-stride instructions have an EEW encoded directly in the instruction, We should use that instead of SEW in vtype. Change-Id: I282041ce8ed57fbcca899f7497ef6c6fb2dfcf85 --- src/arch/riscv/isa/templates/vector_mem.isa | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arch/riscv/isa/templates/vector_mem.isa b/src/arch/riscv/isa/templates/vector_mem.isa index 1510c106c7..a0e8da1ba1 100644 --- a/src/arch/riscv/isa/templates/vector_mem.isa +++ b/src/arch/riscv/isa/templates/vector_mem.isa @@ -171,7 +171,7 @@ Fault if (fault != NoFault) return fault; - const size_t micro_vlmax = vtype_VLMAX(machInst.vtype8, vlen, true); + const size_t micro_vlmax = vlen / width_EEW(machInst.width); const size_t micro_elems = vlen / width_EEW(machInst.width); size_t ei; @@ -243,7 +243,7 @@ Fault memcpy(Mem.as(), pkt->getPtr(), pkt->getSize()); - const size_t micro_vlmax = vtype_VLMAX(machInst.vtype8, vlen, true); + const size_t micro_vlmax = vlen / width_EEW(machInst.width); const size_t micro_elems = vlen / width_EEW(machInst.width); size_t ei; @@ -360,7 +360,7 @@ Fault %(set_vlen)s; %(ea_code)s; - const size_t micro_vlmax = vtype_VLMAX(machInst.vtype8, vlen, true); + const size_t micro_vlmax = vlen / width_EEW(machInst.width); const size_t eewb = width_EEW(machInst.width) / 8; const size_t mem_size = eewb * microVl; std::vector byte_enable(mem_size, false); @@ -411,7 +411,7 @@ Fault %(set_vlen)s; %(ea_code)s; - const size_t micro_vlmax = vtype_VLMAX(machInst.vtype8, vlen, true); + const size_t micro_vlmax = vlen / width_EEW(machInst.width); const size_t eewb = width_EEW(machInst.width) / 8; const size_t mem_size = eewb * microVl; std::vector byte_enable(mem_size, false);