2
0
Эх сурвалжийг харах

+ 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 -
svenbarth 8 жил өмнө
parent
commit
5f08e47d84
1 өөрчлөгдсөн 12 нэмэгдсэн , 0 устгасан
  1. 12 0
      rtl/x86_64/math.inc

+ 12 - 0
rtl/x86_64/math.inc

@@ -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}