Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: 
 <DM5PR02MB36393EC2358E084CDBD77D3AF0D72@DM5PR02MB3639.namprd02.prod.outlook.com>
Date: Thu, 27 Jun 2024 06:15:08 +0000
From: "Ram Nalamothu (QUIC)" <quic_vnalamot@...cinc.com>
To: James Y Knight <jyknight@...gle.com>,
        "musl@...ts.openwall.com"
	<musl@...ts.openwall.com>
CC: Ana Pazos <apazos@...cinc.com>
Subject: RE: Integer only print functions support in MUSL

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@...gle.com> 
Sent: Thursday, June 13, 2024 9:34 PM
To: musl@...ts.openwall.com
Cc: Ram Nalamothu (QUIC) <quic_vnalamot@...cinc.com>
Subject: Re: [musl] Integer only print functions support in MUSL

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.