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: Michael Meissner <meissner@linux.ibm.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 2/3 V2] Do not include stdio.h in libgcc's Decimal/Float128 conversions.
Date: Wed, 3 Mar 2021 20:01:36 -0500	[thread overview]
Message-ID: <20210304010136.GA29907@ibm-toto.the-meissners.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2103032328480.426551@digraph.polyomino.org.uk>

On Wed, Mar 03, 2021 at 11:33:52PM +0000, Joseph Myers wrote:
> On Wed, 3 Mar 2021, Michael Meissner via Gcc-patches wrote:
> 
> > As we have discussed many times, on 32-bit BE, you cannot use hardware
> > _Float128 support on power9/power10 because there is no TImode in 32-bit.
> > Various machine independent parts of GCC require an integer type to be the same
> > size as basic types.  If somebody made TImode work, we can remove the
> > restriction and allow _Float128 to work on 32-bit.
> 
> I'm not sure exactly what the machine-independent requirement is, but 
> _Float128 is supported for 32-bit x86, riscv, sparc and s390 at least.
> 
> There's no support for _Float128 in the 32-bit powerpc ABI, but I don't 
> think there is anything architecture-independent preventing such support 
> on 32-bit platforms where TImode is unsupported (i.e. not supported by the 
> scalar_mode_supported_p hook).

The problem is several parts of GCC insists that there be an integer MODE that
is the same size as the scalar MODE.  I recall it happens in moves (such as
during calls), but it could be other places as well.

In theory, it would be nice to get this fixed, but the practicality is you can
go down a lot of places to find the next bug and fix that.

Maybe there is somebody who has enough time and patience to fix all of the
places that demand that there be an integer type large enough to hold scalar
types like _Float128 and generate alternate code.

Or perhaps implement enough of TImode so that it doesn't cause issues.

But in order to do the work and make sure it does not cause issues for 32-bit
and hardware _Float128, you need to build on a big endian power9 system.  In
the compile farm there is gcc135, but it is run little endian.

BTW, during the initial development of MMA, I ran into the same issue for the
vector pair and vector quad types.  Each of the approaches that we took had
some serious issues.  What I did in the initial stages of development is add
dummy moves that would never succeed for 256 and 512-bit integers, and then use
partial integers to represent that these weren't quite real integers.  However,
even then we discovered various parts of the compiler would strip off the
partial integer type and use the full integer type, even though there was no
real support for that type.  Peter and Aaron eventually solved this by adding
support for opaque modes.

However, Float128 needs to be a scalar floating point mode, not an opaque mode.

-- 
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-03-04  1:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 17:14 [PATCH 0/3 V2] Honor --disable-decimal-float in PowerPC libgcc _Float128 Michael Meissner
2021-03-01 17:17 ` [PATCH 1/3 V2] Fix __sprintfkf prototype in libgcc Michael Meissner
2021-03-01 22:37   ` Segher Boessenkool
2021-03-01 17:18 ` [PATCH 2/3 V2] Do not include stdio.h in libgcc's Decimal/Float128 conversions Michael Meissner
2021-03-01 23:15   ` Segher Boessenkool
2021-03-02 21:25     ` Michael Meissner
2021-03-02 21:53       ` Segher Boessenkool
2021-03-03 19:12         ` Michael Meissner
2021-03-03 23:33           ` Joseph Myers
2021-03-04  1:01             ` Michael Meissner [this message]
2021-03-09 18:35           ` Segher Boessenkool
2021-03-01 17:19 ` [PATCH 3/3 V2] Do not build Decimal/Float128 conversions if decimal is disabled 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=20210304010136.GA29907@ibm-toto.the-meissners.org \
    --to=meissner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.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).