public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.ibm.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	Patrick McGehearty via Gcc-patches <gcc-patches@gcc.gnu.org>,
	segher@kernel.crashing.org
Subject: Re: [PATCH v3] Fix for powerpc64 long double complex divide failure
Date: Thu, 26 Aug 2021 22:10:58 -0400	[thread overview]
Message-ID: <YShJspFxd0EKMO01@toto.the-meissners.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2108131718530.20072@digraph.polyomino.org.uk>

On Fri, Aug 13, 2021 at 05:22:47PM +0000, Joseph Myers wrote:
> On Fri, 13 Aug 2021, Andreas Schwab wrote:
> 
> > On Aug 12 2021, Patrick McGehearty via Gcc-patches wrote:
> > How can it happen that __LONG_DOUBLE_IEEE128__ is not defined?  This
> > file is always compiled with -mfloat128 and this looks like dead code.
> 
> I think the answer there is that -mfloat128 serves to enable __float128, 
> it doesn't change the long double ABI, which is what 
> __LONG_DOUBLE_IEEE128__ refers to (that's what -mabi=ieeelongdouble does).

Yes this is correct.  The -mfloat128 enables the __float128 keyword.  It does
not change the default long double format.  Particularly before glibc 2.32 came
out we had some software packages that saw that we had had __float128, and
added functions to their library that took __float128 arguments.  Unfortunately
until the library had the support, it meant they would have references to
things not yet implemented.

We only enable -mfloat128 by default on 64-bit Linux systems.

The macro __LONG_DOUBLE_IEEE128__ is defined when long double uses the IEEE
128-bit format.

The macro __LONG_DOUBLE_IBM128__ is defined when long double uses the IBM
128-bit format.

The macro __LONG_DOUBLE_128__ is defined when one of the 128-bit long double
types (IBM or IEEE) is used for long double.

You can change the long double format with the -mabi=ieeelongdouble option or
by configuring the compiler with the --with-long-double-format=ieee
configuration option.

At present, only the C and C++ languages will work if you use the
-mabi=ieeelongdouble option and your GLIBC is at least 2.32.  This is because
the library support has been done to allow building both ibm128 and IEEE
128-bit functions in the library, and the compiler will use the appropriate
names based on the options.

Other languages such as fortran cannot be configured during compilation and you
must configure the compiler with the --with-long-double-format=ieee option.
This is because those libraries and compilers have not been modified to have
support for both 16-byte long double formats.  You will need to use at least
GLIBC 2.32.

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

      reply	other threads:[~2021-08-27  2:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 16:03 Patrick McGehearty
2021-08-12 16:19 ` Joseph Myers
2021-08-12 16:40   ` Patrick McGehearty
2021-08-12 16:47     ` Joseph Myers
2021-08-12 20:53       ` Segher Boessenkool
2021-08-12 22:17       ` Patrick McGehearty
2021-08-13 17:12         ` Joseph Myers
2021-08-26 15:51           ` Patrick McGehearty
2021-08-26 16:34             ` Joseph Myers
2021-08-26 16:57             ` Segher Boessenkool
2021-08-26 17:04           ` Segher Boessenkool
2021-08-12 20:55 ` Segher Boessenkool
2021-08-12 22:36 ` Andreas Schwab
2021-08-13 17:22   ` Joseph Myers
2021-08-27  2:10     ` Michael Meissner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YShJspFxd0EKMO01@toto.the-meissners.org \
    --to=meissner@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=schwab@linux-m68k.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).