Skip to content

Stabilize passing 128-bit integers via vector registers with asm! on x86 - #2313

Open
folkertdev wants to merge 2 commits into
rust-lang:masterfrom
folkertdev:assembly-x86-i128
Open

Stabilize passing 128-bit integers via vector registers with asm! on x86#2313
folkertdev wants to merge 2 commits into
rust-lang:masterfrom
folkertdev:assembly-x86-i128

Conversation

@folkertdev

@folkertdev folkertdev commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

I believe that this is the only change that is needed.

Stabilization PR: rust-lang/rust#159525
Tracking Issue: rust-lang/rust#133416

@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Jul 28, 2026
Comment thread src/inline-assembly.md Outdated

@traviscross traviscross left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved modulo fixing the missing backticks.

View changes since this review

Co-authored-by: Eric Huss <eric@huss.org>
@folkertdev
folkertdev marked this pull request as ready for review July 28, 2026 18:08
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jul 28, 2026
@traviscross traviscross removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jul 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 1, 2026
… r=Amanieu

Stabilize passing 128-bit integers via vector registers with `asm!` on x86

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

# Stabilization report

## Summary

Stabilize passing 128-bit integers via vector registers with `asm!` on x86 and x86_64:

```rust
// Use 128-bit integers with vector registers.
let mut v = 0u128;

asm!("/* {:x} */", in(xmm_reg) v);
asm!("/* {:x} */", out(xmm_reg) v);

asm!("/* {:y} */", in(ymm_reg) v);
asm!("/* {:y} */", out(ymm_reg) v);

asm!("/* {:z} */", in(zmm_reg) v);
asm!("/* {:z} */", out(zmm_reg) v);
```

32-bit and 64-bit integer types can already be passed via vector registers. LLVM has supported 128-bit integers since 2019, see llvm/llvm-project#42502, so `rustc` not supporting them seems like an oversight.

This feature is part of [`asm_experimental_reg`](rust-lang#133416). We're not stabilizing that feature as a whole, but only pull out part of it.

## History

- rust-lang#151059

## Open questions

None.

r? Amanieu
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 1, 2026
… r=Amanieu

Stabilize passing 128-bit integers via vector registers with `asm!` on x86

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

# Stabilization report

## Summary

Stabilize passing 128-bit integers via vector registers with `asm!` on x86 and x86_64:

```rust
// Use 128-bit integers with vector registers.
let mut v = 0u128;

asm!("/* {:x} */", in(xmm_reg) v);
asm!("/* {:x} */", out(xmm_reg) v);

asm!("/* {:y} */", in(ymm_reg) v);
asm!("/* {:y} */", out(ymm_reg) v);

asm!("/* {:z} */", in(zmm_reg) v);
asm!("/* {:z} */", out(zmm_reg) v);
```

32-bit and 64-bit integer types can already be passed via vector registers. LLVM has supported 128-bit integers since 2019, see llvm/llvm-project#42502, so `rustc` not supporting them seems like an oversight.

This feature is part of [`asm_experimental_reg`](rust-lang#133416). We're not stabilizing that feature as a whole, but only pull out part of it.

## History

- rust-lang#151059

## Open questions

None.

r? Amanieu
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 2, 2026
… r=Amanieu

Stabilize passing 128-bit integers via vector registers with `asm!` on x86

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

# Stabilization report

## Summary

Stabilize passing 128-bit integers via vector registers with `asm!` on x86 and x86_64:

```rust
// Use 128-bit integers with vector registers.
let mut v = 0u128;

asm!("/* {:x} */", in(xmm_reg) v);
asm!("/* {:x} */", out(xmm_reg) v);

asm!("/* {:y} */", in(ymm_reg) v);
asm!("/* {:y} */", out(ymm_reg) v);

asm!("/* {:z} */", in(zmm_reg) v);
asm!("/* {:z} */", out(zmm_reg) v);
```

32-bit and 64-bit integer types can already be passed via vector registers. LLVM has supported 128-bit integers since 2019, see llvm/llvm-project#42502, so `rustc` not supporting them seems like an oversight.

This feature is part of [`asm_experimental_reg`](rust-lang#133416). We're not stabilizing that feature as a whole, but only pull out part of it.

## History

- rust-lang#151059

## Open questions

None.

r? Amanieu
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 2, 2026
… r=Amanieu

Stabilize passing 128-bit integers via vector registers with `asm!` on x86

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

# Stabilization report

## Summary

Stabilize passing 128-bit integers via vector registers with `asm!` on x86 and x86_64:

```rust
// Use 128-bit integers with vector registers.
let mut v = 0u128;

asm!("/* {:x} */", in(xmm_reg) v);
asm!("/* {:x} */", out(xmm_reg) v);

asm!("/* {:y} */", in(ymm_reg) v);
asm!("/* {:y} */", out(ymm_reg) v);

asm!("/* {:z} */", in(zmm_reg) v);
asm!("/* {:z} */", out(zmm_reg) v);
```

32-bit and 64-bit integer types can already be passed via vector registers. LLVM has supported 128-bit integers since 2019, see llvm/llvm-project#42502, so `rustc` not supporting them seems like an oversight.

This feature is part of [`asm_experimental_reg`](rust-lang#133416). We're not stabilizing that feature as a whole, but only pull out part of it.

## History

- rust-lang#151059

## Open questions

None.

r? Amanieu
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 2, 2026
… r=Amanieu

Stabilize passing 128-bit integers via vector registers with `asm!` on x86

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

# Stabilization report

## Summary

Stabilize passing 128-bit integers via vector registers with `asm!` on x86 and x86_64:

```rust
// Use 128-bit integers with vector registers.
let mut v = 0u128;

asm!("/* {:x} */", in(xmm_reg) v);
asm!("/* {:x} */", out(xmm_reg) v);

asm!("/* {:y} */", in(ymm_reg) v);
asm!("/* {:y} */", out(ymm_reg) v);

asm!("/* {:z} */", in(zmm_reg) v);
asm!("/* {:z} */", out(zmm_reg) v);
```

32-bit and 64-bit integer types can already be passed via vector registers. LLVM has supported 128-bit integers since 2019, see llvm/llvm-project#42502, so `rustc` not supporting them seems like an oversight.

This feature is part of [`asm_experimental_reg`](rust-lang#133416). We're not stabilizing that feature as a whole, but only pull out part of it.

## History

- rust-lang#151059

## Open questions

None.

r? Amanieu
rust-timer added a commit to rust-lang/rust that referenced this pull request Aug 2, 2026
Rollup merge of #159525 - folkertdev:stabilize-x86-i128-asm, r=Amanieu

Stabilize passing 128-bit integers via vector registers with `asm!` on x86

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

# Stabilization report

## Summary

Stabilize passing 128-bit integers via vector registers with `asm!` on x86 and x86_64:

```rust
// Use 128-bit integers with vector registers.
let mut v = 0u128;

asm!("/* {:x} */", in(xmm_reg) v);
asm!("/* {:x} */", out(xmm_reg) v);

asm!("/* {:y} */", in(ymm_reg) v);
asm!("/* {:y} */", out(ymm_reg) v);

asm!("/* {:z} */", in(zmm_reg) v);
asm!("/* {:z} */", out(zmm_reg) v);
```

32-bit and 64-bit integer types can already be passed via vector registers. LLVM has supported 128-bit integers since 2019, see llvm/llvm-project#42502, so `rustc` not supporting them seems like an oversight.

This feature is part of [`asm_experimental_reg`](#133416). We're not stabilizing that feature as a whole, but only pull out part of it.

## History

- #151059

## Open questions

None.

r? Amanieu
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.

4 participants