<div dir="ltr">On Thu, Jul 24, 2014 at 11:13 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">IMO we should flip the condition around, and add exceptions for Cygwin and Mingw.  Something like:<div>  if (!T.isOSWindows() || T.isOSCygMing()) {<br>  }</div><div class="gmail_extra"><br></div><div class="gmail_extra">

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.</div></div></blockquote>
<div><br></div><div>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?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="h5"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 24, 2014 at 10:46 AM, Saleem Abdulrasool <span dir="ltr"><<a href="mailto:compnerd@compnerd.org" target="_blank">compnerd@compnerd.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: compnerd<br>
Date: Thu Jul 24 12:46:36 2014<br>
New Revision: 213883<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=213883&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=213883&view=rev</a><br>
Log:<br>
X86: correct library call setup for Windows itanium<br>
<br>
This target is identical to the Windows MSVC (and follows Microsoft ABI for C).<br>
Correct the library call setup for this target.  The same set of library calls<br>
are missing on this environment.<br>
<br>
Added:<br>
    llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll<br>
Modified:<br>
    llvm/trunk/lib/Target/TargetLibraryInfo.cpp<br>
<br>
Modified: llvm/trunk/lib/Target/TargetLibraryInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLibraryInfo.cpp?rev=213883&r1=213882&r2=213883&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLibraryInfo.cpp?rev=213883&r1=213882&r2=213883&view=diff</a><br>


==============================================================================<br>
--- llvm/trunk/lib/Target/TargetLibraryInfo.cpp (original)<br>
+++ llvm/trunk/lib/Target/TargetLibraryInfo.cpp Thu Jul 24 12:46:36 2014<br>
@@ -426,7 +426,7 @@ static void initialize(TargetLibraryInfo<br>
     TLI.setUnavailable(LibFunc::fiprintf);<br>
   }<br>
<br>
-  if (T.isKnownWindowsMSVCEnvironment()) {<br>
+  if (T.isKnownWindowsMSVCEnvironment() || T.isWindowsItaniumEnvironment()) {<br>
     // Win32 does not support long double<br>
     TLI.setUnavailable(LibFunc::acosl);<br>
     TLI.setUnavailable(LibFunc::asinl);<br>
<br>
Added: llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll?rev=213883&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll?rev=213883&view=auto</a><br>


==============================================================================<br>
--- llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll (added)<br>
+++ llvm/trunk/test/MC/X86/x86-windows-itanium-libcalls.ll Thu Jul 24 12:46:36 2014<br>
@@ -0,0 +1,16 @@<br>
+; RUN: opt -mtriple i686-windows-itanium -O2 -o - %s | llvm-dis | FileCheck %s<br>
+<br>
+target triple = "i686-windows-itanium"<br>
+<br>
+declare dllimport double @floor(double)<br>
+<br>
+define dllexport float @test(float %f) {<br>
+  %conv = fpext float %f to double<br>
+  %call = tail call double @floor(double %conv)<br>
+  %cast = fptrunc double %call to float<br>
+  ret float %cast<br>
+}<br>
+<br>
+; CHECK-NOT: floorf<br>
+; CHECK: floor<br>
+<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>