From: Chandler Carruth Date: Sun, 21 Sep 2014 23:32:42 +0000 (+0000) Subject: [x86] Add a bunch of test cases where we have different shuffle patterns X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7da57cf5b44afd5dc1860ac3374952e46b931380;p=oota-llvm.git [x86] Add a bunch of test cases where we have different shuffle patterns in the high and low 128-bit lanes of a v8f32 vector. No functionality change yet, but wanted to set up the baseline for my next patch which will make these quite a bit better. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218224 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/X86/vector-shuffle-256-v8.ll b/test/CodeGen/X86/vector-shuffle-256-v8.ll index 311fe7e4734..34215806fb1 100644 --- a/test/CodeGen/X86/vector-shuffle-256-v8.ll +++ b/test/CodeGen/X86/vector-shuffle-256-v8.ll @@ -377,3 +377,154 @@ define <8 x float> @shuffle_v8f32_10225466(<8 x float> %a, <8 x float> %b) { %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> ret <8 x float> %shuffle } + +define <8 x float> @shuffle_v8f32_00015444(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_00015444 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[0,0,0,1] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[1,0,0,0] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_00204644(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_00204644 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[0,0,2,0] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[0,2,0,0] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_03004474(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_03004474 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[0,3,0,0] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[0,0,3,0] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_10004444(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_10004444 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[1,0,0,0] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[0,0,0,0] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_22006446(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_22006446 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[2,2,0,0] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[2,0,0,2] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_33307474(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_33307474 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[3,3,3,0] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[3,0,3,0] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_32104567(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_32104567 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[3,2,1,0] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_00236744(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_00236744 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[0,0,2,3] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[2,3,0,0] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_00226644(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_00226644 +; ALL: # BB#0: +; ALL-NEXT: vmovsldup {{.*}} # xmm1 = xmm0[0,0,2,2] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vpermilps {{.*}} # xmm0 = xmm0[2,2,0,0] +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_10324567(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_10324567 +; ALL: # BB#0: +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm0[1,0,3,2] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_11334567(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_11334567 +; ALL: # BB#0: +; ALL-NEXT: vmovshdup {{.*}} # xmm1 = xmm0[1,1,3,3] +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0 +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %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_01235467(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_01235467 +; ALL: # BB#0: +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm1 +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm1[1,0,2,3] +; ALL-NEXT: vinsertf128 $1, %xmm1, %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_01235466(<8 x float> %a, <8 x float> %b) { +; ALL-LABEL: @shuffle_v8f32_01235466 +; ALL: # BB#0: +; ALL-NEXT: vextractf128 $1, %ymm0, %xmm1 +; ALL-NEXT: vpermilps {{.*}} # xmm1 = xmm1[1,0,2,2] +; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0 +; ALL-NEXT: retq + %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %shuffle +}