Fix lrint, llrint missing exceptions close to overflow threshold (bug 19094) [committed]
Joseph Myers
joseph@codesourcery.com
Fri Oct 9 17:27:00 GMT 2015
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
More information about the Libc-alpha
mailing list