Repository navigation
VLEN32 Support - #88
gregdavill wants to merge 4 commits into
Conversation
|
@gregdavill could you update CI to run a few tests with VLEN=32? See |
There was a problem hiding this comment.
General observation:
This will likely break test generation for some cases when VLEN == 32. The issue is that combinations currently uses XLEN to filter invalid SEW values. However, some configurations are constrained by XLEN (e.g. vslide1up), while many others are actually constrained by VLEN as well (or rather by Zve32x, Zve64x, etc.). As a result, filtering based on XLEN is not enough.
Example:
func (i *Insn) combinations(lmuls []LMUL, sews []SEW, masks []bool, rms []RM) []combination {
res := make([]combination, 0)
for _, lmul := range lmuls {
if i.EGW > 0 && int(float64(lmul)*float64(i.Option.VLEN)) < i.EGW {
continue
}
for _, sew := range sews {
if int(i.Option.XLEN) < int(sew) {
continue
}
The same issue likely exists in vsetvlicombinations().
The current test generation approach feels fragile. It is easy to miss edge cases because constraints are scattered across multiple parameters (XLEN, VLEN, instruction specific rules, etc.).
One possible improvement would be to define constraints per instruction which explicitly declares SEWs, LMULs, etc., (for rather for a given instruction and extension) and then a single generator that applies them. it would make correctness much easier to reason about, especially when validating configurations across different extension sets (Zve32x, Zve64x, V, etc.). The cool thing about this is that someone could intentionally generate invalid combinations as well, to test their vector engine further.
|
I've added this config to the CI. I can see that brittleness becoming an issue. I guess I've sidestepped many of these by excluding the XLEN==64,VLEN==32 in the configuration matrix. This seems like a sensible stepping stone to add this config, while constraining the scope of this PR. |
|
Are there specific issues open that should be fixed before this can be considered? |
The vector spec defines Zve32x with minimum VLEN of 32.
It would be good for this generator to support this configuration.
The main change is just using
.wordrather than.quadfor testdata.Then a small adjustment to the patch code to not match .word within testdata.