Re: quad precision on PowerPC?

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

 



On 2011-05-16 02:07:15 +0200, Vincent Lefevre wrote:
> 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

-mabi=ieeelongdouble seems to be the solution:

ay:~> gcc -dM -E -xc /dev/null -mabi=ieeelongdouble | grep LDBL
cc1: warning: Using IEEE extended precision long double
#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
#define __LDBL_MAX_EXP__ 16384
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
#define __LDBL_HAS_QUIET_NAN__ 1
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
#define __LDBL_MANT_DIG__ 113
#define __LDBL_MIN_EXP__ (-16381)
#define __LDBL_MAX_10_EXP__ 4932
#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
#define __LDBL_MIN_10_EXP__ (-4931)
#define __LDBL_DIG__ 33

113-bit precision, that's quadruple precision!

But it's badly documented:

`-mabi=ieeelongdouble'
     Change the current ABI to use IEEE extended precision long double.
     This is a PowerPC 32-bit Linux ABI option.

"IEEE extended precision" doesn't give much information: it can be
any precision and range at least those of Intel's x87. This notion
has even been removed from the IEEE 754 standard in its current
version (2008).

-- 
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