Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add misc macro for vector extensions.
Introduce `__riscv_min_vlen`, `__riscv_max_eew` and `__riscv_max_eew_fp` macro, for let programer easier to get vector related information, like: - What's the minimal VLEN value is guaranteed current architecture extension? - What's the maximal available EEW is guaranteed current architecture extension? - What's the maximal available EEW for floating-point operation is guaranteed current architecture extension? It's possible to get the information by testing serveral architecture extension test macro, but the life can be simpler if toolchain can help, for example, if you want to check the minimal VLEN value via those macro: ```c #if defined(__riscv_zvl512b) #define __riscv_min_vlen 512 #elif defined(__riscv_zvl256b) #define __riscv_min_vlen 256 #elif defined(__riscv_zvl128b) || defined(__riscv_v) #define __riscv_min_vlen 128 #elif defined(__riscv_zvl64b) || defined(__riscv_zve64x) || \ defined(__riscv_zve64f) || defined(__riscv_zve64d) #define __riscv_min_vlen 64 #elif defined(__riscv_zvl32b) || defined(__riscv_zve32x) || \ defined(__riscv_zve32f) #define __riscv_min_vlen 32 #endif ``` And it's not scalable solution since in theory we can have up to zvl32768b.
- Loading branch information