Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize Ratified RISC-V Target Features #1476

Merged

Conversation

coastalwhite
Copy link
Contributor

@coastalwhite coastalwhite commented Oct 4, 2023

As shortly discussed on Zulip
(https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704), this commit PR the ratified RISC-V instruction bases and extensions.

Specifically, this PR stabilizes the:

  • Instruction-Fetch Fence (Zifencei) on v2.0
  • Control and Status Register (Zcsr) on v2.0
  • Pause Hint (Zihintpause) on v2.0
  • Zicntr and Zihpm were ratified March 2023
  • Total Store Ordering (Ztso) on v1.0
  • Supervisor-level Instructions (S) on v1.12
  • Atomic Instructions (A) on v2.0
  • Compressed Instructions (C) on v2.0
  • Double-Precision Floating-Point (D) on v2.2
  • Embedded Base (E) (Given as RV32E / RV64E) on v2.0
  • Single-Precision Floating-Point (F) on v2.2
  • Integer Multiplication and Division (M) on v2.0
  • Vector Operations (V) on v1.0
  • Bit Manipulations (B) on v1.0 listed as zba, zbc, zbs
  • Scalar Cryptography (Zk) v1.0.1 listed as zk, zkn, zknd, zkne, zknh, zkr, zks, zksed, zksh, zkt, zbkb, zbkc zkbx
  • Double-Precision Floating-Point in Integer Register (Zdinx) on v1.0
  • Half-Precision Floating-Point (Zfh) on v1.0
  • Minimal Half-Precision Floating-Point (Zfhmin) on v1.0
  • Single-Precision Floating-Point in Integer Register (Zfinx) on v1.0
  • Half-Precision Floating-Point in Integer Register (Zhinx) on v1.0
  • Minimal Half-Precision Floating-Point in Integer Register (Zhinxmin) on v1.0

When this is merged, a PR for the main Rust repository can be created.

@rustbot
Copy link
Collaborator

rustbot commented Oct 4, 2023

r? @Amanieu

(rustbot has picked a reviewer for you, use r? to override)

@Amanieu
Copy link
Member

Amanieu commented Oct 6, 2023

Could you open a PR for rust-lang/rust first which stabilizes the compiler-level feature names so that we can start a T-lang FCP on that?

@coastalwhite
Copy link
Contributor Author

Do I need to request a separate FCP for this PR or is this also okay to merge if rust-lang/rust#116485 passes the FCP?

@Amanieu
Copy link
Member

Amanieu commented Oct 19, 2023

The other FCP is sufficient.

@bors
Copy link
Contributor

bors commented Oct 29, 2023

☔ The latest upstream changes (presumably 68b3ddf) made this pull request unmergeable. Please resolve the merge conflicts.

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 30, 2023
…features, r=Amanieu

Stabilize Ratified RISC-V Target Features

Stabilization PR for the ratified RISC-V target features. This stabilizes some of the target features tracked by rust-lang#44839. This is also a part of rust-lang#114544 and eventually needed for the RISC-V part of rust-lang/rfcs#3268.

There is a similar PR for the the stdarch crate which can be found at rust-lang/stdarch#1476.

This was briefly discussed on Zulip
(https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704).

