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

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Fri Oct 12 10:30:08 PDT 2012


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?

Bye,
Ulrich
(See attached file: diff-testsuite-altivec-complex)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-testsuite-altivec-complex
Type: application/octet-stream
Size: 3192 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121012/698fa85c/attachment.obj>


More information about the llvm-commits mailing list