summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-08-27 17:15:49 +0000
committerSanjay Patel <spatel@rotateright.com>2017-08-27 17:15:49 +0000
commit4e4ba615b25372eb56d7fa76bf88dc16d9d34a98 (patch)
treefa4b57e16c35a850cc4bd69fdb90941cacf3438b /llvm
parent5f5b29dd22bf13262bf2119743fc46bba00e4f53 (diff)
downloadbcm5719-llvm-4e4ba615b25372eb56d7fa76bf88dc16d9d34a98.tar.gz
bcm5719-llvm-4e4ba615b25372eb56d7fa76bf88dc16d9d34a98.zip
[x86] add haddps test for PR34111; NFC
llvm-svn: 311852
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/X86/haddsub.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/haddsub.ll b/llvm/test/CodeGen/X86/haddsub.ll
index 8e28433d2ac..b63d97df52a 100644
--- a/llvm/test/CodeGen/X86/haddsub.ll
+++ b/llvm/test/CodeGen/X86/haddsub.ll
@@ -397,3 +397,28 @@ define <2 x float> @haddps_v2f32(<4 x float> %v0) {
%res1 = insertelement <2 x float> %res0, float %op1, i32 1
ret <2 x float> %res1
}
+
+define <4 x float> @PR34111(<4 x float> %a) {
+; SSE3-LABEL: PR34111:
+; SSE3: # BB#0:
+; SSE3-NEXT: movaps %xmm0, %xmm1
+; SSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,2,2,3]
+; SSE3-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,3,2,3]
+; SSE3-NEXT: addps %xmm1, %xmm0
+; SSE3-NEXT: movddup {{.*#+}} xmm0 = xmm0[0,0]
+; SSE3-NEXT: retq
+;
+; AVX-LABEL: PR34111:
+; AVX: # BB#0:
+; AVX-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,2,2,3]
+; AVX-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,3,2,3]
+; AVX-NEXT: vaddps %xmm0, %xmm1, %xmm0
+; AVX-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
+; AVX-NEXT: retq
+ %a02 = shufflevector <4 x float> %a, <4 x float> undef, <2 x i32> <i32 0, i32 2>
+ %a13 = shufflevector <4 x float> %a, <4 x float> undef, <2 x i32> <i32 1, i32 3>
+ %add = fadd <2 x float> %a02, %a13
+ %hadd = shufflevector <2 x float> %add, <2 x float> undef, <4 x i32> <i32 undef, i32 undef, i32 0, i32 1>
+ ret <4 x float> %hadd
+}
+
OpenPOWER on IntegriCloud