Skip to content

Add missing avx512vl intrinsics for u32->f32 conversions - #2197

Merged
folkertdev merged 4 commits into
rust-lang:mainfrom
Shnatsel:missing-avx512vl-conversions
Aug 23, 2026
Merged

Add missing avx512vl intrinsics for u32->f32 conversions#2197
folkertdev merged 4 commits into
rust-lang:mainfrom
Shnatsel:missing-avx512vl-conversions

Conversation

@Shnatsel

@Shnatsel Shnatsel commented Jul 26, 2026

Copy link
Copy Markdown
Member

Fixes rust-lang/rust#158196

Adds 6 intrinsics that were apparently forgotten by Intel and not included into the Intrinsics Guide web viewer, despite being present in the Intel Software Development Manual and implemented in clang. They all lower into a single hardware instruction and there is no other way to access that instruction; the AVX2 emulation is very costly compared to these native conversions.

The implementation mirrors both the existing 512-bit-wide form and the clang implementation for these 128-bit and 256-bit forms.

This is my first contribution so I have no idea what I'm doing. I don't know what the stabilization process for these would be and if these are supposed to be instantly stable or not, so I just made up a new unstable feature name.

@rustbot

rustbot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

r? @sayantn

rustbot has assigned @sayantn.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn
  • @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn expanded to Amanieu, adamgemmell, davidtwco, folkertdev, sayantn
  • Random selection from Amanieu, adamgemmell, davidtwco, folkertdev, sayantn

@folkertdev

Copy link
Copy Markdown
Contributor

Can you rebase this? Our CI was broken when you opened the PR.

Comment thread crates/core_arch/src/x86/avx512f.rs Outdated
/// Documentation on them can be found in the [Intel Software Development Manual](https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html).
#[inline]
#[target_feature(enable = "avx512f,avx512vl")]
#[unstable(feature = "stdarch_x86_avx512_vl_updates", issue = "158196")]

@folkertdev folkertdev Aug 22, 2026

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.

Can you make a proper tracking issue for these? Something similar to rust-lang/rust#153514.

Picking a more tightly scoped name like stdarch_x86_avx512_vl_f32_to_u32_conversions might be helpful when stabilizing.

View changes since the review

@Shnatsel
Shnatsel force-pushed the missing-avx512vl-conversions branch from 849ba38 to 720458e Compare August 22, 2026 20:17
@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main 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.

@Shnatsel

Copy link
Copy Markdown
Member Author

Rebased without conflicts.

Automatic verification fails because Intel Intrinsics Guide does not contain these intrinsics as of version 3.6.9. They are present in the Intel Software Development Manual and other sources, see rust-lang/rust#158196 for details.

@folkertdev

Copy link
Copy Markdown
Contributor

I think you can add them to crates/intrinsic-test/missing_x86_clang.txt etc. for them to be skipped in that check.

@Shnatsel Shnatsel changed the title Add missing avx512vl intrinsics for f32->u32 conversions Add missing avx512vl intrinsics for u32->f32 conversions Aug 23, 2026
@Shnatsel

Copy link
Copy Markdown
Member Author

Thank you for the guidance!

I've added Intrinsics Guide XML check exception, opened the proper tracking issue and changed the stability annotations to point to it. CI is green. This should be ready to go now.

@folkertdev
folkertdev added this pull request to the merge queue Aug 23, 2026
Merged via the queue into rust-lang:main with commit 750162a Aug 23, 2026
82 checks passed
@Shnatsel

Copy link
Copy Markdown
Member Author

Thank you! How do I mark the tracking issue as implemented? I don't think I can edit the labels on rust-lang/rust#161585

@folkertdev

Copy link
Copy Markdown
Contributor

I've fixed it, but you can with @rustbot label -label-name I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing AVX-512 intrinsics from the avx512vl extension

4 participants