about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc64/fpu/multiarch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-03-15 02:13:54 -0700
committerDavid S. Miller <davem@davemloft.net>2012-03-15 02:13:54 -0700
commitf7062b9a6f8ccaeb080b6c819ceec59b77cce3c4 (patch)
treed72011561c032765833f16dbca7f5a67309cae03 /sysdeps/sparc/sparc64/fpu/multiarch
parent559398ab746fd7dbbe09e847813a1b917b9ded14 (diff)
downloadglibc-f7062b9a6f8ccaeb080b6c819ceec59b77cce3c4.tar.gz
glibc-f7062b9a6f8ccaeb080b6c819ceec59b77cce3c4.tar.xz
glibc-f7062b9a6f8ccaeb080b6c819ceec59b77cce3c4.zip
Sparc optimized fmin{,f} and fmax{,f}.
	* sysdeps/sparc/sparc64/fpu/s_fmax.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_fmaxf.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_fmin.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_fminf.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Add new vis3
	fmin/fmax sysdep routines.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Likewise.
Diffstat (limited to 'sysdeps/sparc/sparc64/fpu/multiarch')
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/Makefile3
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S26
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S46
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S27
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S46
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S26
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S46
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S27
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S46
9 files changed, 292 insertions, 1 deletions
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
index 564ed26c3d..0aa40464e0 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
@@ -5,7 +5,8 @@ libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 s_ceilf-vis3 \
 			s_floorf-vis3 s_floor-vis3 m_isinff-vis3 \
 			m_isinf-vis3 m_isnanf-vis3 m_isnan-vis3 \
 			s_lrintf-vis3 s_lrint-vis3 s_rintf-vis3 \
-			s_rint-vis3
+			s_rint-vis3 s_fminf-vis3 s_fmin-vis3 \
+			s_fmaxf-vis3 s_fmax-vis3
 sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \
 		   s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \
 		   s_isnanf-vis3 s_isnan-vis3
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S
new file mode 100644
index 0000000000..777bb6eee9
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S
@@ -0,0 +1,26 @@
+/* fmax function, sparc64 vis3 version.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+   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 <sysdep.h>
+
+ENTRY (__fmax_vis3)
+	flcmpd	%fcc1, %f0, %f2
+	retl
+	 fmovdlg %fcc1, %f2, %f0
+END (__fmax_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S
new file mode 100644
index 0000000000..f604f5b533
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S
@@ -0,0 +1,46 @@
+#include <sysdep.h>
+
+	.text
+ENTRY(__fmax)
+	.type	__fmax, @gnu_indirect_function
+# ifdef SHARED
+	SETUP_PIC_REG_LEAF(o3, o5)
+# endif
+# ifdef HAVE_AS_VIS3_SUPPORT
+	set	HWCAP_SPARC_VIS3, %o1
+	andcc	%o0, %o1, %g0
+	be	9f
+	 nop
+#  ifdef SHARED
+	sethi	%gdop_hix22(__fmax_vis3), %o1
+	xor	%o1, %gdop_lox10(__fmax_vis3), %o1
+#  else
+	set	__fmax_vis3, %o1
+#  endif
+	ba	10f
+	 nop
+9:
+# endif
+# ifdef SHARED
+	sethi	%gdop_hix22(__fmax_generic), %o1
+	xor	%o1, %gdop_lox10(__fmax_generic), %o1
+# else
+	set	__fmax_generic, %o1
+# endif
+# ifdef HAVE_AS_VIS3_SUPPORT
+10:
+# endif
+# ifdef SHARED
+	add	%o3, %o1, %o1
+# endif
+	retl
+	 mov	%o1, %o0
+END(__fmax)
+weak_alias (__fmax, fmax)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmax __fmax_generic
+
+#include "../s_fmax.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S
new file mode 100644
index 0000000000..b3f2e85cd3
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S
@@ -0,0 +1,27 @@
+/* fmaxf function, sparc64 vis3 version.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+   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 <sysdep.h>
+
+ENTRY (__fmaxf_vis3)
+	flcmps	%fcc1, %f1, %f3
+	fmovs	%f1, %f0
+	retl
+	 fmovslg %fcc1, %f3, %f0
+END (__fmaxf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S
new file mode 100644
index 0000000000..c188f8e568
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S
@@ -0,0 +1,46 @@
+#include <sysdep.h>
+
+	.text
+ENTRY(__fmaxf)
+	.type	__fmaxf, @gnu_indirect_function
+# ifdef SHARED
+	SETUP_PIC_REG_LEAF(o3, o5)
+# endif
+# ifdef HAVE_AS_VIS3_SUPPORT
+	set	HWCAP_SPARC_VIS3, %o1
+	andcc	%o0, %o1, %g0
+	be	9f
+	 nop
+#  ifdef SHARED
+	sethi	%gdop_hix22(__fmaxf_vis3), %o1
+	xor	%o1, %gdop_lox10(__fmaxf_vis3), %o1
+#  else
+	set	__fmaxf_vis3, %o1
+#  endif
+	ba	10f
+	 nop
+9:
+# endif
+# ifdef SHARED
+	sethi	%gdop_hix22(__fmaxf_generic), %o1
+	xor	%o1, %gdop_lox10(__fmaxf_generic), %o1
+# else
+	set	__fmaxf_generic, %o1
+# endif
+# ifdef HAVE_AS_VIS3_SUPPORT
+10:
+# endif
+# ifdef SHARED
+	add	%o3, %o1, %o1
+# endif
+	retl
+	 mov	%o1, %o0
+END(__fmaxf)
+weak_alias (__fmaxf, fmaxf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmaxf __fmaxf_generic
+
+#include "../s_fmaxf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S
new file mode 100644
index 0000000000..edb5823b41
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S
@@ -0,0 +1,26 @@
+/* fmin function, sparc64 vis3 version.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+   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 <sysdep.h>
+
+ENTRY (__fmin_vis3)
+	flcmpd	%fcc1, %f0, %f2
+	retl
+	 fmovdge %fcc1, %f2, %f0
+END (__fmin_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S
new file mode 100644
index 0000000000..ed7018b58b
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S
@@ -0,0 +1,46 @@
+#include <sysdep.h>
+
+	.text
+ENTRY(__fmin)
+	.type	__fmin, @gnu_indirect_function
+# ifdef SHARED
+	SETUP_PIC_REG_LEAF(o3, o5)
+# endif
+# ifdef HAVE_AS_VIS3_SUPPORT
+	set	HWCAP_SPARC_VIS3, %o1
+	andcc	%o0, %o1, %g0
+	be	9f
+	 nop
+#  ifdef SHARED
+	sethi	%gdop_hix22(__fmin_vis3), %o1
+	xor	%o1, %gdop_lox10(__fmin_vis3), %o1
+#  else
+	set	__fmin_vis3, %o1
+#  endif
+	ba	10f
+	 nop
+9:
+# endif
+# ifdef SHARED
+	sethi	%gdop_hix22(__fmin_generic), %o1
+	xor	%o1, %gdop_lox10(__fmin_generic), %o1
+# else
+	set	__fmin_generic, %o1
+# endif
+# ifdef HAVE_AS_VIS3_SUPPORT
+10:
+# endif
+# ifdef SHARED
+	add	%o3, %o1, %o1
+# endif
+	retl
+	 mov	%o1, %o0
+END(__fmin)
+weak_alias (__fmin, fmin)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmin __fmin_generic
+
+#include "../s_fmin.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S
new file mode 100644
index 0000000000..81d5fb1781
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S
@@ -0,0 +1,27 @@
+/* fminf function, sparc64 vis3 version.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+   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 <sysdep.h>
+
+ENTRY (__fminf_vis3)
+	flcmps	%fcc1, %f1, %f3
+	fmovs	%f1, %f0
+	retl
+	 fmovsge %fcc1, %f3, %f0
+END (__fminf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S
new file mode 100644
index 0000000000..6c7a4928c1
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S
@@ -0,0 +1,46 @@
+#include <sysdep.h>
+
+	.text
+ENTRY(__fminf)
+	.type	__fminf, @gnu_indirect_function
+# ifdef SHARED
+	SETUP_PIC_REG_LEAF(o3, o5)
+# endif
+# ifdef HAVE_AS_VIS3_SUPPORT
+	set	HWCAP_SPARC_VIS3, %o1
+	andcc	%o0, %o1, %g0
+	be	9f
+	 nop
+#  ifdef SHARED
+	sethi	%gdop_hix22(__fminf_vis3), %o1
+	xor	%o1, %gdop_lox10(__fminf_vis3), %o1
+#  else
+	set	__fminf_vis3, %o1
+#  endif
+	ba	10f
+	 nop
+9:
+# endif
+# ifdef SHARED
+	sethi	%gdop_hix22(__fminf_generic), %o1
+	xor	%o1, %gdop_lox10(__fminf_generic), %o1
+# else
+	set	__fminf_generic, %o1
+# endif
+# ifdef HAVE_AS_VIS3_SUPPORT
+10:
+# endif
+# ifdef SHARED
+	add	%o3, %o1, %o1
+# endif
+	retl
+	 mov	%o1, %o0
+END(__fminf)
+weak_alias (__fminf, fminf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fminf __fminf_generic
+
+#include "../s_fminf.S"