aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--riscv/processor.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc
index 9db3f6a..b67c54a 100644
--- a/riscv/processor.cc
+++ b/riscv/processor.cc
@@ -391,7 +391,12 @@ reg_t processor_t::vectorUnit_t::set_vl(int rd, int rs1, reg_t reqVL, reg_t newT
vma = BITS(newType, 7, 7);
vediv = 1 << BITS(newType, 9, 8);
- vill = !(vflmul >= 0.125 && vflmul <= 8) || vsew > ELEN || vediv != 1 || (newType >> 8) != 0;
+ vill = !(vflmul >= 0.125 && vflmul <= 8)
+ || vsew > ELEN
+ || vflmul < ((float)vsew / ELEN)
+ || vediv != 1
+ || (newType >> 8) != 0;
+
if (vill) {
vlmax = 0;
vtype = UINT64_MAX << (p->get_xlen() - 1);