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

Eli Friedman eli.friedman at gmail.com
Mon Oct 24 15: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




More information about the cfe-dev mailing list