Skip to content

stabilize s390x vector registers#154184

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
folkertdev:stabilize-s390x-vector-registers
Apr 8, 2026
Merged

stabilize s390x vector registers#154184
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
folkertdev:stabilize-s390x-vector-registers

Conversation

@folkertdev
Copy link
Copy Markdown
Contributor

@folkertdev folkertdev commented Mar 21, 2026

tracking issue: #133416
reference PR: rust-lang/reference#2215

Stabilizes s390x vector registers, e.g.

unsafe fn vreg_128(x: i128) -> i128 {
    let y;
    asm!("vlr {}, {}", out(vreg) y, in(vreg) x);
    y
}

The types that are accepted for vreg registers are

  • all float types f16, f32, f64, f128
  • integer types i32, i64 and i128 and their unsigned counterparts
  • integer vector types i8x16, i16x8, i32x4, i64x2 and their unsigned counterparts
  • float vector types f16x8, f32x4 and f64x2

Support for all of these is tested in https://github.com/rust-lang/rust/blob/main/tests/assembly-llvm/asm/s390x-types.rs, and the types correspond with the LLVM definition in https://github.com/llvm/llvm-project/blob/df9eb79970c012990e829d174d181d575d414efe/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L312-L339

The f16, f16x8 and f128 types are unstable, and so can't be used on stable in practice. They do show up in some error messages though.

vreg was previously only accepted as a clobber.


Currently the vector types in core::arch::s390x are still unstable. Separately stabilizing vreg is still useful because scalar types can also be put into vregs.

Implementation history

cc @uweigand @taiki-e
r? @Amanieu

@folkertdev folkertdev added the I-lang-nominated Nominated for discussion during a lang team meeting. label Mar 21, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 21, 2026
@rust-log-analyzer

This comment has been minimized.

@folkertdev folkertdev force-pushed the stabilize-s390x-vector-registers branch from 2986c81 to ba604f5 Compare March 21, 2026 18:30
@rust-log-analyzer

This comment has been minimized.

@folkertdev folkertdev force-pushed the stabilize-s390x-vector-registers branch from ba604f5 to e182fef Compare March 21, 2026 19:58
@traviscross traviscross added P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang T-lang Relevant to the language team labels Mar 25, 2026
@traviscross
Copy link
Copy Markdown
Contributor

Thanks @folkertdev; I'll be looking to see that @Amanieu confirms this is OK after the back and force.

@rfcbot fcp merge lang

@rust-rfcbot
Copy link
Copy Markdown
Collaborator

rust-rfcbot commented Mar 25, 2026

Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Mar 25, 2026
@traviscross traviscross added I-lang-radar Items that are on lang's radar and will need eventual work or consideration. and removed I-lang-nominated Nominated for discussion during a lang team meeting. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels Mar 25, 2026
@scottmcm
Copy link
Copy Markdown
Member

Happy to trust @Amanieu for this.

@rfcbot reviewed

@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Mar 25, 2026
@rust-rfcbot
Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Apr 4, 2026
@rust-rfcbot
Copy link
Copy Markdown
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

@folkertdev
Copy link
Copy Markdown
Contributor Author

@bors r=Amanieu

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 8, 2026

📌 Commit e182fef has been approved by Amanieu

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 8, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #153995 (Use convergent attribute to funcs for GPU targets)
 - #154184 (stabilize s390x vector registers)
 - #151898 (constify DoubleEndedIterator)
 - #154235 (remove unnecessary variables and delimiter check)
 - #154473 (move borrow checker tests)
 - #154745 (Replace span_look_ahead with span_followed_by)
 - #154778 (make field representing types invariant over the base type)
 - #154867 (Fix private fields diagnostics and improve error messages)
 - #154879 (Don't store `pattern_ty` in `TestableCase`)
 - #154910 (Suppress `unreachable_code` lint in `derive(PartialEq, Clone)`)
 - #154923 (Fix ICE in next-solver dyn-compatibility check)
 - #154934 (Add getters for `rustc_pattern_analysis::constructor::Slice` fields)
 - #154938 (match exhaustiveness: Show the guard exhaustivity note only when it's the guards alone that cause non-exhaustiveness)
 - #154961 (Use derived impl for `GappedRange` subdiagnostic)
 - #154980 (rustc-dev-guide subtree update)
@rust-bors rust-bors bot merged commit 3e027ff into rust-lang:main Apr 8, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 8, 2026
rust-timer added a commit that referenced this pull request Apr 8, 2026
Rollup merge of #154184 - folkertdev:stabilize-s390x-vector-registers, r=Amanieu

stabilize s390x vector registers

tracking issue: #133416
reference PR: rust-lang/reference#2215

Stabilizes s390x vector registers, e.g.

```rust
unsafe fn vreg_128(x: i128) -> i128 {
    let y;
    asm!("vlr {}, {}", out(vreg) y, in(vreg) x);
    y
}
```

The types that are accepted for vreg registers are

- all float types `f16`,  `f32`, `f64`, `f128`
- integer types `i32`, `i64` and `i128` and their unsigned counterparts
- integer vector types `i8x16`, `i16x8`, `i32x4`, `i64x2` and their unsigned counterparts
- float vector types `f16x8`, `f32x4` and `f64x2`

Support for all of these is tested in https://github.com/rust-lang/rust/blob/main/tests/assembly-llvm/asm/s390x-types.rs, and the types correspond with the LLVM definition in https://github.com/llvm/llvm-project/blob/df9eb79970c012990e829d174d181d575d414efe/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L312-L339

The `f16`, `f16x8` and `f128` types are unstable, and so can't be used on stable in practice. They do show up in some error messages though.

`vreg` was previously only accepted as a clobber.

---

Currently the vector types in `core::arch::s390x` are still unstable. Separately stabilizing `vreg` is still useful because scalar types can also be put into `vreg`s.

## Implementation history

- #131664
- #150826

cc @uweigand @taiki-e
r? @Amanieu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants