summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2009-01-28 23:11:14 +0000
committerMon P Wang <wangmp@apple.com>2009-01-28 23:11:14 +0000
commit9150f735fa3180c3985c12456856a7cede64b82e (patch)
tree7e27e018baf784c74f114839d6834dc36f6a8082 /llvm
parentd27a820ae237766c2f3b92e189ba70cdd471c276 (diff)
downloadbcm5719-llvm-9150f735fa3180c3985c12456856a7cede64b82e.tar.gz
bcm5719-llvm-9150f735fa3180c3985c12456856a7cede64b82e.zip
Fixed lowering of v816 shuffles.
llvm-svn: 63252
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp2
-rw-r--r--llvm/test/CodeGen/X86/vec_shuffle-29.ll14
2 files changed, 15 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index f48d75253df..6ec97e2db60 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -3677,7 +3677,7 @@ SDValue LowerVECTOR_SHUFFLEv8i16(SDValue V1, SDValue V2,
++V2InOrder;
} else if (EltIdx < 8) {
V1Elts.push_back(Elt);
- V2Elts.push_back(DAG.getConstant(i+8, MaskEVT));
+ V2Elts.push_back(DAG.getConstant(EltIdx+8, MaskEVT));
++V1FromV1;
} else {
V1Elts.push_back(Elt);
diff --git a/llvm/test/CodeGen/X86/vec_shuffle-29.ll b/llvm/test/CodeGen/X86/vec_shuffle-29.ll
new file mode 100644
index 00000000000..aac63c3bbec
--- /dev/null
+++ b/llvm/test/CodeGen/X86/vec_shuffle-29.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -disable-mmx -o %t -f
+; RUN: not grep pextrw %t
+; RUN: grep pinsrw %t
+
+; Test for v8xi16 lowering where we extract the first element of the vector and
+; placed it in the second element of the result.
+
+define void @test_cl(<8 x i16> addrspace(1)* %dest, <8 x i16> addrspace(1)* %old) nounwind {
+entry:
+ %tmp3 = load <8 x i16> addrspace(1)* %old ; <<8 x i16>> [#uses=1]
+ %tmp6 = shufflevector <8 x i16> %tmp3, <8 x i16> < i16 0, i16 undef, i16 undef, i16 undef, i16 undef, i16 undef, i16 undef, i16 undef >, <8 x i32> < i32 8, i32 0, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef > ; <<8 x i16>> [#uses=1]
+ store <8 x i16> %tmp6, <8 x i16> addrspace(1)* %dest
+ ret void
+} \ No newline at end of file
OpenPOWER on IntegriCloud