[llvm] r213883 - X86: correct library call setup for Windows itanium

Reid Kleckner rnk at google.com
Thu Jul 24 11:26:23 PDT 2014


On Thu, Jul 24, 2014 at 11:21 AM, Saleem Abdulrasool <compnerd at compnerd.org>
wrote:

> On Thu, Jul 24, 2014 at 11:13 AM, Reid Kleckner <rnk at google.com> wrote:
>
>> IMO we should flip the condition around, and add exceptions for Cygwin
>> and Mingw.  Something like:
>>   if (!T.isOSWindows() || T.isOSCygMing()) {
>>   }
>>
>> Most of the things here just don't exist on Windows, like gettimeofday
>> etc.  I consider the Visual C runtime to be the canonical C runtime, and it
>> doesn't provide the long double math helpers either.
>>
>
> The block sets the library calls as unavailable rather than available as
> they are considered available by default.  I think that making them
> unavailable by default makes it a slight bit less pleasant as they are only
> unavailable on Windows.  If it were being marked as available, then I would
> agree that it would be nicer to invert the condition.  Or am I
> misunderstanding something here?
>

Woops, I think I just did bad boolean logic.  See the updated condition
inline.


>
>
>> On Thu, Jul 24, 2014 at 10:46 AM, Saleem Abdulrasool <
>> compnerd at compnerd.org> wrote:
>>
>>> Author: compnerd
>>> Date: Thu Jul 24 12:46:36 2014
>>> New Revision: 213883
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=213883&view=rev
>>> Log:
>>> X86: correct library call setup for Windows itanium
>>>
>>> This target is identical to the Windows MSVC (and follows Microsoft ABI
>>> for C).
>>> Correct the library call setup for this target.  The same set of library
>>> calls
>>> are missing on this environment.
>>>
>>> Added:
>>>     llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll
>>> Modified:
>>>     llvm/trunk/lib/Target/TargetLibraryInfo.cpp
>>>
>>> Modified: llvm/trunk/lib/Target/TargetLibraryInfo.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLibraryInfo.cpp?rev=213883&r1=213882&r2=213883&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/lib/Target/TargetLibraryInfo.cpp (original)
>>> +++ llvm/trunk/lib/Target/TargetLibraryInfo.cpp Thu Jul 24 12:46:36 2014
>>> @@ -426,7 +426,7 @@ static void initialize(TargetLibraryInfo
>>>      TLI.setUnavailable(LibFunc::fiprintf);
>>>    }
>>>
>>> -  if (T.isKnownWindowsMSVCEnvironment()) {
>>> +  if (T.isKnownWindowsMSVCEnvironment() ||
>>> T.isWindowsItaniumEnvironment()) {
>>>
>>
Maybe if (T.isOSWindows() && !T.isOSCygMing()) here?


>      // Win32 does not support long double
>>>      TLI.setUnavailable(LibFunc::acosl);
>>>      TLI.setUnavailable(LibFunc::asinl);
>>>
>>> Added: llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll?rev=213883&view=auto
>>>
>>> ==============================================================================
>>> --- llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll (added)
>>> +++ llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll Thu Jul 24
>>> 12:46:36 2014
>>> @@ -0,0 +1,16 @@
>>> +; RUN: opt -mtriple i686-windows-itanium -O2 -o - %s | llvm-dis |
>>> FileCheck %s
>>> +
>>> +target triple = "i686-windows-itanium"
>>> +
>>> +declare dllimport double @floor(double)
>>> +
>>> +define dllexport float @test(float %f) {
>>> +  %conv = fpext float %f to double
>>> +  %call = tail call double @floor(double %conv)
>>> +  %cast = fptrunc double %call to float
>>> +  ret float %cast
>>> +}
>>> +
>>> +; CHECK-NOT: floorf
>>> +; CHECK: floor
>>> +
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>
>>
>
>
> --
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140724/e388e07f/attachment.html>


More information about the llvm-commits mailing list