Skip to content

Allow creating masks from booleans (and arrays and slices of them) #151

Closed as not planned

Description

@valadaptive

Not sure if this should be exposed in the same way as the other operations, since I don't know if it can be optimized to a simple load/copy. Still, it'd be good for convenience.

Activity

  1. Shnatsel commented on Aug 5, 2026

    @Shnatsel
    Contributor

    I looked into this in the course of #218 because that's what std::simd does, but the codegen for that is always awful.

    Instead we provide conversions into native types like i32 appropriate for the mask width that makes up an entire SIMD vector, which can then be converted to an array of i32 which you can compare etc, and all of those conversions are cheap. Giving people an array of bool feels like degrading performance without adding any expressiveness.

  2. LaurenzV commented on Aug 5, 2026

    @LaurenzV
    Collaborator

    Yeah, if it's not possible to do efficiently then let's not add that. You can always use the existing set_bit method after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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