Skip to content

Bug in avx512f swizzle #1255

@lu1and10

Description

@lu1and10

Hi XSIMD development team,

Thanks for maintaining such a great package.

I believe I’ve found a bug in the AVX-512F swizzle implementation: detail::is_cross_lane appears to return the wrong result on both master and release 14.

For example, with the swizzle mask:

3 2 1 0 7 6 5 4

the logic at

XSIMD_IF_CONSTEXPR(!detail::is_cross_lane(mask))

evaluates detail::is_cross_lane(...) as true and takes the _mm512_permute_pd(self, imm) path. However, _mm512_permute_pd only permutes within 128-bit lanes, so it is not valid for a mask like 3 2 1 0 7 6 5 4, which requires a cross-128-bit-lane permutation.

This code path is triggered when the built-in shuffle is not available, falling back through the implementation here:

.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions