about summary refs log tree commit diff
path: root/REORG.TODO/sysdeps/sparc/sparc32/fpu
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/sysdeps/sparc/sparc32/fpu')
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/e_sqrtl.c30
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_copysign.S31
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_copysignf.S31
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabs.S28
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabsf.S28
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabsl.c8
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fma.c2
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbit.S30
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbitf.S1
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbitl.S32
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S53
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S51
12 files changed, 325 insertions, 0 deletions
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/e_sqrtl.c b/REORG.TODO/sysdeps/sparc/sparc32/fpu/e_sqrtl.c
new file mode 100644
index 0000000000..1592d58849
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/e_sqrtl.c
@@ -0,0 +1,30 @@
+/* Long double square root, sparc32 version.
+   Copyright (C) 2016-2017 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 <math.h>
+
+extern long double _Q_sqrt(const long double a);
+
+long double
+__ieee754_sqrtl (long double x)
+{
+  return _Q_sqrt (x);
+}
+
+#include <shlib-compat.h>
+versioned_symbol (libm, __ieee754_sqrtl, __sqrtl_finite, GLIBC_2_23);
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_copysign.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_copysign.S
new file mode 100644
index 0000000000..bddbfb2386
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_copysign.S
@@ -0,0 +1,31 @@
+/* copysign function, sparc32 version.
+   Copyright (C) 2012-2017 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 (__copysign)
+	sethi	%hi(0x80000000), %g1
+	and	%o2, %g1, %o4
+	andn	%o0, %g1, %o0
+	or	%o0, %o4, %o0
+	std	%o0, [%sp + 72]
+	retl
+	 ldd	[%sp + 72], %f0
+END (__copysign)
+weak_alias (__copysign, copysign)
\ No newline at end of file
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_copysignf.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_copysignf.S
new file mode 100644
index 0000000000..f2e78962a9
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_copysignf.S
@@ -0,0 +1,31 @@
+/* float copysign function, sparc32 version.
+   Copyright (C) 2012-2017 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 (__copysignf)
+	sethi	%hi(0x80000000), %g1
+	and	%o1, %g1, %o4
+	andn	%o0, %g1, %o0
+	or	%o0, %o4, %o0
+	st	%o0, [%sp + 68]
+	retl
+	 ld	[%sp + 68], %f0
+END (__copysignf)
+weak_alias (__copysignf, copysignf)
\ No newline at end of file
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabs.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabs.S
new file mode 100644
index 0000000000..fdeda68898
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabs.S
@@ -0,0 +1,28 @@
+/* Float absolute value, sparc32 version.
+   Copyright (C) 2011-2017 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 <sysdep.h>
+
+ENTRY (__fabs)
+	st	%o0, [%sp+72]
+	st	%o1, [%sp+76]
+	ldd	[%sp+72], %f0
+	retl
+	 fabss	%f0, %f0
+END (__fabs)
+weak_alias (__fabs, fabs)
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabsf.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabsf.S
new file mode 100644
index 0000000000..12ac9de5c8
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabsf.S
@@ -0,0 +1,28 @@
+/* Float absolute value, sparc32 version.
+   Copyright (C) 2006-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
+
+   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 (__fabsf)
+	st	%o0, [%sp+68]
+	ld	[%sp+68], %f0
+	retl
+	 fabss	%f0, %f0
+END (__fabsf)
+weak_alias (__fabsf, fabsf)
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabsl.c b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabsl.c
new file mode 100644
index 0000000000..3c03b92828
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fabsl.c
@@ -0,0 +1,8 @@
+#include <math.h>
+#include <math_ldbl_opt.h>
+
+long double __fabsl (long double x)
+{
+  return __builtin_fabsl (x);
+}
+long_double_symbol (libm, __fabsl, fabsl);
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fma.c b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fma.c
new file mode 100644
index 0000000000..8f62605870
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_fma.c
@@ -0,0 +1,2 @@
+/* Always use dbl-64 version because long double is emulated in software.  */
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbit.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbit.S
new file mode 100644
index 0000000000..956517022f
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbit.S
@@ -0,0 +1,30 @@
+/* signbit().  sparc32 version.
+   Copyright (C) 2012-2017 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 <sysdep.h>
+
+ENTRY (__signbit)
+	retl
+	 srl	%o0, 31, %o0
+END (__signbit)
+
+/* On 32-bit the double version will also always work for
+   single-precision since in both cases the word with the
+   sign bit in it is passed always in register %o0.  */
+strong_alias (__signbit, __signbitf)
+hidden_def (__signbitf)
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbitf.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbitf.S
new file mode 100644
index 0000000000..91886af6d5
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbitf.S
@@ -0,0 +1 @@
+/* signbitf is implemented in s_signbit.S */
\ No newline at end of file
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbitl.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbitl.S
new file mode 100644
index 0000000000..5688186d39
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/s_signbitl.S
@@ -0,0 +1,32 @@
+/* signbitl().  sparc32 version.
+   Copyright (C) 2012-2017 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 <sysdep.h>
+#include <math_ldbl_opt.h>
+
+ENTRY (___signbitl)
+	ld	[%o0], %o1
+	retl
+	 srl	%o1, 31, %o0
+END (___signbitl)
+
+#if IS_IN (libm)
+long_double_symbol (libm, ___signbitl, __signbitl);
+#else
+long_double_symbol (libc, ___signbitl, __signbitl);
+#endif
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S
new file mode 100644
index 0000000000..703f228766
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S
@@ -0,0 +1,53 @@
+/* sqrt function.  sparc32 version.
+   Copyright (C) 2012-2017 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 <sysdep.h>
+
+ENTRY (__sqrt)
+	clr	%g1
+	std	%g0, [%sp + 72]
+	std	%o0, [%sp + 80]
+	ldd	[%sp + 72], %f8
+	ldd	[%sp + 80], %f0
+	fcmpd	%f0, %f8
+	fbl	1f
+	 nop
+8:	retl
+	 fsqrtd	%f0, %f0
+1:
+#ifdef SHARED
+	SETUP_PIC_REG_LEAF(o5, g1)
+	sethi	%gdop_hix22(_LIB_VERSION), %g1
+	xor	%g1, %gdop_lox10(_LIB_VERSION), %g1
+	ld	[%o5 + %g1], %g1, %gdop(_LIB_VERSION)
+#else
+	sethi	%hi(_LIB_VERSION), %g1
+	or	%g1, %lo(_LIB_VERSION), %g1
+#endif
+	ld	[%g1], %g1
+	cmp	%g1, -1
+	be	8b
+	 mov	%o0, %o2
+	mov	%o1, %o3
+	mov	26, %o4
+	mov	%o7, %g1
+	call	__kernel_standard
+	 mov	%g1, %o7
+END (__sqrt)
+
+weak_alias (__sqrt, sqrt)
diff --git a/REORG.TODO/sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S b/REORG.TODO/sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S
new file mode 100644
index 0000000000..05d1160378
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S
@@ -0,0 +1,51 @@
+/* sqrtf function.  sparc32 version.
+   Copyright (C) 2012-2017 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 <sysdep.h>
+
+ENTRY (__sqrtf)
+	st	%g0, [%sp + 68]
+	st	%o0, [%sp + 72]
+	ld	[%sp + 68], %f8
+	ld	[%sp + 72], %f0
+	fcmps	%f0, %f8
+	fbl	1f
+	 nop
+8:	retl
+	 fsqrts	%f0, %f0
+1:
+#ifdef SHARED
+	SETUP_PIC_REG_LEAF(o5, g1)
+	sethi	%gdop_hix22(_LIB_VERSION), %g1
+	xor	%g1, %gdop_lox10(_LIB_VERSION), %g1
+	ld	[%o5 + %g1], %g1, %gdop(_LIB_VERSION)
+#else
+	sethi	%hi(_LIB_VERSION), %g1
+	or	%g1, %lo(_LIB_VERSION), %g1
+#endif
+	ld	[%g1], %g1
+	cmp	%g1, -1
+	be	8b
+	 mov	%o0, %o1
+	mov	126, %o2
+	mov	%o7, %g1
+	call	__kernel_standard_f
+	 mov	%g1, %o7
+END (__sqrtf)
+
+weak_alias (__sqrtf, sqrtf)