This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: long double and GLIBCPP_CHECK_MATH_SUPPORT


> 	GCC for PowerPC does not implement true long double support yet.
> This affects PowerPC GNU/Linux, not just AIX.  "long double" is
> implemented as "double".

Right. So about that powerpc compiler support..............

I have checked that the current repository, 
with the long double macro removed, compiles on the following platforms:

1) x86 linux
2) powerpc linux
3) alpha linux

> 1) src/complexl.cc failed to compile and contained an ifdef for
> _GLIBCPP_USE_LONG_LONG while defining FLT to "long double" which clearly
> was a mismatch.  If std_cmath.h provides a definition for each function
> and falls back to "double" for each implementation, it should work.

fixed with the current approach.

> 2) AC_CHECK_FUNCS(strtold) succeeds on AIX and finds the AIX strtold()
> function, but there is no visible declaration (because long double is not
> supported) which prevented locale_facet.tcc from compiling.  configure
> only checks linkage for strtold() but checks declaration and linkage for
> all of the math functions which is why it determines the accurate
> information for the math functions and not for strtold().  (AIX does
> implement long double support and provides all of the functions but GCC
> does not use it and it is not clear whether a GCC implementation would use
> the same format.)

aaah. Right. So I think:

1) configure should check declaration and linkage of strtold
2) locale_facets.tcc explicitly checks for 

#if defined(_GLIBCPP_HAVE_STRTOLD) && !defined(__hpux)
  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, long double& __v) const
    {
      // Stage 1: extract and determine the conversion specifier.
      // Assuming leading zeros eliminated, thus the size of 256 for
#else
...
#endif

?

what is the compile error you see? I think that if you check for 1), it 
should compile.

> 3) configure takes an excruciating long amount of time to test every
> individual long double math function (including underscore versions), so
> it would be nice if it could skip the rest when it realizes that basic
> long double functions are absent.

At the moment I don't think it's wise to try and optimize this, 
although I understand and have sympathy for your underlying motivations.

> 	Using double support for long double types (which is how GCC is
> behaving) is fine with me.  Platforms without true long double support
> simply require that this be done everywhere, including do_get() and
> do_put(). 

Agreed. Let's start with the changes for strtold and see how much farther 
that gets the compile....

> 	Ignoring pthread support, with Phil's excellent set of patches and
> my config/os/aix localized patches, I was able to compile all of
> libstdc++v3 yesterday.

Please send a patch with a ChangeLog entry for config/os/aix/*. I'm eager 
to get this in.

thanks,
benjamin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]