This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] S/390: Do not raise inexact exception in lrint/lround functions in overflow case.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 15 Jan 2016 22:24:03 +0000
- Subject: Re: [PATCH] S/390: Do not raise inexact exception in lrint/lround functions in overflow case.
- Authentication-results: sourceware.org; auth=none
- References: <n7b1fe$eap$1 at ger dot gmane dot org>
On Fri, 15 Jan 2016, Stefan Liebler wrote:
> Hi,
>
> I get some math test-failures on s390 for float/double/ldouble for
> various lrint/lround functions like:
> lrint (0x1p64): Exception "Inexact" set
> lrint (-0x1p64): Exception "Inexact" set
> lround (0x1p64): Exception "Inexact" set
> lround (-0x1p64): Exception "Inexact" set
> ...
>
> GCC emits "convert to fixed" instructions for casting floating point
> values to integer values. These instructions raise invalid and inexact
> exceptions if the floating point value exceeds the integer type ranges.
>
> This patch enables the various FIX_DBL_LONG_CONVERT_OVERFLOW macros in
> order to avoid a cast from floating point to integer type and raise the
> invalid exception with feraiseexcept.
> The ldbl-128 rint/round functions are now using the same logic.
OK, given the usual bug filed in Bugzilla for a user-visible issue, listed
in the ChangeLog entry and marked as FIXED with the appropriate milestone
set when the fix is committed.
--
Joseph S. Myers
joseph@codesourcery.com