On Tue, Feb 15, 2022 at 03:18:30PM -0500, Michael Meissner wrote:
> On Tue, Feb 15, 2022 at 01:45:06PM -0600, Segher Boessenkool wrote:
> > On Tue, Feb 15, 2022 at 12:49:41PM -0500, Michael Meissner wrote:
> > > Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
> > > 
> > > Define the sizes of the PowerPC specific types __float128 and __ibm128 if 
> > > those
> > > types are enabled.
> > 
> > This is very silly of course, both of these are 16 bytes.  Abusing this
> > to see if the types exist is at least as silly (there are much better
> > mechanisms to do this).
> 
> This is just trying to close out the PR that people asked for.

I put many arguments in that PR why this is a futile thing to have.

On all older compilers these macros will not be defined, but the types
often are.  If you are willing to not support older compilers properly
anyway, you could just *always* use the types, which will work with most
very old compilers as well (and the approach using these propesed
predefines will *not*!)

This is (not) solving a non-problem.

> > So, this facilitates bad habits and bad code.  But, whatever, the macros
> > are just stating totally obvious and redundant facts, no problem, let's
> > just ignore that pepople only want it to abuse it.
> > 
> > > gcc/
> > >   PR target/99708
> > >   * config/rs6000/rs6000-c.cc (rs6000_target_modify_macros): Define
> > >   __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ if we have float128
> > >   support.
> > 
> > No.  __SIZEOF_IBM128__ should be defined if and only if __ibm128 is
> > defined.
> 
> In the current implementation, __ibm128 is only defined if __float128 was
> defined.  I did have patches 6 months or so to define __ibm128 on any system
> with IBM 128-bit long double.  But those were never applied to the trunk.
> 
> > This should be tested directly, it should not depend on that some other
> > code did what it does today.  That would also make the code much more
> > obvious.

Read that last paragraph again please?  This is the only thing that
needs changing.

> Given __float128 and __ibm128 are defined at the same time, I don't see the
> need for a separate target-supports.exp test, and so forth.  But if you want
> that, I can easily do it.

No, I'm asking for it in the code that does the predefine.  Not in the
testcase, testcases are dirty pretty much always, and it is acceptable
there because the scope is so limited.


Segher

Reply via email to