Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Question on performance



On 2010-10-11 09:36:58 -0500, Nate Hayes wrote:
> On most floating-point processors there is a hardware instruction to perform
> the comparision x != x, so this eliminates the overhead of a function call
> to a potentially more expensive software routine like isnan().

Note that this is just a lack of optimization. It's strange that
GCC doesn't replace isnan() by a test x != x (it knows how to do
such kind of things for other functions).

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)