Skip to content

Revert "Use SIMD intrinsics for vector shifts" - #2217

Merged
adamgemmell merged 3 commits into
rust-lang:mainfrom
RalfJung:vector-shift-codegen
Sep 9, 2026
Merged

Revert "Use SIMD intrinsics for vector shifts"#2217
adamgemmell merged 3 commits into
rust-lang:mainfrom
RalfJung:vector-shift-codegen

Conversation

@RalfJung

@RalfJung RalfJung commented Sep 5, 2026

Copy link
Copy Markdown
Member

Reverts #1955 to fix rust-lang/rust#159831 and to fix rust-lang/rust#159801.
Cc @sayantn

No tests because the per-intrinsic codegen is actually fine, it's the combined codegen with other operations where things fall apart.

@rustbot

rustbot commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

r? @adamgemmell

rustbot has assigned @adamgemmell.
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 commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

(CI seems to be generally broken, that's not from my PR.)

@adamgemmell

Copy link
Copy Markdown
Contributor

CI should be fixed if you give this a rebase

@RalfJung
RalfJung force-pushed the vector-shift-codegen branch from 05cca4e to 768db9f Compare September 9, 2026 11:52
@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

RalfJung commented Sep 9, 2026

Copy link
Copy Markdown
Member Author
#7 0.384 curl: (23) Failure writing output to destination, passed 1494 returned 18

CI seems broken in new ways now.

@RalfJung

RalfJung commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

I don't know what's going on with that Windows job. The 691 failures seem to all be similar:

thread 'core_arch::x86::avx512fp16::tests::test_mm256_castpd_ph' (1328) panicked at crates\core_arch\src\x86\avx512fp16.rs:17098:9:
assertion `left == right` failed
  left: Simd(0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00)
 right: Simd(0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00)

Those are the same? Also the PR doesn't touch that intrinsic...?

@RalfJung

RalfJung commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Wtf, it worked on a retry...

@adamgemmell adamgemmell 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.

I couldn't find the failing windows job in the gha history, do you happen to have a link to it?

View changes since this review

Comment thread crates/core_arch/src/x86/avx2.rs
@RalfJung

RalfJung commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

I couldn't find the failing windows job in the gha history, do you happen to have a link to it?

https://github.com/rust-lang/stdarch/actions/runs/34347799442/job/102462592457?pr=2217

@adamgemmell
adamgemmell added this pull request to the merge queue Sep 9, 2026
Merged via the queue into rust-lang:main with commit 921827a Sep 9, 2026
166 of 246 checks passed
@adamgemmell

Copy link
Copy Markdown
Contributor

I couldn't find the failing windows job in the gha history, do you happen to have a link to it?

https://github.com/rust-lang/stdarch/actions/runs/34347799442/job/102462592457?pr=2217

Spooky. Possibly it's due to fp16 just being broken on windows gnu, see llvm_util.rs and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054. On a dev profile where inlining doesn't happen maybe the equality check can fail while the debug print works fine. Perhaps we should skip those tests on windows gnu.

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.

Poor codegen for AVX2 variable shift intrinsics: _mm256_sllv_epi32 and _mm256_srlv_epi32 Suboptimal codegen for _mm512_sllv_epi16

3 participants