Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure.cmake: improve RVV1 check #602

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

orlitzky
Copy link

@orlitzky orlitzky commented Nov 2, 2024

To test for RVV1 support, we currently run a small program that uses some vector intrinsics from the v0.11.x draft of the RVV standard. The library itself however needs newer intrinsics than the ones that we test for. This can lead to a problem because GCC 13 supports the intrinsics that we test for, but not (all of) the ones we intend to use. In short, the build can fail with GCC 13: #579

This commit changes the detection mechanism. Instead of compiling a program that makes use of the intrinsics, we now just check the two values, __riscv_v and __riscv_v_intrinsic, to ensure that we have version 1.0 of RVV and version 0.12 of the intrinsics. According to the intrinsics spec, https://github.com/riscv-non-isa/rvv-intrinsic-doc, these are the stable versions.

@orlitzky orlitzky mentioned this pull request Nov 2, 2024
To test for the RISC-V vector extension (RVV), we currently run two
small programs -- one for each value of LMUL=1,2 -- that use some
vector intrinsics from the v0.11.x draft of the intrinsics spec. The
library itself however needs newer intrinsics than the ones that we
test for. This can lead to a problem because GCC 13 supports the
intrinsics that we test for, but not (all of) the ones we intend to
use. In short, the build can fail with GCC 13:

  shibatch#579

This commit changes the detection mechanism. Instead of compiling a
program that makes use of the intrinsics, we now just check the two
values, __riscv_v and __riscv_v_intrinsic, to ensure that we have
version 1.0 of the vector extension and version 0.12 of the
intrinsics. These should be the stable versions of each.

Note: the "m1" and "m2" checks are now identical because they are both
covered by the official spec.

Fixes shibatch#579
Copy link
Contributor

@ericlove ericlove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for making this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants