+ add an SSE2 implementation of Frac() (the existing Trunc() and Round() implementations are also SSE2, so nothing special to keep in mind here)

git-svn-id: trunk@36253 -
This commit is contained in:
svenbarth 2017-05-19 14:59:23 +00:00
parent b58c3ed212
commit 5f08e47d84

View File

@ -372,4 +372,16 @@ const
end;
{$endif FPC_SYSTEM_HAS_ROUND}
{$ifndef FPC_SYSTEM_HAS_FRAC}
{$define FPC_SYSTEM_HAS_FRAC}
function fpc_frac_real(d: ValReal) : ValReal;compilerproc; assembler; nostackframe;
asm
cvttsd2si %xmm0,%rax
{ Windows defines %xmm4 and %xmm5 as first non-parameter volatile registers;
on SYSV systems all are considered as such, so use %xmm4 }
cvtsi2sd %rax,%xmm4
subsd %xmm4,%xmm0
end;
{$endif FPC_SYSTEM_HAS_FRAC}
{$endif FPC_HAS_TYPE_EXTENDED}