[llvm-commits] [llvm] r103911 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2010-05-16-nosseconversion.ll
Dale Johannesen
dalej at apple.com
Sun May 16 11:22:38 PDT 2010
Author: johannes
Date: Sun May 16 13:22:38 2010
New Revision: 103911
URL: http://llvm.org/viewvc/llvm-project?rev=103911&view=rev
Log:
Make x86-64 64-bit bitconvert work when SSE is not available.
(This worked as of about 6 months ago and I didn't track down
exactly what broke it; I think this fix is appropriate.)
Added:
llvm/trunk/test/CodeGen/X86/2010-05-16-nosseconversion.ll
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=103911&r1=103910&r2=103911&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun May 16 13:22:38 2010
@@ -217,6 +217,10 @@
if (!X86ScalarSSEf64) {
setOperationAction(ISD::BIT_CONVERT , MVT::f32 , Expand);
setOperationAction(ISD::BIT_CONVERT , MVT::i32 , Expand);
+ if (Subtarget->is64Bit()) {
+ setOperationAction(ISD::BIT_CONVERT , MVT::f64 , Expand);
+ setOperationAction(ISD::BIT_CONVERT , MVT::i64 , Expand);
+ }
}
// Scalar integer divide and remainder are lowered to use operations that
Added: llvm/trunk/test/CodeGen/X86/2010-05-16-nosseconversion.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-05-16-nosseconversion.ll?rev=103911&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2010-05-16-nosseconversion.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2010-05-16-nosseconversion.ll Sun May 16 13:22:38 2010
@@ -0,0 +1,11 @@
+; RUN: llc -mtriple=x86_64-apple-darwin -mattr=-sse < %s
+
+ at x = common global i64 0 ; <i64*> [#uses=1]
+
+define i32 @foo() nounwind readonly ssp {
+entry:
+ %0 = load i64* @x, align 8 ; <i64> [#uses=1]
+ %1 = uitofp i64 %0 to double ; <double> [#uses=1]
+ %2 = fptosi double %1 to i32 ; <i32> [#uses=1]
+ ret i32 %2
+}
More information about the llvm-commits
mailing list