Specifically, this PR stabilizes the:
* Atomic Instructions (A) on v2.0
* Compressed Instructions (C) on v2.0
* ~Double-Precision Floating-Point (D) on v2.2~
* ~Embedded Base (E) (Given as `RV32E` / `RV64E`) on v2.0~
* ~Single-Precision Floating-Point (F) on v2.2~
* Integer Multiplication and Division (M) on v2.0
* ~Vector Operations (V) on v1.0~
* Bit Manipulations (B) on v1.0 listed as `zba`, `zbc`, `zbs`
* Scalar Cryptography (Zk) v1.0.1 listed as `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `zbkb`, `zbkc` `zkbx`
* ~Double-Precision Floating-Point in Integer Register (Zdinx) on v1.0~
* ~Half-Precision Floating-Point (Zfh) on v1.0~
* ~Minimal Half-Precision Floating-Point (Zfhmin) on v1.0~
* ~Single-Precision Floating-Point in Integer Register (Zfinx) on v1.0~
* ~Half-Precision Floating-Point in Integer Register (Zhinx) on v1.0~
* ~Minimal Half-Precision Floating-Point in Integer Register (Zhinxmin) on v1.0~

r? `@Amanieu`
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Nov 2, 2023
… r=Amanieu

Stabilize Ratified RISC-V Target Features

Stabilization PR for the ratified RISC-V target features. This stabilizes some of the target features tracked by #44839. This is also a part of #114544 and eventually needed for the RISC-V part of rust-lang/rfcs#3268.

There is a similar PR for the the stdarch crate which can be found at rust-lang/stdarch#1476.

This was briefly discussed on Zulip
(https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704).

Specifically, this PR stabilizes the:
* Atomic Instructions (A) on v2.0
* Compressed Instructions (C) on v2.0
* ~Double-Precision Floating-Point (D) on v2.2~
* ~Embedded Base (E) (Given as `RV32E` / `RV64E`) on v2.0~
* ~Single-Precision Floating-Point (F) on v2.2~
* Integer Multiplication and Division (M) on v2.0
* ~Vector Operations (V) on v1.0~
* Bit Manipulations (B) on v1.0 listed as `zba`, `zbc`, `zbs`
* Scalar Cryptography (Zk) v1.0.1 listed as `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `zbkb`, `zbkc` `zkbx`
* ~Double-Precision Floating-Point in Integer Register (Zdinx) on v1.0~
* ~Half-Precision Floating-Point (Zfh) on v1.0~
* ~Minimal Half-Precision Floating-Point (Zfhmin) on v1.0~
* ~Single-Precision Floating-Point in Integer Register (Zfinx) on v1.0~
* ~Half-Precision Floating-Point in Integer Register (Zhinx) on v1.0~
* ~Minimal Half-Precision Floating-Point in Integer Register (Zhinxmin) on v1.0~

r? `@Amanieu`
@coastalwhite coastalwhite force-pushed the stabilize-riscv-target-features branch from eb43384 to b4c4a89 Compare November 3, 2023 10:47
@coastalwhite
Copy link
Contributor Author

I just rebased this onto the master branch and force pushed. I think this is mergable now.

@Amanieu
Copy link
Member

Amanieu commented Nov 18, 2023

Can you bump the version number in the attributes to 1.76 (current nightly)?

@coastalwhite coastalwhite force-pushed the stabilize-riscv-target-features branch from b4c4a89 to d1e69d3 Compare November 19, 2023 13:20
@coastalwhite
Copy link
Contributor Author

Can you bump the version number in the attributes to 1.76 (current nightly)?

Done

crates/std_detect/src/detect/arch/riscv.rs Outdated Show resolved Hide resolved
crates/std_detect/src/detect/arch/riscv.rs Outdated Show resolved Hide resolved
crates/std_detect/src/detect/arch/riscv.rs Outdated Show resolved Hide resolved
@coastalwhite coastalwhite force-pushed the stabilize-riscv-target-features branch 2 times, most recently from 327062c to 64a5bbe Compare November 22, 2023 11:05
Comment on lines 158 to 159
@FEATURE: #[stable(feature = "riscv_ratified", since = "1.76.0")] zb: "zb";
/// "Zb" Standard Extension for Bit Manipulation
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. It was still unstaged on my pc. This should be fixed now.

@coastalwhite coastalwhite force-pushed the stabilize-riscv-target-features branch from 64a5bbe to 2cd47a5 Compare November 23, 2023 14:31
@Amanieu
Copy link
Member

Amanieu commented Nov 30, 2023

CI should be fixed, can you rebase?

As shortly discussed on Zulip
(https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704), this commit stabilizes the ratified RISC-V instruction bases and extensions.

