Skip to content

Revert "Reimplement _mm_mulhi_epi16, ... without LLVM intrinsics" - #2219

Merged
Amanieu merged 4 commits into
rust-lang:mainfrom
RalfJung:mulhi
Sep 29, 2026
Merged

Amanieu merged 4 commits into
rust-lang:mainfrom
RalfJung:mulhi

Conversation

@RalfJung

@RalfJung RalfJung commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Reverts parts of #1477 to fix rust-lang/rust#159474.
Cc @eduardosm

@rustbot

rustbot commented Sep 5, 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

@RalfJung RalfJung Sep 5, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

FWIW there are also _mm512 variants of this... those should then probably also use the LLVM intrinsic?

View changes since the review

@rustbot

rustbot commented Sep 9, 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.

@RalfJung

Copy link
Copy Markdown
Member Author

@folkertdev @sayantn @Amanieu what's the plan for this one? Not sure how high you are putting the bar for when to revert back to vendor intrinsics. Personally I think if we have people actually filing bugs for seeing this in the real world, the bar is met.

@Amanieu
Amanieu added this pull request to the merge queue Sep 29, 2026
Merged via the queue into rust-lang:main with commit 5a9519f Sep 29, 2026
82 checks passed
@RalfJung
RalfJung deleted the mulhi branch September 29, 2026 06:22
@RalfJung

Copy link
Copy Markdown
Member Author

@eduardosm this will need some Miri changes to be reverted, right?

@eduardosm

Copy link
Copy Markdown
Contributor

@eduardosm this will need some Miri changes to be reverted, right?

Yes, done in rust-lang/miri#5358

At least for the SSE2 version. I think the AVX2 and AVX512 versions were never implemented. They do not appear in Miri test suite, but miri-test-libstd may start failing.

eduardosm added a commit to eduardosm/miri that referenced this pull request Sep 29, 2026
… and `_mm_mulhi_epu16`

These are being used again (rust-lang/stdarch#2219) due to performance regression of the generic implementation

This partially reverts rust-lang/rust#116609
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Sep 30, 2026
… and `_mm_mulhi_epu16`

These are being used again (rust-lang/stdarch#2219) due to performance regression of the generic implementation

This partially reverts rust-lang#116609
lcnr pushed a commit to lcnr/rust that referenced this pull request Oct 1, 2026
… and `_mm_mulhi_epu16`

These are being used again (rust-lang/stdarch#2219) due to performance regression of the generic implementation

This partially reverts rust-lang#116609
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.

std::arch::x86_64::_mm_mulhi_epu16(vector, _mm_set1_epi16(scalar)) generates slow emulated path instead of pmulhuw (regressed in rustc 1.75)

5 participants