This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, 0 of 5], Add suport for PowerPC IEEE 128-bit floating point

I will be submitting 5 patches in this thread to add support for IEEE 128-bit
floating point on the PowerPC.  I have tested this on power7 big endian
systems, power8 big endian systems, and power8 little endian systems, and there
were no regressions.  Ideally, I would like to install this in trunk, and
optionally to the GCC 4.9 and 4.8 branches, depending on the wishes of the
PowerPC maintainer and release managers.

The 5 patches that I will be providing include:
  1) Machine independent patches to libgcc;
  2) PowerPC patches to libgcc to enable IEEE 128-bit floating point;
  3) Machine independent patches to gcc;
  4) PowerPC patches to gcc to enable IEEE 128-bit floating point;
  5) PowerPC tests for IEEE 128-bit floating point.

Obviously, the libgcc patches can't go into until the gcc patches go in.

There are two options to enable IEEE 128-bit floating point:
  1) -mfloat128-vsx: Pass/return IEEE 128-bit FP in vector registers;
  2) -mfloat128-ref: Pass/return IEEE 128-bit FP by reference.

The -mfloat128-ref is intended to use the same calling sequence as the current
compiler uses on systems like Netbsd that have long double as a 128-bit type,
and don't use the IBM extended double format.  The intention here is to not
break these systems, though at present, I have no access to such a system.  I
wanted to leave it as a runtime option rather than a configuration options,
since it has been my experience that configuration options (like SPE, paired
floating point, etc.) are much harder to support.

If you use -mcpu=power7 or -mcpu=power8, it automatically selects
-mfloat128-vsx unless you explicitly use -mfloat128-ref or -mno-float128-vsx.

To use IEEE 128-bit floating point at present, you need to use the __float128
type instead of the long double type.  This is the same as the x86 port uses.
Like the x86 port, the suffix 'q' or 'Q' is used for IEEE 128-bit floating
point constants.

These patches do not address additional support in glibc and gdb that will
likely be needed as well to round out the patches.

Ideally at some time in the future, we will migrate Linux systems so that long
double will be the same as __float128, but these patches do not change the
default behavior.

Are these patches acceptable to be checked into the trunk?

Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email:, phone: +1 (978) 899-4797

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]