mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 21:09:11 +02:00
+ 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:
parent
b58c3ed212
commit
5f08e47d84
@ -372,4 +372,16 @@ const
|
|||||||
end;
|
end;
|
||||||
{$endif FPC_SYSTEM_HAS_ROUND}
|
{$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}
|
{$endif FPC_HAS_TYPE_EXTENDED}
|
||||||
|
Loading…
Reference in New Issue
Block a user