From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1812 invoked by alias); 26 Sep 2011 22:47:11 -0000 Received: (qmail 1803 invoked by uid 22791); 26 Sep 2011 22:47:09 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Sep 2011 22:46:55 +0000 Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id p8QMks6p026540 for ; Mon, 26 Sep 2011 15:46:54 -0700 Received: from iabz7 (iabz7.prod.google.com [10.12.102.7]) by hpaq12.eem.corp.google.com with ESMTP id p8QMkerM020395 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 26 Sep 2011 15:46:52 -0700 Received: by iabz7 with SMTP id z7so5604275iab.7 for ; Mon, 26 Sep 2011 15:46:52 -0700 (PDT) Received: by 10.42.139.129 with SMTP id g1mr480373icu.113.1317077212498; Mon, 26 Sep 2011 15:46:52 -0700 (PDT) Received: by 10.42.139.129 with SMTP id g1mr480363icu.113.1317077212245; Mon, 26 Sep 2011 15:46:52 -0700 (PDT) Received: from coign.google.com ([2620:0:1000:2301:21c:25ff:fe14:8d86]) by mx.google.com with ESMTPS id 37sm27922626iba.5.2011.09.26.15.46.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Sep 2011 15:46:51 -0700 (PDT) From: Ian Lance Taylor To: Michael Veksler Cc: gcc-help@gcc.gnu.org Subject: Re: sizeof(long double) vs. std::numeric_limits and x86-64 vs x86 References: <4E80F88F.2050608@tx.technion.ac.il> Date: Tue, 27 Sep 2011 05:12:00 -0000 In-Reply-To: <4E80F88F.2050608@tx.technion.ac.il> (Michael Veksler's message of "Tue, 27 Sep 2011 01:11:27 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00216.txt.bz2 Michael Veksler 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