summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/avx-splat.ll
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-08-11 02:49:41 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-08-11 02:49:41 +0000
commit572c9aaf537b5600e37ea65aee593cf540de1809 (patch)
treedad67c6fe6e265c3aa5ed24344e16611063e9346 /llvm/test/CodeGen/X86/avx-splat.ll
parentaa149cbd863d1722f8e5263cac26b9c9f4461f57 (diff)
downloadbcm5719-llvm-572c9aaf537b5600e37ea65aee593cf540de1809.tar.gz
bcm5719-llvm-572c9aaf537b5600e37ea65aee593cf540de1809.zip
Use the splat index to generate the desired shuffle. Otherwise we
could only get undefs and the vector shuffle becomes an undef, generating wrong code. llvm-svn: 137295
Diffstat (limited to 'llvm/test/CodeGen/X86/avx-splat.ll')
-rw-r--r--llvm/test/CodeGen/X86/avx-splat.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/avx-splat.ll b/llvm/test/CodeGen/X86/avx-splat.ll
index 36d469417f9..243ab9ba318 100644
--- a/llvm/test/CodeGen/X86/avx-splat.ll
+++ b/llvm/test/CodeGen/X86/avx-splat.ll
@@ -77,3 +77,13 @@ __load_and_broadcast_32.exit1249: ; preds = %load.i1247, %for_ex
ret void
}
+; CHECK: vpshufd $0
+; CHECK-NEXT: vinsertf128 $1
+define <8 x float> @funcF(i32* %ptr) nounwind {
+ %val = load i32* %ptr, align 4
+ %ret6 = insertelement <8 x i32> undef, i32 %val, i32 6
+ %ret7 = insertelement <8 x i32> %ret6, i32 %val, i32 7
+ %tmp = bitcast <8 x i32> %ret7 to <8 x float>
+ ret <8 x float> %tmp
+}
+
OpenPOWER on IntegriCloud