]>
Commit | Line | Data |
---|---|---|
7799b7b3 | 1 | /* Compute sine and cosine of argument. |
9e25f6e2 | 2 | Copyright (C) 1997, 2000 Free Software Foundation, Inc. |
7799b7b3 UD |
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 | |
41bdb6e2 AJ |
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. | |
7799b7b3 UD |
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 | |
41bdb6e2 | 14 | Lesser General Public License for more details. |
7799b7b3 | 15 | |
41bdb6e2 | 16 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
17 | License along with the GNU C Library; if not, see |
18 | <http://www.gnu.org/licenses/>. */ | |
7799b7b3 UD |
19 | |
20 | #include <machine/asm.h> | |
9e25f6e2 GM |
21 | #include "bp-sym.h" |
22 | #include "bp-asm.h" | |
7799b7b3 | 23 | |
9e25f6e2 GM |
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) | |
7799b7b3 | 34 | fsincos |
9e25f6e2 GM |
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) | |
7799b7b3 UD |
39 | fnstsw %ax |
40 | testl $0x400,%eax | |
41 | jnz 1f | |
42 | fstpl (%edx) | |
43 | fstpl (%ecx) | |
9e25f6e2 GM |
44 | |
45 | LEAVE | |
7799b7b3 | 46 | ret |
9e25f6e2 | 47 | |
7799b7b3 UD |
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) | |
9e25f6e2 GM |
60 | |
61 | LEAVE | |
7799b7b3 | 62 | ret |
9e25f6e2 GM |
63 | END (BP_SYM (__sincos)) |
64 | weak_alias (BP_SYM (__sincos), BP_SYM (sincos)) |