summaryrefslogtreecommitdiff
path: root/libquadmath/math
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2010-12-13 20:44:38 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2010-12-13 20:44:38 +0100
commitf0c2df63c64cb18ff1e8be7d0042108efd6483b3 (patch)
treedcd344482f53be11c8fdb8b5221713e795bf5b1f /libquadmath/math
parentc58bb30d66b333fc184a6b53ae9479e4aaeae8c4 (diff)
downloadgcc-f0c2df63c64cb18ff1e8be7d0042108efd6483b3.tar.gz
re PR fortran/46625 (libquadmath: Mangle internal symbols; rename __float128 <-> string functions)
2010-12-13 Tobias Burnus <burnus@net-b.de> PR fortran/46625 * gdtoa/gdtoaimp.h: Mangle internal functions by prefixing them with __quadmath. Don't use gdtoa's strcp(y). * gdtoa/g_Qfmt.c (g_Qfmt): Use strcpy instead of strcp. * gdtoa/misc.c (strcpy): Renamed from strcp and only use if NO_STRING_H is set. * quadmath-imp.h (__quadmath_rem_pio2q, * __quadmath_kernel_sincosq __quadmath_kernel_sinq, __quadmath_kernel_cosq): Added __quadmath prefix to internal functions. * math/cosq.c (cosq): Ditto. * math/sinq.c (cosq): Ditto. * math/tanq.c (tanq,__quadmath_kernel_tanq): Ditto. * math/rem_pio2q.c (rem_pio2, __quadmath_kernel_rem_pio2): * Ditto. * math/sinq_kernel.c (__quadmath_kernel_sinq): Ditto. * math/cosq_kernel.c (__quadmath_kernel_cosq): Ditto. From-SVN: r167768
Diffstat (limited to 'libquadmath/math')
-rw-r--r--libquadmath/math/cosq.c12
-rw-r--r--libquadmath/math/cosq_kernel.c2
-rw-r--r--libquadmath/math/rem_pio2q.c9
-rw-r--r--libquadmath/math/sincosq.c12
-rw-r--r--libquadmath/math/sincosq_kernel.c3
-rw-r--r--libquadmath/math/sinq.c12
-rw-r--r--libquadmath/math/sinq_kernel.c2
-rw-r--r--libquadmath/math/tanq.c12
8 files changed, 33 insertions, 31 deletions
diff --git a/libquadmath/math/cosq.c b/libquadmath/math/cosq.c
index fff0861d652..16955511e04 100644
--- a/libquadmath/math/cosq.c
+++ b/libquadmath/math/cosq.c
@@ -58,7 +58,7 @@ cosq (__float128 x)
/* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL;
if(ix <= 0x3ffe921fb54442d1LL)
- return __kernel_cosq(x,z);
+ return __quadmath_kernel_cosq(x,z);
/* cos(Inf or NaN) is NaN */
else if (ix>=0x7fff000000000000LL) {
@@ -70,13 +70,13 @@ cosq (__float128 x)
/* argument reduction needed */
else {
- n = rem_pio2q(x,y);
+ n = __quadmath_rem_pio2q(x,y);
switch(n&3) {
- case 0: return __kernel_cosq(y[0],y[1]);
- case 1: return -__kernel_sinq(y[0],y[1],1);
- case 2: return -__kernel_cosq(y[0],y[1]);
+ case 0: return __quadmath_kernel_cosq(y[0],y[1]);
+ case 1: return -__quadmath_kernel_sinq(y[0],y[1],1);
+ case 2: return -__quadmath_kernel_cosq(y[0],y[1]);
default:
- return __kernel_sinq(y[0],y[1],1);
+ return __quadmath_kernel_sinq(y[0],y[1],1);
}
}
}
diff --git a/libquadmath/math/cosq_kernel.c b/libquadmath/math/cosq_kernel.c
index b310dc0ef32..86f39551c32 100644
--- a/libquadmath/math/cosq_kernel.c
+++ b/libquadmath/math/cosq_kernel.c
@@ -77,7 +77,7 @@ static const __float128 c[] = {
extern const __float128 __sincosq_table[];
__float128
-__kernel_cosq (__float128 x, __float128 y)
+__quadmath_kernel_cosq (__float128 x, __float128 y)
{
__float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
diff --git a/libquadmath/math/rem_pio2q.c b/libquadmath/math/rem_pio2q.c
index db0059dd186..a1c0b831ddb 100644
--- a/libquadmath/math/rem_pio2q.c
+++ b/libquadmath/math/rem_pio2q.c
@@ -151,7 +151,7 @@ static const double
static int
-__kernel_rem_pio2 (double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2)
+__quadmath_kernel_rem_pio2 (double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2)
{
int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
double z,fw,f[20],fq[20],q[20];
@@ -500,7 +500,7 @@ static const __float128 c[] = {
int32_t
-rem_pio2q (__float128 x, __float128 *y)
+__quadmath_rem_pio2q (__float128 x, __float128 *y)
{
__float128 z, w, t;
double tx[8];
@@ -557,8 +557,9 @@ rem_pio2q (__float128 x, __float128 *y)
tx [3] = (double)((lx >> 17) & 0xffffff);
tx [4] = (double)((lx << 7) & 0xffffff);
- n = __kernel_rem_pio2 (tx, tx + 5, exp, ((lx << 7) & 0xffffff) ? 5 : 4,
- 3, two_over_pi);
+ n = __quadmath_kernel_rem_pio2 (tx, tx + 5, exp,
+ ((lx << 7) & 0xffffff) ? 5 : 4,
+ 3, two_over_pi);
/* The result is now stored in 3 double values, we need to convert it into
two __float128 values. */
diff --git a/libquadmath/math/sincosq.c b/libquadmath/math/sincosq.c
index a9f41fc99c8..b7c221486d7 100644
--- a/libquadmath/math/sincosq.c
+++ b/libquadmath/math/sincosq.c
@@ -32,7 +32,7 @@ sincosq (__float128 x, __float128 *sinx, __float128 *cosx)
/* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL;
if (ix <= 0x3ffe921fb54442d1LL)
- __kernel_sincosq (x, 0.0Q, sinx, cosx, 0);
+ __quadmath_kernel_sincosq (x, 0.0Q, sinx, cosx, 0);
else if (ix >= 0x7fff000000000000LL)
{
/* sin(Inf or NaN) is NaN */
@@ -44,23 +44,23 @@ sincosq (__float128 x, __float128 *sinx, __float128 *cosx)
__float128 y[2];
int n;
- n = rem_pio2q (x, y);
+ n = __quadmath_rem_pio2q (x, y);
switch (n & 3)
{
case 0:
- __kernel_sincosq (y[0], y[1], sinx, cosx, 1);
+ __quadmath_kernel_sincosq (y[0], y[1], sinx, cosx, 1);
break;
case 1:
- __kernel_sincosq (y[0], y[1], cosx, sinx, 1);
+ __quadmath_kernel_sincosq (y[0], y[1], cosx, sinx, 1);
*cosx = -*cosx;
break;
case 2:
- __kernel_sincosq (y[0], y[1], sinx, cosx, 1);
+ __quadmath_kernel_sincosq (y[0], y[1], sinx, cosx, 1);
*sinx = -*sinx;
*cosx = -*cosx;
break;
default:
- __kernel_sincosq (y[0], y[1], cosx, sinx, 1);
+ __quadmath_kernel_sincosq (y[0], y[1], cosx, sinx, 1);
*sinx = -*sinx;
break;
}
diff --git a/libquadmath/math/sincosq_kernel.c b/libquadmath/math/sincosq_kernel.c
index 64ccaf83fca..578d1828f75 100644
--- a/libquadmath/math/sincosq_kernel.c
+++ b/libquadmath/math/sincosq_kernel.c
@@ -96,7 +96,8 @@ static const __float128 c[] = {
extern const __float128 __sincosq_table[];
void
-__kernel_sincosq(__float128 x, __float128 y, __float128 *sinx, __float128 *cosx, int iy)
+__quadmath_kernel_sincosq(__float128 x, __float128 y, __float128 *sinx,
+ __float128 *cosx, int iy)
{
__float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
diff --git a/libquadmath/math/sinq.c b/libquadmath/math/sinq.c
index 2d573e42409..76254a37302 100644
--- a/libquadmath/math/sinq.c
+++ b/libquadmath/math/sinq.c
@@ -58,7 +58,7 @@ sinq (__float128 x)
/* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL;
if(ix <= 0x3ffe921fb54442d1LL)
- return __kernel_sinq(x,z,0);
+ return __quadmath_kernel_sinq(x,z,0);
/* sin(Inf or NaN) is NaN */
else if (ix>=0x7fff000000000000LL) {
@@ -70,13 +70,13 @@ sinq (__float128 x)
/* argument reduction needed */
else {
- n = rem_pio2q(x,y);
+ n = __quadmath_rem_pio2q(x,y);
switch(n&3) {
- case 0: return __kernel_sinq(y[0],y[1],1);
- case 1: return __kernel_cosq(y[0],y[1]);
- case 2: return -__kernel_sinq(y[0],y[1],1);
+ case 0: return __quadmath_kernel_sinq(y[0],y[1],1);
+ case 1: return __quadmath_kernel_cosq(y[0],y[1]);
+ case 2: return -__quadmath_kernel_sinq(y[0],y[1],1);
default:
- return -__kernel_cosq(y[0],y[1]);
+ return -__quadmath_kernel_cosq(y[0],y[1]);
}
}
}
diff --git a/libquadmath/math/sinq_kernel.c b/libquadmath/math/sinq_kernel.c
index fdfe4e80599..395fcaba9cb 100644
--- a/libquadmath/math/sinq_kernel.c
+++ b/libquadmath/math/sinq_kernel.c
@@ -77,7 +77,7 @@ static const __float128 c[] = {
extern const __float128 __sincosq_table[];
__float128
-__kernel_sinq (__float128 x, __float128 y, int iy)
+__quadmath_kernel_sinq (__float128 x, __float128 y, int iy)
{
__float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
diff --git a/libquadmath/math/tanq.c b/libquadmath/math/tanq.c
index c490c6a3025..e1ec6aae86c 100644
--- a/libquadmath/math/tanq.c
+++ b/libquadmath/math/tanq.c
@@ -31,7 +31,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* __kernel_tanq( x, y, k )
+/* __quadmath_kernel_tanq( x, y, k )
* kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
* Input x is assumed to be bounded by ~pi/4 in magnitude.
* Input y is the tail of x.
@@ -84,7 +84,7 @@ static const __float128
static __float128
-__kernel_tanq (__float128 x, __float128 y, int iy)
+__quadmath_kernel_tanq (__float128 x, __float128 y, int iy)
{
__float128 z, r, v, w, s;
int32_t ix, sign = 1;
@@ -218,7 +218,7 @@ tanq (__float128 x)
/* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL;
- if(ix <= 0x3ffe921fb54442d1LL) return __kernel_tanq(x,z,1);
+ if(ix <= 0x3ffe921fb54442d1LL) return __quadmath_kernel_tanq(x,z,1);
/* tanl(Inf or NaN) is NaN */
else if (ix>=0x7fff000000000000LL) {
@@ -230,8 +230,8 @@ tanq (__float128 x)
/* argument reduction needed */
else {
- n = rem_pio2q(x,y);
- return __kernel_tanq(y[0],y[1],1-((n&1)<<1)); /* 1 -- n even
- -1 -- n odd */
+ n = __quadmath_rem_pio2q(x,y);
+ /* 1 -- n even, -1 -- n odd */
+ return __quadmath_kernel_tanq(y[0],y[1],1-((n&1)<<1));
}
}