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:

  1. Either discoverable through a riscv_hwprobe system call on Linux 6.14
    or should be very helpful even on basic needs (the B extension),
  2. Does not disrupt current Rust's feature handling mechanism and
  3. 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


Related:

@rustbot r? @Amanieu
@rustbot label +T-compiler +O-riscv +A-target-feature