I have some questions about decimal floating point ("dfp")
support, specifically the new _Decimal32, _Decimal64, and
_Decimal128 types introduced in C23. I'm hoping to talk to
someone familiar with their implementation in gcc.
If nothing else, I want to say, Thank you! Implementing decimal
floating point must have been a ton of not-immediately-rewarding
work, and I'm impressed that it has been completed already.
(I suppose there was experimental work already being performed
in advance of C23's ratification.)
What's disappointing, however -- and no fault of gcc's -- is that
it's difficult to actually usefully *use* the decimal floating
point types. As far as I know you can assign them, and add and
subtract them, and multiply and divide them, but you can't call
scanf or strtod64 to get one into your program, or printf to
print one back out -- because glibc doesn't support them yet.
(And then there are considerably thornier problems if you want to
be able to use decimal versions of all the <math.h> functions.)
I guess anyone who wants to start using the decimal types
with gcc today has to separately download and install libdfp
(https://github.com/libdfp/libdfp), which though a valiant
effort, is still a separate project, and unavoidably somewhat
incomplete.
So I have an interest -- it may be foolhardy -- in trying to
get some decent decimal floating point support built natively
into glibc. However, the folks on the glibc mailing list have
suggested that coordination -- closer than I had imagined --
with gcc might be necessary. Specifically, they're concerned
about correct rounding, and user-settable rounding modes, and
libgcc, and related issues.
I'm not going to plough ahead with those questions just now --
I'm not necessarily conversant enough on some of the issues to
even present them intelligibly -- but I would like to start a
dialog with any gcc maintainers who have an interest in dfp.
I'm guessing the library problem has been thought about;
I suspect there are probably plans or at least ideas for how
dfp might best be supported in the library. So if you have
any knowledge of those plans, and some time to discuss them,
please let me know, because I'd like to help figure out how
to get decimal floating point better supported, if possible.
Steve Summit
[email protected]