Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libm/i386/src/__reduction.s
+++ new/usr/src/lib/libm/i386/src/__reduction.s
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 23 */
24 24 /*
25 25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 26 * Use is subject to license terms.
27 27 */
28 28
29 29 .file "__reduction.s"
30 30
31 31 /
↓ open down ↓ |
31 lines elided |
↑ open up ↑ |
32 32 / After argument reduction which returns n:
33 33 / n mod 4 sin(x) cos(x) tan(x)
34 34 / ----------------------------------------------------------
35 35 / 0 S C S/C
36 36 / 1 C -S -C/S
37 37 / 2 -S -C S/C
38 38 / 3 -C S -C/S
39 39 / ----------------------------------------------------------
40 40
41 41 #include "libm.h"
42 -#include "libm_synonyms.h"
43 42 #include "libm_protos.h"
44 -#undef fabs
45 43
46 44 ENTRY(__reduction)
47 45 #ifndef PIC
48 46 movl 12(%esp),%eax / load the high part of arg
49 47 #else
50 48 movl 16(%esp),%eax / load the high part of arg
51 49 #endif
52 50 andl $0x7fffffff,%eax / clear sign
53 51 cmpl $0x3fe921fb,%eax / Is |x| < pi/4 (= 0x3fe921fb54...) ?
54 52 jbe .L0
55 53 cmpl $0x7ff00000,%eax / Is arg a NaN or an Inf ?
56 54 jb .L1
57 55 .L0:
58 56 #ifndef PIC
59 57 fldl 8(%esp) / push arg
60 58 #else
61 59 fldl 12(%esp) / push arg
62 60 #endif
63 61 fwait
64 62 movl $0,%eax / set n = 0
65 63 ret
66 64 .L1:
67 65 pushl %ebp
68 66 movl %esp,%ebp
69 67 subl $16,%esp
70 68 PIC_SETUP(1)
71 69 leal -16(%ebp),%eax / address of y[0]
72 70 pushl %eax
73 71 #ifndef PIC
74 72 pushl 16(%ebp)
75 73 pushl 12(%ebp)
76 74 #else
77 75 pushl 20(%ebp)
78 76 pushl 16(%ebp)
79 77 #endif
80 78 call PIC_F(__rem_pio2) / call __rem_pio2(x,&y)
81 79 fldl -8(%ebp) / y[1]
82 80 fldl -16(%ebp) / y[0], y[1]
83 81 faddp %st,%st(1) / y[0]+y[1] round-to-extended
84 82 addl $28,%esp / 16+4*3
85 83 andl $3,%eax
86 84 PIC_WRAPUP
87 85 leave
88 86 ret
89 87 .align 4
90 88 SET_SIZE(__reduction)
↓ open down ↓ |
36 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX