Index: lib/Target/X86/X86ISelLowering.cpp =================================================================== --- lib/Target/X86/X86ISelLowering.cpp +++ lib/Target/X86/X86ISelLowering.cpp @@ -235,7 +235,7 @@ } } else { setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Promote); - setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Promote); + setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Custom); } // Promote i1/i8 FP_TO_SINT to larger FP_TO_SINTS's, as X86 doesn't have Index: test/CodeGen/X86/sitofp.ll =================================================================== --- /dev/null +++ test/CodeGen/X86/sitofp.ll @@ -0,0 +1,12 @@ +; RUN: llc < %s + +target triple = "i386-unknown-linux-gnu" + +define double @foo(i16 %a) #0 { +entry: + %conv = zext i16 %a to i32 + %conv1 = sitofp i32 %conv to double + ret double %conv1 +} + +attributes #0 = { "use-soft-float"="true" }