From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 5F3DF29536 for ; Thu, 13 Jun 2024 18:04:37 +0200 (CEST) Received: (qmail 28146 invoked by uid 550); 13 Jun 2024 16:04:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 28102 invoked from network); 13 Jun 2024 16:04:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718294663; x=1718899463; darn=lists.openwall.com; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IFGsHlV8MA9okxXMEefUNCYHIWUR46ayAbtTlW7/bjg=; b=TGOA+lerpgr+Phri8dBvaptWrlZ1zx/3zafDkOkF7ujPaiqNe7qimCAV6kiib+kj4a Qih9vvE0vT2fMEcLN4WsB8pBp2f0W6+2Ydj+xtbOfA/k+65+urN7fT86qNHLJQvWrSAa xlRdmhiM187gkzjZRThU/SrpieIy1QMR0INAEYzMv3TRrVNi4fuu0ogHiPJmrTMJvFFl +6U4gufmsHdq8AwutnlAA0e4oPLqGTrgscCnxIYKUoZetkkO/+NIORvryAPHRjzY3Pgr Q/FKmYMz5NxJ/YaHHXC43f1XMA8322QTIntEMmZ/Xs1PBhv1mcSopEm8sEeqXWcuW/G6 HfBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718294663; x=1718899463; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IFGsHlV8MA9okxXMEefUNCYHIWUR46ayAbtTlW7/bjg=; b=opcUvGP/kichIG9by4yAmLfsL2+uptysjJYbiUTo7u8HA/eD7Cwr96pWqYF8lG0zKs ackrZM4A7dd1H1nl6OBZ9VuiM2rnbB60xsvoskL3OwseefgpgsUJhM/nwY1mKhugzrr6 vSw/7sL7Lq6RLmSIZDVun1DuO0ADUJOZ0AuQB4brlTTT9uNgPK3XL1dRqG6F3I+LN3Hz vKjX/Zv318GbuTptXHhAKummy2t/99d0QaHgvyP0tNUSLobGE7jgNx2MjMDZ7s1Kwq7G SuJyfkGQOBuhZ2eKPzcCf5/7zjuyFJdATr+CldvRWBrDKcndArZoNwab4HTb3eimFzfd aOsg== X-Gm-Message-State: AOJu0Yy/FMMZUCgI4foWtDDLhhn640uBJFY66Ih9E9IfdTa/x2lsrPVd 7k5LVcENloa6E/HG4O+S0EtZIKQOx8P5arqC4aX6Gy81pfSjbBQlviKl9luslvMIy6D+tXS8YxX I5ssg0gUBhn7SMdz0sC12Q1QmMgOtRHmQI3aekHA5IAqQFKNq3MRw X-Google-Smtp-Source: AGHT+IHikqLjjPW+MrslToBvql0mAoaWwPRh4jT4yLwr/83Ua3g37w1CERmBMaBneTq534QXgFzLKx9CyJp9NAyrIfI= X-Received: by 2002:a05:622a:114b:b0:441:5f28:1e91 with SMTP id d75a77b69052e-441e226ac43mr3273111cf.5.1718294662475; Thu, 13 Jun 2024 09:04:22 -0700 (PDT) MIME-Version: 1.0 References: <20240613010654.GV10433@brightrain.aerifal.cx> In-Reply-To: <20240613010654.GV10433@brightrain.aerifal.cx> From: James Y Knight Date: Thu, 13 Jun 2024 12:03:53 -0400 Message-ID: To: musl@lists.openwall.com Cc: "Ram Nalamothu (QUIC)" Content-Type: multipart/alternative; boundary="000000000000fa6189061ac7a690" Subject: Re: [musl] Integer only print functions support in MUSL --000000000000fa6189061ac7a690 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 12, 2024 at 9:06=E2=80=AFPM Rich Felker 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. --000000000000fa6189061ac7a690 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jun 12, 2024 at 9:06=E2=80=AFPM R= ich Felker <dalias@libc.org> w= rote:
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= =C2=A0produces a 14450-byte output file.

Adding a = call to `printf("%d\n", 0)` (which is optimized to a call to ipri= ntf by the compiler):
=C2=A0 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 'dou= ble' precision output:
=C2=A0 increases output size by 84= 13 bytes (2644 bytes more than the iprintf version).
Adding a call to `printf("%f\n", 0.0)`, usi= ng "-s PRINTF_LONG_DOUBLE" config option (thus enabling printf su= pport for proper output of a 128-bit 'long double' type):
=C2=A0 increases output size by 13067 bytes (7298 above the iprintf versio= n).

The 128-bit long double uses a soft-float implementation.
--000000000000fa6189061ac7a690--