Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@ics.u-strasbg.fr>
To: Andrew Cagney <ac131313@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: [RFA] Support true 'long double' size.
Date: Tue, 11 Mar 2003 12:21:00 -0000	[thread overview]
Message-ID: <5.0.2.1.2.20030311131024.00aebbe0@ics.u-strasbg.fr> (raw)
In-Reply-To: <3E528EC8.9040906@redhat.com>

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  <muller@ics.u-strasbg.fr>

        * 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


  reply	other threads:[~2003-03-11 12:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-17 16:54 [RFC] Support alternate " Pierre Muller
2003-02-18 19:46 ` Andrew Cagney
2003-03-11 12:21   ` Pierre Muller [this message]
     [not found]     ` <3E6DF2A2.8030609@redhat.com>
2003-03-11 16:39       ` [RFA] Support true " Pierre Muller

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=5.0.2.1.2.20030311131024.00aebbe0@ics.u-strasbg.fr \
    --to=muller@ics.u-strasbg.fr \
    --cc=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /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