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