public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* sizeof(long double) vs. std::numeric_limits and x86-64 vs x86
@ 2011-09-27  5:09 Michael Veksler
  2011-09-27  5:12 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Veksler @ 2011-09-27  5:09 UTC (permalink / raw)
  To: gcc-help

Hello,

I wanted to check how many bits long double takes. So I checked 
sizeof(long double) which, naturally, may account for padding. On x86-64 
it takes 16 bytes and only 12 on x86, a difference of 4 bytes. This 
supported my hope that on x86-64 we would have "long double"= |__float128|.


But this difference does not exist in std::numeric_limits<long double>. 
Does it really mean that only the
padding is different between the architectures, but the type is still 
the same?

If "long double" != |__float128|, then is there any chance to have a 
correct definition of std::numeric_limits<__float128> in the near 
future? If not, where can I find macro names such as __LDBL_MANT_DIG__ 
for __float128?
Running
gcc -g -E -dM t.cpp | grep MANT_DIG__
gives only

    #define __FLT_MANT_DIG__ 24
    #define __DEC64_MANT_DIG__ 16
    #define __LDBL_MANT_DIG__ 64
    #define __DBL_MANT_DIG__ 53
    #define __DEC32_MANT_DIG__ 7
    #define __DEC128_MANT_DIG__ 34

no mention of anything like FLT128

Thanks

-- 
   Michael



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-27 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27  5:09 sizeof(long double) vs. std::numeric_limits and x86-64 vs x86 Michael Veksler
2011-09-27  5:12 ` Ian Lance Taylor
2011-09-27 18:27   ` Michael Veksler
2011-09-28  0:41   ` Toon Moene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).