Browse Source

Replace ternary operator with std:min

pull/1375/head
demin.han 3 years ago
parent
commit
cf7e434c80
  1. 4
      riscv/vector_unit.cc

4
riscv/vector_unit.cc

@ -54,11 +54,11 @@ reg_t vectorUnit_t::vectorUnit_t::set_vl(int rd, int rs1, reg_t reqVL, reg_t new
if (vlmax == 0) {
vl->write_raw(0);
} else if (rd == 0 && rs1 == 0) {
vl->write_raw(vl->read() > vlmax ? vlmax : vl->read());
vl->write_raw(std::min(vl->read(), vlmax));
} else if (rd != 0 && rs1 == 0) {
vl->write_raw(vlmax);
} else if (rs1 != 0) {
vl->write_raw(reqVL > vlmax ? vlmax : reqVL);
vl->write_raw(std::min(reqVL, vlmax));
}
vstart->write_raw(0);

Loading…
Cancel
Save