]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/i386/fpu/s_sincos.S
Replace FSF snail mail address with URLs.
[thirdparty/glibc.git] / sysdeps / i386 / fpu / s_sincos.S
1 /* Compute sine and cosine of argument.
2 Copyright (C) 1997, 2000 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
19
20 #include <machine/asm.h>
21 #include "bp-sym.h"
22 #include "bp-asm.h"
23
24 #define PARMS LINKAGE /* no space for saved regs */
25 #define ANGLE PARMS
26 #define SINP ANGLE+8
27 #define COSP SINP+PTR_SIZE
28
29 .text
30 ENTRY (BP_SYM (__sincos))
31 ENTER
32
33 fldl ANGLE(%esp)
34 fsincos
35 movl SINP(%esp), %ecx
36 CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $8)
37 movl COSP(%esp), %edx
38 CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $8)
39 fnstsw %ax
40 testl $0x400,%eax
41 jnz 1f
42 fstpl (%edx)
43 fstpl (%ecx)
44
45 LEAVE
46 ret
47
48 .align ALIGNARG(4)
49 1: fldpi
50 fadd %st(0)
51 fxch %st(1)
52 2: fprem1
53 fnstsw %ax
54 testl $0x400,%eax
55 jnz 2b
56 fstp %st(1)
57 fsincos
58 fstpl (%edx)
59 fstpl (%ecx)
60
61 LEAVE
62 ret
63 END (BP_SYM (__sincos))
64 weak_alias (BP_SYM (__sincos), BP_SYM (sincos))