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
This commit is contained in:
QQeg
2024-02-07 21:11:28 +00:00
parent 4aecf9d35c
commit 7eeac98b8d

View File

@@ -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<uint8_t>(), pkt->getPtr<uint8_t>(), 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<bool> 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<bool> byte_enable(mem_size, false);