On 28/09/2024 10:26, Martin Frb via fpc-devel wrote:

In addition, now googled, on wikipedia there is only one format for 80bits? (unless I missed something). But it's in a paragraph referring to x86...
https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format


From that any debugger on any platform seems to be able to read such a float. So I presumed that for a given length there is a standard how the number should be represented in memory?

I haven't tested if e.g. gdb would on a big endian be able to read an 80bit float. Or if it would just say that is an invalid size for the platform.

Some ABIs require aligning and padding the value in memory to 16 bytes (maybe some also to 12 bytes).

On trunk, it could be solved with packing + an align directive, although then you'd still have to hard-code the alignment per platform using ifdefs (or add an "alignof" intrinsic).


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to