Skip to content

std_detect: RISC-V platform guide documentation #145417

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

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

Conversation

a4lg
Copy link
Contributor

@a4lg a4lg commented Aug 15, 2025

This is practically a revert of a revert, making the commit e907456b2e10622ccd854a3bba8d02ce170b5dbb on stdarch come around again with minor fixes, enhancements and adjustments.

An excerpt from the original commit message follows:

Since there's no architectural feature detection on RISC-V (unlike CPUID on x86 architectures and some system registers on Arm/AArch64), runtime feature detection entirely depends on the platform-specific facility.

As a result, availability of each feature heavily depends on the platform and its version.

To help users make a decision for feature checking on a RISC-V system, this commit adds a platform guide with minimum supported platform versions.

History

This is originally rust-lang/stdarch#1779 which is approved and an attempt to merge this was performed... but blocked by HTML errors (generated by rustdoc) later fixed by #140434 (cf. #140389; so at that time I reverted the original PR as rust-lang/stdarch#1792 and non-table parts are partially restored as rust-lang/stdarch#1797).

Since #140434 is merged now and the std_detect crate is now under the main Rust repository, I'm going to fully restore the intent of rust-lang/stdarch#1779 (to provide useful yet complex information for std::arch::is_riscv_feature_detected! users).

Changes from the Original (rust-lang/stdarch#1779)

Note (CI)

I don't have full knowledge about Rust's CI process and we may need to wait for the next beta bump.


r? @Amanieu
@rustbot label +O-riscv

This is practically a revert of a revert, making the
commit e907456b2e10622ccd854a3bba8d02ce170b5dbb on `stdarch` come around
again with minor fixes, enhancements and adjustments.

An excerpt from the original commit message follows:

Since there's no architectural feature detection on RISC-V (unlike `CPUID`
on x86 architectures and some system registers on Arm/AArch64), runtime
feature detection entirely depends on the platform-specific facility.

As a result, availability of each feature heavily depends on the platform
and its version.

To help users make a decision for feature checking on a RISC-V system, this
commit adds a platform guide with minimum supported platform versions.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. O-riscv Target: RISC-V architecture labels Aug 15, 2025
@a4lg
Copy link
Contributor Author

a4lg commented Aug 15, 2025

Seems jobs *-gnu-llvm* has succeeded (x86_64-gnu-llvm-19 failed in #140389). It's a good sign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-riscv Target: RISC-V architecture S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants