public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Joseph Myers <joseph@codesourcery.com>
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>,
	Peter Bergner <bergner@linux.ibm.com>,
	Richard Biener <richard.guenther@gmail.com>,
	Richard Sandiford <richard.sandiford@arm.com>,
	Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: [RFC/PATCH] Remove the workaround for _Float128 precision [PR107299]
Date: Thu, 22 Dec 2022 14:37:02 +0800	[thread overview]
Message-ID: <b980893f-abbc-2a4f-dc6d-9297098ac3ea@linux.ibm.com> (raw)
In-Reply-To: <a4f011e0-544c-c62-1cfc-e013d140728f@codesourcery.com>

Hi Joseph,

on 2022/12/22 05:40, Joseph Myers wrote:
> On Wed, 21 Dec 2022, Segher Boessenkool wrote:
> 
>>> --- 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.
>>
>> Joseph: what do you think about this patch?  Is the workaround it
>> removes still useful in any way, do we need to do that some other way if
>> we remove this?
> 
> I think it's best for the TYPE_PRECISION, for any type with the binary128 
> format, to be 128 (not 126).

I agree that it's more reasonable to use 128 for it (all of them) eventually,
but what I thought is that if we can get rid of this workaround first to make
the bootstrapping survive.  Commit r9-1302-g6a8886e45f7eb6 makes TFmode/
KFmode/IFmode have different precisions with some reasons, Jakub mentioned
commit r13-3292, I think later we can refer to it and have a try to unique
those modes to have the same precisions (probably next stage1), I guess Mike
may have more insightful comments here.

> 
> It's necessary that _Float128, _Float64x and long double all have the same 
> TYPE_PRECISION when they have the same (binary128) format, or at least 
> that TYPE_PRECISION for _Float128 >= that for long double >= that for 
> _Float64x, so that the rules in c_common_type apply properly.
> 

a. _Float128, _Float64x and long double all have the same
   TYPE_PRECISION when they have the same (binary128) format.

b. TYPE_PRECISION for _Float128 >= that for long double
   >= that for _Float64x.

**Without this patch**, 

1) -mabi=ieeelongdouble (these three are ieee128)

  _Float128 => 128 ("type => its TYPE_PRECISION")
  _Float64x => 128
  long double => 127

// Neither a and b holds.

2) -mabi=ibmlongdouble (long double is ibm128)

  _Float128 => 128
  _Float64x => 128
  long double => 127

// a N/A, b doesn't hold.

**With this patch**, 

1) -mabi=ieeelongdouble

  _Float128 => 127
  _Float64x => 127
  long double => 127

// both a and b hold.
  
2) -mabi=ibmlongdouble
  
  _Float128 => 126
  _Float64x => 126
  long double => 127

// a N/A, b doesn't hold.

IMHO, this patch improves the status quo slightly.

BR,
Kewen

  parent reply	other threads:[~2022-12-22  6:40 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 [this message]
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

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=b980893f-abbc-2a4f-dc6d-9297098ac3ea@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).