On Wed, Jan 27, 2021 at 09:11:49PM -0600, Segher Boessenkool wrote:
> On Tue, Jan 26, 2021 at 06:43:06PM -0500, Michael Meissner wrote:
> > I posted this patch on January 14th, 2021:
> > https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563498.html
> > 
> > | Date: Thu, 14 Jan 2021 12:09:36 -0500
> > | Subject: [PATCH] PowerPC: Add float128/Decimal conversions.
> > | Message-ID: <20210114170936.ga3...@ibm-toto.the-meissners.org>
> > 
> > You had a question about what changed, and I replied:
> > 
> > | In your last message, you said that it was unacceptable that the 
> > conversion
> > | fails if the user uses an old GLIBC.  So I rewrote the code using weak
> > | references.  If the user has at least GLIBC 2.32, it will use the IEEE 
> > 128-bit
> > | string support in the library.
> > |
> > | If an older GLIBC is used, I then use the IBM 128-bit format as an 
> > intermediate
> > | value.  Obviously there are cases where IEEE 128-bit can hold values that 
> > IBM
> > | 128-bit can't (mostly due to the increased exponent range in IEEE 
> > 128-bit), but
> > | it at least does the conversion for the numbers in the common range.
> > |
> > | In doing this transformation, I needed to do minor edits to the main 
> > decimal
> > | to/from binary conversion functions to allow the KF functions to be 
> > declared.
> > | Previously, I used preprocessor magic to rename the functions.
> > 
> > This is the second most important patch in the IEEE 128-bit work.  What do I
> > need to do to be able to commit the patch?
> 
> The whole thread is at 
> https://patchwork.ozlabs.org/project/gcc/patch/20201120000524.ga...@ibm-toto.the-meissners.org/
>  .
> 
> I approved *that* version of the patch.

Yes you approved the built-in renaming patch and I checked in the patch that
you approved (rather than the modifications that I submitted).

However, this is about the second patch (that provides conversions between
_Float128 and Decimal), which as far as I can tell was not approved.  That is
what this particular question is about.

You did not like the previous _Float128 <-> Decimal conversion patch because it
was tied into having a minimum GLIBC version.

So, I rewrote the whole patch so that it will work with older GLIBC's.

If you have a newer GLIBC (detected at runtime via a weak reference), it uses
the support functions in the new GLIBC to do the conversion.  I had a cut+paste
error in the original patch that I resubmitted, and I resubmitted with the
changed line.

If you have an older GLIBC and want to convert _Float128 to one of the Decimal
types, it will convert the _Float128 to __ibm128 and then convert that to
Decimal.

Similarly if you have one of the Decimal types, and want to convert to
_Float128, it will first convert the Decimal type to __ibm128, and then convert
__ibm128 to _Float128.

So what do I do?  Can I check in this patch or do I need to do further
modifications.

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

Reply via email to