Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the SWAR chunks are 64-bit in more cases #1182

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

CryZe
Copy link
Contributor

@CryZe CryZe commented Aug 23, 2024

Various architectures have native support for 64-bit integers, but there are Rust targets for those architectures where the pointer size is intentionally just 32-bit. For SWAR this smaller pointer size would negatively affect those targets, so this PR ensures the chunk size stays 64-bit on those targets.

The same is done in various other crates, such as hashbrown. Though I wish there was some sort of #[cfg(target_integer_width = "64")].

Various architectures have support for 64-bit integers, but there are
Rust targets for those architectures where the pointer size is
intentionally just 32-bit. For SWAR this smaller pointer size would
negatively affect those targets, so this PR ensures the chunk size stays
64-bit on those targets.
@purplesyringa
Copy link
Contributor

For context:

  • aarch64 is for target aarch64-unknown-linux-gnu_ilp32
  • x86_64 is for target x86_64-unknown-linux-gnux32

WASM's self-explanatory.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@dtolnay dtolnay merged commit fec0376 into serde-rs:master Aug 23, 2024
16 checks passed
@CryZe CryZe deleted the chunk-64bit branch August 23, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants