public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Patrick McGehearty <patrick.mcgehearty@oracle.com>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
Date: Fri, 20 Oct 2017 14:56:00 -0000	[thread overview]
Message-ID: <6a4f4103-9015-e6d7-917d-d3959264bb3d@oracle.com> (raw)
In-Reply-To: <59E9E0E5.4000705@arm.com>

On 10/20/2017 6:41 AM, Szabolcs Nagy wrote:
> On 19/10/17 23:31, Patrick McGehearty wrote:
>> Table of hex float constants. I can readily adjust the formating. What
>> you see is the formating used in the original source.
>> I've been uncomfortable with hex floats approach
>> as it only works for ieee754 representations
>> that use base 2. I admit that is most current machines.
> your entire algorithm depends on ieee754 binary representation,
> that's not a good reason for avoiding hexfloats.
>
> decimal floats are not even required to be correctly rounded by
> the compiler in iso c, they are only faithfully rounded, so
> this is a portability bug in the original source too, you can
> silently get completely wrong code generation because of it.
>
>> And the prior ieee754 exp table uses hex format.
>> My second reason for resisting the change is my philosophy
>> when porting code is that every change without a good reason
>> is an opportunity to introduce errors without corresponding benefit.
>>
>> If you feel strongly about suing hex constants, I will make an effort
>> to convert these values to hex format.  This conversion seems likely
>> to require the most effort on my part.
>>
You make good points. In the prior context of the code being built
and used for Sparc/Solaris, the Studio compiler was known to
correctly round floating point constants since the early 90's.
In the gnu context, we have to be prepared for any C standard
compliant compiler, which is a greater challenge.
I'll make the conversion to using hex constants. I'm wondering
if it would be beneficial to retain the decimal constants in comment form?
Maybe not for the big table, but for the constants used for
specific thresholds, etc.  I know when I first looked at
some of this code, I wrote a little program to display the
decimal equivalents of some of the hex constants to better understand
what the control flow was doing.

- patrick



  reply	other threads:[~2017-10-20 14:56 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 16:56 Patrick McGehearty
2017-10-18 17:22 ` Joseph Myers
2017-10-18 23:22   ` Joseph Myers
2017-10-19 22:31   ` Patrick McGehearty
2017-10-19 22:48     ` Joseph Myers
2017-10-20 15:04       ` Patrick McGehearty
2017-10-21  5:23       ` Patrick McGehearty
2017-10-23 12:47         ` Joseph Myers
2017-10-23 19:58           ` Patrick McGehearty
2017-10-23 21:31             ` Joseph Myers
2017-10-20 11:41     ` Szabolcs Nagy
2017-10-20 14:56       ` Patrick McGehearty [this message]
2017-10-20 16:10       ` Joseph Myers
2017-10-23 12:25 ` Siddhesh Poyarekar
2017-10-23 15:58   ` Joseph Myers
2017-10-20 13:38 Wilco Dijkstra
2017-10-20 14:58 ` Patrick McGehearty
2017-10-26 16:44 Patrick McGehearty
2017-10-26 17:20 ` Joseph Myers
2017-10-26 17:25   ` Joseph Myers
2017-10-26 18:30     ` Patrick McGehearty
2017-10-26 19:44       ` Joseph Myers
2017-10-26 22:53 Patrick McGehearty
2017-11-01  0:26 ` Joseph Myers
2017-11-07  4:25 Patrick McGehearty
2017-11-16 17:52 ` Patrick McGehearty
2017-11-16 18:27   ` Carlos O'Donell
2017-11-16 18:31   ` Joseph Myers
2017-11-23 21:19 ` Joseph Myers
2017-12-01  0:47   ` Patrick McGehearty
2017-12-01  0:51 Patrick McGehearty
2017-12-01  0:56 ` Joseph Myers
2017-12-04 21:53 Patrick McGehearty
2017-12-05 23:20 ` Joseph Myers
2017-12-08 23:08 Patrick McGehearty
2017-12-11  8:14 ` Siddhesh Poyarekar
2017-12-11 17:04   ` Patrick McGehearty
2017-12-11 17:53     ` Siddhesh Poyarekar
2017-12-14  1:28 ` Joseph Myers
2017-12-18 20:11   ` Patrick McGehearty
2017-12-29 23:42 Patrick McGehearty
2018-01-01  1:36 ` Joseph Myers
2018-01-01 16:31   ` Patrick McGehearty
2018-01-01 16:41     ` 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=6a4f4103-9015-e6d7-917d-d3959264bb3d@oracle.com \
    --to=patrick.mcgehearty@oracle.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).