rustc_target: Use "B" shorthand on the RISC-V Android target

The "B" extension is ratified as a combination of three extensions: "Zba",
"Zbb" and "Zbs".  To maximize discoverability of the RISC-V target features,
this commit makes use of the "B" extension instead of its three members.

This way, `#[cfg(target_feature = "b")]` can also be used instead of:
`#[cfg(all(target_feature = "zba", target_feature = "zbb", target_feature = "zbs"))]`
This commit is contained in:
Tsukasa OI 2025-04-06 04:21:01 +00:00
parent b084603c63
commit 52392ec9e1

View file

@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
code_model: Some(CodeModel::Medium),
cpu: "generic-rv64".into(),
features: "+m,+a,+f,+d,+c,+zicsr,+zifencei,+zba,+zbb,+zbs,+v".into(),
features: "+m,+a,+f,+d,+c,+b,+v,+zicsr,+zifencei".into(),
llvm_abiname: "lp64d".into(),
supported_sanitizers: SanitizerSet::ADDRESS,
max_atomic_width: Some(64),