Specifically, this commit stabilizes the:
* Atomic Instructions (A) on v2.0
* Compressed Instructions (C) on v2.0
* Integer Multiplication and Division (M) on v2.0
* Bit Manipulations (B) on v1.0 listed as `zba`, `zbc`, `zbs`
* Scalar Cryptography (Zk) v1.0.1 listed as `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `zbkb`, `zbkc` `zkbx`
@coastalwhite coastalwhite force-pushed the stabilize-riscv-target-features branch from 2cd47a5 to 2e6dcf2 Compare November 30, 2023 20:24
@coastalwhite
Copy link
Contributor Author

Done 😄

@Amanieu Amanieu merged commit 821a641 into rust-lang:master Nov 30, 2023
26 checks passed
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Apr 7, 2024
… r=Amanieu

Stabilize Ratified RISC-V Target Features

Stabilization PR for the ratified RISC-V target features. This stabilizes some of the target features tracked by #44839. This is also a part of #114544 and eventually needed for the RISC-V part of rust-lang/rfcs#3268.

There is a similar PR for the the stdarch crate which can be found at rust-lang/stdarch#1476.

This was briefly discussed on Zulip
(https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704).

Specifically, this PR stabilizes the:
* Atomic Instructions (A) on v2.0
* Compressed Instructions (C) on v2.0
* ~Double-Precision Floating-Point (D) on v2.2~
* ~Embedded Base (E) (Given as `RV32E` / `RV64E`) on v2.0~
* ~Single-Precision Floating-Point (F) on v2.2~
* Integer Multiplication and Division (M) on v2.0
* ~Vector Operations (V) on v1.0~
* Bit Manipulations (B) on v1.0 listed as `zba`, `zbc`, `zbs`
* Scalar Cryptography (Zk) v1.0.1 listed as `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `zbkb`, `zbkc` `zkbx`
* ~Double-Precision Floating-Point in Integer Register (Zdinx) on v1.0~
* ~Half-Precision Floating-Point (Zfh) on v1.0~
* ~Minimal Half-Precision Floating-Point (Zfhmin) on v1.0~
* ~Single-Precision Floating-Point in Integer Register (Zfinx) on v1.0~
* ~Half-Precision Floating-Point in Integer Register (Zhinx) on v1.0~
* ~Minimal Half-Precision Floating-Point in Integer Register (Zhinxmin) on v1.0~

r? `@Amanieu`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
… r=Amanieu

Stabilize Ratified RISC-V Target Features

Stabilization PR for the ratified RISC-V target features. This stabilizes some of the target features tracked by #44839. This is also a part of #114544 and eventually needed for the RISC-V part of rust-lang/rfcs#3268.

There is a similar PR for the the stdarch crate which can be found at rust-lang/stdarch#1476.

This was briefly discussed on Zulip
(https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704).

Specifically, this PR stabilizes the:
* Atomic Instructions (A) on v2.0
* Compressed Instructions (C) on v2.0
* ~Double-Precision Floating-Point (D) on v2.2~
* ~Embedded Base (E) (Given as `RV32E` / `RV64E`) on v2.0~
* ~Single-Precision Floating-Point (F) on v2.2~
* Integer Multiplication and Division (M) on v2.0
* ~Vector Operations (V) on v1.0~
* Bit Manipulations (B) on v1.0 listed as `zba`, `zbc`, `zbs`
* Scalar Cryptography (Zk) v1.0.1 listed as `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `zbkb`, `zbkc` `zkbx`
* ~Double-Precision Floating-Point in Integer Register (Zdinx) on v1.0~
* ~Half-Precision Floating-Point (Zfh) on v1.0~
* ~Minimal Half-Precision Floating-Point (Zfhmin) on v1.0~
* ~Single-Precision Floating-Point in Integer Register (Zfinx) on v1.0~
* ~Half-Precision Floating-Point in Integer Register (Zhinx) on v1.0~
* ~Minimal Half-Precision Floating-Point in Integer Register (Zhinxmin) on v1.0~

r? `@Amanieu`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants