On Thu, 23 Jun 2022 at 21:36, Richard Henderson <richard.hender...@linaro.org> wrote: > On 6/23/22 04:41, Peter Maydell wrote: > > We now have several rather long functions that are > > pretty complicated and pretty similar handling the various > > SVE and SME loads and stores. Is there really no hope for > > sharing code ? > > I'm not sure. Maybe. The two issues are: > > (1) sve ld4/st4 -- arm didn't make z29-z31 illegal, but defined wraparound to > z0. So I > pass in a Zreg number not a pointer to those routines. So the routines can't > be reused > for Zarray without changing that. > > (2) sme ld1/st1 vertical slice, which significantly alters the spacing > between the elements. > > One possibility for these cases is to perform the load into > env->some_scratch_space, then > copy into the final position afterward, and the reverse for stores. > > Is that preferable? Do you see another alternative?
Hmm, loading into a scratch space seems a bit clunky too. I'll leave it to your judgement but I guess since you've already written and tested the code we have here that argues for going with what we have. Maybe we'll come back in six months and realize there's a neater approach. (The GIC ITS code ended up being refactored like that.) -- PMM