Hello,
I'm searching for an efficient way to detect Not a Number values on my Omap L138 platform.
Using the "isnan" library function generates very slow code as a function call is generated which prevents the compiler from pipelining my loop.
A look into the implementation of the isnan function shows that it is coded as return (volatile)x != (volatile)x, rather interesting but correct according to the IEEE754 rules. And ideed, the corresponding CMPEQSP functions correctly. The problem is now, that if I declare an inlinable function (not declaring x volatile, because this obviously kills my effort to speed it up):
inline int myisnan(x)
{return(x != x);
}
the compiler optimizes away the comparision (which it assumes always to be false, though this is NOT correct in case of a NaN!!!).
I did not find any way to include the correct assembler command CMPEQSP in my c code! (no intrinsic, no way to wire the registers correctly with inline assembly)
Does anybody know how I can instanciate CMPEQSP for an efficient, pipelinable NaN detection?
I'm using CC3.3, CG tools 6.1.20
Thanks
Christoph