[llvm-commits] [llvm] r72606 - in /llvm/trunk: include/llvm/ADT/APFloat.h lib/Support/APFloat.cpp

Dale Johannesen dalej at apple.com
Mon Jun 1 11:31:37 PDT 2009


On Jun 1, 2009, at 11:11 AMPDT, Mike Stump wrote:

> On Jun 1, 2009, at 11:05 AM, Dale Johannesen wrote:
>> On May 29, 2009, at 8:49 PMPDT, Mike Stump wrote:
>> What problem are you trying to solve with this?  I'm skeptical this  
>> is
>> a good idea.
>
> You gotta love standards:
>
>   http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Other-Builtins.html#index-g_t_005f_005fbuiltin_005fnan-2885
>
> so many fun and interesting bits.


Apparently you're trying to support the builtin_nan functions.  Those  
allow the user to specify only the significand.  How exactly does this  
relate to your "type" operand (which obviously has nothing to do with  
types, whatever it might be)?  Is the caller supposed to do the  
truncation to the significand size, or are you expecting APFloat to do  
this?  Please document better.

I'm not sure modifying makeNaN is a good way to do this; that was  
intended for cases where the caller doesn't know, or care, what the  
exact representation might be,  i.e. the callee is supposed to  
choose.  That's not the same thing as having a default argument; that  
is still the caller choosing.   The end result is the same, though, so  
this is probably OK in principle.





More information about the llvm-commits mailing list