Message ID | 20240403121150.1018799-1-adhemerval.zanella@linaro.org |
---|---|
Headers | show |
Series | Improve rounding to interger function for C23 | expand |
On Wed, 3 Apr 2024, Adhemerval Zanella wrote: > As indicated by GCC documentation [1], ISO C23 does not allow that C > bindings ceil, floor, round, and trunc (in all floating point formats) > to raise inexact exceptions (different than ISO C99/C11 where this is > allowed). > > A recent MIPS patch to used some arch-specific instructions raised this > issue [1] and it was not caught because there was no proper testing. By > adding the missing tests, some implementations do indeed raise inexact > exceptions. There is testing that, in the terminology used by IEEE 754, the operations do not raise the exception flag (the result of default exception handling when the exception is signaled). This is done through NO_INEXACT_EXCEPTION in libm-test-*.inc. What is not tested is specifically quality of implementation when exception traps are enabled (a GNU extension outside the scope of the C standard). I think that as a user-visible fix, there should be a bug filed in Bugzilla for this issue (that can then be marked FIXED so it goes in the automatically generated list of bugs fixed in the next release).
On 03/04/24 12:03, Joseph Myers wrote: > On Wed, 3 Apr 2024, Adhemerval Zanella wrote: > >> As indicated by GCC documentation [1], ISO C23 does not allow that C >> bindings ceil, floor, round, and trunc (in all floating point formats) >> to raise inexact exceptions (different than ISO C99/C11 where this is >> allowed). >> >> A recent MIPS patch to used some arch-specific instructions raised this >> issue [1] and it was not caught because there was no proper testing. By >> adding the missing tests, some implementations do indeed raise inexact >> exceptions. > > There is testing that, in the terminology used by IEEE 754, the operations > do not raise the exception flag (the result of default exception handling > when the exception is signaled). This is done through > NO_INEXACT_EXCEPTION in libm-test-*.inc. > > What is not tested is specifically quality of implementation when > exception traps are enabled (a GNU extension outside the scope of the C > standard). Ack, I will add that we are now testing for exception traps. > > I think that as a user-visible fix, there should be a bug filed in > Bugzilla for this issue (that can then be marked FIXED so it goes in the > automatically generated list of bugs fixed in the next release). > Alright, I open bug for the x86 issues.
Dear Adhemerval, since nobody seems to have noticed, please fix the subject of this thread: interger -> integer. Paul