1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

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.)

llvm-svn: 103911
This commit is contained in:
Dale Johannesen 2010-05-16 18:22:38 +00:00
parent a63555c10d
commit 15dce10b5a
2 changed files with 15 additions and 0 deletions

View File

@ -217,6 +217,10 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
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

View File

@ -0,0 +1,11 @@
; RUN: llc -mtriple=x86_64-apple-darwin -mattr=-sse < %s
@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
}