From 1ca1e33c3aff32f14f54d3186ef840b94dfe3401 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 21 Sep 2014 09:01:26 +0000 Subject: [PATCH] [x86] Add some more test cases covering specific blend patterns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218200 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/vector-shuffle-256-v8.ll | 91 +++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/test/CodeGen/X86/vector-shuffle-256-v8.ll b/test/CodeGen/X86/vector-shuffle-256-v8.ll index bf0ab1d0ef0..46aa6554091 100644 --- a/test/CodeGen/X86/vector-shuffle-256-v8.ll +++ b/test/CodeGen/X86/vector-shuffle-256-v8.ll @@ -132,6 +132,97 @@ define <8 x float> @shuffle_v8f32_00001111(<8 x float> %a, <8 x float> %b) { ret <8 x float> %shuffle } +define <8 x float> @shuffle_v8f32_81a3c5e7(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_81a3c5e7 +; ALL: # BB#0: +; ALL-NEXT: vextractf128 $1, %ymm1, %xmm2 +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm3 +; ALL-NEXT: vblendps $5, %xmm2, %xmm3, %xmm2 # xmm2 = xmm2[0],xmm3[1],xmm2[2],xmm3[3] +; ALL-NEXT: vblendps $5, %xmm1, %xmm0, %xmm0 # xmm0 = xmm1[0],xmm0[1],xmm1[2],xmm0[3] +; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: retq + %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %shuffle +} + +define <8 x float> @shuffle_v8f32_08080808(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_08080808 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm1[0,0,2,0] +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[0,1,0,3] +; ALL-NEXT: vblendps $10, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; ALL-NEXT: retq + %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %shuffle +} + +define <8 x float> @shuffle_v8f32_08084c4c(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_08084c4c +; ALL: # BB#0: +; ALL-NEXT: vextractf128 $1, %ymm1, %xmm2 +; ALL-NEXT: vpermilps {{.*}} # xmm2 = xmm2[0,0,2,0] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm3 +; ALL-NEXT: vpermilps {{.*}} # xmm3 = xmm3[0,1,0,3] +; ALL-NEXT: vblendps $10, %xmm2, %xmm3, %xmm2 # xmm2 = xmm3[0],xmm2[1],xmm3[2],xmm2[3] +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm1[0,0,2,0] +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[0,1,0,3] +; ALL-NEXT: vblendps $10, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3] +; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: retq + %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %shuffle +} + +define <8 x float> @shuffle_v8f32_8823cc67(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_8823cc67 +; ALL: # BB#0: +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm2 +; ALL-NEXT: vextractf128 $1, %ymm1, %xmm3 +; ALL-NEXT: vpermilps {{.*}} # xmm3 = xmm3[0,0,2,3] +; ALL-NEXT: vblendps {{.*}} # xmm2 = xmm3[0,1],xmm2[2,3] +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm1[0,0,2,3] +; ALL-NEXT: vblendps {{.*}} # xmm0 = xmm1[0,1],xmm0[2,3] +; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: retq + %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %shuffle +} + +define <8 x float> @shuffle_v8f32_9832dc76(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_9832dc76 +; ALL: # BB#0: +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm2 +; ALL-NEXT: vpermilps {{.*}} # xmm2 = xmm2[0,1,3,2] +; ALL-NEXT: vextractf128 $1, %ymm1, %xmm3 +; ALL-NEXT: vpermilps {{.*}} # xmm3 = xmm3[1,0,2,3] +; ALL-NEXT: vblendps {{.*}} # xmm2 = xmm3[0,1],xmm2[2,3] +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[0,1,3,2] +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm1[1,0,2,3] +; ALL-NEXT: vblendps {{.*}} # xmm0 = xmm1[0,1],xmm0[2,3] +; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: retq + %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %shuffle +} + +define <8 x float> @shuffle_v8f32_9810dc54(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_9810dc54 +; ALL: # BB#0: +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm2 +; ALL-NEXT: vpermilps {{.*}} # xmm2 = xmm2[0,1,1,0] +; ALL-NEXT: vextractf128 $1, %ymm1, %xmm3 +; ALL-NEXT: vpermilps {{.*}} # xmm3 = xmm3[1,0,2,3] +; ALL-NEXT: vblendps {{.*}} # xmm2 = xmm3[0,1],xmm2[2,3] +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[0,1,1,0] +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm1[1,0,2,3] +; ALL-NEXT: vblendps {{.*}} # xmm0 = xmm1[0,1],xmm0[2,3] +; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: retq + %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %shuffle +} + define <8 x float> @shuffle_v8f32_08192a3b(<8 x float> %a, <8 x float> %b) { ; ALL-LABEL: @shuffle_v8f32_08192a3b ; ALL: # BB#0: