Skip to content

Conversation

@folkertdev
Copy link
Contributor

This intrinsic is useful for the adler32 checksum algorithm.

The test attempts to hit a bunch of overflow and truncation cases, and I've validated it on real hardware.

@rustbot
Copy link
Collaborator

rustbot commented Dec 18, 2025

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 Dec 18, 2025
Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I am slightly concerned about slowly growing a huge avx512 file that nobody has an overview of any more.^^ But as long as there's a clear motivation in the form of a core ecosystem crate, I hope that will naturally limit the scope of what we have to support.

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Dec 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@folkertdev
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels Dec 27, 2025

/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in `a` with corresponding signed
/// 8-bit integers in `b`, producing 4 intermediate signed 16-bit results. Sum these 4 results with
/// the corresponding 32-bit integer in `src`, and store the packed 32-bit results in `dst`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// the corresponding 32-bit integer in `src`, and store the packed 32-bit results in `dst`.
/// the corresponding 32-bit integer in `src` (using wrapping arithmetic), and store the packed 32-bit results in `dst`.

0,
7,
// Using values close to the minimum/maximum here makes it very likely that the final
// addition with the element from this array overflows. The addition should wrap.
Copy link
Member

@RalfJung RalfJung Dec 27, 2025

Choose a reason for hiding this comment

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

What do you mean by "very likely"? You are fixing all the inputs here, there should be no probabilities.^^

This pairs up with elements in A and B, right? So you can have comments there indicating which ones this is paired up with.

@RalfJung
Copy link
Member

RalfJung commented Jan 1, 2026

This looks great, thanks! Please squash the commits. You can squash manually if there are multiple independent commits you want to preserve, or use ./miri squash (make sure to pick a suitable commit message). Then write @rustbot ready after you force-pushed the squashed PR.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Jan 1, 2026
@folkertdev
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels Jan 1, 2026
@RalfJung RalfJung enabled auto-merge January 2, 2026 09:38
@RalfJung RalfJung dismissed their stale review January 2, 2026 09:38

resolved

@RalfJung RalfJung added this pull request to the merge queue Jan 2, 2026
Merged via the queue into rust-lang:master with commit 554ce9c Jan 2, 2026
13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting for a review to complete label Jan 2, 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.

3 participants