public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Patrick McGehearty <patrick.mcgehearty@oracle.com>
Cc: <gcc-patches@gcc.gnu.org>, <segher@kernel.crashing.org>
Subject: Re: [PATCH v3] Fix for powerpc64 long double complex divide failure
Date: Fri, 13 Aug 2021 17:12:47 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2108131701580.20072@digraph.polyomino.org.uk> (raw)
In-Reply-To: <8f29c866-46e5-1619-fe0b-22a72a617ec5@oracle.com>

On Thu, 12 Aug 2021, Patrick McGehearty via Gcc-patches wrote:

> If _divkc3.c is not intended to provide a version of complex divide
> that handles IBM-128 format, then where should that option be handled?

That should be the function __divtc3.  (A single libgcc binary supports 
multiple long double formats, so libgcc function names referring to 
floating-point modes need to be understood as actually referring to a 
particular *format*, which may or may not correspond to the named *mode* 
depending on the compilation options used.  Thus, libgcc functions with 
"tf" or "tc" in their names, on configurations such as 
powerpc64le-linux-gnu that ever supported IBM long double, always refer to 
IBM long double.  It's up to the back end to ensure that, when building 
with TFmode = binary128, TCmode and KCmode division both get mapped to 
__divkc3 while ICmode division gets mapped to __divtc3; when building with 
TFmode = IBM long double, KCmode division should still be __divkc3, ICmode 
division should still be __divtc3, and TCmode division should be __divtc3 
in that case as well.)

> Do I need add a special case for
> #ifndef __LONG_DOUBLE_IEEE128__
> in the complex divide code in libgcc/libgcc2.c?

That macro is architecture-specific so shouldn't be tested there.  Doing 
things differently if __LIBGCC_TF_MANT_DIG__ == 106 would be reasonable 
(if it fixes the observed problem!), however; there are a few places in 
generic libgcc code that check for MANT_DIG == 106 to handle IBM long 
double differently.

> And, for completeness, does gcc support LDBL for non-IEEE on
> any platform besides IBM?

I believe TFmode is IEEE binary128 everywhere except for those powerpc 
configurations where it's IBM long double.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2021-08-13 17:12 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 [this message]
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

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=alpine.DEB.2.22.394.2108131701580.20072@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=patrick.mcgehearty@oracle.com \
    --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).