Skip to content

stabilize s390x vector registers#154184

Open
folkertdev wants to merge 1 commit intorust-lang:mainfrom
folkertdev:stabilize-s390x-vector-registers
Open

stabilize s390x vector registers#154184
folkertdev wants to merge 1 commit intorust-lang:mainfrom
folkertdev:stabilize-s390x-vector-registers

Conversation

@folkertdev
Copy link
Contributor

tracking issue: #133416

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-lang-nominated Nominated for discussion during a lang team meeting. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants