From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31006 invoked from network); 18 Aug 2022 15:51:53 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 18 Aug 2022 15:51:53 -0000 Received: (qmail 23945 invoked by uid 550); 18 Aug 2022 15:51:50 -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 23907 invoked from network); 18 Aug 2022 15:51:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc; bh=RF+zxxeLPahWHrzQ2wLV5N9l1ydkvst8GpqfKXnWUMk=; b=QGX0PTanL24I8qMvcEBKZO1LUkMs96VmTuI3uAwNxktfD1Bb5/P0H4b0Z1rFPlzosC w7oc+Fr/Am36wXXpEwp9WtgdTzohfVvJvkJ5VklObijAdgwpJzVJz//JGSgVds9CPjUj tqimgSYhu32GD7G7oDG1bmtjKPMx6eQ9ydSxF3o+yMlzp6PWBdnRLsCtUwGkxijKe8wU 5C+fR16cyR9SchIs6WwvsTEYoPFZZw7l6Rc6JB7QR3pI4ho+leFwrJVlrzIh/gJMzJoT jc3qC3cKj8hAKOGJY9/6NBUHjBntxOXqJdJAC6IE5Zvb9H6dUjRg+sD4hfIkmoFgqskw kZxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc; bh=RF+zxxeLPahWHrzQ2wLV5N9l1ydkvst8GpqfKXnWUMk=; b=dYJwhZ0wL4vN5cRZaHLKHQjZ1EhHKOs15ORz0ZjywPcSqWOF92GULGpT12YubMg6T4 R0x6u8v3VcqMimCUdUUhw2IMBEd3q+6AfqATDV0deHC2itashQfMprbAKC6Sqaw7mLVX +EtVlwlb1ZNhZnGt17hTsQaPUScZMeD6yFjd0bTOcZeRMx7fz3Xxk8Ppi8tgDnyiRd4L tP5SHHAurXyHleA4RLyijeEOGBEk+/iWLB/tjFrwJZYQo60QgE7hg/MfWp9O/ERlXEul SKY8UwlKzhRf1Wc3S79UMoVRclk/6lTcraDhCAVV6cmOSXnnNngMbdyTG2uy+X/w4aj2 CFqw== X-Gm-Message-State: ACgBeo00f3lwWb1ncI4M0dYZM5Vqca6FhdmYMTiby/Ycgduy+571S/gM sGeHxv5vddoDIFsP/4bG50SeK6Gf72HLsguJbRY3VGi4 X-Google-Smtp-Source: AA6agR7hNmh5rABxSfo7OfFSfCrehghqAhVc7VX64n01KXtyuKguCCiU2ZSVA86wsbGCLsw/AwCsHJp2NYgCkitGweU= X-Received: by 2002:a92:cda4:0:b0:2e5:c5e4:5cb7 with SMTP id g4-20020a92cda4000000b002e5c5e45cb7mr1736536ild.12.1660837897766; Thu, 18 Aug 2022 08:51:37 -0700 (PDT) MIME-Version: 1.0 From: ardi Date: Thu, 18 Aug 2022 17:51:26 +0200 Message-ID: To: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [musl] Do you recommend using fmt_fp() and Hi, I'm looking for a small and robust dtoa-like implementation for quad floats (IEEE binary128). The need is because I'm using John Hauser's SoftFloat for IEEE binary128 computing, but I have no easy means for converting such floats from/to strings (I can use the host printf/strtold for 80bit extended long doubles, but I'm missing some significant digits by doing that, and besides, if I ever build in a host that considers long doubles as regular doubles, I'd lose even more digits). I've been considering gdtoa for some days, taking into account its pros and cons, but I don't like its code size, its dependency on the FPU flavour behaviour, and that it requires mutexes if it's used in parallel. So, I was looking at how musl does this. It appears to be in the fmt_fp() function in vfprintf.c and in floatscan.c It looks like I can modify these functions and force them to use the binary128 type as provided by SoftFloat, instead of using long double. But it can require quite a bit of surgery, so, before I get my hands busy in it, I have to ask the question: Would you use this implementation for my needs if you were me? Did you adapt fmt_fp() and floatscan from older code? Was that code ready for 128bit floats? Or maybe you can recommend another dtoa-like code for 128bit floats? Thanks a lot, C=C3=A9sar