Skip to content

Conversation

@a4lg
Copy link
Contributor

@a4lg a4lg commented Aug 30, 2025

This commit directly corresponds to rust-lang/rust#145948.
See that proposal for criteria of 29 new extensions.

Notes (for the Rust reference)

  • Updated existing a and c to imply its subset(s).
    • a equals zalrsc and zaamo combined (imply both from a).
    • The C extension always implies the Zca extension and conditionally implies Zcf and/or Zcd extensions (on RISC-V) but
      c (Rust target feature) only implies zca as both zcf and zcd are not to be stabilized on this proposal.
  • For each extension, linked to the first document containing it with the ratified state.
    For instance, all extensions present in the RVA23 profiles link to (3) (despite that they are present in (2)) because they were not ratified at the time when (2) is published.

References

  1. RISC-V Instruction Set Manual (version 20250508)
    https://github.com/riscv/riscv-isa-manual/tree/20250508
  2. RISC-V Profiles (version 1.0 - RVA23 profiles were not ratified at the time)
    https://github.com/riscv/riscv-profiles/tree/v1.0
  3. RISC-V Profiles (RVA23/RVB23-ratified version)
    https://github.com/riscv/riscv-profiles/tree/rva23-rvb23-ratified

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Aug 30, 2025
@a4lg a4lg force-pushed the riscv-extensions-2025.1 branch 2 times, most recently from c60bc59 to 25d43f0 Compare August 30, 2025 03:17
@a4lg a4lg force-pushed the riscv-extensions-2025.1 branch from 25d43f0 to a35f1c8 Compare August 30, 2025 04:18
@a4lg
Copy link
Contributor Author

a4lg commented Aug 30, 2025

Possible Consideration

Some platform behavior extensions are hard to make a short, concise summary.

Do we prefer to keep long(er than usual) descriptions? Or, do we just link to the RISC-V Profiles documentation and let it explain?

My Current Position

I prefer the latter if allowed but mdbook design is confirmed not broken so the current approach (long descriptions) is okay for me.

@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Sep 2, 2025
@a4lg
Copy link
Contributor Author

a4lg commented Sep 11, 2025

Ping. Can someone review this PR?

@a4lg
Copy link
Contributor Author

a4lg commented Sep 17, 2025

Non-stabilization part is separated as #2002.

Submission v2 (zacas is added) of this PR is a superset of #2002.

@a4lg a4lg force-pushed the riscv-extensions-2025.1 branch from a35f1c8 to d27acfa Compare September 17, 2025 12:45
@a4lg a4lg changed the title RISC-V Extensions update including 28 extensions to stabilize RISC-V Extensions update including 29 extensions to stabilize Sep 17, 2025
@a4lg a4lg force-pushed the riscv-extensions-2025.1 branch from d27acfa to 5527d55 Compare September 18, 2025 01:02
@a4lg
Copy link
Contributor Author

a4lg commented Sep 18, 2025

cc: @Amanieu, @RalfJung

@a4lg a4lg force-pushed the riscv-extensions-2025.1 branch from 5527d55 to 9d250ee Compare September 29, 2025 02:22
@rustbot
Copy link
Collaborator

rustbot commented Sep 29, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@a4lg a4lg force-pushed the riscv-extensions-2025.1 branch from 9d250ee to 94395db Compare September 29, 2025 02:59
This commit directly corresponds to rust-lang/rust#145948.
See that proposal for criteria of 29 new extensions.

Notes (for the Rust reference):

*   Updated existing `a` and `c` to imply its subset(s).
    *   `a` equals `zalrsc` and `zaamo` combined (imply both from `a`).
    *   The C extension always implies the Zca extension and
        conditionally implies Zcf and/or Zcd extensions (on RISC-V) but
        `c` (Rust target feature) only implies `zca` as both `zcf` and
        `zcd` are not to be stabilized on this proposal.
*   For each extension, linked to the first document containing it with
    the ratified state.  For instance, all extensions present in the
    RVA23 profiles link to (3) (despite that they are present in (2))
    because they were not ratified at the time when (2) is published.

References:

1.  RISC-V Instruction Set Manual (version 20250508):
    <https://github.com/riscv/riscv-isa-manual/tree/20250508>
2.  RISC-V Profiles (version 1.0 - RVA23 profiles were not ratified at the time):
    <https://github.com/riscv/riscv-profiles/tree/v1.0>
3.  RISC-V Profiles (RVA23/RVB23-ratified version):
    <https://github.com/riscv/riscv-profiles/tree/rva23-rvb23-ratified>
@a4lg a4lg force-pushed the riscv-extensions-2025.1 branch from 94395db to 317dbf6 Compare September 29, 2025 03:07
@a4lg
Copy link
Contributor Author

a4lg commented Sep 29, 2025

Rebased and made some clarification in the commit message (the same as the edited initial comment).

@a4lg
Copy link
Contributor Author

a4lg commented Dec 21, 2025

