public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* long double format on I!64
@ 2002-08-28 15:07 Gabriel Dos Reis
  2002-08-28 23:34 ` Bo Thorsen
  2002-08-29  8:32 ` Jim Wilson
  0 siblings, 2 replies; 6+ messages in thread
From: Gabriel Dos Reis @ 2002-08-28 15:07 UTC (permalink / raw)
  To: gcc; +Cc: Jim Wilson

Hi,

  I've been reviewing the fundamental data types format as
communicated to V3 sources. due to some mismatch in data, we're now
getting some information directly from the compiler.  See

      http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01672.html

In the file

     libstdc++-v3/config/cpu/ia64/cpu_limits.h

I see the following 

    // While sizeof(long double) == 16, the format is the same as the x86.
    #define __glibcpp_long_double_bits 80

I don't know how exactly I should interpret that since 80 bits don't
make 16 bytes.  I guess that means some bits are ignored.  If so I need
to know exactly which ones. 

Thanks,

-- Gaby

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long double format on I!64
  2002-08-28 15:07 long double format on I!64 Gabriel Dos Reis
@ 2002-08-28 23:34 ` Bo Thorsen
  2002-08-29  1:37   ` Gabriel Dos Reis
  2002-08-29  8:32 ` Jim Wilson
  1 sibling, 1 reply; 6+ messages in thread
From: Bo Thorsen @ 2002-08-28 23:34 UTC (permalink / raw)
  To: Gabriel Dos Reis, gcc; +Cc: Jim Wilson

On Thursday 29 August 2002 00:02, Gabriel Dos Reis wrote:
> Hi,
>
>   I've been reviewing the fundamental data types format as
> communicated to V3 sources. due to some mismatch in data, we're now
> getting some information directly from the compiler.  See
>
>       http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01672.html
>
> In the file
>
>      libstdc++-v3/config/cpu/ia64/cpu_limits.h
>
> I see the following
>
>     // While sizeof(long double) == 16, the format is the same as the x86.
>     #define __glibcpp_long_double_bits 80
>
> I don't know how exactly I should interpret that since 80 bits don't
> make 16 bytes.  I guess that means some bits are ignored.  If so I need
> to know exactly which ones.

It's like x86, just with 6 bytes padding instead of 2. So the first 10 bytes 
are the double.

BTW, x86-64 does exactly the same.

Bo.

-- 

     Bo Thorsen                 |   Praestevejen 4
     Free software developer    |   5290 Marslev
     SuSE Labs                  |   Denmark

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long double format on I!64
  2002-08-28 23:34 ` Bo Thorsen
@ 2002-08-29  1:37   ` Gabriel Dos Reis
  0 siblings, 0 replies; 6+ messages in thread
From: Gabriel Dos Reis @ 2002-08-29  1:37 UTC (permalink / raw)
  To: Bo Thorsen; +Cc: gcc, Jim Wilson

Bo Thorsen <bo@sonofthor.dk> writes:

| > I don't know how exactly I should interpret that since 80 bits don't
| > make 16 bytes.  I guess that means some bits are ignored.  If so I need
| > to know exactly which ones.
| 
| It's like x86, just with 6 bytes padding instead of 2. So the first 10 bytes 
| are the double.

OK, thanks a lot.

Hmm, I guess I'm going to have another funny day with this stuf.

-- Gaby

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long double format on I!64
  2002-08-28 15:07 long double format on I!64 Gabriel Dos Reis
  2002-08-28 23:34 ` Bo Thorsen
@ 2002-08-29  8:32 ` Jim Wilson
  1 sibling, 0 replies; 6+ messages in thread
From: Jim Wilson @ 2002-08-29  8:32 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc

ia64-linux uses a long double with 80-bits of info stored in a 128-bit
slot.  The 80-bit format is used for compatibility with x86 systems.
The 128-bit slot is used to make alignment/padding simpler.  The first
ten bytes are the FP value, the last 6 bytes are the padding.  This is
true for both big and little endian.

ia64-hpux however uses an actual 128-bit long double.  This is for
compatibility with hppa-hpux systems.  I don't have access to ia64-hpux,
so I can't help you with this.

Jim

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long double format on I!64
  2002-08-29  8:21 Steve Ellcey
@ 2002-08-29  8:30 ` Gabriel Dos Reis
  0 siblings, 0 replies; 6+ messages in thread
From: Gabriel Dos Reis @ 2002-08-29  8:30 UTC (permalink / raw)
  To: Steve Ellcey; +Cc: gcc

Steve Ellcey <sje@cup.hp.com> writes:

| >     // While sizeof(long double) == 16, the format is the same as the x86.
| >     #define __glibcpp_long_double_bits 80
| 
| FYI:  While Linux on IA64 uses the 80 bit format, HP-UX does not.  It
| uses the full 128 bit format for long double.  In gcc/config/ia64 the
| floating point format is determined by the macro
| INTEL_EXTENDED_IEEE_FORMAT.  (1 for 80 bit format, 0 for 128 bit
| format).  This is because the HP-UX C and C++ compilers also use 128
| bits for long double in order to be compatible with the HP-UX PA
| compilers.

Thanks, that is helpful.

-- Gaby

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long double format on I!64
@ 2002-08-29  8:21 Steve Ellcey
  2002-08-29  8:30 ` Gabriel Dos Reis
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Ellcey @ 2002-08-29  8:21 UTC (permalink / raw)
  To: gcc, gdr

>     // While sizeof(long double) == 16, the format is the same as the x86.
>     #define __glibcpp_long_double_bits 80

FYI:  While Linux on IA64 uses the 80 bit format, HP-UX does not.  It
uses the full 128 bit format for long double.  In gcc/config/ia64 the
floating point format is determined by the macro
INTEL_EXTENDED_IEEE_FORMAT.  (1 for 80 bit format, 0 for 128 bit
format).  This is because the HP-UX C and C++ compilers also use 128
bits for long double in order to be compatible with the HP-UX PA
compilers.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-08-29  8:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-28 15:07 long double format on I!64 Gabriel Dos Reis
2002-08-28 23:34 ` Bo Thorsen
2002-08-29  1:37   ` Gabriel Dos Reis
2002-08-29  8:32 ` Jim Wilson
2002-08-29  8:21 Steve Ellcey
2002-08-29  8:30 ` Gabriel Dos Reis

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).