This is a question about the vector extension in RISC-V. Currently, I'm considering adapting my custom RTOS to support the vector extension.
Upon reviewing the spec for the vector extension, I've learned that the size of vector registers depends on vlen. When performing a context swap of vector registers between tasks, if vlen is 64 bits or less, it would suffice to execute the vle64.v instruction 31 times (excluding v0). However, if vlen is 2048 or 4096, the time required for context swapping of vector registers becomes immense.
If managing context on a per-task basis, it can be anticipated that significant time will be consumed for context swapping every time a task switches. In vector extension version 1.0-rc2-draft, it's explained that the mstatus.VS field is provided to avoid unnecessary context swaps. However, context swapping cannot be avoided when switching tasks because each task has its own context, making context swapping necessary.
So, how should one go about performing context swaps for the vector extension?