Add a few missing weak aliasesdiff -r1.8 -r1.9 src/lib/libm/arch/vax/n_atan2.S
(martin)
--- src/lib/libm/arch/vax/n_atan2.S 2008/03/20 18:49:39 1.8
+++ src/lib/libm/arch/vax/n_atan2.S 2014/10/10 20:58:09 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_atan2.S,v 1.8 2008/03/20 18:49:39 mhitch Exp $ */ | 1 | /* $NetBSD: n_atan2.S,v 1.9 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1985, 1993 | 3 | * Copyright (c) 1985, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -74,26 +74,27 @@ | @@ -74,26 +74,27 @@ | |||
74 | 74 | |||
75 | #ifdef WEAK_ALIAS | 75 | #ifdef WEAK_ALIAS | |
76 | WEAK_ALIAS(atan2f, _atan2f) | 76 | WEAK_ALIAS(atan2f, _atan2f) | |
77 | #endif | 77 | #endif | |
78 | 78 | |||
79 | ENTRY(_atan2f, 0) | 79 | ENTRY(_atan2f, 0) | |
80 | cvtfd 4(%ap),-(%sp) | 80 | cvtfd 4(%ap),-(%sp) | |
81 | calls $2,_C_LABEL(_atan2) | 81 | calls $2,_C_LABEL(_atan2) | |
82 | cvtdf %r0,%r0 | 82 | cvtdf %r0,%r0 | |
83 | ret | 83 | ret | |
84 | 84 | |||
85 | #ifdef WEAK_ALIAS | 85 | #ifdef WEAK_ALIAS | |
86 | WEAK_ALIAS(atan2, _atan2) | 86 | WEAK_ALIAS(atan2, _atan2) | |
87 | WEAK_ALIAS(_atan2l, _atan2) | |||
87 | #endif | 88 | #endif | |
88 | 89 | |||
89 | ENTRY(_atan2, 0x0fc0) | 90 | ENTRY(_atan2, 0x0fc0) | |
90 | movq 4(%ap),%r2 # %r2 = y | 91 | movq 4(%ap),%r2 # %r2 = y | |
91 | movq 12(%ap),%r4 # %r4 = x | 92 | movq 12(%ap),%r4 # %r4 = x | |
92 | bicw3 $0x7f,%r2,%r0 | 93 | bicw3 $0x7f,%r2,%r0 | |
93 | bicw3 $0x7f,%r4,%r1 | 94 | bicw3 $0x7f,%r4,%r1 | |
94 | cmpw %r0,$0x8000 # y is the reserved operand | 95 | cmpw %r0,$0x8000 # y is the reserved operand | |
95 | jeql resop | 96 | jeql resop | |
96 | cmpw %r1,$0x8000 # x is the reserved operand | 97 | cmpw %r1,$0x8000 # x is the reserved operand | |
97 | jeql resop | 98 | jeql resop | |
98 | subl2 $8,%sp | 99 | subl2 $8,%sp | |
99 | bicw3 $0x7fff,%r2,-4(%fp) # copy y sign bit to -4(%fp) | 100 | bicw3 $0x7fff,%r2,-4(%fp) # copy y sign bit to -4(%fp) |
--- src/lib/libm/arch/vax/n_cabs.S 2008/03/20 16:41:26 1.6
+++ src/lib/libm/arch/vax/n_cabs.S 2014/10/10 20:58:09 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_cabs.S,v 1.6 2008/03/20 16:41:26 mhitch Exp $ */ | 1 | /* $NetBSD: n_cabs.S,v 1.7 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1985, 1993 | 3 | * Copyright (c) 1985, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -45,26 +45,28 @@ | @@ -45,26 +45,28 @@ | |||
45 | /* entry for c functions cabs and hypot */ | 45 | /* entry for c functions cabs and hypot */ | |
46 | #ifdef WEAK_ALIAS | 46 | #ifdef WEAK_ALIAS | |
47 | WEAK_ALIAS(hypotf, _hypotf) | 47 | WEAK_ALIAS(hypotf, _hypotf) | |
48 | #endif | 48 | #endif | |
49 | 49 | |||
50 | ENTRY(_hypotf, 0) | 50 | ENTRY(_hypotf, 0) | |
51 | cvtfd 4(%ap),-(%sp) | 51 | cvtfd 4(%ap),-(%sp) | |
52 | calls $2,_C_LABEL(_hypot) | 52 | calls $2,_C_LABEL(_hypot) | |
53 | cvtdf %r0,%r0 | 53 | cvtdf %r0,%r0 | |
54 | ret | 54 | ret | |
55 | 55 | |||
56 | #ifdef WEAK_ALIAS | 56 | #ifdef WEAK_ALIAS | |
57 | WEAK_ALIAS(hypot, _hypot) | 57 | WEAK_ALIAS(hypot, _hypot) | |
58 | WEAK_ALIAS(hypotl, _hypot) | |||
59 | WEAK_ALIAS(_hypotl, _hypot) | |||
58 | #endif | 60 | #endif | |
59 | 61 | |||
60 | ALTENTRY(cabs) | 62 | ALTENTRY(cabs) | |
61 | ENTRY(_hypot, 0x8040) # save %r6, enable floating overflow | 63 | ENTRY(_hypot, 0x8040) # save %r6, enable floating overflow | |
62 | movq 4(%ap),%r0 # %r0:1 = x | 64 | movq 4(%ap),%r0 # %r0:1 = x | |
63 | movq 12(%ap),%r2 # %r2:3 = y | 65 | movq 12(%ap),%r2 # %r2:3 = y | |
64 | jbr cabs2 | 66 | jbr cabs2 | |
65 | 67 | |||
66 | /* entry for Fortran use, call by: d = abs(z) */ | 68 | /* entry for Fortran use, call by: d = abs(z) */ | |
67 | ENTRY(z_abs, 0x8040) # save %r6, enable floating overflow | 69 | ENTRY(z_abs, 0x8040) # save %r6, enable floating overflow | |
68 | movl 4(%ap),%r2 # indirect addressing is necessary here | 70 | movl 4(%ap),%r2 # indirect addressing is necessary here | |
69 | movq (%r2)+,%r0 # %r0:1 = x | 71 | movq (%r2)+,%r0 # %r0:1 = x | |
70 | movq (%r2),%r2 # %r2:3 = y | 72 | movq (%r2),%r2 # %r2:3 = y |
--- src/lib/libm/noieee_src/n_atan2.c 2003/08/07 16:44:50 1.6
+++ src/lib/libm/noieee_src/n_atan2.c 2014/10/10 20:58:09 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_atan2.c,v 1.6 2003/08/07 16:44:50 agc Exp $ */ | 1 | /* $NetBSD: n_atan2.c,v 1.7 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1985, 1993 | 3 | * Copyright (c) 1985, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -160,26 +160,30 @@ ic(a11, 1.6438029044759730479E-2 , | @@ -160,26 +160,30 @@ ic(a11, 1.6438029044759730479E-2 , | |||
160 | #define a2 vccast(a2) | 160 | #define a2 vccast(a2) | |
161 | #define a3 vccast(a3) | 161 | #define a3 vccast(a3) | |
162 | #define a4 vccast(a4) | 162 | #define a4 vccast(a4) | |
163 | #define a5 vccast(a5) | 163 | #define a5 vccast(a5) | |
164 | #define a6 vccast(a6) | 164 | #define a6 vccast(a6) | |
165 | #define a7 vccast(a7) | 165 | #define a7 vccast(a7) | |
166 | #define a8 vccast(a8) | 166 | #define a8 vccast(a8) | |
167 | #define a9 vccast(a9) | 167 | #define a9 vccast(a9) | |
168 | #define a10 vccast(a10) | 168 | #define a10 vccast(a10) | |
169 | #define a11 vccast(a11) | 169 | #define a11 vccast(a11) | |
170 | #define a12 vccast(a12) | 170 | #define a12 vccast(a12) | |
171 | #endif | 171 | #endif | |
172 | 172 | |||
173 | #ifdef __weak_alias | |||
174 | __weak_alias(_atan2l, atan2); | |||
175 | #endif | |||
176 | ||||
173 | double | 177 | double | |
174 | atan2(double y, double x) | 178 | atan2(double y, double x) | |
175 | { | 179 | { | |
176 | static const double zero=0, one=1, small=1.0E-9, big=1.0E18; | 180 | static const double zero=0, one=1, small=1.0E-9, big=1.0E18; | |
177 | double t,z,signy,signx,hi,lo; | 181 | double t,z,signy,signx,hi,lo; | |
178 | int k,m; | 182 | int k,m; | |
179 | 183 | |||
180 | #if !defined(__vax__)&&!defined(tahoe) | 184 | #if !defined(__vax__)&&!defined(tahoe) | |
181 | /* if x or y is NAN */ | 185 | /* if x or y is NAN */ | |
182 | if(x!=x) return(x); if(y!=y) return(y); | 186 | if(x!=x) return(x); if(y!=y) return(y); | |
183 | #endif /* !defined(__vax__)&&!defined(tahoe) */ | 187 | #endif /* !defined(__vax__)&&!defined(tahoe) */ | |
184 | 188 | |||
185 | /* copy down the sign of y and x */ | 189 | /* copy down the sign of y and x */ |
--- src/lib/libm/noieee_src/n_sincos.c 2003/08/07 16:44:52 1.6
+++ src/lib/libm/noieee_src/n_sincos.c 2014/10/10 20:58:09 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_sincos.c,v 1.6 2003/08/07 16:44:52 agc Exp $ */ | 1 | /* $NetBSD: n_sincos.c,v 1.7 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1987, 1993 | 3 | * Copyright (c) 1987, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -28,26 +28,31 @@ | @@ -28,26 +28,31 @@ | |||
28 | * SUCH DAMAGE. | 28 | * SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #ifndef lint | 31 | #ifndef lint | |
32 | #if 0 | 32 | #if 0 | |
33 | static char sccsid[] = "@(#)sincos.c 8.1 (Berkeley) 6/4/93"; | 33 | static char sccsid[] = "@(#)sincos.c 8.1 (Berkeley) 6/4/93"; | |
34 | #endif | 34 | #endif | |
35 | #endif /* not lint */ | 35 | #endif /* not lint */ | |
36 | 36 | |||
37 | #define _LIBM_DECLARE | 37 | #define _LIBM_DECLARE | |
38 | #include "mathimpl.h" | 38 | #include "mathimpl.h" | |
39 | #include "trig.h" | 39 | #include "trig.h" | |
40 | 40 | |||
41 | #ifdef __weak_alias | |||
42 | __weak_alias(_sinl, sin); | |||
43 | __weak_alias(_cosl, cos); | |||
44 | #endif | |||
45 | ||||
41 | double | 46 | double | |
42 | sin(double x) | 47 | sin(double x) | |
43 | { | 48 | { | |
44 | double a,c,z; | 49 | double a,c,z; | |
45 | 50 | |||
46 | if(!finite(x)) /* sin(NaN) and sin(INF) must be NaN */ | 51 | if(!finite(x)) /* sin(NaN) and sin(INF) must be NaN */ | |
47 | return x-x; | 52 | return x-x; | |
48 | x=drem(x,PI2); /* reduce x into [-PI,PI] */ | 53 | x=drem(x,PI2); /* reduce x into [-PI,PI] */ | |
49 | a=copysign(x,__one); | 54 | a=copysign(x,__one); | |
50 | if (a >= PIo4) { | 55 | if (a >= PIo4) { | |
51 | if(a >= PI3o4) /* ... in [3PI/4,PI] */ | 56 | if(a >= PI3o4) /* ... in [3PI/4,PI] */ | |
52 | x = copysign((a = PI-a),x); | 57 | x = copysign((a = PI-a),x); | |
53 | else { /* ... in [PI/4,3PI/4] */ | 58 | else { /* ... in [PI/4,3PI/4] */ |
--- src/lib/libm/noieee_src/n_cosh.c 2008/03/20 16:41:26 1.8
+++ src/lib/libm/noieee_src/n_cosh.c 2014/10/10 20:58:09 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_cosh.c,v 1.8 2008/03/20 16:41:26 mhitch Exp $ */ | 1 | /* $NetBSD: n_cosh.c,v 1.9 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1985, 1993 | 3 | * Copyright (c) 1985, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -77,26 +77,27 @@ static char sccsid[] = "@(#)cosh.c 8.1 ( | @@ -77,26 +77,27 @@ static char sccsid[] = "@(#)cosh.c 8.1 ( | |||
77 | * Constants: | 77 | * Constants: | |
78 | * The hexadecimal values are the intended ones for the following constants. | 78 | * The hexadecimal values are the intended ones for the following constants. | |
79 | * The decimal values may be used, provided that the compiler will convert | 79 | * The decimal values may be used, provided that the compiler will convert | |
80 | * from decimal to binary accurately enough to produce the hexadecimal values | 80 | * from decimal to binary accurately enough to produce the hexadecimal values | |
81 | * shown. | 81 | * shown. | |
82 | */ | 82 | */ | |
83 | 83 | |||
84 | #define _LIBM_STATIC | 84 | #define _LIBM_STATIC | |
85 | #include "../src/namespace.h" | 85 | #include "../src/namespace.h" | |
86 | #include "mathimpl.h" | 86 | #include "mathimpl.h" | |
87 | 87 | |||
88 | #ifdef __weak_alias | 88 | #ifdef __weak_alias | |
89 | __weak_alias(cosh, _cosh); | 89 | __weak_alias(cosh, _cosh); | |
90 | __weak_alias(_coshl, _cosh); | |||
90 | __weak_alias(coshf, _coshf); | 91 | __weak_alias(coshf, _coshf); | |
91 | #endif | 92 | #endif | |
92 | 93 | |||
93 | vc(mln2hi, 8.8029691931113054792E1 ,0f33,43b0,2bdb,c7e2, 7, .B00F33C7E22BDB) | 94 | vc(mln2hi, 8.8029691931113054792E1 ,0f33,43b0,2bdb,c7e2, 7, .B00F33C7E22BDB) | |
94 | vc(mln2lo,-4.9650192275318476525E-16 ,1b60,a70f,582a,279e, -50,-.8F1B60279E582A) | 95 | vc(mln2lo,-4.9650192275318476525E-16 ,1b60,a70f,582a,279e, -50,-.8F1B60279E582A) | |
95 | vc(lnovfl, 8.8029691931113053016E1 ,0f33,43b0,2bda,c7e2, 7, .B00F33C7E22BDA) | 96 | vc(lnovfl, 8.8029691931113053016E1 ,0f33,43b0,2bda,c7e2, 7, .B00F33C7E22BDA) | |
96 | 97 | |||
97 | ic(mln2hi, 7.0978271289338397310E2, 10, 1.62E42FEFA39EF) | 98 | ic(mln2hi, 7.0978271289338397310E2, 10, 1.62E42FEFA39EF) | |
98 | ic(mln2lo, 2.3747039373786107478E-14, -45, 1.ABC9E3B39803F) | 99 | ic(mln2lo, 2.3747039373786107478E-14, -45, 1.ABC9E3B39803F) | |
99 | ic(lnovfl, 7.0978271289338397310E2, 9, 1.62E42FEFA39EF) | 100 | ic(lnovfl, 7.0978271289338397310E2, 9, 1.62E42FEFA39EF) | |
100 | 101 | |||
101 | #ifdef vccast | 102 | #ifdef vccast | |
102 | #define mln2hi vccast(mln2hi) | 103 | #define mln2hi vccast(mln2hi) |
--- src/lib/libm/noieee_src/n_exp.c 2008/03/20 16:41:26 1.8
+++ src/lib/libm/noieee_src/n_exp.c 2014/10/10 20:58:09 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_exp.c,v 1.8 2008/03/20 16:41:26 mhitch Exp $ */ | 1 | /* $NetBSD: n_exp.c,v 1.9 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1985, 1993 | 3 | * Copyright (c) 1985, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -72,26 +72,27 @@ static char sccsid[] = "@(#)exp.c 8.1 (B | @@ -72,26 +72,27 @@ static char sccsid[] = "@(#)exp.c 8.1 (B | |||
72 | * Constants: | 72 | * Constants: | |
73 | * The hexadecimal values are the intended ones for the following constants. | 73 | * The hexadecimal values are the intended ones for the following constants. | |
74 | * The decimal values may be used, provided that the compiler will convert | 74 | * The decimal values may be used, provided that the compiler will convert | |
75 | * from decimal to binary accurately enough to produce the hexadecimal values | 75 | * from decimal to binary accurately enough to produce the hexadecimal values | |
76 | * shown. | 76 | * shown. | |
77 | */ | 77 | */ | |
78 | 78 | |||
79 | #define _LIBM_STATIC | 79 | #define _LIBM_STATIC | |
80 | #include "../src/namespace.h" | 80 | #include "../src/namespace.h" | |
81 | #include "mathimpl.h" | 81 | #include "mathimpl.h" | |
82 | 82 | |||
83 | #ifdef __weak_alias | 83 | #ifdef __weak_alias | |
84 | __weak_alias(exp, _exp); | 84 | __weak_alias(exp, _exp); | |
85 | __weak_alias(_expl, _exp); | |||
85 | __weak_alias(expf, _expf); | 86 | __weak_alias(expf, _expf); | |
86 | #endif | 87 | #endif | |
87 | 88 | |||
88 | vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) | 89 | vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) | |
89 | vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) | 90 | vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) | |
90 | vc(lnhuge, 9.4961163736712506989E1 ,ec1d,43bd,9010,a73e, 7, .BDEC1DA73E9010) | 91 | vc(lnhuge, 9.4961163736712506989E1 ,ec1d,43bd,9010,a73e, 7, .BDEC1DA73E9010) | |
91 | vc(lntiny,-9.5654310917272452386E1 ,4f01,c3bf,33af,d72e, 7,-.BF4F01D72E33AF) | 92 | vc(lntiny,-9.5654310917272452386E1 ,4f01,c3bf,33af,d72e, 7,-.BF4F01D72E33AF) | |
92 | vc(invln2, 1.4426950408889634148E0 ,aa3b,40b8,17f1,295c, 1, .B8AA3B295C17F1) | 93 | vc(invln2, 1.4426950408889634148E0 ,aa3b,40b8,17f1,295c, 1, .B8AA3B295C17F1) | |
93 | vc(p1, 1.6666666666666602251E-1 ,aaaa,3f2a,a9f1,aaaa, -2, .AAAAAAAAAAA9F1) | 94 | vc(p1, 1.6666666666666602251E-1 ,aaaa,3f2a,a9f1,aaaa, -2, .AAAAAAAAAAA9F1) | |
94 | vc(p2, -2.7777777777015591216E-3 ,0b60,bc36,ec94,b5f5, -8,-.B60B60B5F5EC94) | 95 | vc(p2, -2.7777777777015591216E-3 ,0b60,bc36,ec94,b5f5, -8,-.B60B60B5F5EC94) | |
95 | vc(p3, 6.6137563214379341918E-5 ,b355,398a,f15f,792e, -13, .8AB355792EF15F) | 96 | vc(p3, 6.6137563214379341918E-5 ,b355,398a,f15f,792e, -13, .8AB355792EF15F) | |
96 | vc(p4, -1.6533902205465250480E-6 ,ea0e,b6dd,5f84,2e93, -19,-.DDEA0E2E935F84) | 97 | vc(p4, -1.6533902205465250480E-6 ,ea0e,b6dd,5f84,2e93, -19,-.DDEA0E2E935F84) | |
97 | vc(p5, 4.1381367970572387085E-8 ,bb4b,3431,2683,95f5, -24, .B1BB4B95F52683) | 98 | vc(p5, 4.1381367970572387085E-8 ,bb4b,3431,2683,95f5, -24, .B1BB4B95F52683) |
--- src/lib/libm/noieee_src/n_log.c 2008/03/20 16:41:26 1.7
+++ src/lib/libm/noieee_src/n_log.c 2014/10/10 20:58:09 1.8
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_log.c,v 1.7 2008/03/20 16:41:26 mhitch Exp $ */ | 1 | /* $NetBSD: n_log.c,v 1.8 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1992, 1993 | 3 | * Copyright (c) 1992, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -33,26 +33,27 @@ | @@ -33,26 +33,27 @@ | |||
33 | static char sccsid[] = "@(#)log.c 8.2 (Berkeley) 11/30/93"; | 33 | static char sccsid[] = "@(#)log.c 8.2 (Berkeley) 11/30/93"; | |
34 | #endif | 34 | #endif | |
35 | #endif /* not lint */ | 35 | #endif /* not lint */ | |
36 | 36 | |||
37 | #include "../src/namespace.h" | 37 | #include "../src/namespace.h" | |
38 | 38 | |||
39 | #include <math.h> | 39 | #include <math.h> | |
40 | #include <errno.h> | 40 | #include <errno.h> | |
41 | 41 | |||
42 | #include "mathimpl.h" | 42 | #include "mathimpl.h" | |
43 | 43 | |||
44 | #ifdef __weak_alias | 44 | #ifdef __weak_alias | |
45 | __weak_alias(log, _log); | 45 | __weak_alias(log, _log); | |
46 | __weak_alias(_logl, _log); | |||
46 | __weak_alias(logf, _logf); | 47 | __weak_alias(logf, _logf); | |
47 | #endif | 48 | #endif | |
48 | 49 | |||
49 | /* Table-driven natural logarithm. | 50 | /* Table-driven natural logarithm. | |
50 | * | 51 | * | |
51 | * This code was derived, with minor modifications, from: | 52 | * This code was derived, with minor modifications, from: | |
52 | * Peter Tang, "Table-Driven Implementation of the | 53 | * Peter Tang, "Table-Driven Implementation of the | |
53 | * Logarithm in IEEE Floating-Point arithmetic." ACM Trans. | 54 | * Logarithm in IEEE Floating-Point arithmetic." ACM Trans. | |
54 | * Math Software, vol 16. no 4, pp 378-400, Dec 1990). | 55 | * Math Software, vol 16. no 4, pp 378-400, Dec 1990). | |
55 | * | 56 | * | |
56 | * Calculates log(2^m*F*(1+f/F)), |f/j| <= 1/256, | 57 | * Calculates log(2^m*F*(1+f/F)), |f/j| <= 1/256, | |
57 | * where F = j/128 for j an integer in [0, 128]. | 58 | * where F = j/128 for j an integer in [0, 128]. | |
58 | * | 59 | * |
--- src/lib/libm/noieee_src/n_sinh.c 2008/03/20 16:41:26 1.7
+++ src/lib/libm/noieee_src/n_sinh.c 2014/10/10 20:58:09 1.8
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_sinh.c,v 1.7 2008/03/20 16:41:26 mhitch Exp $ */ | 1 | /* $NetBSD: n_sinh.c,v 1.8 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1985, 1993 | 3 | * Copyright (c) 1985, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -70,26 +70,27 @@ static char sccsid[] = "@(#)sinh.c 8.1 ( | @@ -70,26 +70,27 @@ static char sccsid[] = "@(#)sinh.c 8.1 ( | |||
70 | * Constants: | 70 | * Constants: | |
71 | * The hexadecimal values are the intended ones for the following constants. | 71 | * The hexadecimal values are the intended ones for the following constants. | |
72 | * The decimal values may be used, provided that the compiler will convert | 72 | * The decimal values may be used, provided that the compiler will convert | |
73 | * from decimal to binary accurately enough to produce the hexadecimal values | 73 | * from decimal to binary accurately enough to produce the hexadecimal values | |
74 | * shown. | 74 | * shown. | |
75 | */ | 75 | */ | |
76 | 76 | |||
77 | #define _LIBM_STATIC | 77 | #define _LIBM_STATIC | |
78 | #include "../src/namespace.h" | 78 | #include "../src/namespace.h" | |
79 | #include "mathimpl.h" | 79 | #include "mathimpl.h" | |
80 | 80 | |||
81 | #ifdef __weak_alias | 81 | #ifdef __weak_alias | |
82 | __weak_alias(sinh, _sinh); | 82 | __weak_alias(sinh, _sinh); | |
83 | __weak_alias(_sinhl, _sinh); | |||
83 | __weak_alias(sinhf, _sinhf); | 84 | __weak_alias(sinhf, _sinhf); | |
84 | #endif | 85 | #endif | |
85 | 86 | |||
86 | vc(mln2hi, 8.8029691931113054792E1 ,0f33,43b0,2bdb,c7e2, 7, .B00F33C7E22BDB) | 87 | vc(mln2hi, 8.8029691931113054792E1 ,0f33,43b0,2bdb,c7e2, 7, .B00F33C7E22BDB) | |
87 | vc(mln2lo,-4.9650192275318476525E-16 ,1b60,a70f,582a,279e, -50,-.8F1B60279E582A) | 88 | vc(mln2lo,-4.9650192275318476525E-16 ,1b60,a70f,582a,279e, -50,-.8F1B60279E582A) | |
88 | vc(lnovfl, 8.8029691931113053016E1 ,0f33,43b0,2bda,c7e2, 7, .B00F33C7E22BDA) | 89 | vc(lnovfl, 8.8029691931113053016E1 ,0f33,43b0,2bda,c7e2, 7, .B00F33C7E22BDA) | |
89 | 90 | |||
90 | ic(mln2hi, 7.0978271289338397310E2, 10, 1.62E42FEFA39EF) | 91 | ic(mln2hi, 7.0978271289338397310E2, 10, 1.62E42FEFA39EF) | |
91 | ic(mln2lo, 2.3747039373786107478E-14, -45, 1.ABC9E3B39803F) | 92 | ic(mln2lo, 2.3747039373786107478E-14, -45, 1.ABC9E3B39803F) | |
92 | ic(lnovfl, 7.0978271289338397310E2, 9, 1.62E42FEFA39EF) | 93 | ic(lnovfl, 7.0978271289338397310E2, 9, 1.62E42FEFA39EF) | |
93 | 94 | |||
94 | #ifdef vccast | 95 | #ifdef vccast | |
95 | #define mln2hi vccast(mln2hi) | 96 | #define mln2hi vccast(mln2hi) |
--- src/lib/libm/noieee_src/n_pow.c 2013/11/24 14:46:18 1.9
+++ src/lib/libm/noieee_src/n_pow.c 2014/10/10 20:58:09 1.10
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: n_pow.c,v 1.9 2013/11/24 14:46:18 martin Exp $ */ | 1 | /* $NetBSD: n_pow.c,v 1.10 2014/10/10 20:58:09 martin Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1985, 1993 | 3 | * Copyright (c) 1985, 1993 | |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. Neither the name of the University nor the names of its contributors | 14 | * 3. Neither the name of the University nor the names of its contributors | |
@@ -112,38 +112,38 @@ static char sccsid[] = "@(#)pow.c 8.1 (B | @@ -112,38 +112,38 @@ static char sccsid[] = "@(#)pow.c 8.1 (B | |||
112 | #define TRUNC(x) x = (double) (float) x | 112 | #define TRUNC(x) x = (double) (float) x | |
113 | #define _IEEE 0 | 113 | #define _IEEE 0 | |
114 | #else | 114 | #else | |
115 | #define _IEEE 1 | 115 | #define _IEEE 1 | |
116 | #define endian (((*(int *) &one)) ? 1 : 0) | 116 | #define endian (((*(int *) &one)) ? 1 : 0) | |
117 | #define TRUNC(x) *(((int *) &x)+endian) &= 0xf8000000 | 117 | #define TRUNC(x) *(((int *) &x)+endian) &= 0xf8000000 | |
118 | #define infnan(x) 0.0 | 118 | #define infnan(x) 0.0 | |
119 | #endif /* __vax__ or tahoe */ | 119 | #endif /* __vax__ or tahoe */ | |
120 | 120 | |||
121 | static const double zero=0.0, one=1.0, two=2.0, negone= -1.0; | 121 | static const double zero=0.0, one=1.0, two=2.0, negone= -1.0; | |
122 | 122 | |||
123 | static double pow_P (double, double); | 123 | static double pow_P (double, double); | |
124 | 124 | |||
125 | #ifdef __weak_alias | |||
126 | __weak_alias(_powf, powf); | |||
127 | __weak_alias(_pow, pow); | |||
128 | __weak_alias(_powl, pow); | |||
129 | #endif | |||
130 | ||||
125 | float | 131 | float | |
126 | powf(float x, float y) | 132 | powf(float x, float y) | |
127 | { | 133 | { | |
128 | return pow((double) x, (double) (y)); | 134 | return pow((double) x, (double) (y)); | |
129 | } | 135 | } | |
130 | 136 | |||
131 | long double | |||
132 | powl(long double x, long double y) | |||
133 | { | |||
134 | return pow((double) x, (double) (y)); | |||
135 | } | |||
136 | ||||
137 | double | 137 | double | |
138 | pow(double x, double y) | 138 | pow(double x, double y) | |
139 | { | 139 | { | |
140 | double t; | 140 | double t; | |
141 | if (y==zero) | 141 | if (y==zero) | |
142 | return (one); | 142 | return (one); | |
143 | else if (y==one || (_IEEE && x != x)) | 143 | else if (y==one || (_IEEE && x != x)) | |
144 | return (x); /* if x is NaN or y=1 */ | 144 | return (x); /* if x is NaN or y=1 */ | |
145 | else if (_IEEE && y!=y) /* if y is NaN */ | 145 | else if (_IEEE && y!=y) /* if y is NaN */ | |
146 | return (y); | 146 | return (y); | |
147 | else if (!finite(y)) /* if y is INF */ | 147 | else if (!finite(y)) /* if y is INF */ | |
148 | if ((t=fabs(x))==one) /* +-1 ** +-INF is NaN */ | 148 | if ((t=fabs(x))==one) /* +-1 ** +-INF is NaN */ | |
149 | return (y - y); | 149 | return (y - y); |