From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8545 invoked by alias); 11 Mar 2003 12:21:18 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8532 invoked from network); 11 Mar 2003 12:21:17 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.250) by 172.16.49.205 with SMTP; 11 Mar 2003 12:21:17 -0000 Received: from laocoon.ics.u-strasbg.fr (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (Postfix) with ESMTP id 350C82C26D2; Tue, 11 Mar 2003 13:31:24 +0100 (CET) Message-Id: <5.0.2.1.2.20030311131024.00aebbe0@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr Date: Tue, 11 Mar 2003 12:21:00 -0000 To: Andrew Cagney From: Pierre Muller Subject: [RFA] Support true 'long double' size. Cc: gdb-patches@sources.redhat.com In-Reply-To: <3E528EC8.9040906@redhat.com> References: <5.0.2.1.2.20030217174903.02c193e8@ics.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2003-03/txt/msg00250.txt.bz2 At 20:51 18/02/2003, Andrew Cagney wrote: >>Index: doublest.c >>=================================================================== >>RCS file: /cvs/src/src/gdb/doublest.c,v >>retrieving revision 1.11 >>diff -u -p -r1.11 doublest.c >>--- doublest.c 4 Dec 2002 05:40:40 -0000 1.11 >>+++ doublest.c 17 Feb 2003 16:07:19 -0000 >>@@ -633,6 +633,8 @@ floatformat_from_length (int len) >> return TARGET_DOUBLE_FORMAT; >> else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT) >> return TARGET_LONG_DOUBLE_FORMAT; >>+ else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT_ALTERNATE) >>+ return TARGET_LONG_DOUBLE_FORMAT; >> >> return NULL; >> } > >Would simply adding: > >else if (TARGET_LONG_DOUBLE_FORMAT != NULL > && len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_FORMAT->totalsize) > .. > >to the end of that if() chain work? (and the other alternatives as well of course). Yes this works and has the same functionality for the i386 specific problem. >Otherwize, yes, I can't see any other way of handling this problem :-( The old patch might still be usefull for other processors, but I am not sure about that. So here is a new simplified patch proposal: ChangeLog entry: 2003-03-11 Pierre Muller * doublest.c (floatformat_from_length): Accept also the real size of 'long double' type. Index: doublest.c =================================================================== RCS file: /cvs/src/src/gdb/doublest.c,v retrieving revision 1.12 diff -p -u -r1.12 doublest.c --- doublest.c 27 Feb 2003 18:08:25 -0000 1.12 +++ doublest.c 11 Mar 2003 12:17:52 -0000 @@ -633,6 +633,14 @@ floatformat_from_length (int len) return TARGET_DOUBLE_FORMAT; else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT) return TARGET_LONG_DOUBLE_FORMAT; + /* On i386 the 'long double' type takes 96 bits, + while the real number of used bits is only 80, + both in processor and in memory. + The code below accepts the real bit size. */ + else if ((TARGET_LONG_DOUBLE_FORMAT) + && (len * TARGET_CHAR_BIT == + TARGET_LONG_DOUBLE_FORMAT->totalsize)) + return TARGET_LONG_DOUBLE_FORMAT; return NULL; } Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99