Skip to content

Feature detection issue on x86 targets #1

@landonxjames

Description

@landonxjames

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions