This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix lrint, llrint missing exceptions close to overflow threshold (bug 19094) [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 9 Oct 2015 17:27:03 +0000
- Subject: Re: Fix lrint, llrint missing exceptions close to overflow threshold (bug 19094) [committed]
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1510082218100 dot 8465 at digraph dot polyomino dot org dot uk> <CAMe9rOokzEeEpQQ7XTjaVT0bbVyUwPEJL5BQmx+WzwrMTu_-iQ at mail dot gmail dot com>
On Fri, 9 Oct 2015, H.J. Lu wrote:
> testing double (without inline functions)
> Failure: lrint (0x1p31): Exception "Invalid operation" not set
[...]
>
> on x32. Do you know why?
The x86_64 versions of lrint / lrintf / lrintl are aliases for the long
long versions. This isn't correct for x32, where exceptions must respect
overflow for 32-bit long. I think you need to write separate versions of
the long functions for x32 that convert to 32-bit long and raise the right
exceptions for that conversion, while keeping the aliases in the non-x32
case.
--
Joseph S. Myers
joseph@codesourcery.com