[llvm] r213883 - X86: correct library call setup for Windows itanium
Saleem Abdulrasool
compnerd at compnerd.org
Thu Jul 24 10:46:37 PDT 2014
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
+
More information about the llvm-commits
mailing list