[llvm] r187314 - [APFloat] Make all arithmetic operations with NaN produce positive NaNs.

Owen Anderson resistor at mac.com
Sun Jul 28 14:06:20 PDT 2013


On Jul 27, 2013, at 2:49 PM, Michael Gottesman <mgottesman at apple.com> wrote:

> Author: mgottesman
> Date: Sat Jul 27 16:49:25 2013
> New Revision: 187314
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=187314&view=rev
> Log:
> [APFloat] Make all arithmetic operations with NaN produce positive NaNs.
> 
> IEEE-754R 1.4 Exclusions states that IEEE-754R does not specify the
> interpretation of the sign of NaNs. In order to remove an irrelevant
> variable that most floating point implementations do not use,
> standardize add, sub, mul, div, mod so that operating anything with
> NaN always yields a positive NaN.
> 
> In a later commit I am going to update the APIs for creating NaNs so
> that one can not even create a negative NaN.

Is this actually desirable?  It seems that we still need to be able to create negative NaNs, for example when bitcasting integers to floats.

--Owen



More information about the llvm-commits mailing list