This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit fb53ad6
authored
Unrolled build for rust-lang#139440
Rollup merge of rust-lang#139440 - a4lg:riscv-feature-addition-batch-2, r=Amanieu
rustc_target: RISC-V: feature addition batch 2
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:
* [The latest ratified ISA Manuals (version 20240411)](https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154769/RISC-V+Technical+Specifications)
Linux Definition: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwprobe.h
LLVM Definitions:
* [`B`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L507-L510)
* [`Zca`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L395-L398)
* [`Zcb`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L407-L410)
* [`Zcmop`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L460-L463)
* [`Zfa`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L335-L338)
* [`Zicboz`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L89-L92)
* [`Zicond`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L125-L128)
* [`Zihintntl`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L148-L151)
* [`Zimop`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L161-L162)
* [`Ztso`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L214-L217)
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:
* rust-lang#44839
(`riscv_target_feature`)
* rust-lang#138823
(my previous batch)
* rust-lang#132618
(stabilization of the `Zfa` extension is blocked by this)
`@rustbot` r? `@Amanieu`
`@rustbot` label +T-compiler +O-riscv +A-target-featureFile tree
3 files changed
+22
-2
lines changed- compiler/rustc_target/src
- spec/targets
- tests/ui/check-cfg
3 files changed
+22
-2
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
| 495 | + | |
495 | 496 | | |
496 | 497 | | |
497 | 498 | | |
| |||
520 | 521 | | |
521 | 522 | | |
522 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
523 | 527 | | |
| 528 | + | |
524 | 529 | | |
525 | 530 | | |
526 | 531 | | |
527 | 532 | | |
528 | 533 | | |
| 534 | + | |
529 | 535 | | |
| 536 | + | |
530 | 537 | | |
531 | 538 | | |
| 539 | + | |
532 | 540 | | |
533 | 541 | | |
| 542 | + | |
534 | 543 | | |
535 | 544 | | |
536 | 545 | | |
| |||
541 | 550 | | |
542 | 551 | | |
543 | 552 | | |
| 553 | + | |
544 | 554 | | |
545 | 555 | | |
546 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
321 | 325 | | |
| 326 | + | |
322 | 327 | | |
323 | 328 | | |
324 | 329 | | |
325 | 330 | | |
326 | 331 | | |
| 332 | + | |
327 | 333 | | |
| 334 | + | |
328 | 335 | | |
329 | 336 | | |
| 337 | + | |
330 | 338 | | |
331 | 339 | | |
| 340 | + | |
332 | 341 | | |
333 | 342 | | |
334 | 343 | | |
| |||
339 | 348 | | |
340 | 349 | | |
341 | 350 | | |
| 351 | + | |
342 | 352 | | |
343 | 353 | | |
344 | 354 | | |
| |||
0 commit comments