On Wed, Oct 28, 2020 at 07:04:31PM -0500, Segher Boessenkool wrote: > On Thu, Oct 22, 2020 at 06:06:03PM -0400, Michael Meissner wrote: > > This patch adds the various decimal to/from IEEE 128-bit conversions. I > > had to make some changes to the infrastructure, since that infrastructure > > assumed that there is a sprintf/scanf format modifier to convert floating > > point. Instead, I used to str* conversion functions. > > > --- /dev/null > > +++ b/libgcc/config/rs6000/_dd_to_kf.c > > > +/* Decimal64 -> _Float128 conversion. */ > > +#define FINE_GRAINED_LIBRARIES 1 > > This isn't defined in any other source file (instead, it is put in the > Makefile). Why should it be different here?
I'll check it out. > > +# Force the TF mode to/from decimal functions to be compiled with IBM long > > +# double. Add building the KF mode to/from decimal conversions with > > explict > > (typo, "explicit") > > > +#if HAVE_KF_MODE > > + strfromf128 (buf, BUFMAX, BFP_FMT, (BFP_VIA_TYPE) x); > > +#else > > sprintf (buf, BFP_FMT, (BFP_VIA_TYPE) x); > > +#endif > > Does strfromf128 exist everywhere we build this? It isn't a standard > function. Yes, it is in ISO/IEC TS 18661-3, which is the document that describes most of the *f128 functions. We have to use str* instead of sprintf or scanf, because I don't believe their is a float128 format specifier. > > +/* Support PowerPC KF mode, which is __float128 when long double is > > + IBM extended double. */ > > +#if defined (L_sd_to_kf) || defined (L_dd_to_kf) || defined (L_td_to_kf) \ > > + || defined (L_kf_to_sd) || defined (L_kf_to_dd) || defined (L_kf_to_td) > > +#define HAVE_KF_MODE 1 > > +#endif > > This might want a better name, other targets can have a KFmode as well, > for some completely different purpose, since it is not a standard mode. Given everything else uses *F, including XF on the x86, I figured it was easier than creating a new name. > (Some libgcc maintainer needs to approve the generic parts, not all of > it can obviously only trigger for us.) > > > Segher -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797