public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Michael Meissner <meissner@linux.ibm.com>
Cc: gcc-patches@gcc.gnu.org,
	Segher Boessenkool <segher@kernel.crashing.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	Peter Bergner <bergner@linux.ibm.com>,
	Will Schmidt <will_schmidt@vnet.ibm.com>
Subject: Re: [PATCH 1/2] PR target/107299: Fix build issue when long double is IEEE 128-bit
Date: Wed, 22 Feb 2023 18:37:39 +0800	[thread overview]
Message-ID: <d9ce7635-eabe-fa5c-23ba-38698aab3b20@linux.ibm.com> (raw)
In-Reply-To: <Y9ygWHc7w3DeIr9O@toto.the-meissners.org>

Hi Mike,

on 2023/2/3 13:49, Michael Meissner wrote:
> This patch is a repost of a patch:
> 
> | Date: Thu, 19 Jan 2023 11:37:27 -0500
> | Subject: [PATCH] PR target/107299: Fix build issue when long double is IEEE 128-bit
> | Message-ID: <Y8lxx+Jxfl1IkheJ@toto.the-meissners.org>
> 
> This patch updates the IEEE 128-bit types used in libgcc.
> 
> At the moment, we cannot build GCC when the target uses IEEE 128-bit long
> doubles, such as building the compiler for a native Fedora 36 system.  The
> build dies when it is trying to build the _mulkc3.c and _divkc3 modules.
> 
> This patch changes libgcc to use long double for the IEEE 128-bit base type if
> long double is IEEE 128-bit, and it uses _Float128 otherwise.  The built-in
> functions are adjusted to be the correct version based on the IEEE 128-bit base
> type used.
> 
> While it is desirable to ultimately have __float128 and _Float128 use the same
> internal type and mode within GCC, at present if you use the option
> -mabi=ieeelongdouble, the __float128 type will use the long double type and not
> the _Float128 type.  We get an internal compiler error if we combine the
> signbitf128 built-in with a long double type.
> 
> I've gone through several iterations of trying to fix this within GCC, and
> there are various problems that have come up.  I developed this alternative
> patch that changes libgcc so that it does not tickle the issue.  I hope we can
> fix the compiler at some point, but right now, this is preventing people on
> Fedora 36 systems from building compilers where the default long double is IEEE
> 128-bit.

Thanks for working on this!  If updating libgcc source to workaround this issue
is the best option we can have at this moment, it's fine.  Comparing to one
previous proposal which removes the workaround in build_common_tree_nodes for
rs6000 KFmode, a bit concern on this one is that users can still meet the ICE
with a simple case like:

typedef float TFtype __attribute__((mode (TF)));

TFtype
test (TFtype t)
{
  return __builtin_copysignf128 (1.0q, t);
}

but I guess they would write this kind of code very rarely?

BR,
Kewen

  reply	other threads:[~2023-02-22 10:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03  5:43 [PATCH 0/2] Repost of patches for solving the build on Fedora 36 problem Michael Meissner
2023-02-03  5:49 ` [PATCH 1/2] PR target/107299: Fix build issue when long double is IEEE 128-bit Michael Meissner
2023-02-22 10:37   ` Kewen.Lin [this message]
2023-02-22 18:11     ` Michael Meissner
2023-03-02 22:45   ` Ping: " Michael Meissner
2023-03-03 20:56   ` Segher Boessenkool
2023-02-03  5:53 ` [PATCH 2/2] Rework 128-bit complex multiply and divide Michael Meissner
2023-02-22 10:13   ` Kewen.Lin
2023-02-22 18:01     ` Michael Meissner
2023-03-02 22:46   ` Ping: " Michael Meissner
2023-03-03 21:35   ` Segher Boessenkool
2023-03-09 16:11     ` Michael Meissner
2023-03-09 22:16       ` Segher Boessenkool
2023-03-09 23:23         ` Michael Meissner
2023-03-09 16:42     ` Michael Meissner
2023-02-03  7:42 ` [PATCH 0/2] Repost of patches for solving the build on Fedora 36 problem Richard Biener
2023-02-06 18:28   ` Peter Bergner
2023-02-07 14:22     ` Richard Biener
2023-02-07 14:31       ` Jakub Jelinek

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=d9ce7635-eabe-fa5c-23ba-38698aab3b20@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=meissner@linux.ibm.com \
    --cc=segher@kernel.crashing.org \
    --cc=will_schmidt@vnet.ibm.com \
    /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).