public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
To: libc-alpha@sourceware.org
Cc: joseph@codesourcery.com
Subject: [PATCH 04/12] Add a generic significand implementation
Date: Wed, 20 Jun 2018 02:05:00 -0000	[thread overview]
Message-ID: <20180620020426.20372-5-tuliom@linux.ibm.com> (raw)
In-Reply-To: <20180620020426.20372-1-tuliom@linux.ibm.com>

Create a template for significand.

2018-06-19  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>

	* math/Makefile (libm-calls): Move s_significandF to...
	(gen-libm-calls): ... here.
	* math/s_significand_template.c: New file.
	* math/s_significand.c: Removed.
	* math/s_significandf.c: Removed.
	* math/s_significandl.c: Removed.
	* sysdeps/ieee754/ldbl-opt/s_significand.c: Removed.
	* sysdeps/ieee754/ldbl-opt/s_significandl.c: Removed.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
 math/Makefile                             |  5 +++--
 math/s_significand.c                      | 34 -------------------------------
 math/s_significand_template.c             | 33 ++++++++++++++++++++++++++++++
 math/s_significandf.c                     | 27 ------------------------
 math/s_significandl.c                     | 34 -------------------------------
 sysdeps/ieee754/ldbl-opt/s_significand.c  |  5 -----
 sysdeps/ieee754/ldbl-opt/s_significandl.c |  5 -----
 7 files changed, 36 insertions(+), 107 deletions(-)
 delete mode 100644 math/s_significand.c
 create mode 100644 math/s_significand_template.c
 delete mode 100644 math/s_significandf.c
 delete mode 100644 math/s_significandl.c
 delete mode 100644 sysdeps/ieee754/ldbl-opt/s_significand.c
 delete mode 100644 sysdeps/ieee754/ldbl-opt/s_significandl.c

diff --git a/math/Makefile b/math/Makefile
index e5d9ab7013..291788b348 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -53,7 +53,8 @@ gen-libm-calls = cargF conjF cimagF crealF cabsF e_scalbF s_cacosF	  \
 		 k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \
 		 s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF	  \
 		 s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF	  \
-		 s_nanF s_iseqsigF s_canonicalizeF w_ilogbF w_llogbF	  \
+		 s_nanF s_iseqsigF s_canonicalizeF s_significandF	  \
+		 w_ilogbF w_llogbF					  \
 		 w_log1pF w_scalblnF s_fmaxmagF s_fminmagF w_acosF	  \
 		 w_acoshF w_asinF w_atan2F w_atanhF w_coshF w_exp10F	  \
 		 w_exp2F w_fmodF w_hypotF w_j0F w_j1F w_jnF w_logF	  \
@@ -70,7 +71,7 @@ libm-calls =								  \
 	s_ceilF s_cosF s_erfF s_expm1F s_fabsF				  \
 	s_floorF s_log1pF s_logbF				  \
 	s_nextafterF s_nexttowardF s_rintF s_scalblnF			  \
-	s_significandF s_sinF s_tanF s_tanhF				  \
+	s_sinF s_tanF s_tanhF						  \
 	s_fpclassifyF s_truncF						  \
 	s_remquoF e_log2F s_roundF s_nearbyintF s_sincosF		  \
 	s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F		  \
