qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v4 19/70] target/riscv: rvv-1.0: index load and store instructi


From: Richard Henderson
Subject: Re: [RFC v4 19/70] target/riscv: rvv-1.0: index load and store instructions
Date: Sat, 29 Aug 2020 11:33:52 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 8/17/20 1:49 AM, frank.chang@sifive.com 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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]