diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-11-25 22:46:48 -0800 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-11-27 19:50:20 -0800 |
commit | 859be9833258e14fdda13c2254fdd73e64e9c1b5 (patch) | |
tree | da02fd905dbbfe9f2faf7a377156a9683f5ee458 /riscv/processor.cc | |
parent | 9c53a160e4f0fbfa9a957f6768d5b42ee723ca58 (diff) | |
download | spike-859be9833258e14fdda13c2254fdd73e64e9c1b5.zip spike-859be9833258e14fdda13c2254fdd73e64e9c1b5.tar.gz spike-859be9833258e14fdda13c2254fdd73e64e9c1b5.tar.bz2 |
rvv: change vsetvl[i] to match 0.8 spec
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv/processor.cc')
-rw-r--r-- | riscv/processor.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc index 7dce217..ffcf99b 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -233,10 +233,10 @@ void vectorUnit_t::reset(){ reg_file = malloc(NVPR * (VLEN/8)); vtype = 0; - set_vl(-1, 0, -1); // default to illegal configuration + set_vl(0, 0, 0, -1); // default to illegal configuration } -reg_t vectorUnit_t::set_vl(int regId, reg_t reqVL, reg_t newType){ +reg_t vectorUnit_t::set_vl(int rd, int rs1, reg_t reqVL, reg_t newType){ if (vtype != newType){ vtype = newType; vsew = 1 << (BITS(newType, 4, 2) + 3); @@ -256,11 +256,11 @@ reg_t vectorUnit_t::set_vl(int regId, reg_t reqVL, reg_t newType){ // set vl if (vlmax == 0) { vl = 0; - } else if (regId == 0) { + } else if (rd == 0 && rs1 == 0) { vl = vl > vlmax ? vlmax : vl; - } else if (regId == -1) { + } else if (rd != 0 && rs1 == 0) { vl = vlmax; - } else if (regId >= 0) { + } else if (rs1 != 0) { vl = reqVL > vlmax ? vlmax : reqVL; } |