This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libm-test: switching the error handling behavior


On Thu, 4 Apr 2013, Thomas Schwinge wrote:

> Hi!
> 
> The libm-test infrastructure currently doesn't allow for switching to a
> non-default (that is, non-POSIX) error handling behavior.  Doing so is

Really the tests should be run for all error-handling modes, rather than 
annotating individual tests to run in a different mode (see the wiki todo 
list).

> Per math/Makefile:CPPFLAGS-s_lib_version.c, the default is POSIX, and
> <math.h> also allows for switching to SVID, XOPEN, ISOC.
> 
> math/math.h:
>     /* This variable can be changed at run-time to any of the values above to
>        affect floating point error handling behavior (it may also be necessary
>        to change the hardware FPU exception settings).  */
>     extern _LIB_VERSION_TYPE _LIB_VERSION;
> 
> How to address the part of the comment suggesting that we might have to
> change the hardware FPU exception settings?  A few architectures define

It seems completely orthogonal to me.  For modes that are defined to 
involve signaling exceptions (which I guess is everything except maybe 
_SVID_, although the error-handling modes aren't exactly well-defined or 
documented), the question of whether signaling an exception generates a 
signal or just raises the corresponding exception flag is orthogonal to 
what mode is in use at all.

There are lots of different _LIB_VERSION checks, but the main use appears 
to be avoiding the __kernel_standard / errno-setting code altogether for 
_IEEE_, and then avoiding __kernel_standard calling matherr in the _POSIX_ 
case.  (Maybe the checks should use better-defined internal macros to say 
what logical property is being tested rather than directly checking 
_LIB_VERSION everywhere.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]