mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Do you recommend using fmt_fp() and
@ 2022-08-18 15:51 ardi
  2022-08-19  3:19 ` Rich Felker
  0 siblings, 1 reply; 9+ messages in thread
From: ardi @ 2022-08-18 15:51 UTC (permalink / raw)
  To: musl

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ésar

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-09-05  8:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 15:51 [musl] Do you recommend using fmt_fp() and ardi
2022-08-19  3:19 ` Rich Felker
2022-08-23 17:00   ` ardi
2022-08-23 17:30     ` Rich Felker
2022-08-30 10:17       ` ardi
2022-08-30 12:26         ` Rich Felker
2022-09-04 19:52           ` ardi
2022-09-04 21:59             ` Rich Felker
2022-09-05  8:49               ` ardi

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).