From: Joseph Myers <joseph@codesourcery.com>
To: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH 1/8] Begin refactor of libm-test.inc
Date: Wed, 18 May 2016 21:18:00 -0000 [thread overview]
Message-ID: <alpine.DEB.2.20.1605182110160.7137@digraph.polyomino.org.uk> (raw)
In-Reply-To: <d07dfc0973a9a1288b424abfb19633ab0048f1c9.1463599718.git.murphyp@linux.vnet.ibm.com>
On Wed, 18 May 2016, Paul E. Murphy wrote:
> +#define MANT_DIG (TYPE_MANT_DIG - 1)
> +#define MIN_EXP (TYPE_MIN_EXP - 1)
> +#define MAX_EXP (TYPE_MAX_EXP - 1)
No. All these "- 1" are gratuitous obfuscation (difference from the
standard C macros) in the existing code; having similar macros with
different values is particularly confusing. The correct approach is a
preliminary patch to change the definition and uses of MANT_DIG and
MIN_EXP, rather than extending the use of - 1 to MAX_EXP.
And then you don't need the TYPE_ prefixes at all; just use MAX_EXP etc.
as at present (I agree that moving away from CHOOSE makes sense). Only
TYPE_DECIMAL_DIG (and TYPE_HEX_DIG for consistency) needs such a prefix,
because of the incompatible meaning of DECIMAL_DIG in <float.h>.
> +#define TYPE_DECIMAL_DIG DBL_DECIMAL_DIG
> +#define TYPE_MIN DBL_MIN
> +#define TYPE_TRUE_MIN DBL_TRUE_MIN
> +#define TYPE_MAX DBL_MAX
> +#define TYPE_MIN_EXP DBL_MIN_EXP
> +#define TYPE_MAX_EXP DBL_MAX_EXP
> +#define TYPE_MANT_DIG DBL_MANT_DIG
Apart from removing the TYPE_ prefix in most cases, I think it would be
better for this header just to define something to the DBL prefix, and for
libm-test.inc to deal with concatenating that with _DECIMAL_DIG, _MIN,
etc.
--
Joseph S. Myers
joseph@codesourcery.com
next prev parent reply other threads:[~2016-05-18 21:17 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-20 21:38 [PATCHv2 00/14] Refactor libm-test.inc and friends Paul E. Murphy
2016-05-18 20:56 ` [PATCH 0/8] Refactor libm-tests.c " Paul E. Murphy
2016-05-18 20:56 ` [PATCH 5/8] Apply LIT(x) to floating point literals in libm-test.c Paul E. Murphy
2016-05-18 21:34 ` Joseph Myers
2016-05-18 20:56 ` [PATCH 1/8] Begin refactor of libm-test.inc Paul E. Murphy
2016-05-18 21:18 ` Joseph Myers [this message]
2016-05-18 21:54 ` Joseph Myers
2016-05-18 21:57 ` Paul E. Murphy
2016-05-19 11:05 ` Joseph Myers
2016-05-18 20:56 ` [PATCH 2/8] Refactor type specific macros using regexes Paul E. Murphy
2016-05-18 20:56 ` [PATCH 3/8] Fixup TYPE_* substitutions Paul E. Murphy
2016-05-18 21:19 ` Joseph Myers
2016-05-18 20:56 ` [PATCH 4/8] Add LIT() around literals in check_ulp in libm-tests.inc Paul E. Murphy
2016-05-18 21:24 ` Joseph Myers
2016-05-18 20:56 ` [PATCH 8/8] Generate new format names in auto-libm-test-out Paul E. Murphy
2016-05-18 20:56 ` [PATCH 7/8] Remove type specific information from auto-libm-test-in Paul E. Murphy
2016-05-18 21:55 ` Joseph Myers
2016-05-18 21:17 ` [PATCH 6/8] Refactor CHOOSE() macro usage in libm-tests.inc Paul E. Murphy
2016-05-18 21:39 ` Joseph Myers
2016-05-18 21:44 ` [PATCH 0/8] Refactor libm-tests.c and friends Joseph Myers
2016-05-18 21:58 ` Paul E. Murphy
2016-05-20 21:37 ` [PATCHv2 02/14] Fixup usage of MIN_EXP in libm-test.inc Paul E. Murphy
2016-05-23 16:02 ` Joseph Myers
2016-05-24 20:50 ` Paul E. Murphy
2016-05-20 21:37 ` [PATCHv2 01/14] Fixup usage of MANT_DIG " Paul E. Murphy
2016-05-23 15:41 ` Joseph Myers
2016-05-24 20:45 ` Paul E. Murphy
2016-05-20 21:37 ` [PATCHv2 05/14] Refactor M_ macros defined " Paul E. Murphy
2016-05-20 21:38 ` [PATCHv2 06/14] Replace M_PI2l with pi_2_d " Paul E. Murphy
2016-05-23 16:59 ` Joseph Myers
2016-05-23 20:02 ` Paul E. Murphy
2016-05-23 20:34 ` Joseph Myers
2016-05-23 21:36 ` Paul E. Murphy
2016-05-23 23:11 ` Joseph Myers
2016-05-20 21:38 ` [PATCHv2 12/14] Remove CHOOSE() macro from libm-tests.inc Paul E. Murphy
2016-05-20 21:38 ` [PATCHv2 13/14] Remove type specific information from auto-libm-test-in Paul E. Murphy
2016-05-20 21:38 ` [PATCHv2 14/14] Generate new format names in auto-libm-test-out Paul E. Murphy
2016-05-20 21:38 ` [PATCHv2 04/14] Refactor type specific macros using regexes Paul E. Murphy
2016-05-23 16:57 ` Joseph Myers
2016-05-20 21:38 ` [PATCHv2 11/14] Apply LIT(x) to floating point literals in libm-test.c Paul E. Murphy
2016-05-24 16:26 ` Joseph Myers
2016-05-20 21:38 ` [PATCHv2 10/14] Add note about nexttoward test cases in libm-test.inc Paul E. Murphy
2016-05-23 17:07 ` Joseph Myers
2016-05-23 18:20 ` Zack Weinberg
2016-05-20 21:38 ` [PATCHv2 03/14] Begin refactor of libm-test.inc Paul E. Murphy
2016-05-23 16:10 ` Joseph Myers
2016-05-20 21:38 ` [PATCHv2 08/14] Replace M_PI_4l with pi_4_d in libm-test.inc Paul E. Murphy
2016-05-20 21:45 ` [PATCHv2 07/14] Replace M_PIl with pi " Paul E. Murphy
2016-05-20 21:52 ` [PATCHv2 09/14] Replace M_El with exp1 " 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=alpine.DEB.2.20.1605182110160.7137@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=murphyp@linux.vnet.ibm.com \
/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).