According to the v spec, there is no include relationship or dependency among the Zve* extensions. For exmaple, we do not need to implement Zve64x for Zve64f, these two are indepedent extensions. This patch decouple all Zve* extensions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Not sure if this simplifies things. Users and the compiler can use the macro __riscv_v_elen and __riscv_v_elen_fp to do things to the vector-related target feature.
Other than that I don't hold any strong objection to this refactoring.
llvm/lib/Support/RISCVISAInfo.cpp | ||
---|---|---|
753 | Now we need to check if multiple Zve extensions are specified at the same time? |
This patch is similar with https://reviews.llvm.org/D117854. I think these five Zve* extensions are independent, we do not need to implement Zve32x for Zve64x, even all instructions of Zve32x is subset of instructions of Zve64x, same with other dependencies.
Current implemention of Zve* with depedency make some unclear. For example, in clang/test/CodeGen/RISCV/rvv-intrinsics/rvv-error.c, the error message shows that the buitin only needs Zve32x or V extension to be enable. But actually, if we just implement Zve64x, these builtins should work as well. These error messages is kind of confusing if we make Zve* extensions has depedent relationship.
Discussion on riscv-v-spec : https://github.com/riscv/riscv-v-spec/issues/723#issuecomment-922153867, although v-spec and isa-spec still not clearly describe that, but seems ISA folks prefer having those implication relationship between those zve* and v extensions.
clang-format not found in user’s local PATH; not linting file.