Skip to content

x86_mm256_sad_epu8 intrinsic has incorrect return type #43439

Closed
@the8472

Description

@the8472

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;
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions