Skip to content

Wrong return type for _mm_extract_ps? #57225

Closed
@jsgf

Description

@jsgf

std::arch::x86_64::_mm_extract_ps (and x86) is documented as

Extract a single-precision (32-bit) floating-point element from a, selected with imm8

but has the signature

pub unsafe fn _mm_extract_ps(a: __m128, imm8: i32) -> i32

Shouldn't this be returning f32? The implementation just uses mem::transmute with inferred types, so its just transmuting the result to i32 even though the implementation is using simd_transmute to make an f32.

Is this a bug or am I missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-SIMDArea: SIMD (Single Instruction Multiple Data)A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions