Browse Source

* x86_64 non-Win64 targets: calculate tan() and cotan() using x87 "fptan" instruction.

git-svn-id: trunk@25996 -
sergei 11 years ago
parent
commit
5ea99c84fd
1 changed files with 19 additions and 0 deletions
  1. 19 0
      rtl/x86_64/mathu.inc

+ 19 - 0
rtl/x86_64/mathu.inc

@@ -23,6 +23,25 @@ function arctan2(y,x : float) : float;assembler;
      fpatan
      fwait
   end;
+
+{$define FPC_MATH_HAS_TAN}
+function tan(x : float) : float;assembler;
+  asm
+    fldt X
+    fptan
+    fstp %st
+    fwait
+  end;
+
+
+{$define FPC_MATH_HAS_COTAN}
+function cotan(x : float) : float;assembler;
+  asm
+    fldt X
+    fptan
+    fdivp %st,%st(1)
+    fwait
+  end;
 {$endif FPC_HAS_TYPE_EXTENDED}