Il mer 23 apr 2025, 15:54 Ben Dooks <ben.do...@codethink.co.uk> ha scritto:
> > Leaving aside your patch I think you can improve the density of the > > tbflags a bit too: > > > > - PM_MASK_ENABLED, PM_BASE_ENABLED and AXL are unused, which gives you > > back 4 bits. > > Hmm, the PM_MASK_ENABLED, PM_BASE_ENABLED are also used by VMA and VTA > Ah, indeed they were reused without removing the old ones. So those are out... > - VLMUL == 4 is invalid, and you can use that to get rid of VILL > - SEW reserves 3 bits, but TCG only supports 8/16/32/64; that could be > > one more bit if you can live with the limitation > ... and any of these two is the easiest in the short term if you need to recoup one bit. Paolo > This is already 6 bits, but for FS and VS it may be efficient enough to > > have just one bit (dirty vs. everything else): for all cases other than > > dirty, REQUIRE_FPU and require_rv* can call a helper to look at the > > actual MSTATUS and generate the exception if the extension is disabled; > > then the caller always proceeds with translation into TCG ops(*). The > > overhead for the DISABLED/INITIAL/CLEAN cases is minimal and it gives > > back 2 more bits. > > > > Finally, in many cases it makes sense to do a full TB flush when CSRs > > change. However I am not sure if this could be done for RISC-V, maybe > > for the CFI enabled bits? > > I'll have a look at those, but for now I'm going back to 9.1 > > > > Thanks, > > > > Paolo > > > > (*) that is: > > > > static bool require_rvv(DisasContext *s) > > { > > REQUIRE_EXT(s, RVV); > > if (!s->mstatus_vs_dirty) { > > gen_helper_require_rvv(tcg_env); > > } > > return true; > > } > > > > static bool require_rvf(DisasContext *s) > > { > > switch (s->sew) { > > case MO_16: > > if (!s->cfg_ptr->ext_zvfh) { > > return false; > > } > > break; > > case MO_32: > > if (s->cfg_ptr->ext_zve32f) { > > return false; > > } > > break; > > case MO_64: > > if (s->cfg_ptr->ext_zve64d) { > > return false; > > } > > break; > > default: > > return false; > > } > > > > if (!s->mstatus_fs_dirty) { > > gen_helper_require_rvf(tcg_env); > > } > > return true; > > } > > > > > > > -- > Ben Dooks http://www.codethink.co.uk/ > Senior Engineer Codethink - Providing Genius > > https://www.codethink.co.uk/privacy.html > >