This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: Re: Change default sizeof(long double) to 128-bit


By mistake I sent this to the original author only, not to gcc-help.

-------- Original Message --------
Subject: Re: Change default sizeof(long double) to 128-bit
Date: Sun, 27 Mar 2011 15:33:23 +0100
From: Dr. David Kirkby <david.kirkby@onetel.net>
To: bd satish <bdsatish@gmail.com>

On 03/27/11 01:29 PM, bd satish wrote:
Hi,

I am trying to build gcc and  I would like gcc to map (by default)
"long double"  to 128-bit.
What option should I pass to "configure" script to get this behaviour ?

I'm running a 32-bit OS [ Ubuntu 10.10 ] on intel core i3 processor.
Currently sizeof( long double) prints 12 bytes, i.e., 96 bits.

PS: I do not like to specify the flag "-m128bit-long-double" to every
C program I compile. Instead, I want gcc to use 16-byte (128-bit) by
default without the end user having to specify this flag.  Is this
possible ?

For sake of completeness,

[gnu]:15 $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/god/gcc/libexec/gcc/i786-pc-linux-gnu/4.7.0/lto-wrapper
Target: i786-pc-linux-gnu
Configured with: ./configure --prefix=/home/god/gnu/installed/gcc
--enable-languages=c,fortran --build=i786-pc-linux-gnu
--enable-checking=release --disable-libmudflap --enable-libgomp
--disable-shared --disable-bootstrap
Thread model: posix
gcc version 4.7.0 20110319 (experimental) (GCC)


Thanks !

I don't know if this works on any platform (read the docs), but on the gcc I downloaded for the AIX operating system, there was an option to the 'configure' script which might do what you want. Here's how gcc was built on AIX

-bash-4.1$ gcc -v
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../stage/gcc-4.2.4/configure --disable-shared
--enable-threads=posix --prefix=/opt/pware --with-long-double-128
--with-mpfr=/opt/pware --with-gmp=/opt/pware
Thread model: aix
gcc version 4.2.4
-bash-4.1$

I assume 128 bit long doubles will be much slower, as this would have to be
implemented in sofware, whereas I think the 12-byte long double can be done in
hardware on the x86 chips, as the floating point processor uses 80 bits internally.

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Dave


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