Skip to content

Conversation

@folkertdev
Copy link
Contributor

@folkertdev folkertdev commented Jan 7, 2026

Previously stdarch implemented this function in terms of primitives miri can already evaluate. To work around a performance regression stdarch now uses the llvm intrinsic again. In zlib-rs we rely on miri being able to evaluate this function.

I've already fixed the LLVM bug, so in LLVM 22 we should be able to remove the shim, but the test coverage is still useful to ensure there are no further regressions.

I've only hooked up the avx512 version. I could add the sse2/avx2 variants too, but if nobody has complained about them yet it's just adding code that we'll remove in ~2 months.

I validated the test on real hardware.

cc rust-lang/stdarch#1985

@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2026

Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two.
Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Jan 7, 2026
@usamoi
Copy link
Contributor

usamoi commented Jan 7, 2026

In case you didn't notice, SSE2 and AVX2 variants of pmaddwd have been already reimplemented; it's only the AVX512 variant that's missing.

@folkertdev
Copy link
Contributor Author

Thanks, I had missed that completely. I've now unified the implementations.

@RalfJung
Copy link
Member

RalfJung commented Jan 8, 2026

LGTM, thanks!

I assume you tested this on real hardware?

@RalfJung RalfJung added this pull request to the merge queue Jan 8, 2026
@folkertdev
Copy link
Contributor Author

I did, yes.

Merged via the queue into rust-lang:master with commit 32556bb Jan 8, 2026
13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting for a review to complete label Jan 8, 2026
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.

4 participants