- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
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
          
     Merged
      
      
    
                
     Merged
            
            
          Conversation
  
    
      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
    
  
  
    
    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.
| Seems jobs  | 
| @bors r+ rollup | 
    
  bors 
      added a commit
      that referenced
      this pull request
    
      Aug 20, 2025 
    
    
      
  
    
      
    
  
Rollup of 13 pull requests Successful merges: - #139357 (Fix parameter order for `_by()` variants of `min` / `max`/ `minmax` in `std::cmp`) - #140314 (Rustdoc: typecheck scrape-examples.js) - #140794 (mention lint group in default level lint note) - #145006 (Clarify EOF handling for `BufRead::skip_until`) - #145252 (Demote x86_64-apple-darwin to Tier 2 with host tools) - #145359 (Fix bug where `rustdoc-js` tester would not pick the right `search.js` file if there is more than one) - #145381 (Implement feature `int_lowest_highest_one` for integer and NonZero types) - #145417 (std_detect: RISC-V platform guide documentation) - #145531 (Add runtime detection for APX-F and AVX10) - #145619 (`std_detect`: Use `rustc-std-workspace-*` to pull in `compiler-builtins`) - #145622 (Remove the std workspace patch for `compiler-builtins`) - #145623 (Pretty print the name of an future from calling async closure) - #145626 (add a fallback implementation for the `prefetch_*` intrinsics ) r? `@ghost` `@rustbot` modify labels: rollup
    
  rust-timer 
      added a commit
      that referenced
      this pull request
    
      Aug 20, 2025 
    
    
      
  
    
      
    
  
Rollup merge of #145417 - a4lg:riscv-arch-platform-guide-ch2, r=Amanieu std_detect: RISC-V platform guide documentation 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.
    
  github-actions bot
      pushed a commit
        to rust-lang/miri
      that referenced
      this pull request
    
      Aug 21, 2025 
    
    
      
  
    
      
    
  
Rollup of 13 pull requests Successful merges: - rust-lang/rust#139357 (Fix parameter order for `_by()` variants of `min` / `max`/ `minmax` in `std::cmp`) - rust-lang/rust#140314 (Rustdoc: typecheck scrape-examples.js) - rust-lang/rust#140794 (mention lint group in default level lint note) - rust-lang/rust#145006 (Clarify EOF handling for `BufRead::skip_until`) - rust-lang/rust#145252 (Demote x86_64-apple-darwin to Tier 2 with host tools) - rust-lang/rust#145359 (Fix bug where `rustdoc-js` tester would not pick the right `search.js` file if there is more than one) - rust-lang/rust#145381 (Implement feature `int_lowest_highest_one` for integer and NonZero types) - rust-lang/rust#145417 (std_detect: RISC-V platform guide documentation) - rust-lang/rust#145531 (Add runtime detection for APX-F and AVX10) - rust-lang/rust#145619 (`std_detect`: Use `rustc-std-workspace-*` to pull in `compiler-builtins`) - rust-lang/rust#145622 (Remove the std workspace patch for `compiler-builtins`) - rust-lang/rust#145623 (Pretty print the name of an future from calling async closure) - rust-lang/rust#145626 (add a fallback implementation for the `prefetch_*` intrinsics ) r? `@ghost` `@rustbot` modify labels: rollup
    
  github-actions bot
      pushed a commit
        to model-checking/verify-rust-std
      that referenced
      this pull request
    
      Aug 26, 2025 
    
    
      
  
    
      
    
  
…, r=Amanieu std_detect: RISC-V platform guide documentation 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.
  
    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-bors
  Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 
  
    T-libs
  Relevant to the library team, which will review and decide on the PR/issue. 
  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.
  
    
  
    
This is practically a revert of a revert, making the commit e907456b2e10622ccd854a3bba8d02ce170b5dbb on
stdarchcome 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
CPUIDon 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_detectcrate 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 forstd::arch::is_riscv_feature_detected!users).Changes from the Original (rust-lang/stdarch#1779)
Zcbextension stdarch#1789 (remove footnote from the Zcb extension).linux-riscvML brought the conclusion that the Zicntr extension is included in the base IMA behavior.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