about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc32/q_qtoi.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-05-25 16:51:15 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-05-25 16:51:15 +0000
commit2c753f3e8406495862d9db1347ea61271c18ace1 (patch)
tree29748352a3763b4aae896ee94ec83ba6e27f08c1 /sysdeps/sparc/sparc32/q_qtoi.c
parentc1dc1e1b34873db79dfbfa8f2f0a2abbe28c0514 (diff)
downloadglibc-2c753f3e8406495862d9db1347ea61271c18ace1.tar.gz
glibc-2c753f3e8406495862d9db1347ea61271c18ace1.tar.xz
glibc-2c753f3e8406495862d9db1347ea61271c18ace1.zip
Remove sysdeps/sparc/sparc32/soft-fp directory.
As per <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>,
there should not be separate sysdeps/<arch>/soft-fp directories when
those are used by all configurations that use sysdeps/<arch>, and,
more generally, should not be sysdeps/foo/Implies files pointing to a
subdirectory foo/bar.  This patch eliminates the
sysdeps/sparc/sparc32/soft-fp directory accordingly, merging its
contents into sysdeps/sparc/sparc32.

Tested with build-many-glibcs.py that installed stripped shared
libraries for sparc configurations are unchanged by this patch.

	* sysdeps/sparc/sparc32/Implies: Remove sparc/sparc32/soft-fp.
	* sysdeps/sparc/sparc32/Makefile [$(subdir) = soft-fp]
	(sparc32-quad-routines): New variable.  Moved from ....
	[$(subdir) = soft-fp] (sysdep_routines): Add
	$(sparc32-quad-routines).  Moved from ....
	* sysdeps/sparc/sparc32/soft-fp/Makefile: ... here.  Remove file.
	* sysdeps/sparc/sparc32/Versions (libc): Add GLIBC_2.4 symbols
	moved from ....
	* sysdeps/sparc/sparc32/soft-fp/Versions: ... here.  Remove file.
	* sysdeps/sparc/sparc32/soft-fp/q_add.c: Move to ....
	* sysdeps/sparc/sparc32/q_add.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_cmp.c: Move to ....
	* sysdeps/sparc/sparc32/q_cmp.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_cmpe.c: Move to ....
	* sysdeps/sparc/sparc32/q_cmpe.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_div.c: Move to ....
	* sysdeps/sparc/sparc32/q_div.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_dtoq.c: Move to ....
	* sysdeps/sparc/sparc32/q_dtoq.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_feq.c: Move to ....
	* sysdeps/sparc/sparc32/q_feq.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_fge.c: Move to ....
	* sysdeps/sparc/sparc32/q_fge.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_fgt.c: Move to ....
	* sysdeps/sparc/sparc32/q_fgt.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_fle.c: Move to ....
	* sysdeps/sparc/sparc32/q_fle.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_flt.c: Move to ....
	* sysdeps/sparc/sparc32/q_flt.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_fne.c: Move to ....
	* sysdeps/sparc/sparc32/q_fne.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_itoq.c: Move to ....
	* sysdeps/sparc/sparc32/q_itoq.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_lltoq.c: Move to ....
	* sysdeps/sparc/sparc32/q_lltoq.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_mul.c: Move to ....
	* sysdeps/sparc/sparc32/q_mul.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_neg.c: Move to ....
	* sysdeps/sparc/sparc32/q_neg.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_qtod.c: Move to ....
	* sysdeps/sparc/sparc32/q_qtod.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_qtoi.c: Move to ....
	* sysdeps/sparc/sparc32/q_qtoi.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_qtoll.c: Move to ....
	* sysdeps/sparc/sparc32/q_qtoll.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_qtos.c: Move to ....
	* sysdeps/sparc/sparc32/q_qtos.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_qtou.c: Move to ....
	* sysdeps/sparc/sparc32/q_qtou.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_qtoull.c: Move to ....
	* sysdeps/sparc/sparc32/q_qtoull.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_sqrt.c: Move to ....
	* sysdeps/sparc/sparc32/q_sqrt.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_stoq.c: Move to ....
	* sysdeps/sparc/sparc32/q_stoq.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_sub.c: Move to ....
	* sysdeps/sparc/sparc32/q_sub.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c: Move to ....
	* sysdeps/sparc/sparc32/q_ulltoq.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_util.c: Move to ....
	* sysdeps/sparc/sparc32/q_util.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/q_utoq.c: Move to ....
	* sysdeps/sparc/sparc32/q_utoq.c: ... here.
	* sysdeps/sparc/sparc32/soft-fp/sfp-machine.h: Move to ....
	* sysdeps/sparc/sparc32/sfp-machine.h: ... here.
Diffstat (limited to 'sysdeps/sparc/sparc32/q_qtoi.c')
-rw-r--r--sysdeps/sparc/sparc32/q_qtoi.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/sysdeps/sparc/sparc32/q_qtoi.c b/sysdeps/sparc/sparc32/q_qtoi.c
new file mode 100644
index 0000000000..0b5af2327e
--- /dev/null
+++ b/sysdeps/sparc/sparc32/q_qtoi.c
@@ -0,0 +1,37 @@
+/* Software floating-point emulation.
+   Return (int)a
+   Copyright (C) 1997-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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/>.  */
+
+#define FP_ROUNDMODE FP_RND_ZERO
+#include "soft-fp.h"
+#include "quad.h"
+
+int _Q_qtoi(const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A);
+  unsigned int r;
+
+  FP_UNPACK_RAW_Q(A, a);
+  FP_TO_INT_Q(r, A, 32, 1);
+  FP_HANDLE_EXCEPTIONS;
+
+  return r;
+}