[llvm] r213477 - SIISelLowering.cpp: Define _USE_MATH_DEFINES to let M_PI provided on MS <cmath>.

Eric Christopher echristo at gmail.com
Mon Jul 21 14:35:26 PDT 2014


Mmm.. I don't think there because it's not related to our floating
point implementation. I suggested DataTypes since it's a bit of an
overarching file containing types, but past that I don't think we've
got much of a "I needed this here".

Definitely don't need to ifdef it on msc_ver though.

-eric

On Mon, Jul 21, 2014 at 2:12 PM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
> Since M_PI is related to codegen, I may suggest M_PI (and other math
> constants) stuff might be sunk into APFloat.
>
> 2014-07-22 5:59 GMT+09:00 Eric Christopher <echristo at gmail.com>:
>> On Sun, Jul 20, 2014 at 4:15 AM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
>>> Author: chapuni
>>> Date: Sun Jul 20 06:15:07 2014
>>> New Revision: 213477
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=213477&view=rev
>>> Log:
>>> SIISelLowering.cpp: Define _USE_MATH_DEFINES to let M_PI provided on MS <cmath>.
>>>
>>> FIXME: Would it be better to move it into configure?
>>>
>>
>> Poossibly, but as a note DataTypes.h also includes cmath and could
>> probably do the define there as well since it'll work on most
>> platforms (though newer linux systems don't need the define).
>>
>> -eric
>>
>>> Modified:
>>>     llvm/trunk/lib/Target/R600/SIISelLowering.cpp
>>>
>>> Modified: llvm/trunk/lib/Target/R600/SIISelLowering.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIISelLowering.cpp?rev=213477&r1=213476&r2=213477&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/Target/R600/SIISelLowering.cpp (original)
>>> +++ llvm/trunk/lib/Target/R600/SIISelLowering.cpp Sun Jul 20 06:15:07 2014
>>> @@ -12,6 +12,12 @@
>>>  //
>>>  //===----------------------------------------------------------------------===//
>>>
>>> +#ifdef _MSC_VER
>>> +// Provide M_PI.
>>> +#define _USE_MATH_DEFINES
>>> +#include <cmath>
>>> +#endif
>>> +
>>>  #include "SIISelLowering.h"
>>>  #include "AMDGPU.h"
>>>  #include "AMDGPUIntrinsicInfo.h"
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list