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

Hal Finkel hfinkel at anl.gov
Fri Oct 12 11:41:36 PDT 2012


----- Original Message -----
> From: "Ulrich Weigand" <Ulrich.Weigand at de.ibm.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: llvm-commits at cs.uiuc.edu
> Sent: Friday, October 12, 2012 12:30:08 PM
> Subject: [PATCH, test-suite, AltiVec] Remove use of GNU extension __complex__
> 
> 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 code also uses the GCC extensions __real__ and __imag__,
>   which don't really have an equivalent in C99, in particular
>   when used on the LHS
> 
> - 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
> 
> So, as an alternative, I've implemented a patch that replaces
> use of __complex__ in "step" by arrays of two floats as well.
> This removes the GNU extension, and the non-portable assumptions,
> and only requires mechanical changes to the source ...
> 
> OK to commit?

As Steve points out, the layout compatibility is guaranteed by the standard. Nevertheless, as you've already done the work, I'm fine with eliminating the GNU extensions in their entirety.

 -Hal

> 
> Bye,
> Ulrich
> (See attached file: diff-testsuite-altivec-complex)

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list