[cfe-dev] __builtin_nan support

Nate Begeman natebegeman at mac.com
Mon May 19 11:02:45 PDT 2008

Attached patch implements __builtin_nan, __builtin_nanf, and  
__builtin_nanl.  When given a string literal as an argument, the  
expression becomes an FP literal that is a quiet NaN with the  
appropriate significand.  When the argument is not a string literal,  
we let the code for  handling builtin math library functions just turn  
the builtin into a call to the appropriate libm nan()/nanf()/nanl()  
call, which performs the same conversion.  This behavior is similar to  
GCC, although I believe GCC's __builtin_nan does not call nan() if the  
argument is not a string literal.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: builtin_nan.patch
Type: application/octet-stream
Size: 3745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080519/e8ca4c07/attachment.obj>
-------------- next part --------------

More information about the cfe-dev mailing list