[Bug c++/58845] [4.8/4.9 Regression] Operator || and && broken for vectors

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 4 09:38:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58845

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, what does OpenCL specify here?  IIRC we've decided on -1 (all bits set)
as true for vectors and 0 as false.  I'd prefer to allow trivial lowering
to | and & which IIRC are already supported.  That means that

 v1 && v2

should be emitted as GENERIC

 (v1 != { 0, 0, ... }) && (v2 != { 0, 0, ... })

where the ANDIF semantics don't make sense for vectors(?) and thus we
can directly emit GENERIC

 (v1 != { 0, 0, ... }) & (v2 != { 0, 0, ... })

from the frontend.



More information about the Gcc-bugs mailing list