qemu-riscv
[Top][All Lists]
Advanced

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

Re: [RFC v4 34/70] target/riscv: rvv-1.0: register gather instructions


From: Richard Henderson
Subject: Re: [RFC v4 34/70] target/riscv: rvv-1.0: register gather instructions
Date: Sat, 29 Aug 2020 12:52:02 -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 vrgatherei16_vv_check(DisasContext *s, arg_rmrr *a)
> +{
> +    int8_t emul = 4 - (s->sew + 3) + s->lmul;

Similarly for EEW elsewhere.  This should be

    int emul = MO_16 - s->sew + s->lmul;

> @@ -3339,7 +3353,8 @@ static bool trans_vrgather_vx(DisasContext *s, arg_rmrr 
> *a)
>      }
>  
>      if (a->vm && s->vl_eq_vlmax) {
> -        int vlmax = s->vlen;
> +        int scale = s->lmul - (s->sew + 3);
> +        int vlmax = scale < 0 ? s->vlen >> -scale : s->vlen << scale;

Isn't this what s->vlen is already computed as?


> +#define GEN_VEXT_VRGATHER_VV(NAME, TS1, TS2, HS1, HS2)                    \
>  void HELPER(NAME)(void *vd, void *v0, void *vs1, void *vs2,               \
>                    CPURISCVState *env, uint32_t desc)                      \
>  {                                                                         \
> -    uint32_t vlmax = vext_max_elems(desc, ctzl(sizeof(ETYPE)));           \
> +    uint32_t vlmax = vext_max_elems(desc, ctzl(sizeof(TS1)));             \

Surely you can't just use TS1?  For vrgatherei16_vv_[wd], the maximum number of
elements is still bound by TS2.


r~



reply via email to

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