This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv2 3/7] ldbl-128ibm-compat: Add tests for IBM long double functions
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 17 Feb 2020 22:24:27 +0000
- Subject: Re: [PATCHv2 3/7] ldbl-128ibm-compat: Add tests for IBM long double functions
- Ironport-sdr: BXgk6mYJJpkMWX2jJ8i2eg/xGWC13IPTwNKd2a/ZSlyCgY4wIWmIbuFyaojqo/ZMCiNjwME3N3 18TVTw2RTe8W2Z+nkZb2nltFM9Ch7jmFPsXiTAYSIr2bZ7fQPWL8RUdCuCT5zo1j9sdVQSYaG9 5/xADvUnGEtSxtz3woHQX759QJYwecqRbN9TjBtmHCWU8vgPfIBJhL43mJV8GvzoaKG/X5M+m4 JqsyL6xdnRTrtKWFMvtCEr3V+28RYpSFcjmf6EuM9n9hEcft2D5Eei9VPMxLqTni65MDVs9Uqm k4k=
- Ironport-sdr: GznM1aWzptgEluYnHPep4rUeiknYWKCwfzWdpManBliF7TW6WtEM01/ancQA62+HUc33oHGUwm T1Q2C8Pc4zgL//CoySnB0ORc6KzmyJjVrQzEL1A6mmm34fk7XBX/pv18LrsiYuFqlVfnsgRDE4 Li64uYQkJF+ZCp+Og/ZXczzMIzsqzfV2wl4iE5GF7TpvzTZb7c59M+CG7g3eLU2rJLSO2Lix6K m+HS8Z9udhg/rkM01dxLzGdBjHa3YiDOoVeHz4PuvYNZp5QIV6WNlew7fH2jlNqaQA3/1xQkZt tBw=
- References: <20200214161051.32579-4-murphyp@linux.vnet.ibm.com> <20200217220609.26623-1-murphyp@linux.vnet.ibm.com>
On Mon, 17 Feb 2020, Paul E. Murphy wrote:
> The reason for the awkward __LONG_DOUBLE_USES_FLOAT128 test is that GCC 7
> compilers can (and do via later patchsets) get invoked with
> "-mabi=ieeelongdouble" and without "-mfloat128". GCC 7 treats this
> as not having _Float128 and thereby __HAVE_DISTINCT_FLOAT128 == 0.
Why are you building without -mfloat128?
Normally, code built with GCC 7 can expect that, if long double has the
binary128 format, _Float128 is also available. Having powerpc64le (only)
break that invariant seems a bad idea. I think you should make sure that
__HAVE_FLOAT128 and __HAVE_DISTINCT_FLOAT128 both are defined to 1 (that
you compile with options causing them to be defined to 1) when building
any parts of glibc that use binary128, rather than working around them
being defined to 0.
> -#if FLT128_MANT_DIG == LDBL_MANT_DIG
> +/* __LONG_DOUBLE_USES_FLOAT128 is used instead of __HAVE_DISTINCT_FLOAT128
> + because GCC 7 compilers can support IEEE 128 long double without
> + outwardly supporting _Float128. When minimum GCC is raised to 8, this
> + check can be replaced. */
Any place where something can be simplified when the minimum GCC version
is increased should have a conditional using __GNUC_PREREQ, not just a
free-form comment; that's the only way we can effectively find all such
places when increasing the minimum GCC version.
> +/* _Float128 unconditionally redirects to lgamma. Ensure the ULPs do too. */
> +# define gamma lgamma
Rather than a hack like this, I think you should do one of the following:
* Just all the float128 ulps for gamma to the relevant libm-test-ulps
file.
* Properly implement ulps sharing in the libm-test machinery for all cases
where tests of more than one function use the same table of tests, and
update all libm-test-ulps files accordingly.
--
Joseph S. Myers
joseph@codesourcery.com