[PATCH] D45572: [X86] Replace action Promote with Custom for operation ISD::SINT_TO_FP

Vyacheslav via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 17 03:55:21 PDT 2018


vrybalov updated this revision to Diff 142752.
vrybalov edited the summary of this revision.
vrybalov added a comment.

Updated test.


Repository:
  rL LLVM

https://reviews.llvm.org/D45572

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/sitofp.ll


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" }
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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45572.142752.patch
Type: text/x-patch
Size: 921 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180417/f39f3d35/attachment.bin>


More information about the llvm-commits mailing list