[llvm-commits] [llvm] r53927 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/mmx-s2v.ll
Evan Cheng
evan.cheng at apple.com
Tue Jul 22 11:39:19 PDT 2008
Author: evancheng
Date: Tue Jul 22 13:39:19 2008
New Revision: 53927
URL: http://llvm.org/viewvc/llvm-project?rev=53927&view=rev
Log:
Fix PR2574: implement v2f32 scalar_to_vector.
Added:
llvm/trunk/test/CodeGen/X86/mmx-s2v.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=53927&r1=53926&r2=53927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 22 13:39:19 2008
@@ -601,6 +601,7 @@
setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v2i32, Custom);
setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v1i64, Custom);
+ setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v2f32, Custom);
setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i8, Custom);
setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v4i16, Custom);
setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v1i64, Custom);
@@ -4135,6 +4136,12 @@
SDOperand
X86TargetLowering::LowerSCALAR_TO_VECTOR(SDOperand Op, SelectionDAG &DAG) {
+ if (Op.getValueType() == MVT::v2f32)
+ return DAG.getNode(ISD::BIT_CONVERT, MVT::v2f32,
+ DAG.getNode(ISD::SCALAR_TO_VECTOR, MVT::v2i32,
+ DAG.getNode(ISD::BIT_CONVERT, MVT::i32,
+ Op.getOperand(0))));
+
SDOperand AnyExt = DAG.getNode(ISD::ANY_EXTEND, MVT::i32, Op.getOperand(0));
MVT VT = MVT::v2i32;
switch (Op.getValueType().getSimpleVT()) {
Added: llvm/trunk/test/CodeGen/X86/mmx-s2v.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/mmx-s2v.ll?rev=53927&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/mmx-s2v.ll (added)
+++ llvm/trunk/test/CodeGen/X86/mmx-s2v.ll Tue Jul 22 13:39:19 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx
+; PR2574
+
+define void @entry(i32 %m_task_id, i32 %start_x, i32 %end_x) {; <label>:0
+ br i1 true, label %bb.nph, label %._crit_edge
+
+bb.nph: ; preds = %bb.nph, %0
+ %t2206f2.0 = phi <2 x float> [ %2, %bb.nph ], [ undef, %0 ] ; <<2 x float>> [#uses=1]
+ insertelement <2 x float> %t2206f2.0, float 0.000000e+00, i32 0 ; <<2 x float>>:1 [#uses=1]
+ insertelement <2 x float> %1, float 0.000000e+00, i32 1 ; <<2 x float>>:2 [#uses=1]
+ br label %bb.nph
+
+._crit_edge: ; preds = %0
+ ret void
+}
More information about the llvm-commits
mailing list