On Sun, Feb 3, 2019 at 7:28 AM J. Gareth Moreton
<gar...@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
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to