[cfe-dev] More cases not supported RE: Clang doesn't support Logical Operator supported in GCC Vector Extension

Anton Lokhmotov Anton.Lokhmotov at arm.com
Fri Oct 28 06:38:19 PDT 2011


On Mon, Oct 24, 2011 at 2:59 PM, Yin Ma <yinma at codeaurora.org> wrote:
> > Hi,
> >
> > typedef float  float4 __attribute__((ext_vector_type(4)));
> > typedef long   long4 __attribute__((ext_vector_type(4)));
> > typedef int    int4 __attribute__((ext_vector_type(4)));
> >
> >
> > int main()
> > {
> >  float4 af, bf;
> >  long4  al, bl;
> >  int4 ret;
> >
> >  ret = (bf != af);
> >  ret = (bl != al);
> >
> >  return 0;
> > };
> >
> > k.c:13:7: error: assigning to 'int4' from incompatible type 'long4';
> >  ret = (bl != al);
> >     ^ ~~~~~~~~~~
> >
> > Clang is not supporting the GCC Vector Extension in this case.
> > Does anybody know if there is a plan to fix this?

> I'm pretty sure that's intentional; the result of a vector equality
> operation with integer operands has the same type as the operands.
> -Eli

Correct (almost).  For example, see OpenCL 6.3.d (opencl-1.1-rev44, p179):
"vector source operands of type longn and ulongn return a longn result".

Cheers,
Anton.







More information about the cfe-dev mailing list