Author: dim
Date: Sat Aug 11 11:13:48 2012
New Revision: 239192
URL: http://svn.freebsd.org/changeset/base/239192

Log:
  Change a few extern inline functions in libm to static inline, since
  they need to refer to static constants, which C99 does not allow for
  extern inline functions.
  
  While here, change a comment in e_rem_pio2f.c to mention the correct
  number of bits.
  
  Reviewed by:  bde
  MFC after:    1 week

Modified:
  head/lib/msun/src/e_rem_pio2.c
  head/lib/msun/src/e_rem_pio2f.c
  head/lib/msun/src/k_cosf.c
  head/lib/msun/src/k_sinf.c
  head/lib/msun/src/k_tanf.c
  head/lib/msun/src/math_private.h

Modified: head/lib/msun/src/e_rem_pio2.c
==============================================================================
--- head/lib/msun/src/e_rem_pio2.c      Sat Aug 11 05:58:56 2012        
(r239191)
+++ head/lib/msun/src/e_rem_pio2.c      Sat Aug 11 11:13:48 2012        
(r239192)
@@ -48,10 +48,10 @@ pio2_2t =  2.02226624879595063154e-21, /
 pio2_3  =  2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
 pio2_3t =  8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
 
-#ifndef INLINE_REM_PIO2
-extern
+#ifdef INLINE_REM_PIO2
+static __inline
 #endif
-__inline int
+int
 __ieee754_rem_pio2(double x, double *y)
 {
        double z,w,t,r,fn;

Modified: head/lib/msun/src/e_rem_pio2f.c
==============================================================================
--- head/lib/msun/src/e_rem_pio2f.c     Sat Aug 11 05:58:56 2012        
(r239191)
+++ head/lib/msun/src/e_rem_pio2f.c     Sat Aug 11 11:13:48 2012        
(r239192)
@@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$");
 
 /*
  * invpio2:  53 bits of 2/pi
- * pio2_1:   first  33 bit of pi/2
+ * pio2_1:   first 25 bits of pi/2
  * pio2_1t:  pi/2 - pio2_1
  */
 
@@ -40,10 +40,10 @@ invpio2 =  6.36619772367581382433e-01, /
 pio2_1  =  1.57079631090164184570e+00, /* 0x3FF921FB, 0x50000000 */
 pio2_1t =  1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */
 
-#ifndef INLINE_REM_PIO2F
-extern
+#ifdef INLINE_REM_PIO2F
+static __inline
 #endif
-__inline int
+int
 __ieee754_rem_pio2f(float x, double *y)
 {
        double w,r,fn;

Modified: head/lib/msun/src/k_cosf.c
==============================================================================
--- head/lib/msun/src/k_cosf.c  Sat Aug 11 05:58:56 2012        (r239191)
+++ head/lib/msun/src/k_cosf.c  Sat Aug 11 11:13:48 2012        (r239192)
@@ -30,10 +30,10 @@ C1  =  0x155553e1053a42.0p-57,      /*  0.041
 C2  = -0x16c087e80f1e27.0p-62, /* -0.00138867637746099294692 */
 C3  =  0x199342e0ee5069.0p-68; /*  0.0000243904487962774090654 */
 
-#ifndef INLINE_KERNEL_COSDF
-extern
+#ifdef INLINE_KERNEL_COSDF
+static __inline
 #endif
-__inline float
+float
 __kernel_cosdf(double x)
 {
        double r, w, z;

Modified: head/lib/msun/src/k_sinf.c
==============================================================================
--- head/lib/msun/src/k_sinf.c  Sat Aug 11 05:58:56 2012        (r239191)
+++ head/lib/msun/src/k_sinf.c  Sat Aug 11 11:13:48 2012        (r239192)
@@ -29,10 +29,10 @@ S2 =  0x111110896efbb2.0p-59,       /*  0.0083
 S3 = -0x1a00f9e2cae774.0p-65,  /* -0.000198393348360966317347 */
 S4 =  0x16cd878c3b46a7.0p-71;  /*  0.0000027183114939898219064 */
 
-#ifndef INLINE_KERNEL_SINDF
-extern
+#ifdef INLINE_KERNEL_SINDF
+static __inline
 #endif
-__inline float
+float
 __kernel_sindf(double x)
 {
        double r, s, w, z;

Modified: head/lib/msun/src/k_tanf.c
==============================================================================
--- head/lib/msun/src/k_tanf.c  Sat Aug 11 05:58:56 2012        (r239191)
+++ head/lib/msun/src/k_tanf.c  Sat Aug 11 11:13:48 2012        (r239192)
@@ -32,10 +32,10 @@ T[] =  {
   0x1362b9bf971bcd.0p-59,      /* 0.00946564784943673166728 */
 };
 
-#ifndef INLINE_KERNEL_TANDF
-extern
+#ifdef INLINE_KERNEL_TANDF
+static __inline
 #endif
-__inline float
+float
 __kernel_tandf(double x, int iy)
 {
        double z,r,w,s,t,u;

Modified: head/lib/msun/src/math_private.h
==============================================================================
--- head/lib/msun/src/math_private.h    Sat Aug 11 05:58:56 2012        
(r239191)
+++ head/lib/msun/src/math_private.h    Sat Aug 11 11:13:48 2012        
(r239192)
@@ -431,10 +431,9 @@ irintl(long double x)
 int    __kernel_rem_pio2(double*,double*,int,int,int);
 
 /* double precision kernel functions */
-#ifdef INLINE_REM_PIO2
-__inline
-#endif
+#ifndef INLINE_REM_PIO2
 int    __ieee754_rem_pio2(double,double*);
+#endif
 double __kernel_sin(double,double,int);
 double __kernel_cos(double,double);
 double __kernel_tan(double,double,int);
@@ -444,22 +443,18 @@ double complex __ldexp_cexp(double compl
 #endif
 
 /* float precision kernel functions */
-#ifdef INLINE_REM_PIO2F
-__inline
-#endif
+#ifndef INLINE_REM_PIO2F
 int    __ieee754_rem_pio2f(float,double*);
-#ifdef INLINE_KERNEL_SINDF
-__inline
 #endif
+#ifndef INLINE_KERNEL_SINDF
 float  __kernel_sindf(double);
-#ifdef INLINE_KERNEL_COSDF
-__inline
 #endif
+#ifndef INLINE_KERNEL_COSDF
 float  __kernel_cosdf(double);
-#ifdef INLINE_KERNEL_TANDF
-__inline
 #endif
+#ifndef INLINE_KERNEL_TANDF
 float  __kernel_tandf(double,int);
+#endif
 float  __ldexp_expf(float,int);
 #ifdef _COMPLEX_H
 float complex __ldexp_cexpf(float complex,int);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to