public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul E Murphy <murphyp@linux.ibm.com>
To: "Gabriel F. T. Gomes" <gabriel@inconstante.net.br>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH v3 03/11] Refactor *cvt functions implementation (1-4/5)
Date: Mon, 09 Dec 2019 21:25:00 -0000	[thread overview]
Message-ID: <4f9e3ac3-a6d6-53d8-a296-8f0c9df00474@linux.ibm.com> (raw)
In-Reply-To: <20191203170540.18428-4-gabriel@inconstante.net.br>



On 12/3/19 11:05 AM, Gabriel F. T. Gomes wrote:
> From: "Gabriel F. T. Gomes" <gabrielftg@linux.ibm.com>
> 
> Changes since v2:
> 
>    - Squashed patches 1-4 and trivial bits of patch 5.
>    - Replaced http with https (like the rest of glibc).
>    - Updated copyright years.
>    - Removed refactoring noise reported by Paul Murphy.
> 
> No changes since v1.
> 
> This patch is to be squashed with the other n/5 refactoring patches.
> 
> Below, the commit message to be used after the squashing...
> 
> -- 8< --
> This patch refactors the *cvt functions implementation in a way that
> makes it easier to re-use them for implementing the IEEE long double on
> powerpc64le.  By splitting the implementation per se in one file
> (efgcvt-template.c) and the alias definitions in others (e.g. efgcvt.c),
> the new code makes it easier to define new function names, such as
> __qecvtieee128.
> 
> Tested for powerpc64le and with build-many-glibcs.

Is it still your intent to squash the two remaining commits?  This 
refactoring patch is still missing some changes included in the 
followup.  I still think two self-sufficient patches read better than 
squashing these two.  Otherwise, this patch is much improved over 4.

...

> --- a/misc/qefgcvt_r.c
> +++ b/misc/qefgcvt_r.c
> @@ -17,41 +17,19 @@
>      License along with the GNU C Library; if not, see
>      <https://www.gnu.org/licenses/>.  */

This seems to be missing at least the following:

#include <efgcvt-ldbl-macros.h>
#include <efgcvt_r-template.c>

Similarly for some others.

> 
> -#include <float.h>
> -
> -#define FLOAT_TYPE long double
> -#define FUNC_PREFIX q
> -#define FLOAT_FMT_FLAG "L"
> -#define FLOAT_NAME_EXT l
> -#define FLOAT_MIN_10_EXP LDBL_MIN_10_EXP
> -#if LDBL_MANT_DIG == 64
> -# define NDIGIT_MAX 21
> -#elif LDBL_MANT_DIG == 53
> -# define NDIGIT_MAX 17
> -#elif LDBL_MANT_DIG == 113
> -# define NDIGIT_MAX 36
> -#elif LDBL_MANT_DIG == 106
> -# define NDIGIT_MAX 34
> -#elif LDBL_MANT_DIG == 56
> -# define NDIGIT_MAX 18
> -#else
> -/* See IEEE 854 5.6, table 2 for this formula.  Unfortunately we need a
> -   compile time constant here, so we cannot use it.  */
> -# error "NDIGIT_MAX must be precomputed"
> -# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0)))
> -#endif
> -#if LDBL_MIN_10_EXP == -37
> -# define FLOAT_MIN_10_NORM	1.0e-37L
> -#elif LDBL_MIN_10_EXP == -291
> -# define FLOAT_MIN_10_NORM	1.0e-291L
> -#elif LDBL_MIN_10_EXP == -307
> -# define FLOAT_MIN_10_NORM	1.0e-307L
> -#elif LDBL_MIN_10_EXP == -4931
> -# define FLOAT_MIN_10_NORM	1.0e-4931L
> +#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
> +# define cvt_symbol(symbol) \
> +  cvt_symbol_1 (libc, __APPEND (FUNC_PREFIX, symbol), \
> +	      APPEND (FUNC_PREFIX, symbol), GLIBC_2_4)
> +# define cvt_symbol_1(lib, local, symbol, version) \
> +  libc_hidden_def (local) \
> +  versioned_symbol (lib, local, symbol, version)
>   #else
> -/* libc can't depend on libm.  */
> -# error "FLOAT_MIN_10_NORM must be precomputed"
> -# define FLOAT_MIN_10_NORM	exp10l (LDBL_MIN_10_EXP)
> +# define cvt_symbol(symbol) \
> +  cvt_symbol_1 (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
> +#  define cvt_symbol_1(local, symbol) \
> +  libc_hidden_def (local) \
> +  weak_alias (local, symbol)
>   #endif
> -
> -#include "efgcvt_r.c"
> +cvt_symbol(fcvt_r);
> +cvt_symbol(ecvt_r);
> 

  reply	other threads:[~2019-12-09 21:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 17:05 [PATCH v3 00/11] Add IEEE long double <-> string functions for powerpc64le Gabriel F. T. Gomes
2019-12-03 17:05 ` [PATCH v3 01/11] ldbl-128ibm-compat: Fix selection of GNU and ISO C99 scanf Gabriel F. T. Gomes
2019-12-09 16:46   ` Paul E Murphy
2019-12-09 16:50     ` Zack Weinberg
2019-12-09 17:09       ` Paul E Murphy
2019-12-09 18:16         ` Gabriel F. T. Gomes
2019-12-09 20:31           ` Paul E Murphy
2019-12-12 13:42             ` Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 08/11] Avoid compat symbols for totalorder in powerpc64le IEEE long double Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 07/11] ldbl-128ibm-compat: Compiler flags for stdio functions Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 10/11] powerpc64le: Require a compiler with -mno-gnu-attribute Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 02/11] ldbl-128ibm-compat: Add ISO C99 versions of scanf functions Gabriel F. T. Gomes
2019-12-09 18:09   ` Paul E Murphy
2019-12-13 21:13     ` Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 03/11] Refactor *cvt functions implementation (1-4/5) Gabriel F. T. Gomes
2019-12-09 21:25   ` Paul E Murphy [this message]
2019-12-13 20:19     ` Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 06/11] Do not redirect calls to __GI_* symbols, when redirecting to *ieee128 Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 09/11] ldbl-128ibm-compat: Do not mix -mabi=*longdouble and -mlong-double-128 Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 04/11] Refactor *cvt functions implementation (5/5) Gabriel F. T. Gomes
2019-12-03 17:06 ` [PATCH v3 05/11] ldbl-128ibm-compat: Add *cvt functions Gabriel F. T. Gomes
2019-12-09 23:13   ` Paul E Murphy
2019-12-13 20:03     ` Gabriel F. T. Gomes
2019-12-03 17:07 ` [PATCH v3 11/11] RFC: powerpc64le: Enable support for IEEE long double Gabriel F. T. Gomes
2019-12-09 23:47   ` Paul E Murphy
2019-12-13 22:41     ` Gabriel F. T. Gomes
2019-12-13 23:46       ` Paul E Murphy

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=4f9e3ac3-a6d6-53d8-a296-8f0c9df00474@linux.ibm.com \
    --to=murphyp@linux.ibm.com \
    --cc=gabriel@inconstante.net.br \
    --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).