3 days ago, corresponding stabilization proposal riscv_ratified_v2 (rust-lang/rust#145948) is entered its final comment period.

To reviewers: Please prepare for actual stabilization. It is not to be merged for now (in the FCP period) but approving this PR is appreciated!

EDIT: I checked the changes again and no rebase seems required.

@a4lg
Copy link
Contributor Author

a4lg commented Dec 28, 2025

The corresponding change (pull request) has finished its FCP and has been marked Complete.

I understand that many people are on holiday at the end of the year (so there’s no urgency), but I would appreciate it if you could approve this change as well.

@a4lg
Copy link
Contributor Author

a4lg commented Jan 3, 2026

@Amanieu Thanks for re-approval. However, this project requires approvals from at least two person (with write access) and we have to find someone else to approve this PR.

bors added a commit to rust-lang/rust that referenced this pull request Jan 3, 2026
…anieu

Stabilize 29 RISC-V target features (`riscv_ratified_v2`)

This commit stabilizes RISC-V target features with following constraints:

*   Describes a ratified extension.
*   Implemented on Rust 1.88.0 or before.
    Waiting for four+ version cycles seems sufficient.
*   Does not disrupt current rustc's target feature (cf. #140570) + ABI (cf. #132618) handling.
    It excludes `E` and all floating point-arithmetic extensions.  The `Zfinx` family does not involve floating point registers but not stabilizing for now to avoid possible confusion between the `F` extension family.
*   Not vector-related (floating point and integer).
    While integer vector subsets should not cause any ABI issues (as they don't use ABI-dependent floating point registers), we need to discuss before stabilizing them.
*   Supported by the lowest LLVM version supported by rustc (LLVM 20).

List of target features to be stabilized:

1.  `b`
2.  `za64rs` (no-RT)
3.  `za128rs` (no-RT)
4.  `zaamo`
5.  `zabha`
6.  `zacas`
7.  `zalrsc`
8.  `zama16b` (no-RT)
9.  `zawrs`
10.  `zca`
11. `zcb`
12. `zcmop`
13. `zic64b` (no-RT)
14. `zicbom`
15. `zicbop` (no-RT)
16. `zicboz`
17. `ziccamoa` (no-RT)
18. `ziccif` (no-RT)
19. `zicclsm` (no-RT)
20. `ziccrse` (no-RT)
21. `zicntr`
22. `zicond`
23. `zicsr`
24. `zifencei`
25. `zihintntl`
26. `zihintpause`
27. `zihpm`
28. `zimop`
29. `ztso`

Of which, 20 of them (29 minus 9 "no-RT" target features) support runtime detection through `std::arch::is_riscv_feature_detected!()`.

Corresponding PR for the Reference: rust-lang/reference#1987
@tshepang
Copy link
Member

tshepang commented Jan 3, 2026

@a4lg just one person needs to approve, provided they are member of these teams

@a4lg
Copy link
Contributor Author

a4lg commented Jan 3, 2026

@tshepang Ah I misunderstood some of GitHub system messages. Sorry.

Still, it needs an approve from others. Given the fact that corresponding rust-lang/rust#145948 is already in the merge queue, I'd like to avoid de-sync between the implementation and the reference manual.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks! Merging now that rust-lang/rust#145948 has been merged.

@ehuss ehuss added this pull request to the merge queue Jan 3, 2026
Merged via the queue into rust-lang:master with commit 28b5a54 Jan 3, 2026
5 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jan 3, 2026
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 4, 2026
…anieu

Stabilize 29 RISC-V target features (`riscv_ratified_v2`)

This commit stabilizes RISC-V target features with following constraints:

*   Describes a ratified extension.
*   Implemented on Rust 1.88.0 or before.
    Waiting for four+ version cycles seems sufficient.
*   Does not disrupt current rustc's target feature (cf. rust-lang/rust#140570) + ABI (cf. rust-lang/rust#132618) handling.
    It excludes `E` and all floating point-arithmetic extensions.  The `Zfinx` family does not involve floating point registers but not stabilizing for now to avoid possible confusion between the `F` extension family.
*   Not vector-related (floating point and integer).
    While integer vector subsets should not cause any ABI issues (as they don't use ABI-dependent floating point registers), we need to discuss before stabilizing them.
*   Supported by the lowest LLVM version supported by rustc (LLVM 20).

List of target features to be stabilized:

1.  `b`
2.  `za64rs` (no-RT)
3.  `za128rs` (no-RT)
4.  `zaamo`
5.  `zabha`
6.  `zacas`
7.  `zalrsc`
8.  `zama16b` (no-RT)
9.  `zawrs`
10.  `zca`
11. `zcb`
12. `zcmop`
13. `zic64b` (no-RT)
14. `zicbom`
15. `zicbop` (no-RT)
16. `zicboz`
17. `ziccamoa` (no-RT)
18. `ziccif` (no-RT)
19. `zicclsm` (no-RT)
20. `ziccrse` (no-RT)
21. `zicntr`
22. `zicond`
23. `zicsr`
24. `zifencei`
25. `zihintntl`
26. `zihintpause`
27. `zihpm`
28. `zimop`
29. `ztso`

Of which, 20 of them (29 minus 9 "no-RT" target features) support runtime detection through `std::arch::is_riscv_feature_detected!()`.

Corresponding PR for the Reference: rust-lang/reference#1987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants