[fpc-pascal] Floating point question

Thomas Kurz fpc.2021 at t-net.ruhr
Thu Feb 22 15:27:40 CET 2024


Aaaah, ok. Thank you very much for alrifying this long-standing question!


----- Original Message ----- 
From: Tomas Hajny via fpc-pascal <fpc-pascal at lists.freepascal.org>
To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
Sent: Thursday, February 22, 2024, 15:25:34
Subject: [fpc-pascal] Floating point question

On 2024-02-22 15:08, Thomas Kurz via fpc-pascal wrote:
>> 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 reason is that the operating system is among others responsible for 
controlling the multitasking. That includes saving the context of the 
originally active task and restoring the context of the new task to the 
original state before it was interrupted. If Win64 doesn't guarantee 
restoring FPU registers specific to the extended type, using this type 
would get you into troubles despite its support in the FPU.

Tomas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



More information about the fpc-pascal mailing list