about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32
diff options
context:
space:
mode:
authorLiubov Dmitrieva <liubov.dmitrieva@gmail.com>2012-09-03 15:32:13 +0200
committerAndreas Jaeger <aj@suse.de>2012-09-03 15:32:13 +0200
commit4ffffbd272264f083f35783ed81339304025f855 (patch)
treecdd72337981ee00f9c6e48c80905918d8d7feaab /sysdeps/ieee754/flt-32
parent511fa2864a8d01a09b23a6b8b9a599429b7055f6 (diff)
downloadglibc-4ffffbd272264f083f35783ed81339304025f855.tar.gz
glibc-4ffffbd272264f083f35783ed81339304025f855.tar.xz
glibc-4ffffbd272264f083f35783ed81339304025f855.zip
Add optimized sinf and cosf routines for x86 and x86-64
	* sysdeps/i386/i686/fpu/multiarch/Makefile (sysdep_routines):
	Add s_sinf-sse2, s_conf-sse2.

	* sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S: New file.
	* sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S: New file.
	* sysdeps/i386/i686/fpu/multiarch/s_sinf.c: New file.
	* sysdeps/i386/i686/fpu/multiarch/s_cosf.c: New file.

	* sysdeps/ieee754/flt-32/s_sinf.c (SINF, SINF_FUNC): Add macros
	for using routine as __sinf_ia32.
	Use macro for function declaration and weak_alias.
	* sysdeps/ieee754/flt-32/s_cosf.c (COSF, COSF_FUNC): Add macros
	for using routine as __cosf_ia32.
	Use macro for function declaration and weak_alias.

	* sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S: Fix Copyright.
	* sysdeps/i386/i686/fpu/multiarch/e_expf.c: Fix Copyright.

	* sysdeps/x86_64/fpu/s_sinf.S: New file.
	* sysdeps/x86_64/fpu/s_cosf.S: New file.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update.

	* math/libm-test.inc (cos_test): Add more test cases.
	(sin_test): Likewise.
	(sincos_test): Likewise.
Diffstat (limited to 'sysdeps/ieee754/flt-32')
-rw-r--r--sysdeps/ieee754/flt-32/s_cosf.c11
-rw-r--r--sysdeps/ieee754/flt-32/s_sinf.c11
2 files changed, 20 insertions, 2 deletions
diff --git a/sysdeps/ieee754/flt-32/s_cosf.c b/sysdeps/ieee754/flt-32/s_cosf.c
index f4bd81904b..864ab27a4f 100644
--- a/sysdeps/ieee754/flt-32/s_cosf.c
+++ b/sysdeps/ieee754/flt-32/s_cosf.c
@@ -23,7 +23,13 @@ static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
 
 static const float one=1.0;
 
-float __cosf(float x)
+#ifndef COSF
+# define COSF_FUNC __cosf
+#else
+# define COSF_FUNC COSF
+#endif
+
+float COSF_FUNC(float x)
 {
 	float y[2],z=0.0;
 	int32_t n,ix;
@@ -53,4 +59,7 @@ float __cosf(float x)
 	    }
 	}
 }
+
+#ifndef COSF
 weak_alias (__cosf, cosf)
+#endif
diff --git a/sysdeps/ieee754/flt-32/s_sinf.c b/sysdeps/ieee754/flt-32/s_sinf.c
index 02fa29f23b..916e345571 100644
--- a/sysdeps/ieee754/flt-32/s_sinf.c
+++ b/sysdeps/ieee754/flt-32/s_sinf.c
@@ -21,7 +21,13 @@ static char rcsid[] = "$NetBSD: s_sinf.c,v 1.4 1995/05/10 20:48:16 jtc Exp $";
 #include <math.h>
 #include <math_private.h>
 
-float __sinf(float x)
+#ifndef SINF
+# define SINF_FUNC __sinf
+#else
+# define SINF_FUNC SINF
+#endif
+
+float SINF_FUNC(float x)
 {
 	float y[2],z=0.0;
 	int32_t n, ix;
@@ -51,4 +57,7 @@ float __sinf(float x)
 	    }
 	}
 }
+
+#ifndef SINF
 weak_alias (__sinf, sinf)
+#endif