Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-05

Extended in Win64

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi.

Why on Win64 on AMD64 is Extended type 64bit same as double and on Win32, Linux32 and Linux64 is 80bit. It breaks for example this construction:

procedure Swap(var X, Y: Double); overload;
procedure Swap(var X, Y: Extended); overload;

(I know that extended type is defined as float with the best precision on the given platform.)

Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Jonas Maebe
to Unknown author
Why on Win64 on AMD64 is Extended type 64bit same as double and on Win32, Linux32 and Linux64 is 80bit.

Because the original win64 releases did not support the use of the 80x87 floating point unit, and it's still considered to be deprecated. The SSE/SSE2/SSE3/SSE4 units do not support the 80 bit floating point type.

It breaks for example this construction: procedure Swap(var X, Y: Double); overload; procedure Swap(var X, Y: Extended); overload;

This construction also doesn't work on all non-x86 platforms. The proper way is to use the following macros to conditionalise your code:

FPC_HAS_TYPE_SINGLE
FPC_HAS_TYPE_DOUBLE
FPC_HAS_TYPE_EXTENDED

Jonas

Reply by email

Unknown author
to Unknown author: Hi. Why on Win64 on AMD64 is Extended type 64bit same as double and on Win32, Linux32 and…
Show quoted text 10 lines
Hi. Why on Win64 on AMD64 is Extended type 64bit same as double and on Win32, Linux32 and Linux64 is 80bit. It breaks for example this construction: procedure Swap(var X, Y: Double); overload; procedure Swap(var X, Y: Extended); overload; (I know that extended type is defined as float with the best precision on the given platform.)

I now found some explanations:

And explanation that 80-bit precision on AMD64 is depracated and should be replaced by SIMD.
http://developer.amd.com/documentation/articles/Pages/62720069_4.aspx

Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Daniël Mantione
to Jonas Maebe: Because the original win64 releases did not support the use of the 80x87 floating point…

Op Tue, 6 May 2008, schreef Jonas Maebe:

Show quoted text 9 lines
On 06 May 2008, at 15:02, wrote: > Why on Win64 on AMD64 is Extended type 64bit same as double and on Win32, > Linux32 and > Linux64 is 80bit. Because the original win64 releases did not support the use of the 80x87 floating point unit

Actually this is a myth, originating from Microsoft itself. Win64 has always supported the x87, but early Microsoft documentation said it did not. This confused Microsofts' MASM coders which disabled the x87 instructions in MASM.

Daniël

Reply by email