From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by sourceware.org (Postfix) with ESMTPS id 4232B3858D28 for ; Mon, 6 Dec 2021 10:26:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4232B3858D28 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from Express5800-S70 (z221123.dynamic.ppp.asahi-net.or.jp [110.4.221.123]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 1B6AQUi1007885 for ; Mon, 6 Dec 2021 19:26:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 1B6AQUi1007885 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1638786391; bh=ttskrE4eZSuHuRFyi43QMIXNHXDWcRDqGlHmgZ+H+8w=; h=Date:From:To:Subject:In-Reply-To:References:From; b=CM6M09/1kRf0Kodq7HGdyfX9SBXiJiUUo1Eq5GbBYkjoAipT6GBznsqknyOJpewV3 sZ1Mexof8CMO07LvpNvVoHFoJKbe4YIixcfxF+1ShOx0/rirrtuNsCHVSWyem6/+bA U9qskksBX99zrF7ERndg0gp2kpMw+IrjQppbcs9/KHjWAZFyx6YmNZtDQePp2oSe3O tNnHzratkivQ3X1FZp9VF0/qFLIByExv7xZBEnhxJX1HnBkxM9jGwXYT1mO78yBGEh 9vKj4CCaulmqxXfpOvhILCM1qHZUiy7idncCvOYpnJw59Nio5T0zv0k3nQEIgJpWag FJJvHz5jwL5YA== X-Nifty-SrcIP: [110.4.221.123] Date: Mon, 6 Dec 2021 19:26:32 +0900 From: Takashi Yano To: newlib@sourceware.org Subject: Re: gcc 11.1.0: printf("%.43f\n", 0x1.52f8a8e32e982p-140): printed value is incorrectly rounded Message-Id: <20211206192632.981a9c9b851e326f7b8fa3bb@nifty.ne.jp> In-Reply-To: References: <20211128164311.c405014bdf153aec8de46c6e@nifty.ne.jp> <20211128213839.90567fce0606267eb0362cc3@nifty.ne.jp> <20211128221646.4c6f751029f31af953565702@nifty.ne.jp> <20211129195646.c4f66449ff164a0c6bad4d2e@nifty.ne.jp> <20211129232439.ea273a79602b671f8b76383c@nifty.ne.jp> <20211130195156.4d8c0cec184743241c3c3146@nifty.ne.jp> <20211201053801.8da6ce82c350129c6e351669@nifty.ne.jp> <20211201061727.5842ffeba05694aa077a4fe0@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2021 10:26:51 -0000 On Mon, 6 Dec 2021 10:53:42 +0100 Corinna Vinschen wrote: > On Dec 1 06:17, Takashi Yano wrote: > > On Wed, 1 Dec 2021 05:38:01 +0900 > > Takashi Yano wrote: > > > On Tue, 30 Nov 2021 16:09:26 +0100 > > > Corinna Vinschen wrote: > > > > 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. > > > > > > Thanks for reviewing. > > > > > > > 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. > > > > > > Done. > > > > Removed gdtoa-dtoa.c, which almost duplicates dtoa.c. > > > > > > Could some people with other targets than Cygwin give this patch a try? > > > > RTEMS, anybody? > > > > > > I would appreciate it. > > Doesn't look like it, so please push, Takashi. OK, I'll push the patch. -- Takashi Yano