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

Saleem Abdulrasool compnerd at compnerd.org
Thu Jul 24 11:23:57 PDT 2014


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()) {
>      // 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
> +
>

Bill, could you please merge this to the 3.5 branch as it effects code
generation correctness?  It should be safe as it is tied explicitly to a
single target.


>
> _______________________________________________
> 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/8e49c61b/attachment.html>


More information about the llvm-commits mailing list