On 9/12/19 10:53 AM, Chih-Min Chao wrote: > > > On Thu, Sep 12, 2019 at 6:39 AM Richard Henderson > <richard.hender...@linaro.org > <mailto:richard.hender...@linaro.org>> wrote: > > On 9/11/19 10:51 AM, Chih-Min Chao wrote: > > Could the VLEN be configurable in cpu initialization but not fixed in > > compilation phase ? > > Take the integer element as example and the difference should be the > > stride of vfp.vreg[x] isn't continuous > > Do you really want an unbounded amount of vector register storage? > > > Hi Richard, > > VLEN is implementation-defined parameter and the only limitation on spec is > that it must be power of 2. > What I prefer is the value could be adjustable in runtime.
Ok, fine, I suppose. I'll let a risc-v maintainer opine on whether there should be some sanity check on the bounds of VLEN. If you really do have an unbounded vlen, you'll need to consider carefully how you want to manage migration. > > uint8_t *mem = malloc(size) > > for (int idx = 0; idx < 32; ++idx) { > > vfp.vreg[idx].u64 = (void *)&mem[idx * elem]; > > vfp.vreg[idx].u32 = (void *)&mem[idx * elem]; > > vfp.vreg[idx].u16 = (void *)&mem[idx * elem]; > > } > > This isn't adjusting the stride of the elements. And in any case this > would > have to be re-adjusted for every vsetvl. > > Not sure about the relation with vsetvl. Could you provide an example ? Well, I think it's merely a matter of there's no point having so many different pointers into the block of memory that provides the backing storage. I've asserted elsewhere in the thread that we shouldn't have an array of 32 "registers" anyway. r~