From: "Ram Nalamothu (QUIC)" <quic_vnalamot@quicinc.com>
To: James Y Knight <jyknight@google.com>,
"musl@lists.openwall.com" <musl@lists.openwall.com>
Cc: Ana Pazos <apazos@quicinc.com>
Subject: RE: [musl] Integer only print functions support in MUSL
Date: Thu, 27 Jun 2024 06:15:08 +0000 [thread overview]
Message-ID: <DM5PR02MB36393EC2358E084CDBD77D3AF0D72@DM5PR02MB3639.namprd02.prod.outlook.com> (raw)
In-Reply-To: <CAA2zVHqdwA9-ChOr-v3WLrUDiwZuTTsq5gs+CnuQMJpF_Mqwcw@mail.gmail.com>
Thank you, Markus and Rich, for your comments.
James, thanks for providing those code size numbers.
We can consider submitting patches towards non-float printf support if the community's stand were to change in future.
From: James Y Knight <jyknight@google.com>
Sent: Thursday, June 13, 2024 9:34 PM
To: musl@lists.openwall.com
Cc: Ram Nalamothu (QUIC) <quic_vnalamot@quicinc.com>
Subject: Re: [musl] Integer only print functions support in MUSL
On Wed, Jun 12, 2024 at 9:06 PM Rich Felker <mailto:dalias@libc.org> wrote:
But to get back to the point, on archs that are hard-float and don't
have an oversized soft-only long double, the size of the floating
point code in printf is around 6k.
Indeed. A particular example small emscripten program which doesn't call printf produces a 14450-byte output file.
Adding a call to `printf("%d\n", 0)` (which is optimized to a call to iprintf by the compiler):
increases output size by 5769 bytes.
Adding a call to `printf("%f\n", 0.0)`, using the default emscripten printf, which has been modified to only support 'double' precision output:
increases output size by 8413 bytes (2644 bytes more than the iprintf version).
Adding a call to `printf("%f\n", 0.0)`, using "-s PRINTF_LONG_DOUBLE" config option (thus enabling printf support for proper output of a 128-bit 'long double' type):
increases output size by 13067 bytes (7298 above the iprintf version).
The 128-bit long double uses a soft-float implementation.
prev parent reply other threads:[~2024-06-27 6:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 17:29 Ram Nalamothu (QUIC)
2024-06-12 18:56 ` Markus Wichmann
2024-06-12 19:21 ` James Y Knight
2024-06-13 1:06 ` Rich Felker
2024-06-13 16:03 ` James Y Knight
2024-06-27 6:15 ` Ram Nalamothu (QUIC) [this message]
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=DM5PR02MB36393EC2358E084CDBD77D3AF0D72@DM5PR02MB3639.namprd02.prod.outlook.com \
--to=quic_vnalamot@quicinc.com \
--cc=apazos@quicinc.com \
--cc=jyknight@google.com \
--cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).