Hi Dror,

Did you try with the -fno-math-errno flag??

I know the stuff documented in the math_error manpage. But in the end the 
compiler still needs to generate code that handles older programs that use 
errno.


The fetestexcept() library routine uses the x86 fnstsw & SSE stmxcsr 
instructions to get the FPU status. The processor itself does not know anything 
about the errno variable, which is a memory location that is not more special 
than another else in the address space of the program.

Rayson

=================================
Grid Engine / Open Grid Scheduler
http://gridscheduler.sourceforge.net/

Scalable Grid Engine Support Program
http://www.scalablelogic.com/






----- Original Message -----
From: Dror Maydan <may...@tensilica.com>
To: "s...@cup.hp.com" <s...@cup.hp.com>
Cc: "open64-devel@lists.sourceforge.net" <open64-devel@lists.sourceforge.net>
Sent: Tuesday, November 15, 2011 11:55 AM
Subject: Re: [Open64-devel] sqrtf

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


------------------------------------------------------------------------------
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

Reply via email to