I'm working on some changes to finally make __float128 default for PowerPC VSX targets (power7..power9). I am reworking my PowerPC changes, but in using a previous version of my code, I needed to do some minor tweaks to allow libquadmath to build on PowerPC when __float128 becomes on by default.
I have checked this out by doing bootstrap builds and make check for C, C++, and Fortran on both a little endian power8 system and an x86_64 system. Both systems bootstrapped fine, and there were no regressions. Can I install these changes in the trunk? As I mention in the PR, there are two main changes: 1) Know how to create complex float128 on PowerPC's. This is different from Intel because the PowerPC already had a TF/TCmode for the IBM long double format, and so we use KF/KCmode for the IEEE 128-bit floating point type if the long double type is IBM long double. 2) There were a few places where long double was used instead of __float128. I fixed these cases, either by changing the type of the constant, or by modifying the code to do an explicit conversion. This is due to the fact that we do not allow expressions to have both IBM long double and __float128 in the expression. This in turn is caused by GCC not expecting there to be more than one floating point type for a given size, and due to having the existing IBM long double format, we have two different 128-bit floating point types. Another factor is if you have IBM long double and __float128 in an expression, should the resultant type be IBM long double or __float128. On the power7 and power8 systems, you would want long double, because the long double code is faster than the emulation of IEEE 128-bit floating point. However on the power9 systems, since there is hardware support for IEEE 128-bit floating point, you would want that. 2017-08-15 Michael Meissner <meiss...@linux.vnet.ibm.com> PR libquadmath/81848 * configure.ac (powerpc*-linux*): Use attribute mode KC to create complex __float128 on PowerPC instead of attribute mode TC. * quadmth.h (__complex128): Likewise. * configure: Regenerate. * math/cbrtq.c (CBRT2): Use __float128 not long double. (CBRT4): Likewise. (CBRT2I): Likewise. (CBRT4I): Likewise. * math/j0q.c (U0): Likewise. * math/sqrtq.c (sqrtq): Don't depend on implicit conversion between __float128, instead explicitly convert the __float128 value to long double because the PowerPC does not allow __float128 and long double in the same expression. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797