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

Feature detection issue on x86 targets #1

Closed
landonxjames opened this issue Dec 10, 2024 · 5 comments
Closed

Feature detection issue on x86 targets #1

landonxjames opened this issue Dec 10, 2024 · 5 comments

Comments

@landonxjames
Copy link

landonxjames commented Dec 10, 2024

I've recently integrated the crc64fast-nvme crate with the aws-sdk-rust to support Crc64 checksums for S3. Everything works as expected except the crate fails to compile on x86. You can see an example failure from our CI here.

error[E0425]: cannot find function `_mm_extract_epi64` in this scope
    --> /cargo/registry/src/index.crates.io-6f17d22bba15001f/crc64fast-nvme-1.0.0/src/pclmulqdq/x86.rs:53:9
     |
53   |         _mm_extract_epi64(reduced.0, 1) as u64
     |         ^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `_mm_extract_epi16`
     |
    ::: /rust/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:1417:1
     |
1417 | pub unsafe fn _mm_extract_epi16<const IMM8: i32>(a: __m128i) -> i32 {
     | ------------------------------------------------------------------- similarly named function `_mm_extract_epi16` defined here

The compiler fails to find the _mm_extract_epi64 function which is present on x86_64, but not on 32 bit x86. I can see in the code that there is already a check for this particular intrinsic:

&& is_x86_feature_detected!("sse4.1") // _mm_extract_epi64
so I expect that this case was meant to be covered, but isn't quite working as expected.

@onethumb
Copy link

@landonxjames I guess this is what I get for developing on Apple Silicon and deploying to Graviton. 😆 🤦‍♂️

I'll try to find some time to investigate, but feel free to submit a PR if you have a fix in mind. 👍

@onethumb
Copy link

@landonxjames I believe this should be fixed in 1.0.1. Crates.io has also been updated.

Let me know if this doesn't do the trick or I missed something. 👍

@onethumb
Copy link

@landonxjames Totally unrelated, but love your thoughts on the Double throughput on systems which support AVX512 VPCLMULQDQ PR too, if you get a chance.

@onethumb
Copy link

@landonxjames You might be interested to see the new C-compatible shared library support, and an implementation in PHP using FFI. This is released in 1.1.0.

Can you verify the x86 issue is resolved so I can close this Issue?

@landonxjames
Copy link
Author

Sorry, was out for the holidays, but I just bumped the version and reran our CI and all looks good to me. Thanks for the fix!

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

No branches or pull requests

2 participants