This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, #2], Add optional IEEE/IBM long double multilib support
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Fri, 5 Jan 2018 14:25:42 -0500
- Subject: Re: [PATCH, #2], Add optional IEEE/IBM long double multilib support
- Authentication-results: sourceware.org; auth=none
- References: <20180104230555.GA4847@ibm-tiger.the-meissners.org>
On Thu, Jan 04, 2018 at 06:05:55PM -0500, Michael Meissner wrote:
> This patch is the beginning step to switching the PowerPC long double support
> from IBM extended double to IEEE 128-bit floating point on PowerPC servers. It
> will be necessary to have this patch or a similar patch to allow the GLIBC team
> to begin their modifications in GLIBC 2.28, so that by the time GCC 9 comes
> out, we can decide to switch the default. It is likely, the default will only
> be switched on the 64-bit little endian PowerPC systems, when a distribution
> goes through a major level, such that they can contemplate major changes.
In doing some testing on a big endian system, it getting hairy to add support
to add optional multilibs for ieee/ibm. On the BE system, the default cpu is
a power4, and so the IEEE emulator is not built unless you configure to make
power7, power8, or power9 the default cpu. In addition, the BE system already
has multilibs for 64 vs. 32 bit. While these things can be handled, it is not
currently planned to ultimately switch the long double format in BE. So, this
patch replaces the previous patch, and it only allows you to switch the long
double format for powerpc64le-*-linux* systems.
Except for configure.ac and configure, all of the other changes are the same.
I have tested the patch on BE systems, and it builds normally providing you do
not use the --with-long-double-format option.
[gcc]
2018-01-05 Michael Meissner <meissner@linux.vnet.ibm.com>
* configure.ac (--with-long-double-format): Add support for
configuration option to change the default long double format on
little endian PowerPC Linux systems.
* configure: Regenerate.
* config.gcc (powerpc*-linux*-*): Add support for
--with-long-double-format={ieee,ibm}. If the format is explicit
set, also set up IBM and IEEE multilibs.
* config/rs6000/rs6000.h (FLOAT128_IEEE_P): Explicitly check for
128-bit long doubles before checking TFmode or TCmode.
(FLOAT128_IBM_P): Likewise.
(TARGET_IEEEQUAD_MULTILIB): Set to 0 if not already defined.
* config/rs6000/rs6000.c (rs6000_option_override_internal): If we
have IBM/IEEE multilibs, don't give a warning if the user chagnes
the long double format.
(is_complex_IBM_long_double): Explicitly check for 128-bit long
doubles before checking TCmode.
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): If long
double is IEEE, define __KC__ and __KF__ to allow floatn.h to be
used without modification.
* config/rs6000/linux64.h (MULTILIB_DEFAULTS_IEEE): Specify the
-mabi={ieee,ibm}longdouble default for multilibs.
(MULTILIB_DEFAULTS): Likewise.
* config/rs6000/t-ldouble: New file, add IEEE/IBM long double
multilibs.
[libgcc]
2018-01-05 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/quad-float128.h (IBM128_TYPE): Explicitly use
__ibm128, instead of trying to use long double.
(CVT_FLOAT128_TO_IBM128): Use TFtype instead of __float128 to
accomidate -mabi=ieeelongdouble multilibs.
(CVT_IBM128_TO_FLOAT128): Likewise.
* config/rs6000/ibm-ldouble.c (IBM128_TYPE): New macro to define
the appropriate IBM extended double type.
(__gcc_qadd): Change all occurances of long double to IBM128_TYPE.
(__gcc_qsub): Likewise.
(__gcc_qmul): Likewise.
(__gcc_qdiv): Likewise.
(pack_ldouble): Likewise.
(__gcc_qneg): Likewise.
(__gcc_qeq): Likewise.
(__gcc_qne): Likewise.
(__gcc_qge): Likewise.
(__gcc_qle): Likewise.
(__gcc_stoq): Likewise.
(__gcc_dtoq): Likewise.
(__gcc_itoq): Likewise.
(__gcc_utoq): Likewise.
(__gcc_qunord): Likewise.
* config/rs6000/_mulkc3.c (toplevel): Include soft-fp.h and
quad-float128.h for the definitions.
(COPYSIGN): Use the f128 version instead of the q version.
(INFINITY): Likewise.
(__mulkc3): Use TFmode/TCmode for float128 scalar/complex types.
* config/rs6000/_divkc3.c (toplevel): Include soft-fp.h and
quad-float128.h for the definitions.
(COPYSIGN): Use the f128 version instead of the q version.
(INFINITY): Likewise.
(FABS): Likewise.
(__divkc3): Use TFmode/TCmode for float128 scalar/complex types.
* config/rs6000/extendkftf2-sw.c (__extendkftf2_sw): Likewise.
* config/rs6000/trunctfkf2-sw.c (__trunctfkf2_sw): Likewise.
--
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797