[fpc-devel] *** GMX Spamverdacht *** Re: Broken frac function in FPC3.1.1 / Windows x86_64

Sergei Gorelkin sergei_gorelkin at mail.ru
Fri Apr 27 16:58:33 CEST 2018


27.04.2018 17:14, Sven Barth via fpc-devel wrote:
> Thorsten Engler <thorsten.engler at gmx.net <mailto:thorsten.engler at gmx.net>> schrieb am Fr., 27. Apr. 
> 2018, 16:09:
> 
>     Highest integer that fits in a Int64:____
> 
>     9223372036854775808____
> 
>     1e20:____
> 
>     100000000000000000000____
> 
>     __ __
> 
>     Your Int is overflowing.____
> 
>     __ __
> 
>     You can’t implement Frac by going through an Integer, that will never work. Except if you have
>     an integer that can hold 1.8E308 (which would be a 1024 bit integer, or thereabouts)
> 
> 
> Yes, I saw that now as well, though it's even worse as the cvttsd2si instruction in fact only works 
> with 32-bit integers.
> That additionally means that Trunc() and Round() are broken for such values as well as they rely on 
> the same kind of functions. Int() works because it doesn't have an SSE version.
> 

That's true for i386. But on x86_64 cvt(t)sd2si instuctions can deal with int64 range, if 
destination register is a 64-bit one.

Regards,
Sergei



More information about the fpc-devel mailing list