summaryrefslogtreecommitdiff
path: root/sysdeps/m68k/fpu/k_sin.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/m68k/fpu/k_sin.c')
-rw-r--r--sysdeps/m68k/fpu/k_sin.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sysdeps/m68k/fpu/k_sin.c b/sysdeps/m68k/fpu/k_sin.c
index 8c6dfef720..3eed1d466c 100644
--- a/sysdeps/m68k/fpu/k_sin.c
+++ b/sysdeps/m68k/fpu/k_sin.c
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <math.h>
#ifndef FUNC
@@ -29,8 +28,17 @@ Cambridge, MA 02139, USA. */
#define __CONCATX(a,b) __CONCAT(a,b)
float_type
-DEFUN(__CONCATX(__kernel_,FUNC), (x, y, iy),
- float_type x AND float_type y AND int iy)
+__CONCATX(__kernel_,FUNC) (x, y, iy)
+ float_type x;
+ float_type y;
+ int iy;
{
- return __CONCATX(__,FUNC) (x + y);
+ float_type sin_x, cos_x, sin_y, cos_y;
+ if (iy == 0)
+ return __m81_u_(__CONCATX(__,FUNC)) (x);
+ __asm__ __volatile__ ("fsincosx %2,%0:%1" : "=f" (cos_x), "=f" (sin_x)
+ : "f" (x));
+ __asm__ __volatile__ ("fsincosx %2,%0:%1" : "=f" (cos_y), "=f" (sin_y)
+ : "f" (y));
+ return sin_x * cos_y + cos_x * sin_y;
}