about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/e_lgammaf_r.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2018-08-15 16:01:21 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2018-08-15 16:01:21 +0100
commit126c4e3f804881f9fbc4eb71787f41793d2d7be5 (patch)
treea8925aeea4de10fc9fdf788cabc89118e06cd892 /sysdeps/ieee754/flt-32/e_lgammaf_r.c
parent49acec179ca9fb2da961b78f56ef5ce501bbb50b (diff)
downloadglibc-126c4e3f804881f9fbc4eb71787f41793d2d7be5.tar.gz
glibc-126c4e3f804881f9fbc4eb71787f41793d2d7be5.tar.xz
glibc-126c4e3f804881f9fbc4eb71787f41793d2d7be5.zip
Use generic sinf/cosf in lgammaf_r
The internal functions __kernel_sinf and __kernel_cosf are used only by
lgammaf_r.  Removing the internal functions and using the generic sinf
and cosf is better overall.  Benchmarking on Cortex-A72 shows the generic
sinf and cosf are 1.4x and 2.3x faster in the range |x| < PI/4, and 0.66x
and 1.1x for |x| < PI/2, so it should make lgammaf_r faster on average.

GLIBC regression tests pass on AArch64.

	* sysdeps/ieee754/flt-32/e_lgammaf_r.c (sin_pif): Use __sinf/__cosf.
	* sysdeps/ieee754/flt-32/k_cosf.c (__kernel_cosf): Remove all code.
	* sysdeps/ieee754/flt-32/k_sinf.c (__kernel_sinf): Likewise.
Diffstat (limited to 'sysdeps/ieee754/flt-32/e_lgammaf_r.c')
-rw-r--r--sysdeps/ieee754/flt-32/e_lgammaf_r.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/sysdeps/ieee754/flt-32/e_lgammaf_r.c
index 8fdf9bb8bc..ebe2d3462f 100644
--- a/sysdeps/ieee754/flt-32/e_lgammaf_r.c
+++ b/sysdeps/ieee754/flt-32/e_lgammaf_r.c
@@ -97,7 +97,7 @@ sin_pif(float x)
 	GET_FLOAT_WORD(ix,x);
 	ix &= 0x7fffffff;
 
-	if(ix<0x3e800000) return __kernel_sinf(pi*x,zero,0);
+	if(ix<0x3e800000) return __sinf (pi*x);
 	y = -x;		/* x is assume negative */
 
     /*
@@ -121,14 +121,14 @@ sin_pif(float x)
 	    }
 	}
 	switch (n) {
-	    case 0:   y =  __kernel_sinf(pi*y,zero,0); break;
+	    case 0:   y =  __sinf (pi*y); break;
 	    case 1:
-	    case 2:   y =  __kernel_cosf(pi*((float)0.5-y),zero); break;
+	    case 2:   y =  __cosf (pi*((float)0.5-y)); break;
 	    case 3:
-	    case 4:   y =  __kernel_sinf(pi*(one-y),zero,0); break;
+	    case 4:   y =  __sinf (pi*(one-y)); break;
 	    case 5:
-	    case 6:   y = -__kernel_cosf(pi*(y-(float)1.5),zero); break;
-	    default:  y =  __kernel_sinf(pi*(y-(float)2.0),zero,0); break;
+	    case 6:   y = -__cosf (pi*(y-(float)1.5)); break;
+	    default:  y =  __sinf (pi*(y-(float)2.0)); break;
 	    }
 	return -y;
 }