[llvm-commits] [PATCH, test-suite, AltiVec] Remove use of GNU extension __complex__

Stephen Canon scanon at apple.com
Fri Oct 12 10:50:41 PDT 2012


On Oct 12, 2012, at 1:30 PM, Ulrich Weigand <Ulrich.Weigand at de.ibm.com> wrote:

> Hal Finkel <hfinkel at anl.gov> wrote on 12.10.2012 17:43:16:
>>> From: "Ulrich Weigand" <Ulrich.Weigand at de.ibm.com>
>>> 
>>> But I guess we could as well change to _Complex -- would
>>> you like me to prepare a patch to do so?
>> 
>> Yes, please.
> 
> Hmm, _Complex may not be the best fit after all, because:
> 
> ...
> 
> - the callers of this routine use arrays of two floats instead
>  of complex numbers, and just assume those have the same
>  representation as a __complex__ (or _Complex) -- this is
>  non-portable anyway

That's explicitly defined to work by C99 and C++11.

C99: "Each complex type has the same representation and alignment requirements as an array type containing exactly two elements of the corresponding real type."

C++: various requirements in 26.4.

- Steve



More information about the llvm-commits mailing list