Compatibility issue involving the FPU with an application compiled by Delphi 7 executed on Windows 11 ARM64

78 Views Asked by At

I am testing the compatibility of an x86 32-bit application compiled with Delphi 7 and running on Windows 11 ARM64.

The RTL functions IntToHex() and IntToStr() both return bad values when used with an Int64.

For example : IntToHex($FF00FF55AA55AA) returns '00FF00FF55AA55A8' and IntToHex($123456789ABCDEF) returns '0123456789ABCDE0'.

The faulty implementation seems to be in the function SysUtils.CvtInt64, called by IntToHex() and IntToStr(), which implementation relies on the FPU.

For shorter integers (<= 32 bits), the functions call SysUtils.CvtInt, which works correctly and does not rely on the FPU.

The reverse operation StrToInt() also works correctly, and does not use the FPU, either.

So, I think the problem is either due to a buggy FPU emulation on ARM64, or a misuse of the FPU in RTL functions that happened to work on existing processors.

I am now trying to replace the CvtInt64 implementation with an alternative one that does not use the FPU.

Does anyone know of such an implementation, and how to use it to replace the original SysUtils.CvtInt64?

Is there a way to report the problem regarding the FPU emulation on Windows 11 ARM64 to Microsoft?

0

There are 0 best solutions below