You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow creating masks from booleans (and arrays and slices of them) #151
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.
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.
Activity
Shnatsel commentedon Aug 5, 2026
I looked into this in the course of #218 because that's what
std::simddoes, but the codegen for that is always awful.Instead we provide conversions into native types like
i32appropriate for the mask width that makes up an entire SIMD vector, which can then be converted to an array ofi32which you can compare etc, and all of those conversions are cheap. Giving people an array ofboolfeels like degrading performance without adding any expressiveness.LaurenzV commentedon Aug 5, 2026
Yeah, if it's not possible to do efficiently then let's not add that. You can always use the existing
set_bitmethod after all.