[fpc-pascal] Floating point question

Marco van de Voort fpc at pascalprogramming.org
Thu Feb 22 17:50:22 CET 2024


Op 22-2-2024 om 15:08 schreef Thomas Kurz via fpc-pascal:
>> If you're using Win64, then the answer is simple: x86_64-win64 unlike any
>> other x86 target does not support Extended, so neither the compiler nor the
>> code in runtime will ever calculate anything with that precision.
> That's another thing I've never understood. How can it depend on the OS? It's the CPU which does math, and I don't understand what the OS has to do with that? If amd64 architecture didn't support the extended-type at all, I'd say "ok". But it's supported on Linux but not on Windows? Huh?

The problem is not that it is only Extended that is deprecated on win64, 
but the whole of x87. To replace it, the Windows 64-bit ABI points to 
SSE2 floating point math which only goes up to 64-bit Double.

I.e. it is not that Microsoft might not in time save the few extra bits 
of an extended in a x87 context save, but more that it won't save the 
x87 state at all, and only save the SSE2 state.



More information about the fpc-pascal mailing list