fix RVV 1.0 detection code#5432
Merged
martin-frbg merged 1 commit intoOpenMathLib:developfrom Sep 5, 2025
Merged
Conversation
There were a couple of issues with the detection code used to check for RVV 1.0 on kernels that do not support hwprobe. 1. The vtype clobber was missing 2. The wrong form of vsetvli was being used. The vsetvli x0, x0 form is inappropriate for this use case as it can only be safely used in code where the value of vtype is known. The use of vsetvli x0, x0 here can lead to a failure to detect RVV 1.0, if, for example, the vill bit happens to be set before detect_riscv64_rvv100 is called. We fix both issues by adding the missing clobber and replacing the first parameter to vsetvli with t0 (which we add to our clobbers).
Contributor
Author
|
I discovered this when working on #5431. When testing that PR I noticed that the RVV kernels were not always enabled on devices that supported RVV 1.0 but which were running kernels without hwprobe. |
Collaborator
|
The failing DYNAMIC_ARCH job has probably because it is running a riscv-gnu-clang toolchain from a year ago. This probably explains the previously missing clobber - I'm not sure if we should simply require users to have a newer one ? |
martin-frbg
added a commit
to martin-frbg/OpenBLAS
that referenced
this pull request
Sep 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There were a couple of issues with the detection code used to check for RVV 1.0 on kernels that do not support hwprobe.
We fix both issues by adding the missing clobber and replacing the first parameter to vsetvli with t0 (which we add to our clobbers).