mailing list of musl libc
 help / color / mirror / code / Atom feed
From: James Y Knight <jyknight@google.com>
To: musl@lists.openwall.com
Cc: "Ram Nalamothu (QUIC)" <quic_vnalamot@quicinc.com>
Subject: Re: [musl] Integer only print functions support in MUSL
Date: Thu, 13 Jun 2024 12:03:53 -0400	[thread overview]
Message-ID: <CAA2zVHqdwA9-ChOr-v3WLrUDiwZuTTsq5gs+CnuQMJpF_Mqwcw@mail.gmail.com> (raw)
In-Reply-To: <20240613010654.GV10433@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]

On Wed, Jun 12, 2024 at 9:06 PM Rich Felker <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.

[-- Attachment #2: Type: text/html, Size: 1554 bytes --]

  reply	other threads:[~2024-06-13 16:04 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 [this message]
2024-06-27  6:15     ` Ram Nalamothu (QUIC)

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=CAA2zVHqdwA9-ChOr-v3WLrUDiwZuTTsq5gs+CnuQMJpF_Mqwcw@mail.gmail.com \
    --to=jyknight@google.com \
    --cc=musl@lists.openwall.com \
    --cc=quic_vnalamot@quicinc.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).