[fpc-devel] Detecting SSE and AVX compiler options

Bart bartjunk64 at gmail.com
Sun Feb 3 12:14:32 CET 2019


On Sun, Feb 3, 2019 at 7:28 AM J. Gareth Moreton
<gareth at moreton-family.com> wrote:

> {$ASMMODE ATT}
> function floor64(x: float): Int64; assembler; nostackframe;
>   asm
>     roundsd %xmm0, %xmm0, $0b101 { Round towards negative infinity }
>     cvttsd2si %xmm0, %rax { Convert to integer... equivalent to Trunc() }
>   end;

I might be totaly wrong here, but wouldn't that (rounding towards
negative infinity) produce wrong results for negative floating point
numbers?
-- 
Bart



More information about the fpc-devel mailing list