https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68595

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> So, either we should keep what used to be in _Bool/bool type in scalar code
> as 0/-1 at all spots, or as 0/1 at all spots, or as non-zero vs. zero, but
> choose consistently one of those and adjust all the ops accordingly.  Say in
> the last case original bool ~x needs to be vectorized as x == 0.
> So, is 0/-1 the best choice for all targets?

It was chosen for compatibility with vector extensions which are based off
openCL.  And yes, all targets generate truth values that way IIRC as the
result can be used in AND/OR masking operations directly.

Reply via email to