about summary refs log tree commit diff
path: root/sysdeps/i386/i686/fpu/multiarch/s_sinf.c
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/i386/i686/fpu/multiarch/s_sinf.c
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/i386/i686/fpu/multiarch/s_sinf.c')
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/s_sinf.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sysdeps/i386/i686/fpu/multiarch/s_sinf.c b/sysdeps/i386/i686/fpu/multiarch/s_sinf.c
new file mode 100644
index 0000000000..80b2fd6875
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/s_sinf.c
@@ -0,0 +1,28 @@
+/* Multiple versions of sinf
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <init-arch.h>
+
+extern float __sinf_sse2 (float);
+extern float __sinf_ia32 (float);
+float __sinf (float);
+
+libm_ifunc (__sinf, HAS_SSE2 ? __sinf_sse2 : __sinf_ia32);
+weak_alias (__sinf, sinf);
+#define SINF __sinf_ia32
+#include <sysdeps/ieee754/flt-32/s_sinf.c>