Skip to content
New issue

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

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

Already on GitHub? # to your account

x86_mm256_sad_epu8 intrinsic has incorrect return type #43439

Closed
the8472 opened this issue Jul 23, 2017 · 2 comments
Closed

x86_mm256_sad_epu8 intrinsic has incorrect return type #43439

the8472 opened this issue Jul 23, 2017 · 2 comments
Labels
C-bug Category: This is a bug.

Comments

@the8472
Copy link
Member

the8472 commented Jul 23, 2017

According to intel documentation the return type should be 64x4 but rustc expects a 8x32

Test case:

#![feature(platform_intrinsics)]
#![feature(repr_simd)] 

#[repr(simd)]
struct u8x32(u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,u8,);
#[repr(simd)]
struct u64x4(u64,u64,u64,u64,);

extern "platform-intrinsic" {
 fn x86_mm256_sad_epu8(x: u8x32, y: u8x32) -> u64x4;
}

fn main() {}

Compiler error:

error[E0442]: intrinsic return value has wrong type: found vector with length 4, expected length 32
  --> src/main.rs:10:2
   |
10 |  fn x86_mm256_sad_epu8(x: u8x32, y: u8x32) -> u64x4;
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 23, 2017
@alexcrichton
Copy link
Member

cc @BurntSushi

@BurntSushi
Copy link
Member

I think the platform-intrinsic definition has an incorrect return type?

varkor added a commit to varkor/rust that referenced this issue Dec 21, 2017
kennytm added a commit to kennytm/rust that referenced this issue Dec 23, 2017
Correct the return type for `x86_mm256_sad_epu8`

Fixes rust-lang#43439.
kennytm added a commit to kennytm/rust that referenced this issue Dec 23, 2017
Correct the return type for `x86_mm256_sad_epu8`

Fixes rust-lang#43439.
kennytm added a commit to kennytm/rust that referenced this issue Dec 26, 2017
Correct the return type for `x86_mm256_sad_epu8`

Fixes rust-lang#43439.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants