On 8/17/20 1:49 AM, [email protected] wrote:
> +static bool vext_check_st_index(DisasContext *s, int vd, int vs2, int nf,
> + uint8_t eew)
> {
> - return !s->vill;
> + uint8_t lmul_r = s->lmul < 0 ? 0 : s->lmul;
> + int8_t emul = ctzl(eew) - (s->sew + 3) + s->lmul;
> + return (emul >= -3 && emul <= 3) &&
> + require_align(vs2, 1 << emul) &&
> + require_align(vd, 1 << s->lmul) &&
> + ((nf << lmul_r) <= (NVPR / 4) &&
> + (vd + (nf << lmul_r)) <= NVPR);
> +}
Same comments wrt EEW as the last patch.
It wouldn't hurt to extract something like
static bool require_nf(int vd, int nf, int lmul)
{
int size = nf << MAX(lmul, 0);
return size <= 8 && vd + size <= 32;
}
in the previous patch as well.
r~