Re: quad precision on PowerPC?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-05-13 13:53:11 +0100, Jonathan Wakely wrote:
> On 13 May 2011 13:19, Jonathan Wakely wrote:
> > On 13 May 2011 11:20, Vincent Lefevre wrote:
> >> On 2011-05-13 11:38:22 +0200, Axel Freyn wrote:
> >>> Hi Vincent,
> >>> On Fri, May 13, 2011 at 11:29:46AM +0200, Vincent Lefevre wrote:
> >>> > https://www-304.ibm.com/support/docview.wss?rs=2030&uid=swg21245006
> >>> > says:
> >>> >
> >>> >     GCC versions 4.0 and higher support 128-bit quad precision
> >>> >     floating point values. The XL compilers now provide the
> >>> >     -qfloat=gcclongdouble option to be compatible with GCC's
> >>> >     representation of 128-bit quad precision floating point
> >>> >     values.
> >>> >
> >>> > Anyone knows how to enable it?
> >>> >
> >>> > By default, I just get the double-double representation (yielding
> >>> > 106-bit precision).
> >>> the gcc online-docs say
> >>> http://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
> >>> "Not all targets support additional floating point types. __float80 and
> >>> __float128 types are supported on i386, x86_64 and ia64 targets."
> >>> (but I never tried it on PowerPC)
> >>
> >> Still, __float128 isn't a long double as said in the note above.
> >> I now wonder whether the note is correct.
> >
> > Use --with-long-double-128 at configure time.

This is how gcc is configured under Debian:

ay:~> gcc -v
Using built-in specs.
Target: powerpc-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-secureplt --disable-softfloat --enable-targets=powerpc-linux,powerpc64-linux --with-cpu=default32 --with-long-double-128 --enable-checking=release --build=powerpc-linux-gnu --host=powerpc-linux-gnu --target=powerpc-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)

but I do not get quad precision (see below).

> > See gcc/configure
> >
> > case "$target" in
> >  powerpc*-*-linux* | \
> >  powerpc*-*-gnu* | \
> >  sparc*-*-linux* | \
> >  s390*-*-linux* | \
> >  alpha*-*-linux*)
> >
> 
> It looks as though rs6000 and powerpc also support the
> -mlong-double-128 option, although it's not documented

It has no effect on PowerPC:

ay:~> gcc -dM -E -xc /dev/null | grep LDBL
#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
#define __LDBL_HAS_QUIET_NAN__ 1
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
#define __LDBL_MANT_DIG__ 106
#define __LDBL_MIN_EXP__ (-968)
#define __LDBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
#define __LDBL_MIN_10_EXP__ (-291)
#define __LDBL_DIG__ 31

ay:~> gcc -dM -E -xc /dev/null -mlong-double-128 | grep LDBL
#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
#define __LDBL_HAS_QUIET_NAN__ 1
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
#define __LDBL_MANT_DIG__ 106
#define __LDBL_MIN_EXP__ (-968)
#define __LDBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
#define __LDBL_MIN_10_EXP__ (-291)
#define __LDBL_DIG__ 31

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux