This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Decouple Zve* extensions.
AbandonedPublic

Authored by jacquesguan on Jan 26 2022, 1:33 AM.

Details

Summary

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.

Diff Detail

Event Timeline

jacquesguan created this revision.Jan 26 2022, 1:33 AM
jacquesguan requested review of this revision.Jan 26 2022, 1:33 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 26 2022, 1:33 AM
eopXD added a comment.EditedJan 26 2022, 4:06 AM

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.

craig.topper added inline comments.Jan 26 2022, 8:48 AM
llvm/lib/Support/RISCVISAInfo.cpp
753

Now we need to check if multiple Zve extensions are specified at the same time?

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.

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.

Address comment.

llvm/lib/Support/RISCVISAInfo.cpp
753

Done

Update code

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.

jacquesguan abandoned this revision.Feb 7 2022, 7:11 PM