From: Jim Wilson <jimw@sifive.com>
To: Craig Howland <howland@LGSInnovations.com>, newlib@sourceware.org
Subject: Re: [PATCH] Don't call double rint from float powf.
Date: Tue, 12 Dec 2017 18:05:00 -0000 [thread overview]
Message-ID: <9d879f6e-c2c5-00e4-5552-340a36b6d3b8@sifive.com> (raw)
In-Reply-To: <1bd39401-e1b2-5be6-4418-9e6a809964da@LGSInnovations.com>
On 12/11/2017 04:37 PM, Craig Howland wrote:
> On 12/11/2017 07:08 PM, Jim Wilson wrote:
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â if(x<0.0&&rint(y)!=y) exc.retval = -HUGE_VAL;
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â if(x<0.0&&rintf(y)!=y) exc.retval = -HUGE_VAL;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â }
>> Â Â Â Â Â Â Â Â Â Â Â Â Â if (_LIB_VERSION == _POSIX_)
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â errno = ERANGE;
> To be most rigorous, "0.0" on the same lines as the rintf() should be
> "0.0F" (as otherwise the comparison strictly should be done in double).
> (Not addressing the exact change you are making, but is the same class
> of fix and are on the same line of source code.)
Any reasonable compiler will get this right. GCC does a float compare
here even if you compile without optimization. So no fix here is
required, though I can redo the patch if you want.
Jim
next prev parent reply other threads:[~2017-12-12 18:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 0:14 Jim Wilson
2017-12-12 3:45 ` Craig Howland
2017-12-12 12:49 ` Corinna Vinschen
2017-12-12 18:14 ` Jim Wilson
2017-12-12 18:05 ` Jim Wilson [this message]
2017-12-12 19:00 ` Craig Howland
2017-12-12 19:39 ` [PATCH v2] " Jim Wilson
2017-12-13 10:35 ` Corinna Vinschen
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=9d879f6e-c2c5-00e4-5552-340a36b6d3b8@sifive.com \
--to=jimw@sifive.com \
--cc=howland@LGSInnovations.com \
--cc=newlib@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).