projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da579c1
)
fix maxvl calc logic
author
Yunsup Lee
<yunsup@cs.berkeley.edu>
Wed, 16 Oct 2013 22:10:12 +0000
(15:10 -0700)
committer
Yunsup Lee
<yunsup@cs.berkeley.edu>
Wed, 16 Oct 2013 22:10:12 +0000
(15:10 -0700)
hwacha/insns/vsetcfg.h
patch
|
blob
|
history
diff --git
a/hwacha/insns/vsetcfg.h
b/hwacha/insns/vsetcfg.h
index 8ca408c93e4e20d0e8455ada6b79b18d780f16b9..a5fd9594dea82c96499efc4c71b6bd1ceefd08f5 100644
(file)
--- a/
hwacha/insns/vsetcfg.h
+++ b/
hwacha/insns/vsetcfg.h
@@
-4,6
+4,10
@@
uint32_t nfpr = ((XS1 >> 6) & 0x3f) + ((insn.i_imm() >> 6) & 0x3f);
// raise trap when nxpr/nfpr is larger than possible
WRITE_NXPR(nxpr);
WRITE_NFPR(nfpr);
-uint32_t maxvl = 8 * (256 / (nxpr-1 + nfpr));
+uint32_t maxvl;
+if (nxpr + nfpr < 2)
+ maxvl = 8 * 256;
+else
+ maxvl = 8 * (256 / (nxpr-1 + nfpr));
WRITE_MAXVL(maxvl);
WRITE_VL(0);