Size of the real type
Jarrett Billingsley
kb3ctd2 at yahoo.com
Thu Mar 9 07:11:06 PST 2006
"Anders F Björklund" <afb at algonet.se> wrote in message
news:duol0f$278j$1 at digitaldaemon.com...
> Side note:
> Who said the size of a "real" is 80 bits ? The size varies.
> It's just defined as: "largest hardware implemented FP size"
Which should be 80 on x86 processors!
> The difference is due to alignment of the long double type.
>
> In x86 Linux, it is 96 bits. In x64 Linux, it is 128 bits...
> But they both still only use 80 bits, just add some padding.
>
> --anders
>
> PS.
> http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/i386-and-x86_002d64-Options.html
> "The i386 application binary interface specifies the size to be 96 bits,
> so -m96bit-long-double is the default in 32 bit mode." [...] "In the
> x86-64 compiler, -m128bit-long-double is the default choice as its ABI
> specifies that long double is to be aligned on 16 byte boundary."
Well if the only difference is in the alignment, why isn't just the
real.alignof field affected? An x86-32 real is 80 bits, period. Or does it
have to do with, say, C function name mangling? So a C function that takes
one real in Windows would be _Name at 80 but in Linux it'd be _Name at 96 ?
More information about the Digitalmars-d
mailing list