From: Ian Lance Taylor <iant@google.com>
To: Michael Veksler <mveksler@techunix.technion.ac.il>
Cc: gcc-help@gcc.gnu.org
Subject: Re: sizeof(long double) vs. std::numeric_limits and x86-64 vs x86
Date: Tue, 27 Sep 2011 05:12:00 -0000 [thread overview]
Message-ID: <mcrmxdqgbvq.fsf@coign.corp.google.com> (raw)
In-Reply-To: <4E80F88F.2050608@tx.technion.ac.il> (Michael Veksler's message of "Tue, 27 Sep 2011 01:11:27 +0300")
Michael Veksler <mveksler@tx.technion.ac.il> writes:
> 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|.
Alas, no. On x86_64 long double is an 80-bit floating point number,
just as on 32-bit x86. The size is 16 bytes because the x86_64 prefers
to align large values to 8-byte boundaries.
gcc works this way because the 80-bit floating point format is supported
directly in hardware, unlike the 128-bit format.
Ian
next prev parent reply other threads:[~2011-09-26 22:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 5:09 Michael Veksler
2011-09-27 5:12 ` Ian Lance Taylor [this message]
2011-09-27 18:27 ` Michael Veksler
2011-09-28 0:41 ` Toon Moene
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mcrmxdqgbvq.fsf@coign.corp.google.com \
--to=iant@google.com \
--cc=gcc-help@gcc.gnu.org \
--cc=mveksler@techunix.technion.ac.il \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).