Skip to content

Shuffle/swizzle operationsΒ #29

Open
@valadaptive

Description

@valadaptive

I'd like to replace my homegrown SIMD implementation with this crate. My use case requires support for a "shuffle" / "swizzle" / "permute" operation, which this crate currently doesn't appear to have.

One obstacle I encountered when implementing shuffles in my SIMD implementation is that different architectures' intrinsics take different types for shuffle indices (they differ in signedness and size), so we can't use const generics to specify them currently. However, LLVM appears to optimize constant permutes into shuffle instructions.

My thought is to give each SIMD type an associated Indices type (name not final), which is like its Mask or Block types, and is a [usize; N]. A shuffle function would take it as input.

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