From 41a25dd7ef54366ce53da3d07fe0cdec84f18969 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 15 Sep 2014 11:15:23 +0000 Subject: [x86] Teach the x86 DAG combiner to form MOVSLDUP and MOVSHDUP instructions when it finds an appropriate pattern. These are lovely instructions, and its a shame to not use them. =] They are fast, and can hand loads folded into their operands, etc. I've also plumbed the comment shuffle decoding through the various layers so that the test cases are printed nicely. llvm-svn: 217758 --- llvm/test/CodeGen/X86/vector-shuffle-128-v4.ll | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'llvm/test') diff --git a/llvm/test/CodeGen/X86/vector-shuffle-128-v4.ll b/llvm/test/CodeGen/X86/vector-shuffle-128-v4.ll index d5bb55a2caa..dcd8ab166cf 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-128-v4.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-128-v4.ll @@ -119,6 +119,36 @@ define <4 x float> @shuffle_v4f32_3210(<4 x float> %a, <4 x float> %b) { %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> ret <4 x float> %shuffle } +define <4 x float> @shuffle_v4f32_0022(<4 x float> %a, <4 x float> %b) { +; SSE2-LABEL: @shuffle_v4f32_0022 +; SSE2: shufps {{.*}} # xmm0 = xmm0[0,0,2,2] +; SSE2-NEXT: retq +; +; SSE41-LABEL: @shuffle_v4f32_0022 +; SSE41: movsldup {{.*}} # xmm0 = xmm0[0,0,2,2] +; SSE41-NEXT: retq +; +; AVX1-LABEL: @shuffle_v4f32_0022 +; AVX1: vmovsldup {{.*}} # xmm0 = xmm0[0,0,2,2] +; AVX1-NEXT: retq + %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> + ret <4 x float> %shuffle +} +define <4 x float> @shuffle_v4f32_1133(<4 x float> %a, <4 x float> %b) { +; SSE2-LABEL: @shuffle_v4f32_1133 +; SSE2: shufps {{.*}} # xmm0 = xmm0[1,1,3,3] +; SSE2-NEXT: retq +; +; SSE41-LABEL: @shuffle_v4f32_1133 +; SSE41: movshdup {{.*}} # xmm0 = xmm0[1,1,3,3] +; SSE41-NEXT: retq +; +; AVX1-LABEL: @shuffle_v4f32_1133 +; AVX1: vmovshdup {{.*}} # xmm0 = xmm0[1,1,3,3] +; AVX1-NEXT: retq + %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> + ret <4 x float> %shuffle +} define <4 x i32> @shuffle_v4i32_0124(<4 x i32> %a, <4 x i32> %b) { ; SSE2-LABEL: @shuffle_v4i32_0124 -- cgit v1.2.3