|
|
|
@ -355,16 +355,27 @@ void processor_t::vectorUnit_t::reset(){ |
|
|
|
} |
|
|
|
|
|
|
|
reg_t processor_t::vectorUnit_t::set_vl(int rd, int rs1, reg_t reqVL, reg_t newType){ |
|
|
|
int new_vlmul = 0; |
|
|
|
if (vtype != newType){ |
|
|
|
vtype = newType; |
|
|
|
vsew = 1 << (BITS(newType, 4, 2) + 3); |
|
|
|
vlmul = 1 << BITS(newType, 1, 0); |
|
|
|
vediv = 1 << BITS(newType, 6, 5); |
|
|
|
vlmax = VLEN/vsew * vlmul; |
|
|
|
vmlen = vsew / vlmul; |
|
|
|
reg_mask = (NVPR-1) & ~(vlmul-1); |
|
|
|
new_vlmul = (BITS(newType, 5, 5) << 2) | BITS(newType, 1, 0); |
|
|
|
new_vlmul = (int8_t)(new_vlmul << 5) >> 5; |
|
|
|
vflmul = new_vlmul >= 0 ? 1 << new_vlmul : 1.0 / (1 << -new_vlmul); |
|
|
|
vlmul = vflmul < 1 ? 1 : vflmul; |
|
|
|
vlmax = (VLEN/vsew) * vflmul; |
|
|
|
vemul = vflmul; |
|
|
|
veew = vsew; |
|
|
|
vta = BITS(newType, 6, 6); |
|
|
|
vma = BITS(newType, 7, 7); |
|
|
|
vediv = 1 << BITS(newType, 9, 8); |
|
|
|
|
|
|
|
vill = !(vflmul >= 0.125 && vflmul <= 8) |
|
|
|
|| vsew > ELEN |
|
|
|
|| vflmul < ((float)vsew / ELEN) |
|
|
|
|| vediv != 1 |
|
|
|
|| (newType >> 8) != 0; |
|
|
|
|
|
|
|
vill = vsew > ELEN || vediv != 1 || (newType >> 7) != 0; |
|
|
|
if (vill) { |
|
|
|
vlmax = 0; |
|
|
|
vtype = UINT64_MAX << (p->get_xlen() - 1); |
|
|
|
|