3 ms·
> for switching LMUL, which has very limited usefulness I currently have a quite usefull use case for it, I'm concerting utf8 to utf32 and if I've got an avera
by camel-cdr 3y ago
> for switching LMUL, which has very limited usefulness
I currently have a quite usefull use case for it, I'm concerting utf8 to utf32 and if I've got an average utf8 character size of above 2 I could reduce the LMUL for that loop iteration.
This shouldn't actually improve performance that much in good rvv implementations, since you can use vl and not LMUL to schedule your execution units.
Sadly this is currently not the standard, and ara is the only implementation, that does this I know of.
I think this wouldn't even be about code size reduction, consider an input, where there is basically a 50/50 probability LMUL can be reduced, that would be horrible for the branch predictor, but with only a branch over vsetvl, this could behave as a conditional vsetvl via instruction fusion. We'll have to see if such optimization become relevant once there is more hardware out there.
- dzaima 3y agoThat's an interesting use-case, though I wouldn't be surprised if some impls really wouldn't like LMUL dynamically switching at runtime a lot (i.e. something like LMUL being forwarded at decode-time, so it couldn't decode after an unknown-LMUL vsetvl, ruining perf)