[PATCH 1/3] Add IEEE 128-bit min/max support on PowerPC.
Segher Boessenkool
segher@kernel.crashing.org
Wed Jun 30 17:35:22 GMT 2021
On Mon, Jun 28, 2021 at 03:00:02PM -0400, Michael Meissner wrote:
> On Wed, Jun 23, 2021 at 06:56:37PM -0500, Segher Boessenkool wrote:
> > > The problem area is a power10 running in
> > > big endian mode and running 32-bit code. Because we don't have TImode, we
> > > can't enable the IEEE 128-bit hardware instructions.
> >
> > I don't see why not?
And this is still true, and the core of the problem here. Please show
any argument for this?
> > > > > +/* { dg-require-effective-target ppc_float128_hw } */
> > > > > +/* { dg-require-effective-target power10_ok } */
> > > > > +/* { dg-options "-mdejagnu-cpu=power10 -O2 -ffast-math" } */
> > > >
> > > > In testcases we can assume that float128_hw is set whenever we have a
> > > > p10; we don't manually disable it to make live hard for ourselves ;-)
> > >
> > > Again, I put it in case somebody builds a BE power10 compiler.
> >
> > This should still be fixed. And yes, people do test BE p10, of course.
> > And BE p10 *should* enable the QP float insns. Does it not currently?
>
> GCC does not enable __float128 by default on BE.
But it does enable _Float128, as it should, and it does work.
> The reason is there are no
> plans to enable all of the float128 support in glibc in BE. Without a library,
> it is kind of useless to enable __float128.
This is fundamentally wrong. GCC is a compiler. It is used without
libraries often (some applications do not want the standard libraries
for a reason, some implement them themselves, some *are* the standard
libraries). And you can have a lot of useful code without using libm.
> If the compiler enabled __float128, It breaks things that check if __float128
> is avaiable. They think __float128 is available, and then they fail when when
> they can't anything besides basic arithmetic.
So? That would be the *correct* behaviour.
> Because the compiler is configured not to enable __float128 in a BE context, we
> don't build the __float128 emulator in libgcc.
Yes, another imperfection.
> In addition, BE GCC runs on things that does not have GLIBC (like AIX). If we
> enabled it by default, it would break those environments.
How so? Not anymore than you do now, you cannot use *any* QP float
with the status quo.
> A further complication is BE by default is still power4 or power5. You need
> VSX support to even pass __float128 arguments. While it is possible to pass
> __float128 in GPRs, you run into compatibility issues if one module is compiled
> with VSX and another is compiled without setting a base cpu, because one module
> will expect things in GPRs and the other in Altivec registers.
Yes, allowing QP float before p8 would solve a lot more problems, as I
have told you very often; but it is independent of this. You need p9
to have the machine insns, and you can compile code that needs the
libgcc soft-float emulation functions for QP on power7 already (it needs
basic VSX only, and should be okay with only VMX even).
> And as I've said, the issue with 32-bit move is we don't have TImode support.
> Some of the machine indepenent passes want to use an appropriate integer type
> to move basic types.
So why does it work fine with double-double?
Please show an example.
Segher
More information about the Gcc-patches
mailing list