www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/01/12/07:31:20

From: jeffdbREMOVETHIS AT goodnet DOT com (Mikey)
Subject: Re: double != long double
12 Jan 1999 07:31:20 -0800 :
Message-ID: <369ad591.18638270.cygnus.cygwin32.developers@mail.goodnet.com>
References: <3698cbfc DOT 153903947 AT mail DOT goodnet DOT com>
Reply-To: jeffdbREMOVETHIS AT goodnet DOT com
To: DJ Delorie <dj AT delorie DOT com>, cygwin32-developers AT cygnus DOT com

======================================================
FIRST REPLY

Thanks for the reply DJ but that wasn't really my question.

Why is gcc not consistent with the "HOST" compiler in this area?

This will mess up alignment for any sturcture/union that uses the system
libraries with long doubles.

That is what I am currently working on, which is why I noticed this.
;^)

Also won't the stack become inconsistent?
=======================================================
SECOND REPLY

Never mind.  after greping through the PSDK headers long double is
unused, I guess anyone using 3rd party apps/dlls or trying to compile
the vc headers is just going to have to figure it out for themselves.

Another slightly less intrusive, and therefore harder to spot source of
bugs, vc++ defaults to using
_controlfp( _PC_53, _MCW_PC );

linking with fp10.o gets you
_controlfp( 0, _MCW_PC );

with the constants defined as follows
#define	_PC_53		0x00010000
#define	_MCW_PC	0x00030000

if I understand correctly in both cases FPU exceptions are enabled.

where crt0.c says

/* In the following ifdef'd i386 code, the FPU precision is set to 80 bits
   and all FPU exceptions are masked.  The former is needed to make long
   doubles work correctly.  The latter causes the FPU to generate NaNs and
   Infinities instead of signals for certain operations.
*/

which means that any attempt to use floating point that generates errors
would generate unexpected FPU exceptions to the cygwinXX
compiled .dll when runtime linked with a vc app?

On Mon, 11 Jan 1999 10:54:59 -0500, you wrote:

>
>> Why is cygwin using a 12 byte long double when the vc compiler uses an 8
>> byte, does anyone know?
>
>GCC supports long doubles bigger than regular doubles.  8 bytes is a
>regular (64-bit) double.  Apparenly, VC++ just doesn't support
>anything bigger than a regular double.  GCC allows you to use the
>FPU's "extended" precision, which is technically an 80-bit double (10
>bytes) but it stores it in 12 bytes to maintain alignment.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019