Skip to content

Conversation

TimotheeIsnard
Copy link

These target features use the same names as LLVM and is_riscv_feature_detected!, they are:

  • zba (address generation instructions)
  • zbb (basic bit manipulation)
  • zbc (carry-less multiplication)
  • zbs (single-bit manipulation)

The extension is frozen and ratified, and I don't think we should expect LLVM to change those feature names in the future.
For reference, the specification for the B extension can be found here: https://github.com/riscv/riscv-bitmanip/releases/download/1.0.0/bitmanip-1.0.0-38-g865e7a7.pdf)

On my current project, I see a 7.6% reduction in binary size with these features on, so I have some incentive to try to silence the "unknown feature" warning from -Ctarget-feature =)

These use the same names as LLVM and is_riscv_feature_detected!:
- zba (address generation instructions)
- zbb (basic bit manipulation)
- zbc (carry-less multiplication)
- zbs (single-bit manipulation)
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 14, 2022
@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 14, 2022
@bjorn3
Copy link
Member

bjorn3 commented Aug 14, 2022

I don't think we should expect LLVM to change those feature names in the future.

Even if it did, we could always remap the feature name like we already do for a couple of stabilized features. (Although in those cases we remapped them to give a less confusing name rather than because LLVM changed the name I believe.)

@bjorn3 bjorn3 added the O-riscv Target: RISC-V architecture label Aug 14, 2022
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 15, 2022

📌 Commit be8fd0e has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2022
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#100031 (improve "try ignoring the field" diagnostic)
 - rust-lang#100325 (Rustdoc-Json: Don't remove impls for items imported from private modules)
 - rust-lang#100377 (Replace - with _ in fluent slugs to improve developer workflows)
 - rust-lang#100458 (Adjust span of fn argument declaration)
 - rust-lang#100514 (Delay span bug when failing to normalize negative coherence impl subject due to other malformed impls)
 - rust-lang#100528 (Support 1st group of RISC-V Bitmanip backend target features)
 - rust-lang#100559 (Parser simplifications)
 - rust-lang#100568 (Fix STD build for ESP-IDF)
 - rust-lang#100582 ([rustdoc] Fix handling of stripped enum variant in JSON output format)
 - rust-lang#100586 (Reland changes replacing num_cpus with available_parallelism )

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 17914c8 into rust-lang:master Aug 15, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 15, 2022
@tux3 tux3 deleted the riscv-bitmanip-features branch August 16, 2022 07:34
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants