From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: gcc 11.1.0: printf("%.43f\n", 0x1.52f8a8e32e982p-140): printed value is incorrectly rounded
Date: Tue, 30 Nov 2021 16:09:26 +0100 [thread overview]
Message-ID: <YaY+pvLv14ewtjup@calimero.vinschen.de> (raw)
In-Reply-To: <20211130195156.4d8c0cec184743241c3c3146@nifty.ne.jp>
On Nov 30 19:51, Takashi Yano wrote:
> On Mon, 29 Nov 2021 16:55:32 +0100
> Corinna Vinschen wrote:
> > On Nov 29 23:24, Takashi Yano wrote:
> > > [...]
> > > > > > > I have tried to import gdtoa into newlib from OpenBSD.
> > > > > > > [...]
> > [...struct __reent stuff...]
> Thanks for checking and advice. I have done these.
>
> > As for the allocations, how big are those? If they are comparable with
> > the allocation we now perform in _ldtoa_r, it might not be worth to keep
> > both functions. Some users of smaller targets might also complain that
>
> I saw max 16404 byte malloc().
>
> > using printf now always pulls in both variants of ldtoa, thus raising
> > code size unnecessarily. It might be better to keep the calls separate
> > and only use one or the other, per target or per code size constraints,
> > perhaps as a configure option.
>
> I have added --enable-newlib-use-gdtoa option, which defaults
> to 'yes', into newlib/configure.ac. Is this the right thing?
That patch looks good to me, at least as far as Cygwin is concerned.
This isn't essential, but it might make sense to rename __ldtoa to
_ldtoa_r to avoid an extra function call, which could be time consuming
and add stack pressure. I. e., in gdtoa-ldtoa.c
#ifdef _USE_GDTOA
// all code in gdtoa-ldtoa.c
#endif
and in ldtoa.c:
#ifndef _USE_GDTOA
// all code in ldtoa.c
#endif
AFAICS, __ldtoa could easily be changed to take the long double argument
by value because it's used in only two places, one of which just checks
the value anyway. But, as I said, not essential. We can keep in mind
for the time being.
Could some people with other targets than Cygwin give this patch a try?
RTEMS, anybody?
Thanks,
Corinna
next prev parent reply other threads:[~2021-11-30 15:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAL9Mx1uMOz2wfqbMpD_xfA=D9JkpFzVz6AR_DKHK34AvrGOP6w@mail.gmail.com>
2021-11-03 21:26 ` Fwd: " Pavel M
2021-11-04 12:24 ` Corinna Vinschen
2021-11-04 16:48 ` Keith Packard
2021-11-04 17:27 ` Dave Nadler
2021-11-04 17:58 ` Keith Packard
2021-11-04 21:28 ` Brian Inglis
2021-11-05 2:54 ` Keith Packard
2021-11-05 16:00 ` Steven Abner
2021-11-06 12:06 ` Steven Abner
2021-11-06 23:25 ` Steven Abner
2021-11-08 9:57 ` Corinna Vinschen
2021-11-04 20:57 ` Corinna Vinschen
2021-11-28 7:43 ` Takashi Yano
2021-11-28 12:38 ` Takashi Yano
2021-11-28 13:16 ` Takashi Yano
2021-11-29 10:56 ` Takashi Yano
2021-11-29 14:24 ` Takashi Yano
2021-11-29 15:55 ` Corinna Vinschen
2021-11-30 10:51 ` Takashi Yano
2021-11-30 15:09 ` Corinna Vinschen [this message]
2021-11-30 20:38 ` Takashi Yano
2021-11-30 21:17 ` Takashi Yano
2021-12-06 9:53 ` Corinna Vinschen
2021-12-06 10:26 ` Takashi Yano
2021-12-01 12:05 ` Takashi Yano
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=YaY+pvLv14ewtjup@calimero.vinschen.de \
--to=vinschen@redhat.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).