diff --git a/math/s_significand.c b/math/s_significand.c
deleted file mode 100644
index 348bdcf6ad..0000000000
--- a/math/s_significand.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* @(#)s_signif.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_significand.c,v 1.6 1995/05/10 20:48:11 jtc Exp $";
-#endif
-
-/*
- * significand(x) computes just
- * 	scalb(x, (double) -ilogb(x)),
- * for exercising the fraction-part(F) IEEE 754-1985 test vector.
- */
-
-#include <math.h>
-#include <math_private.h>
-
-double __significand(double x)
-{
-	return __ieee754_scalb(x,(double) -__ilogb(x));
-}
-weak_alias (__significand, significand)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__significand, __significandl)
-weak_alias (__significand, significandl)
-#endif
diff --git a/math/s_significand_template.c b/math/s_significand_template.c
new file mode 100644
index 0000000000..0c5ad8d14b
--- /dev/null
+++ b/math/s_significand_template.c
@@ -0,0 +1,33 @@
+/* Return the mantissa of a floating-point number.
+   Copyright (C) 2018 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/>.  */
+
+/*
+ * significand(x) computes just
+ * 	scalb(x, (FLOAT) - ilogb(x)),
+ * for exercising the fraction-part(F) IEEE 754-1985 test vector.
+ */
+
+#include <math.h>
+#include <math_private.h>
+
+FLOAT
+M_DECL_FUNC (__significand) (FLOAT x)
+{
+  return M_SUF (__ieee754_scalb) (x,(FLOAT) - M_SUF (__ilogb) (x));
+}
+declare_mgen_alias (__significand, significand)
diff --git a/math/s_significandf.c b/math/s_significandf.c
deleted file mode 100644
index 876e53932b..0000000000
--- a/math/s_significandf.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* s_significandf.c -- float version of s_significand.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_significandf.c,v 1.3 1995/05/10 20:48:13 jtc Exp $";
-#endif
-
-#include <math.h>
-#include <math_private.h>
-
-float __significandf(float x)
-{
-	return __ieee754_scalbf(x,(float) -__ilogbf(x));
-}
-weak_alias (__significandf, significandf)
diff --git a/math/s_significandl.c b/math/s_significandl.c
deleted file mode 100644
index 0e3337b2fe..0000000000
--- a/math/s_significandl.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* s_significandl.c -- long double version of s_significand.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
-/*
- * significandl(x) computes just
- * 	scalbl(x, (long double) -ilogbl(x)),
- * for exercising the fraction-part(F) IEEE 754-1985 test vector.
- */
-
-#include <math.h>
-#include <math_private.h>
-
-long double __significandl(long double x)
-{
-	return __ieee754_scalbl(x,(long double) -__ilogbl(x));
-}
-weak_alias (__significandl, significandl)
diff --git a/sysdeps/ieee754/ldbl-opt/s_significand.c b/sysdeps/ieee754/ldbl-opt/s_significand.c
deleted file mode 100644
index 5287c09066..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_significand.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_significand.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __significand, significandl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_significandl.c b/sysdeps/ieee754/ldbl-opt/s_significandl.c
deleted file mode 100644
index 9339b4780d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_significandl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_significandl.c>
-long_double_symbol (libm, __significandl, significandl);
-- 
2.14.4

  parent reply	other threads:[~2018-06-20  2:05 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20  2:04 [PATCHv2 00/12] Introduce ieee128 symbols and redirections Tulio Magno Quites Machado Filho
2018-06-20  2:05 ` [PATCH 02/12] Move declare_mgen_finite_alias definition Tulio Magno Quites Machado Filho
2018-06-20 10:39   ` Joseph Myers
2018-06-20 13:14     ` Tulio Magno Quites Machado Filho
2018-06-20 21:04       ` Joseph Myers
2018-06-20 21:09         ` Tulio Magno Quites Machado Filho
2018-06-20  2:05 ` [PATCH 03/12] Add a generic scalb implementation Tulio Magno Quites Machado Filho
2018-06-20 20:32   ` Joseph Myers
2018-06-20 22:19     ` Tulio Magno Quites Machado Filho
2018-06-20 22:24       ` Joseph Myers
2018-06-20  2:05 ` [PATCH 05/12] Refactor math/bits/math-finite.h, reusing math/bits/mathcalls.h [BZ #23292] Tulio Magno Quites Machado Filho
2018-06-20 10:41   ` Joseph Myers
2018-06-20  2:05 ` [PATCH 07/12] ldbl-128ibm-compat: Provide a scalb implementation Tulio Magno Quites Machado Filho
2018-06-20 20:40   ` Joseph Myers
2018-06-20  2:05 ` Tulio Magno Quites Machado Filho [this message]
2018-06-20 20:34   ` [PATCH 04/12] Add a generic significand implementation Joseph Myers
2018-06-20 21:31     ` Tulio Magno Quites Machado Filho
2018-06-21 17:01     ` Joseph Myers
2018-06-22 21:33       ` [PATCH] m68k: Reorganize log1p and significand implementations Tulio Magno Quites Machado Filho
2018-06-22 21:34         ` Jeff Law
2018-06-22 21:54         ` Joseph Myers
2018-06-20  2:05 ` [PATCH 06/12] ldbl-128ibm-compat: Create libm-alias-float128.h Tulio Magno Quites Machado Filho
2018-06-20 20:39   ` Joseph Myers
2018-06-20 22:03     ` Tulio Magno Quites Machado Filho
2018-06-20  2:05 ` [PATCH 01/12] Undefine redirections after long double definition on __LDBL_COMPAT [BZ #23294] Tulio Magno Quites Machado Filho
2018-06-20 10:38   ` Joseph Myers
2018-06-20  2:06 ` [PATCH 12/12] ldbl-128ibm-compat: Provide ieee128 symbols to narrow functions Tulio Magno Quites Machado Filho
2018-06-20 10:55   ` Joseph Myers
2018-06-20  2:06 ` [PATCH 08/12] ldbl-128ibm-compat: Provide a significand implementation Tulio Magno Quites Machado Filho
2018-06-20 20:40   ` Joseph Myers
2018-06-20  2:06 ` [PATCH 09/12] ldbl-128ibm-compat: Provide nexttoward functions Tulio Magno Quites Machado Filho
2018-06-20 20:46   ` Joseph Myers
2018-06-21  1:08     ` Tulio Magno Quites Machado Filho
2018-06-21 16:25       ` Joseph Myers
2018-06-20  2:06 ` [PATCH 10/12] ldbl-128ibm-compat: Redirect long double functions to f128/ieee128 functions Tulio Magno Quites Machado Filho
2018-06-20 20:54   ` Joseph Myers
2018-06-20 22:48     ` Tulio Magno Quites Machado Filho
2018-06-20  2:06 ` [PATCH 11/12] ldbl-128ibm-compat: Redirect complex math functions Tulio Magno Quites Machado Filho
2018-06-20 21:00   ` Joseph Myers
2018-06-21 19:05     ` Tulio Magno Quites Machado Filho
2018-06-21 16:53 ` [PATCHv2 00/12] Introduce ieee128 symbols and redirections Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180620020426.20372-5-tuliom@linux.ibm.com \
    --to=tuliom@linux.ibm.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).