On 11/15/2011 08:16 AM, Steve Ellcey wrote: > On Mon, 2011-11-14 at 17:49 -0800, Dror Maydan wrote: > This is done to set errno. If the sqrt instruction returns a NaN, then > the library function is called to make sure that errno is set correctly > for the error that occurred. > >> Seems like a pretty high performance penalty for this behavior. > The assumption is that errors will not happen very often. Sure, but there is still a performance penalty just for doing the test; it's hard to effectively software pipeline such loops.
It seemed a bit strange to me since there is a hardware exception handling mechanism that is supposed to handle error cases. If I do a "man math_error" on Linux, it seems to imply that the standards allow the use of the floating-point exception mechanism rather than errno. In any event, I understand the background. Thanks, Dror >> Dror >> >> PS gcc seems to do the same thing > It can be turned off for GCC (and probably open64) with -fno-math-errno. > > Steve Ellcey > s...@cup.hp.com > ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel