public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Michael Meissner <meissner@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>,
	Jakub Jelinek <jakub@redhat.com>,
	Joseph Myers <joseph@codesourcery.com>,
	Peter Bergner <bergner@linux.ibm.com>,
	Richard Biener <richard.guenther@gmail.com>,
	Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [RFC/PATCH] Remove the workaround for _Float128 precision [PR107299]
Date: Thu, 22 Dec 2022 14:07:40 +0800	[thread overview]
Message-ID: <9f41bd91-85b3-e5a6-1774-ecfd8a6be15c@linux.ibm.com> (raw)
In-Reply-To: <20221221212407.GU25951@gate.crashing.org>

Hi Segher,

on 2022/12/22 05:24, Segher Boessenkool wrote:
> Hi!
> 
> On Wed, Dec 21, 2022 at 05:02:17PM +0800, Kewen.Lin wrote:
>> This a different attempt from Mike's approach[1][2] to fix the
>> issue in PR107299.
> 
> Ke Wen, Mike: so iiuc with this patch applied all three of Mike's
> patches are unnecessary?

I think the 1st patch is still needed, it's to fix a latent issue
as the associated test cases {mul,div}ic3-1.c show.

> Does it fix the new testcases in Mike's series as well?

Yeah, it doesn't suffer the issue exposed by float128-hw4.c, so
it doesn't need that adjustment on float128-hw4.c.  It can also
make newly added float128-hw{12,13}.c pass.

>> As above, I wonder if we can consider this approach which
>> makes type _Float128 have the same precision as MODE_PRECISION
>> of its mode, it keeps the previous implementation to make type
>> long double compatible with _Float128.  Since the REAL_MODE_FORMAT
>> of the mode still holds the information, even if some place which
>> isn't covered in the above testing need the actual precision, we
>> can still retrieve the actual precision with that.
> 
> "Precision" does not have a useful meaning for all floating point
> formats.  It does not have one for double-double for example.  The way
> precision is defined in IEEE FP means double-double has 2048 bits of
> precision (or is it 2047), not useful.  Taking the precision of the
> format instead to be the minimum over all values in that format gives
> double-double the same precision as IEEE DP, not useful in any practical
> way either :-/

OK, I think that's why we don't see any regressions with this work
around removal,   :)

> 
>> --- a/gcc/tree.cc
>> +++ b/gcc/tree.cc
>> @@ -9442,15 +9442,6 @@ build_common_tree_nodes (bool signed_char)
>>        if (!targetm.floatn_mode (n, extended).exists (&mode))
>>  	continue;
>>        int precision = GET_MODE_PRECISION (mode);
>> -      /* Work around the rs6000 KFmode having precision 113 not
>> -	 128.  */
> 
> It has precision 126 now fwiw.

Yes, with -mabi=ibmlongdouble, it uses KFmode so 126, while with
-mabi=ieeelongdouble, it uses TFmode so 127.

BR,
Kewen

      parent reply	other threads:[~2022-12-22  6:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  9:02 Kewen.Lin
2022-12-21 21:24 ` Segher Boessenkool
2022-12-21 21:40   ` Joseph Myers
2022-12-21 22:45     ` Jakub Jelinek
2022-12-22  6:37     ` Kewen.Lin
2022-12-22 18:18     ` Segher Boessenkool
2022-12-22 19:48       ` Joseph Myers
2022-12-22 22:09         ` Segher Boessenkool
2023-01-03 23:27     ` Michael Meissner
2023-01-07  0:41     ` Michael Meissner
2023-01-10  3:21       ` Michael Meissner
2023-01-10 18:23         ` Jakub Jelinek
2023-01-11 20:26           ` Michael Meissner
2022-12-22  6:07   ` Kewen.Lin [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=9f41bd91-85b3-e5a6-1774-ecfd8a6be15c@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=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=meissner@linux.ibm.com \
    --cc=richard.guenther@gmail.com \
    --cc=richard.sandiford@arm.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).