This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add macro to imply compiler availability on RISC-V Vector intrinsics version
ClosedPublic

Authored by eopXD on Nov 29 2022, 8:39 AM.

Details

Summary

According to version_macro.adoc under rvv-intrinsic-doc, the compiler
should have a macro to imply such availability.

Link: https://github.com/riscv-non-isa/rvv-intrinsic-doc/blob/master/version_macro.adoc

Diff Detail

Event Timeline

eopXD created this revision.Nov 29 2022, 8:39 AM
eopXD requested review of this revision.Nov 29 2022, 8:39 AM
craig.topper added inline comments.Nov 29 2022, 4:24 PM
clang/test/Preprocessor/riscv-target-features.c
266

Check to end of line like the zve* versions

eopXD updated this revision to Diff 478784.Nov 29 2022, 7:05 PM

Add check for end-line.

eopXD marked an inline comment as done.Nov 29 2022, 7:06 PM
kito-cheng accepted this revision.Nov 29 2022, 11:35 PM

LGTM.

I am thinking that we should use same way to define both __riscv_v_intrinsic_overloading[1] and __riscv_v_intrinsic, __riscv_v_intrinsic_overloading is defined in riscv_vector.h now, maybe we should defined that here too.

https://github.com/llvm/llvm-project/blob/main/clang/utils/TableGen/RISCVVEmitter.cpp#L401

This revision is now accepted and ready to land.Nov 29 2022, 11:35 PM
asb accepted this revision.Nov 30 2022, 3:16 AM

LGTM, thanks!

clang/lib/Basic/Targets/RISCV.cpp
195

Nit: comment should end with full stop.

This revision was landed with ongoing or failed builds.Nov 30 2022, 8:36 AM
This revision was automatically updated to reflect the committed changes.
eopXD added inline comments.Nov 30 2022, 8:43 AM
clang/lib/Basic/Targets/RISCV.cpp
195

Sorry I just landed the commit and missed this comment. May I ask what do yo mean by full stop here? Do you mean a period?

jrtc27 added inline comments.Nov 30 2022, 8:47 AM
clang/lib/Basic/Targets/RISCV.cpp
195

Full stop is British English for what is period in US English, yes

196

Do we not have a function to do these (major, minor) -> integer encodings? I guess not since currently the only other instance is in the loop above. Might be worth factoring that out if we're going to grow more of these.

eopXD marked 2 inline comments as done.Nov 30 2022, 9:08 AM
eopXD added inline comments.
clang/lib/Basic/Targets/RISCV.cpp
195