Summary: Clang supports boolean vectors as an extension to the vector model. These are commonly used to represent mask vectors in many vector ISAs. Currently, using these is quite difficult because all of the vector comparison operations use integral bitmasks. C / C++ has a long history of allowing implicit conversions to bool, and I think that we should be able to do the same here, especially because boolean vectors often work as wrappers around a bitfield. This patch adds the minimal changes to enable integral to boolean conversions for vectors. Because LLVM already handles comparison to zero for vectors natively, minimal changes are required. We are not bound to the OpenCL standard at all here because it explicitly forbids boolean vectors anyway, so these are simply clang extensions.
3.7 KiB
3.7 KiB