On Mon, Oct 04, 2021 at 12:07:54PM +0200, Jakub Jelinek wrote:
> etc.  Could we just pretend in the compiler to libgfortran ABI that
> powerpc64le-linux real(kind=16) is kind 17 and make sure that if anything
> would actually think it is 17 bytes it uses 16 instead (though, kind=10
> on x86-64 or i686 also isn't 10 bytes but 16 or 12, right?).
> 
> Your thoughts on this?

I tried this at one point.  There are a lot of hidden assumptions that the kind
number is the number of bytes.  I'm sure it can be tracked down, but the
problem is with these assumptions is you can't prove a negative (i.e. you never
know that you've missed some).

Note the PowerPC has a third configure option for long double with the
configure option --without-long-double-128.  This option makes long double on
C/C++ be 64-bits instead of 128-bits.

In terms of enabling IEEE outside of PowerPC 64 LE Linux systems there are two
roadblocks:

1) The default configuration of BE systems is still Power4.  You need at least
Altivec registers to be able to pass and return IEEE 128-bit values.  However,
I am skeptical that configuring for a power6 could produce workable code, so
power7 is the theoretical minimum that could be used.  I limited it to power8
because the code needed direct moves and other ISA 3.0 support.  PowerPC 64-bit
LE has a minimum base level of power8, so it isn't an issue on that system.

2) The big stumbling block was that GLIBC only has IEEE 128-bit support for the
LE systems.  If there is BE glibc support, we could certainly add support for
enabling IEEE 128-bit in BE systems if the compiler was configured for power8
or higher.

-- 
Michael Meissner, IBM
PO Box 98, Ayer, Massachusetts, USA, 01432
email: meiss...@linux.ibm.com

Reply via email to