rustc_target: RISC-V: feature addition batch 2 by a4lg · Pull Request #139440 · rust-lang/rust (original) (raw)
Of ratified RISC-V extensions, this commit adds ones satisfying following criteria:
- Either discoverable through a
riscv_hwprobe
system call on Linux 6.14
or should be very helpful even on basic needs (theB
extension), - Does not disrupt current Rust's feature handling mechanism and
- Not too OS-dependent (the
Supm
extension)
Due to 2., the author excluded Zcf
(RV32 only) and Zcd
from the list despite that they are discoverable from Linux 6.14.
Due to 3., the author excluded the Supm
extension on the PR version 2.
This is based on the specification:
Linux Definition: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwprobe.h
LLVM Definitions:
The author also adds required implication: C
implies Zca
.
Android RISC-V target is also updated to include the B
extension (this is just a shorthand combination of Zba
, Zbb
and Zbs
extensions but possibly simplifies target_feature
handling).
History
Version 1 → 2
- Remove the
Supm
extension from the Rust target features (thanks, @Amanieu).
Related:
- Tracking issue for RFC 2045: improving #[target_feature] #44839
(riscv_target_feature
) - rustc_target: RISC-V: add base I-related important extensions #138823
(my previous batch) - Some -Ctarget-features must be restrained on RISCV #132618
(stabilization of theZfa
extension is blocked by this)
@rustbot r? @Amanieu
@rustbot label +T-compiler +O-riscv +A-target-feature