Skip to content

Some SIMDWrapper masks are convertible to bool

As you can see in this example: https://godbolt.org/z/dfKafT

The conversions to native mask formats defined in SIMDWrapper types for avx512 also make them implicitly convertible to bool, which is not very user-friendly and makes code that "should not" compile valid. When dealing with masks one should use any, all and none.

Fortunately I think this only affects the avx256/avx512 backends, so I doubt that this has lead to any real bugs in our stack.

The large-diff low-effort fix is to remove the implicit conversion to the underlying __mmaskN type and instead convert mask_v to this explicitly when needed (typically in the argument of an intrinsic).

cc: @nnolte @ahennequ @graven

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information