-
Notifications
You must be signed in to change notification settings - Fork 133
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
Risc V and gcc-13 #579
Comments
As for the RISC-V architecture, gcc-13 is not supported, see README. |
Apparently it does build OK and pass tests once RVV is manually disabled -- we discovered this on the Gentoo bug. I think all of the build failures are due to RVV being misdetected. With gcc-13, both RVV-1.0 and RVV-2.0 are detected but neither are implemented. This leads to build failures because sleef actually needs v1.0 to be fully implemented. The mis-detection with gcc-13 is due to the CMake tests that look for some types present in the v0.11.x draft of RVV. These are present in gcc-13 (so the test passes), but the v1.0 types aren't (so the build fails). As @atupone suggests this can probably be fixed by checking for some types that are present in v1.0 and v2.0 only. I would be happy to test. I already have gcc-14 installed and it would be easy to install gcc-13 as well. |
@luhenry @GlassOfWhiskey @ericlove I thought I should draw your attention on this issue. Can you think of a way to make feature detection a bit more robust for RVV and avoid the mis-detection mentioned above for gcc 13+? I will see what we can do regarding testing with gcc 13/14 in CI. |
The standard way of testing for RVV v1.0 ISA compatibility would be to compare the |
Hi! Is someone able to give that a go? If I understand the suggestion is to use a different intrinsic/type in the detection mechanism, e.g. https://github.com/shibatch/sleef/blob/master/Configure.cmake#L664 Currently the code that's used for checking is
I'm not familiar with RISC-V types and intrinsics, let alone across version of the architecture, what would be a good choice of type or intrisinc to avoid this misdetection? |
I guess I will take a stab at it using @ericlove's suggestion |
Thank you @orlitzky! |
Indeed, sorry to have dropped the ball on this, but thanks @orlitzky for taking it on, and I'd be happy to review. 👍 |
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: 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 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.
An RVV1 attempt here: #602 I have two questions now:
|
@orlitzky thanks for making #602 ! Regarding these questions:
Thanks again, and happy to approve #602 when the latter change is made. |
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
Thanks! Everything is becoming clearer now. I hadn't made the connection between the M2 in RVVM2 and and the "m2" in the function name. I've updated the PR. The two tests for RVVM1 and RVVM2 are identical now, which is begging for a follow-up PR to consolidate them. |
See
https://bugs.gentoo.org/939400
It seems that sleef (3.6.1), on Risc-V, check for SIMD instruction that belongs to the v0.11.x draft
but then during build uses instructions in the v1.0.
gcc-13 only support the v0.11.x draft
I suggest checking instruction set belonging to the v1.0 (e.g. vfloat64m1x4_t)
Unfortunately I don't have a risc-v hardware to test
The text was updated successfully, but these errors were encountered: