about summary refs log tree commit diff
path: root/sysdeps/alpha/ots_cmp.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-05-23 17:29:20 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-05-23 17:29:20 +0000
commit2834fb46109a8a7c9161eb8d0d9ddc707a717144 (patch)
treedb8d39c5ecfb5e3069a4f908299ead60d3befc76 /sysdeps/alpha/ots_cmp.c
parent7f9f1ecb710eac4d65bb02785ddf288cac098323 (diff)
downloadglibc-2834fb46109a8a7c9161eb8d0d9ddc707a717144.tar.gz
glibc-2834fb46109a8a7c9161eb8d0d9ddc707a717144.tar.xz
glibc-2834fb46109a8a7c9161eb8d0d9ddc707a717144.zip
Remove sysdeps/alpha/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/alpha/soft-fp directory accordingly, merging its contents
into sysdeps/alpha.

Tested with build-many-glibcs.py that installed stripped shared
libraries for alpha-linux-gnu are unchanged by this patch.

	* sysdeps/alpha/Implies: Remove alpha/soft-fp.
	* sysdeps/alpha/Makefile [$(subdir) = soft-fp] (sysdep_routines):
	Add functions moved from ....
	[$(subdir) = math] (CPPFLAGS): Add -I../soft-fp.  Moved from ....
	* sysdeps/alpha/soft-fp/Makefile: ... here.  Remove file.
	* sysdeps/alpha/Versions (libc): Add GLIBC_2.3.4 symbols moved
	from ....
	* sysdeps/alpha/soft-fp/Versions: ... here.  Remove file.
	* sysdeps/alpha/soft-fp/e_sqrtl.c: Move to ....
	* sysdeps/alpha/e_sqrtl.c: ... here.
	* sysdeps/alpha/soft-fp/local-soft-fp.h: Move to ....
	* sysdeps/alpha/local-soft-fp.h: ... here.
	* sysdeps/alpha/soft-fp/ots_add.c: Move to ....
	* sysdeps/alpha/ots_add.c: ... here.
	* sysdeps/alpha/soft-fp/ots_cmp.c: Move to ....
	* sysdeps/alpha/ots_cmp.c: ... here.
	* sysdeps/alpha/soft-fp/ots_cmpe.c: Move to ....
	* sysdeps/alpha/ots_cmpe.c: ... here.
	* sysdeps/alpha/soft-fp/ots_cvtqux.c: Move to ....
	* sysdeps/alpha/ots_cvtqux.c: ... here.
	* sysdeps/alpha/soft-fp/ots_cvtqx.c: Move to ....
	* sysdeps/alpha/ots_cvtqx.c: ... here.
	* sysdeps/alpha/soft-fp/ots_cvttx.c: Move to ....
	* sysdeps/alpha/ots_cvttx.c: ... here.
	* sysdeps/alpha/soft-fp/ots_cvtxq.c: Move to ....
	* sysdeps/alpha/ots_cvtxq.c: ... here.
	* sysdeps/alpha/soft-fp/ots_cvtxt.c: Move to ....
	* sysdeps/alpha/ots_cvtxt.c: ... here.
	* sysdeps/alpha/soft-fp/ots_div.c: Move to ....
	* sysdeps/alpha/ots_div.c: ... here.
	* sysdeps/alpha/soft-fp/ots_mul.c: Move to ....
	* sysdeps/alpha/ots_mul.c: ... here.
	* sysdeps/alpha/soft-fp/ots_nintxq.c: Move to ....
	* sysdeps/alpha/ots_nintxq.c: ... here.
	* sysdeps/alpha/soft-fp/ots_sub.c: Move to ....
	* sysdeps/alpha/ots_sub.c: ... here.
	* sysdeps/alpha/soft-fp/sfp-machine.h: Move to ....
	* sysdeps/alpha/sfp-machine.h: ... here.
Diffstat (limited to 'sysdeps/alpha/ots_cmp.c')
-rw-r--r--sysdeps/alpha/ots_cmp.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/sysdeps/alpha/ots_cmp.c b/sysdeps/alpha/ots_cmp.c
new file mode 100644
index 0000000000..77e8161385
--- /dev/null
+++ b/sysdeps/alpha/ots_cmp.c
@@ -0,0 +1,63 @@
+/* Software floating-point emulation: comparison.
+   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/>.  */
+
+#include "local-soft-fp.h"
+
+static long
+internal_equality (long al, long ah, long bl, long bh, long neq)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(B);
+  long r;
+
+  AXP_UNPACK_RAW_Q(A, a);
+  AXP_UNPACK_RAW_Q(B, b);
+
+  if ((A_e == _FP_EXPMAX_Q && !_FP_FRAC_ZEROP_2(A))
+       || (B_e == _FP_EXPMAX_Q && !_FP_FRAC_ZEROP_2(B)))
+    {
+      /* EQ and NE signal invalid operation only if either operand is SNaN.  */
+      if (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B))
+	{
+	  FP_SET_EXCEPTION(FP_EX_INVALID);
+	  FP_HANDLE_EXCEPTIONS;
+	}
+      return -1;
+    }
+
+  r = (A_e == B_e
+       && _FP_FRAC_EQ_2 (A, B)
+       && (A_s == B_s || (!A_e && _FP_FRAC_ZEROP_2(A))));
+  r ^= neq;
+
+  return r;
+}
+
+long
+_OtsEqlX (long al, long ah, long bl, long bh)
+{
+  return internal_equality (al, ah, bl, bh, 0);
+}
+
+long
+_OtsNeqX (long al, long ah, long bl, long bh)
+{
+  return internal_equality (al, ah, bl, bh, 1);
+}