Skip to content

RISC-V target feature B implies Zba, Zbb, Zbs #139748

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

Closed
wants to merge 1 commit into from

Conversation

tux3
Copy link
Contributor

@tux3 tux3 commented Apr 13, 2025

zba, zbb, and zbs are already stable, B is a convenient alias for all three, so it seems reasonable to stabilize it as well.
This feature name is supported by our current LLVM version (and LLVM uses the same name).

The fourth bitmanip extension, Zbc, is not implied by B.

For reference, the RISC-V unprivileged manual defines this in chapter 29 on the B extension: https://github.com/riscv/riscv-isa-manual/releases

@rustbot
Copy link
Collaborator

rustbot commented Apr 13, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 13, 2025
@tux3 tux3 marked this pull request as ready for review April 13, 2025 12:26
@rust-log-analyzer

This comment has been minimized.

zba, zbb, and zbs are already stable, B is a convenient alias
for all three, so it seems reasonable to stabilize it as well.

The fourth bitmanip extension, Zbc, is not implied by B.
@tux3 tux3 force-pushed the riscv_target_feature_b branch from 27a8a9c to 88d1dcf Compare April 13, 2025 12:46
@fee1-dead
Copy link
Member

r? compiler

@rustbot rustbot assigned oli-obk and unassigned fee1-dead Apr 13, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Apr 14, 2025

who are the RISC-V maintainers?

Copy link

@michaelmaitland michaelmaitland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@michaelmaitland michaelmaitland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to check for LLVM compatibility similar to 62612af#diff-9f3bfd2fdc228dcb1b352082a7ebc39b19c8bea15b73141f72d9f5021aa3c66cR266-R268?

@tux3
Copy link
Contributor Author

tux3 commented Apr 14, 2025

It looks like FeatureStdExtB exists in rust-lang's fork of LLVM starting from LLVM 19: https://github.com/rust-lang/llvm-project/blob/rustc/19.1-2024-07-30/llvm/lib/Target/RISCV/RISCVFeatures.td

And it seems the minimum LLVM version was raised to 19 last week: 12167d7

So I think this should be good as is (the compat checks in 62612af also seem to have been removed)

@tux3
Copy link
Contributor Author

tux3 commented Apr 14, 2025

I noticed this comment says we may need t-lang, but I'm not too familiar with procedures yet. Is this a bors command? =)

https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/target_features.rs#L125

@oli-obk oli-obk added I-lang-nominated Nominated for discussion during a lang team meeting. T-lang Relevant to the language team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 14, 2025
@Amanieu
Copy link
Member

Amanieu commented Apr 16, 2025

I believe this is fine to stabilize but I would like to double-check with @a4lg @taiki-e who have been working on RISC-V target features.

@traviscross
Copy link
Contributor

In the lang call today, Amanieu proposed doing #139440 first here.

@rustbot labels -I-lang-nominated

r? Amanieu

@rustbot rustbot removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Apr 16, 2025
@rustbot rustbot assigned Amanieu and unassigned oli-obk Apr 16, 2025
@Amanieu
Copy link
Member

Amanieu commented Apr 16, 2025

#139440 also adds the B feature (along with some others), so I'm going to close this PR in favor of the other one.

@Amanieu Amanieu closed this Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants