From c7129276cd292a9f76d9470bf5b593a7b8dfd08f Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 29 Sep 2014 00:37:27 +0000 Subject: [PATCH] [x86] Add the dispatch skeleton to the new vector shuffle lowering for AVX-512. There is no interesting logic yet. Everything ends up eventually delegating to the generic code to split the vector and shuffle the halves. Interestingly, that logic does a significantly better job of lowering all of these types than the generic vector expansion code does. Mostly, it lets most of the cases fall back to nice AVX2 code rather than all the way back to SSE code paths. Step 2 of basic AVX-512 support in the new vector shuffle lowering. Next up will be to incrementally add direct support for the basic instruction set to each type (adding tests first). llvm-svn: 218585 --- llvm/lib/Target/X86/X86ISelLowering.cpp | 144 +- .../test/CodeGen/X86/vector-shuffle-512-v8.ll | 1716 +++++------------ 2 files changed, 612 insertions(+), 1248 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index d4527be79bc1..6158e428da64 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -9875,6 +9875,148 @@ static SDValue lower256BitVectorShuffle(SDValue Op, SDValue V1, SDValue V2, } } +/// \brief Handle lowering of 8-lane 64-bit floating point shuffles. +static SDValue lowerV8F64VectorShuffle(SDValue Op, SDValue V1, SDValue V2, + const X86Subtarget *Subtarget, + SelectionDAG &DAG) { + SDLoc DL(Op); + assert(V1.getSimpleValueType() == MVT::v8f64 && "Bad operand type!"); + assert(V2.getSimpleValueType() == MVT::v8f64 && "Bad operand type!"); + ShuffleVectorSDNode *SVOp = cast(Op); + ArrayRef Mask = SVOp->getMask(); + assert(Mask.size() == 8 && "Unexpected mask size for v8 shuffle!"); + + // FIXME: Implement direct support for this type! + return splitAndLowerVectorShuffle(DL, MVT::v8f64, V1, V2, Mask, DAG); +} + +/// \brief Handle lowering of 16-lane 32-bit floating point shuffles. +static SDValue lowerV16F32VectorShuffle(SDValue Op, SDValue V1, SDValue V2, + const X86Subtarget *Subtarget, + SelectionDAG &DAG) { + SDLoc DL(Op); + assert(V1.getSimpleValueType() == MVT::v16f32 && "Bad operand type!"); + assert(V2.getSimpleValueType() == MVT::v16f32 && "Bad operand type!"); + ShuffleVectorSDNode *SVOp = cast(Op); + ArrayRef Mask = SVOp->getMask(); + assert(Mask.size() == 16 && "Unexpected mask size for v16 shuffle!"); + + // FIXME: Implement direct support for this type! + return splitAndLowerVectorShuffle(DL, MVT::v16f32, V1, V2, Mask, DAG); +} + +/// \brief Handle lowering of 8-lane 64-bit integer shuffles. +static SDValue lowerV8I64VectorShuffle(SDValue Op, SDValue V1, SDValue V2, + const X86Subtarget *Subtarget, + SelectionDAG &DAG) { + SDLoc DL(Op); + assert(V1.getSimpleValueType() == MVT::v8i64 && "Bad operand type!"); + assert(V2.getSimpleValueType() == MVT::v8i64 && "Bad operand type!"); + ShuffleVectorSDNode *SVOp = cast(Op); + ArrayRef Mask = SVOp->getMask(); + assert(Mask.size() == 8 && "Unexpected mask size for v8 shuffle!"); + assert(Subtarget->hasDQI() && "We can only lower v8i64 with AVX-512-DQI"); + + // FIXME: Implement direct support for this type! + return splitAndLowerVectorShuffle(DL, MVT::v8i64, V1, V2, Mask, DAG); +} + +/// \brief Handle lowering of 16-lane 32-bit integer shuffles. +static SDValue lowerV16I32VectorShuffle(SDValue Op, SDValue V1, SDValue V2, + const X86Subtarget *Subtarget, + SelectionDAG &DAG) { + SDLoc DL(Op); + assert(V1.getSimpleValueType() == MVT::v16i32 && "Bad operand type!"); + assert(V2.getSimpleValueType() == MVT::v16i32 && "Bad operand type!"); + ShuffleVectorSDNode *SVOp = cast(Op); + ArrayRef Mask = SVOp->getMask(); + assert(Mask.size() == 16 && "Unexpected mask size for v16 shuffle!"); + assert(Subtarget->hasDQI() && "We can only lower v16i32 with AVX-512-DQI!"); + + // FIXME: Implement direct support for this type! + return splitAndLowerVectorShuffle(DL, MVT::v16i32, V1, V2, Mask, DAG); +} + +/// \brief Handle lowering of 32-lane 16-bit integer shuffles. +static SDValue lowerV32I16VectorShuffle(SDValue Op, SDValue V1, SDValue V2, + const X86Subtarget *Subtarget, + SelectionDAG &DAG) { + SDLoc DL(Op); + assert(V1.getSimpleValueType() == MVT::v32i16 && "Bad operand type!"); + assert(V2.getSimpleValueType() == MVT::v32i16 && "Bad operand type!"); + ShuffleVectorSDNode *SVOp = cast(Op); + ArrayRef Mask = SVOp->getMask(); + assert(Mask.size() == 32 && "Unexpected mask size for v32 shuffle!"); + assert(Subtarget->hasBWI() && "We can only lower v32i16 with AVX-512-BWI!"); + + // FIXME: Implement direct support for this type! + return splitAndLowerVectorShuffle(DL, MVT::v32i16, V1, V2, Mask, DAG); +} + +/// \brief Handle lowering of 64-lane 8-bit integer shuffles. +static SDValue lowerV64I8VectorShuffle(SDValue Op, SDValue V1, SDValue V2, + const X86Subtarget *Subtarget, + SelectionDAG &DAG) { + SDLoc DL(Op); + assert(V1.getSimpleValueType() == MVT::v64i8 && "Bad operand type!"); + assert(V2.getSimpleValueType() == MVT::v64i8 && "Bad operand type!"); + ShuffleVectorSDNode *SVOp = cast(Op); + ArrayRef Mask = SVOp->getMask(); + assert(Mask.size() == 64 && "Unexpected mask size for v64 shuffle!"); + assert(Subtarget->hasBWI() && "We can only lower v64i8 with AVX-512-BWI!"); + + // FIXME: Implement direct support for this type! + return splitAndLowerVectorShuffle(DL, MVT::v64i8, V1, V2, Mask, DAG); +} + +/// \brief High-level routine to lower various 512-bit x86 vector shuffles. +/// +/// This routine either breaks down the specific type of a 512-bit x86 vector +/// shuffle or splits it into two 256-bit shuffles and fuses the results back +/// together based on the available instructions. +static SDValue lower512BitVectorShuffle(SDValue Op, SDValue V1, SDValue V2, + MVT VT, const X86Subtarget *Subtarget, + SelectionDAG &DAG) { + SDLoc DL(Op); + ShuffleVectorSDNode *SVOp = cast(Op); + ArrayRef Mask = SVOp->getMask(); + assert(Subtarget->hasAVX512() && + "Cannot lower 512-bit vectors w/ basic ISA!"); + + // Dispatch to each element type for lowering. If we don't have supprot for + // specific element type shuffles at 512 bits, immediately split them and + // lower them. Each lowering routine of a given type is allowed to assume that + // the requisite ISA extensions for that element type are available. + switch (VT.SimpleTy) { + case MVT::v8f64: + return lowerV8F64VectorShuffle(Op, V1, V2, Subtarget, DAG); + case MVT::v16f32: + return lowerV16F32VectorShuffle(Op, V1, V2, Subtarget, DAG); + case MVT::v8i64: + if (Subtarget->hasDQI()) + return lowerV8I64VectorShuffle(Op, V1, V2, Subtarget, DAG); + break; + case MVT::v16i32: + if (Subtarget->hasDQI()) + return lowerV16I32VectorShuffle(Op, V1, V2, Subtarget, DAG); + break; + case MVT::v32i16: + if (Subtarget->hasBWI()) + return lowerV32I16VectorShuffle(Op, V1, V2, Subtarget, DAG); + break; + case MVT::v64i8: + if (Subtarget->hasBWI()) + return lowerV64I8VectorShuffle(Op, V1, V2, Subtarget, DAG); + break; + + default: + llvm_unreachable("Not a valid 512-bit x86 vector type!"); + } + + // Otherwise fall back on splitting. + return splitAndLowerVectorShuffle(DL, VT, V1, V2, Mask, DAG); +} + /// \brief Helper function to test whether a shuffle mask could be /// simplified by widening the elements being shuffled. /// @@ -10039,7 +10181,7 @@ static SDValue lowerVectorShuffle(SDValue Op, const X86Subtarget *Subtarget, // Force AVX-512 vectors to be scalarized for now. // FIXME: Implement AVX-512 support! if (VT.getSizeInBits() == 512) - return SDValue(); + return lower512BitVectorShuffle(Op, V1, V2, VT, Subtarget, DAG); llvm_unreachable("Unimplemented!"); } diff --git a/llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll b/llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll index d4944ffb4367..06097d970e63 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll @@ -6,7 +6,8 @@ target triple = "x86_64-unknown-unknown" define <8 x double> @shuffle_v8f64_00000000(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00000000 ; ALL: # BB#0: -; ALL-NEXT: vbroadcastsd %xmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -15,12 +16,9 @@ define <8 x double> @shuffle_v8f64_00000000(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00000010(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00000010 ; ALL: # BB#0: -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,0] -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,0,0] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,1,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -29,12 +27,9 @@ define <8 x double> @shuffle_v8f64_00000010(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00000200(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00000200 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm0[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,0] -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,0,0] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,2,0,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -44,11 +39,7 @@ define <8 x double> @shuffle_v8f64_00003000(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00003000 ; ALL: # BB#0: ; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,0,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[3,0,0,0] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -58,10 +49,10 @@ define <8 x double> @shuffle_v8f64_00003000(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00040000(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00040000 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm0[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,1,2,0] +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm0[0,0,0,3] +; ALL-NEXT: vblendpd {{.*}} # ymm1 = ymm2[0,1,2],ymm1[3] ; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,0] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq @@ -72,11 +63,10 @@ define <8 x double> @shuffle_v8f64_00040000(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00500000(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00500000 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,1,1,3] +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm0[0,0,2,0] +; ALL-NEXT: vblendpd {{.*}} # ymm1 = ymm2[0,1],ymm1[2],ymm2[3] ; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,0] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq @@ -87,10 +77,10 @@ define <8 x double> @shuffle_v8f64_00500000(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_06000000(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_06000000 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm0[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,2,2,3] +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm0[0,1,0,0] +; ALL-NEXT: vblendpd {{.*}} # ymm1 = ymm2[0],ymm1[1],ymm2[2,3] ; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,0] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq @@ -101,12 +91,10 @@ define <8 x double> @shuffle_v8f64_06000000(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_70000000(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_70000000 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[3,1,2,3] ; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,0] +; ALL-NEXT: vblendpd {{.*}} # ymm1 = ymm1[0],ymm0[1,2,3] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -116,14 +104,10 @@ define <8 x double> @shuffle_v8f64_70000000(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_01014545(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_01014545 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm1, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,1,0,1] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,0,1] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -132,16 +116,9 @@ define <8 x double> @shuffle_v8f64_01014545(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00112233(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00112233 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm1[0,0] -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vpermilpd {{.*}} # xmm0 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,1,1] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[2,2,3,3] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -150,9 +127,8 @@ define <8 x double> @shuffle_v8f64_00112233(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00001111(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00001111 ; ALL: # BB#0: -; ALL-NEXT: vbroadcastsd %xmm0, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm0 = xmm0[1,0] -; ALL-NEXT: vbroadcastsd %xmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,0,0] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[1,1,1,1] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -162,22 +138,10 @@ define <8 x double> @shuffle_v8f64_00001111(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_81a3c5e7(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_81a3c5e7 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm3[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm4 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm4[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextractf32x4 $1, %zmm1, %xmm3 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm4 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm4[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm0 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm1[0],xmm0[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -187,8 +151,9 @@ define <8 x double> @shuffle_v8f64_81a3c5e7(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_08080808(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_08080808 ; ALL: # BB#0: -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,0,2,0] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,0,3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -198,12 +163,14 @@ define <8 x double> @shuffle_v8f64_08080808(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_08084c4c(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_08084c4c ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm2 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm3 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm2, %ymm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm2[0,0,2,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3 +; ALL-NEXT: vpermpd {{.*}} # ymm3 = ymm3[0,1,0,3] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3] +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,0,2,0] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,0,3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -213,17 +180,12 @@ define <8 x double> @shuffle_v8f64_08084c4c(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_8823cc67(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_8823cc67 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm3[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm3[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vpermilpd {{.*}} # ymm3 = ymm3[0,0,2,2] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3] +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm1[0,0,2,2] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm1[0,1],ymm0[2,3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -233,19 +195,14 @@ define <8 x double> @shuffle_v8f64_8823cc67(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_9832dc76(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_9832dc76 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm3[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm3[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vpermilpd {{.*}} # ymm2 = ymm2[0,0,3,2] +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vpermilpd {{.*}} # ymm3 = ymm3[1,0,2,2] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3] +; ALL-NEXT: vpermilpd {{.*}} # ymm0 = ymm0[0,0,3,2] +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm1[1,0,2,2] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm1[0,1],ymm0[2,3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -255,18 +212,14 @@ define <8 x double> @shuffle_v8f64_9832dc76(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_9810dc54(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_9810dc54 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm3[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm3[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm2[0,1,1,0] +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vpermilpd {{.*}} # ymm3 = ymm3[1,0,2,2] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,1,0] +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm1[1,0,2,2] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm1[0,1],ymm0[2,3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -276,18 +229,14 @@ define <8 x double> @shuffle_v8f64_9810dc54(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_08194c5d(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_08194c5d ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm4 -; ALL-NEXT: vpermilpd {{.*}} # xmm5 = xmm4[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm5[0],xmm3[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm4[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm2, %ymm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm1[1,0] -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm2[0,0,2,1] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3 +; ALL-NEXT: vpermpd {{.*}} # ymm3 = ymm3[0,1,1,3] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3] +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,0,2,1] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,1,3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -297,20 +246,14 @@ define <8 x double> @shuffle_v8f64_08194c5d(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_2a3b6e7f(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_2a3b6e7f ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm4 -; ALL-NEXT: vpermilpd {{.*}} # xmm5 = xmm4[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm5[0],xmm3[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm4[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm2, %ymm2 -; ALL-NEXT: vextractf32x4 $1, %zmm1, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm1[1,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm2[0,2,2,3] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3 +; ALL-NEXT: vpermpd {{.*}} # ymm3 = ymm3[2,1,3,3] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3] +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,2,2,3] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[2,1,3,3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -320,18 +263,12 @@ define <8 x double> @shuffle_v8f64_2a3b6e7f(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_08192a3b(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_08192a3b ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm1, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm4 -; ALL-NEXT: vpermilpd {{.*}} # xmm5 = xmm4[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm5[0],xmm3[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm4[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm2, %ymm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm1[1,0] -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm1[0,2,2,3] +; ALL-NEXT: vpermpd {{.*}} # ymm3 = ymm0[2,1,3,3] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3] +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,0,2,1] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,1,3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -341,16 +278,11 @@ define <8 x double> @shuffle_v8f64_08192a3b(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_08991abb(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_08991abb ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm1, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm3[0],xmm2[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm2 = ymm0[1,0,2,2] +; ALL-NEXT: vpermpd {{.*}} # ymm3 = ymm1[0,2,3,3] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm2[0],ymm3[1,2,3] +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,0,1,1] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm1[1,2,3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -360,22 +292,11 @@ define <8 x double> @shuffle_v8f64_08991abb(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_091b2d3f(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_091b2d3f ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm3[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm4[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm4 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm4[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextractf32x4 $1, %zmm1, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm3[1,0] -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermpd {{.*}} # ymm3 = ymm0[2,1,3,3] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,1,3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -385,20 +306,10 @@ define <8 x double> @shuffle_v8f64_091b2d3f(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_09ab1def(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_09ab1def ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm3[1,0] -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextractf32x4 $1, %zmm1, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm3[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermilpd {{.*}} # ymm3 = ymm0[1,0,2,2] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0],ymm2[1,2,3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm1[1,2,3] ; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -408,16 +319,10 @@ define <8 x double> @shuffle_v8f64_09ab1def(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00014445(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00014445 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm1[0],xmm2[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,0,1] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,1] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -426,16 +331,10 @@ define <8 x double> @shuffle_v8f64_00014445(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00204464(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00204464 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,2,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,2,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -444,18 +343,10 @@ define <8 x double> @shuffle_v8f64_00204464(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_03004744(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_03004744 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm1[0],xmm2[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,3,0,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,3,0,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -464,16 +355,10 @@ define <8 x double> @shuffle_v8f64_03004744(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_10005444(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_10005444 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[1,0,0,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[1,0,0,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -482,16 +367,10 @@ define <8 x double> @shuffle_v8f64_10005444(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_22006644(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_22006644 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[2,2,0,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[2,2,0,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -500,18 +379,10 @@ define <8 x double> @shuffle_v8f64_22006644(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_33307774(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_33307774 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm2[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[3,3,3,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[3,3,3,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -520,20 +391,10 @@ define <8 x double> @shuffle_v8f64_33307774(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_32107654(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_32107654 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[3,2,1,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[3,2,1,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -542,18 +403,10 @@ define <8 x double> @shuffle_v8f64_32107654(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00234467(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00234467 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[0,0,2,3] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm0 = ymm0[0,0,2,3] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -562,16 +415,10 @@ define <8 x double> @shuffle_v8f64_00234467(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00224466(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00224466 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[0,0,2,2] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm0 = ymm0[0,0,2,2] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -580,20 +427,10 @@ define <8 x double> @shuffle_v8f64_00224466(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_10325476(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_10325476 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[1,0,3,2] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm0 = ymm0[1,0,3,2] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -602,20 +439,10 @@ define <8 x double> @shuffle_v8f64_10325476(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_11335577(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_11335577 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm0 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[1,1,3,3] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm0 = ymm0[1,1,3,3] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -624,20 +451,10 @@ define <8 x double> @shuffle_v8f64_11335577(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_10235467(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_10235467 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[1,0,2,3] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm0 = ymm0[1,0,2,3] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -646,18 +463,10 @@ define <8 x double> @shuffle_v8f64_10235467(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_10225466(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_10225466 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[1,0,2,2] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm0 = ymm0[1,0,2,2] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -666,15 +475,9 @@ define <8 x double> @shuffle_v8f64_10225466(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00015444(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00015444 ; ALL: # BB#0: -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm0[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,0,1] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[1,0,0,0] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -684,15 +487,9 @@ define <8 x double> @shuffle_v8f64_00015444(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00204644(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00204644 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,0,2,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,2,0,0] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -702,18 +499,10 @@ define <8 x double> @shuffle_v8f64_00204644(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_03004474(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_03004474 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[0,3,0,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,3,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -722,12 +511,9 @@ define <8 x double> @shuffle_v8f64_03004474(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_10004444(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_10004444 ; ALL: # BB#0: -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vbroadcastsd %xmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[1,0,0,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,0,0,0] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -737,16 +523,10 @@ define <8 x double> @shuffle_v8f64_10004444(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_22006446(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_22006446 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm3 = xmm2[0],xmm1[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm3, %ymm1, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[2,2,0,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[2,0,0,2] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -755,17 +535,10 @@ define <8 x double> @shuffle_v8f64_22006446(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_33307474(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_33307474 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm1, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm2[0],xmm0[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[3,3,3,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[3,0,3,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -774,20 +547,9 @@ define <8 x double> @shuffle_v8f64_33307474(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_32104567(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_32104567 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm0[3,2,1,0] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -796,17 +558,9 @@ define <8 x double> @shuffle_v8f64_32104567(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00236744(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00236744 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[0,0,2,3] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[2,3,0,0] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -816,16 +570,10 @@ define <8 x double> @shuffle_v8f64_00236744(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00226644(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00226644 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0,0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[0,0,2,2] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[2,2,0,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -834,20 +582,9 @@ define <8 x double> @shuffle_v8f64_00226644(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_10324567(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_10324567 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[1,0,3,2] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -856,20 +593,9 @@ define <8 x double> @shuffle_v8f64_10324567(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_11334567(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_11334567 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm0 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[1,1,3,3] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -878,19 +604,8 @@ define <8 x double> @shuffle_v8f64_11334567(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_01235467(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_01235467 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm3[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm1[1,0,2,3] ; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -900,19 +615,9 @@ define <8 x double> @shuffle_v8f64_01235467(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_01235466(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_01235466 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm0 -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm1[1,0,2,2] +; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -921,14 +626,10 @@ define <8 x double> @shuffle_v8f64_01235466(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_002u6u44(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_002u6u44 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm0[0,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[0,0,2,2] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[2,1,0,0] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -937,9 +638,9 @@ define <8 x double> @shuffle_v8f64_002u6u44(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_00uu66uu(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_00uu66uu ; ALL: # BB#0: -; ALL-NEXT: vbroadcastsd %xmm0, %ymm1 -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm0 -; ALL-NEXT: vbroadcastsd %xmm0, %ymm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[0,0,2,2] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[2,2,2,3] ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -949,15 +650,8 @@ define <8 x double> @shuffle_v8f64_00uu66uu(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_103245uu(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_103245uu ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0],xmm2[0] +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[1,0,3,2] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 ; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -967,17 +661,9 @@ define <8 x double> @shuffle_v8f64_103245uu(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_1133uu67(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_1133uu67 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm0 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm0[1,1,3,3] +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -986,13 +672,8 @@ define <8 x double> @shuffle_v8f64_1133uu67(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_0uu354uu(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_0uu354uu ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpermilpd {{.*}} # xmm2 = xmm2[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm1[1,0,2,2] ; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> @@ -1002,12 +683,9 @@ define <8 x double> @shuffle_v8f64_0uu354uu(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_uuu3uu66(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_uuu3uu66 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[0,1,2,0] -; ALL-NEXT: vextractf32x4 $3, %zmm0, %xmm0 -; ALL-NEXT: vbroadcastsd %xmm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermilpd {{.*}} # ymm1 = ymm1[0,0,2,2] +; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -1016,19 +694,18 @@ define <8 x double> @shuffle_v8f64_uuu3uu66(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_c348cda0(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_c348cda0 ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm1, %xmm2 -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vextractf32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm4 = xmm3[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm4 = xmm3[0],xmm4[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm4, %ymm2 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm4 -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm4[0],xmm1[0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpermilpd {{.*}} # xmm0 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vpermpd {{.*}} # ymm2 = ymm2[0,1,0,3] +; ALL-NEXT: vpermpd {{.*}} # ymm3 = ymm0[0,3,2,3] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm3[0,1],ymm2[2],ymm3[3] +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vpermpd {{.*}} # ymm4 = ymm1[0,1,2,0] +; ALL-NEXT: vblendpd {{.*}} # ymm4 = ymm3[0,1,2],ymm4[3] +; ALL-NEXT: vblendpd {{.*}} # ymm2 = ymm4[0],ymm2[1,2],ymm4[3] +; ALL-NEXT: vblendpd {{.*}} # ymm1 = ymm3[0,1],ymm1[2],ymm3[3] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,2,0] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm1[0,1,2],ymm0[3] +; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -1037,21 +714,18 @@ define <8 x double> @shuffle_v8f64_c348cda0(<8 x double> %a, <8 x double> %b) { define <8 x double> @shuffle_v8f64_f511235a(<8 x double> %a, <8 x double> %b) { ; ALL-LABEL: @shuffle_v8f64_f511235a ; ALL: # BB#0: -; ALL-NEXT: vextractf32x4 $1, %zmm1, %xmm2 -; ALL-NEXT: vextractf32x4 $2, %zmm0, %xmm3 -; ALL-NEXT: vpermilpd {{.*}} # xmm3 = xmm3[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vextractf32x4 $1, %zmm0, %xmm4 -; ALL-NEXT: vpermilpd {{.*}} # xmm5 = xmm4[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm4 = xmm4[0],xmm5[0] -; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm4, %ymm2 -; ALL-NEXT: vextractf32x4 $3, %zmm1, %xmm1 -; ALL-NEXT: vpermilpd {{.*}} # xmm1 = xmm1[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm1 = xmm1[0],xmm3[0] -; ALL-NEXT: vpermilpd {{.*}} # xmm0 = xmm0[1,0] -; ALL-NEXT: vunpcklpd {{.*}} # xmm0 = xmm0[0,0] -; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0 -; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0 +; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vpermpd {{.*}} # ymm3 = ymm2[0,1,1,3] +; ALL-NEXT: vpermpd {{.*}} # ymm4 = ymm0[2,3,2,3] +; ALL-NEXT: vblendpd {{.*}} # ymm3 = ymm4[0,1],ymm3[2],ymm4[3] +; ALL-NEXT: vpermilpd {{.*}} # ymm4 = ymm1[0,0,2,2] +; ALL-NEXT: vblendpd {{.*}} # ymm3 = ymm3[0,1,2],ymm4[3] +; ALL-NEXT: vpermpd {{.*}} # ymm0 = ymm0[0,1,1,1] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm0[0],ymm2[1],ymm0[2,3] +; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm1 +; ALL-NEXT: vpermpd {{.*}} # ymm1 = ymm1[3,1,2,3] +; ALL-NEXT: vblendpd {{.*}} # ymm0 = ymm1[0],ymm0[1,2,3] +; ALL-NEXT: vinsertf64x4 $1, %ymm3, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> ret <8 x double> %shuffle @@ -1060,8 +734,8 @@ define <8 x double> @shuffle_v8f64_f511235a(<8 x double> %a, <8 x double> %b) { define <8 x i64> @shuffle_v8i64_00000000(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00000000 ; ALL: # BB#0: -; ALL-NEXT: vmovq %xmm0, %rax -; ALL-NEXT: vpbroadcastq %rax, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1070,13 +744,9 @@ define <8 x i64> @shuffle_v8i64_00000000(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00000010(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00000010 ; ALL: # BB#0: -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm0[0,1,0,1] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,0] -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,0,0] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,1,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1085,12 +755,9 @@ define <8 x i64> @shuffle_v8i64_00000010(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00000200(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00000200 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm0[0],xmm1[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,0] -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,0,0] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,2,0,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1100,12 +767,7 @@ define <8 x i64> @shuffle_v8i64_00003000(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00003000 ; ALL: # BB#0: ; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,0,0] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[3,0,0,0] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1115,10 +777,10 @@ define <8 x i64> @shuffle_v8i64_00003000(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00040000(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00040000 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm0[0],xmm1[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,1,2,0] +; ALL-NEXT: vpermq {{.*}} # ymm2 = ymm0[0,0,0,3] +; ALL-NEXT: vpblendd {{.*}} # ymm1 = ymm2[0,1,2,3,4,5],ymm1[6,7] ; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,0] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq @@ -1129,12 +791,10 @@ define <8 x i64> @shuffle_v8i64_00040000(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00500000(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00500000 ; ALL: # BB#0: -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm0[0,1,0,1] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,1,1,3] +; ALL-NEXT: vpermq {{.*}} # ymm2 = ymm0[0,0,2,0] +; ALL-NEXT: vpblendd {{.*}} # ymm1 = ymm2[0,1,2,3],ymm1[4,5],ymm2[6,7] ; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,0] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq @@ -1145,10 +805,10 @@ define <8 x i64> @shuffle_v8i64_00500000(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_06000000(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_06000000 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm0[0],xmm1[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,2,2,3] +; ALL-NEXT: vpermq {{.*}} # ymm2 = ymm0[0,1,0,0] +; ALL-NEXT: vpblendd {{.*}} # ymm1 = ymm2[0,1],ymm1[2,3],ymm2[4,5,6,7] ; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,0] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq @@ -1159,13 +819,10 @@ define <8 x i64> @shuffle_v8i64_06000000(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_70000000(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_70000000 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[3,1,2,3] ; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,0] +; ALL-NEXT: vpblendd {{.*}} # ymm1 = ymm1[0,1],ymm0[2,3,4,5,6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1175,16 +832,10 @@ define <8 x i64> @shuffle_v8i64_70000000(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_01014545(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_01014545 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm1, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,1,0,1] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,1,0,1] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1193,18 +844,9 @@ define <8 x i64> @shuffle_v8i64_01014545(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00112233(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00112233 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm1[0,1,0,1] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,1,1] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,2,3,3] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1213,12 +855,8 @@ define <8 x i64> @shuffle_v8i64_00112233(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00001111(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00001111 ; ALL: # BB#0: -; ALL-NEXT: vmovq %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpbroadcastq %xmm1, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpbroadcastq %xmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,0,0] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[1,1,1,1] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1228,26 +866,10 @@ define <8 x i64> @shuffle_v8i64_00001111(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_81a3c5e7(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_81a3c5e7 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm4 -; ALL-NEXT: vpextrq $1, %xmm4, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextracti32x4 $1, %zmm1, %xmm3 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm4 -; ALL-NEXT: vpextrq $1, %xmm4, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm1[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1257,8 +879,9 @@ define <8 x i64> @shuffle_v8i64_81a3c5e7(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_08080808(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_08080808 ; ALL: # BB#0: -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,0,2,0] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,1,0,3] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1268,12 +891,14 @@ define <8 x i64> @shuffle_v8i64_08080808(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_08084c4c(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_08084c4c ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm2 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm2, %ymm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermq {{.*}} # ymm2 = ymm2[0,0,2,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3 +; ALL-NEXT: vpermq {{.*}} # ymm3 = ymm3[0,1,0,3] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7] +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,0,2,0] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,1,0,3] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1283,19 +908,12 @@ define <8 x i64> @shuffle_v8i64_08084c4c(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_8823cc67(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_8823cc67 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vinserti128 $1, %xmm3, %ymm2, %ymm2 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vpshufd {{.*}} # ymm3 = ymm3[0,1,0,1,4,5,4,5] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7] +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm1[0,1,0,1,4,5,4,5] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1305,23 +923,14 @@ define <8 x i64> @shuffle_v8i64_8823cc67(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_9832dc76(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_9832dc76 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm3[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vpshufd {{.*}} # ymm2 = ymm2[2,3,0,1,6,7,4,5] +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vpshufd {{.*}} # ymm3 = ymm3[2,3,0,1,6,7,4,5] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7] +; ALL-NEXT: vpshufd {{.*}} # ymm0 = ymm0[2,3,0,1,6,7,4,5] +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm1[2,3,0,1,6,7,4,5] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1331,22 +940,14 @@ define <8 x i64> @shuffle_v8i64_9832dc76(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_9810dc54(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_9810dc54 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm3[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2 +; ALL-NEXT: vpermq {{.*}} # ymm2 = ymm2[0,1,1,0] +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3 +; ALL-NEXT: vpshufd {{.*}} # ymm3 = ymm3[2,3,0,1,6,7,4,5] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,1,1,0] +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm1[2,3,0,1,6,7,4,5] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1356,22 +957,14 @@ define <8 x i64> @shuffle_v8i64_9810dc54(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_08194c5d(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_08194c5d ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm2 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm4 = xmm3[0],xmm2[0] -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm4, %ymm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm0[0],xmm1[0] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm3, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermq {{.*}} # ymm2 = ymm2[0,0,2,1] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3 +; ALL-NEXT: vpermq {{.*}} # ymm3 = ymm3[0,1,1,3] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7] +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,0,2,1] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,1,1,3] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1381,24 +974,14 @@ define <8 x i64> @shuffle_v8i64_08194c5d(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_2a3b6e7f(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_2a3b6e7f ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm4 = xmm3[0],xmm2[0] -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm4, %ymm2 -; ALL-NEXT: vextracti32x4 $1, %zmm1, %xmm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm0[0],xmm1[0] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm3, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermq {{.*}} # ymm2 = ymm2[0,2,2,3] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3 +; ALL-NEXT: vpermq {{.*}} # ymm3 = ymm3[2,1,3,3] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7] +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,2,2,3] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,1,3,3] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1408,22 +991,12 @@ define <8 x i64> @shuffle_v8i64_2a3b6e7f(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_08192a3b(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_08192a3b ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $1, %zmm1, %xmm2 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm4 = xmm3[0],xmm2[0] -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm4, %ymm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm0[0],xmm1[0] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm3, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm2 = ymm1[0,2,2,3] +; ALL-NEXT: vpermq {{.*}} # ymm3 = ymm0[2,1,3,3] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7] +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,0,2,1] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,1,1,3] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1433,19 +1006,11 @@ define <8 x i64> @shuffle_v8i64_08192a3b(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_08991abb(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_08991abb ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $1, %zmm1, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm3[0],xmm2[0] -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0 +; ALL-NEXT: vpshufd {{.*}} # ymm2 = ymm0[2,3,2,3,6,7,6,7] +; ALL-NEXT: vpermq {{.*}} # ymm3 = ymm1[0,2,3,3] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm2[0,1],ymm3[2,3,4,5,6,7] +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,0,1,1] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1455,28 +1020,11 @@ define <8 x i64> @shuffle_v8i64_08991abb(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_091b2d3f(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_091b2d3f ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm4[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm4 -; ALL-NEXT: vpextrq $1, %xmm4, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextracti32x4 $1, %zmm1, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpermq {{.*}} # ymm3 = ymm0[2,1,3,3] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,1,1,3] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1486,25 +1034,10 @@ define <8 x i64> @shuffle_v8i64_091b2d3f(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_09ab1def(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_09ab1def ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm4[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextracti32x4 $1, %zmm1, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm4 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm3[0],xmm4[0] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm3, %ymm0, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpshufd {{.*}} # ymm3 = ymm0[2,3,2,3,6,7,6,7] +; ALL-NEXT: vpblendd {{.*}} # ymm2 = ymm3[0,1],ymm2[2,3,4,5,6,7] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7] ; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1514,18 +1047,10 @@ define <8 x i64> @shuffle_v8i64_09ab1def(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00014445(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00014445 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm1[0,1,0,1] -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,0,1] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,1] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1534,16 +1059,10 @@ define <8 x i64> @shuffle_v8i64_00014445(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00204464(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00204464 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm1[0] -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,2,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,2,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1552,20 +1071,10 @@ define <8 x i64> @shuffle_v8i64_00204464(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_03004744(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_03004744 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm1[0],xmm2[0] -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,3,0,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,3,0,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1574,18 +1083,10 @@ define <8 x i64> @shuffle_v8i64_03004744(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_10005444(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_10005444 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm1[0] -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[1,0,0,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[1,0,0,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1594,16 +1095,10 @@ define <8 x i64> @shuffle_v8i64_10005444(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_22006644(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_22006644 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[2,2,0,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,2,0,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1612,20 +1107,10 @@ define <8 x i64> @shuffle_v8i64_22006644(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_33307774(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_33307774 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm2[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[3,3,3,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[3,3,3,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1634,24 +1119,10 @@ define <8 x i64> @shuffle_v8i64_33307774(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_32107654(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_32107654 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[3,2,1,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[3,2,1,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1660,20 +1131,10 @@ define <8 x i64> @shuffle_v8i64_32107654(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00234467(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00234467 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,2,3] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,2,3] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1682,16 +1143,10 @@ define <8 x i64> @shuffle_v8i64_00234467(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00224466(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00224466 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[0,1,0,1,4,5,4,5] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpshufd {{.*}} # ymm0 = ymm0[0,1,0,1,4,5,4,5] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1700,24 +1155,10 @@ define <8 x i64> @shuffle_v8i64_00224466(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_10325476(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_10325476 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[2,3,0,1,6,7,4,5] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpshufd {{.*}} # ymm0 = ymm0[2,3,0,1,6,7,4,5] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1726,24 +1167,10 @@ define <8 x i64> @shuffle_v8i64_10325476(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_11335577(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_11335577 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[2,3,2,3,6,7,6,7] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpshufd {{.*}} # ymm0 = ymm0[2,3,2,3,6,7,6,7] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1752,24 +1179,10 @@ define <8 x i64> @shuffle_v8i64_11335577(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_10235467(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_10235467 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[1,0,2,3] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[1,0,2,3] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1778,20 +1191,10 @@ define <8 x i64> @shuffle_v8i64_10235467(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_10225466(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_10225466 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[1,0,2,2] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[1,0,2,2] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1800,17 +1203,9 @@ define <8 x i64> @shuffle_v8i64_10225466(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00015444(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00015444 ; ALL: # BB#0: -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm0[0,1,0,1] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,0,1] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[1,0,0,0] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1820,15 +1215,9 @@ define <8 x i64> @shuffle_v8i64_00015444(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00204644(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00204644 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,2,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,2,0,0] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1838,20 +1227,10 @@ define <8 x i64> @shuffle_v8i64_00204644(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_03004474(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_03004474 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm1[0,1,0,1] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm3[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,3,0,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,3,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1860,15 +1239,9 @@ define <8 x i64> @shuffle_v8i64_03004474(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_10004444(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_10004444 ; ALL: # BB#0: -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vmovq %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpbroadcastq %xmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[1,0,0,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[0,0,0,0] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1878,16 +1251,10 @@ define <8 x i64> @shuffle_v8i64_10004444(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_22006446(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_22006446 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm2[0],xmm1[0] -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm3, %ymm1, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[2,2,0,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,0,0,2] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1896,19 +1263,10 @@ define <8 x i64> @shuffle_v8i64_22006446(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_33307474(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_33307474 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm1, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm2[0],xmm0[0] -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[3,3,3,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[3,0,3,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1917,24 +1275,9 @@ define <8 x i64> @shuffle_v8i64_33307474(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_32104567(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_32104567 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[3,2,1,0] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1943,19 +1286,9 @@ define <8 x i64> @shuffle_v8i64_32104567(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00236744(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00236744 ; ALL: # BB#0: -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm0[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm0[0,0,2,3] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,3,0,0] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -1965,16 +1298,10 @@ define <8 x i64> @shuffle_v8i64_00236744(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00226644(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00226644 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[0,1,0,1,4,5,4,5] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,2,0,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -1983,24 +1310,9 @@ define <8 x i64> @shuffle_v8i64_00226644(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_10324567(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_10324567 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm3[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[2,3,0,1,6,7,4,5] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -2009,24 +1321,9 @@ define <8 x i64> @shuffle_v8i64_10324567(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_11334567(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_11334567 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[2,3,2,3,6,7,6,7] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -2035,23 +1332,8 @@ define <8 x i64> @shuffle_v8i64_11334567(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_01235467(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_01235467 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[1,0,2,3] ; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -2061,22 +1343,9 @@ define <8 x i64> @shuffle_v8i64_01235467(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_01235466(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_01235466 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm0[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm3[0],xmm2[0] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[1,0,2,2] +; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -2085,14 +1354,10 @@ define <8 x i64> @shuffle_v8i64_01235466(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_002u6u44(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_002u6u44 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm1, %ymm1 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm0[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[0,1,0,1,4,5,4,5] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,1,0,0] +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -2101,13 +1366,9 @@ define <8 x i64> @shuffle_v8i64_002u6u44(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_00uu66uu(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_00uu66uu ; ALL: # BB#0: -; ALL-NEXT: vmovq %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpbroadcastq %xmm1, %ymm1 -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm0 -; ALL-NEXT: vmovq %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpbroadcastq %xmm0, %ymm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[0,1,0,1,4,5,4,5] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,2,2,3] ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -2117,18 +1378,8 @@ define <8 x i64> @shuffle_v8i64_00uu66uu(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_103245uu(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_103245uu ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm0[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm2, %ymm1 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm2[0] +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[2,3,0,1,6,7,4,5] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 ; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -2138,20 +1389,9 @@ define <8 x i64> @shuffle_v8i64_103245uu(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_1133uu67(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_1133uu67 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm1 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpshufd {{.*}} # xmm0 = xmm0[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm0[2,3,2,3,6,7,6,7] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -2160,15 +1400,8 @@ define <8 x i64> @shuffle_v8i64_1133uu67(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_0uu354uu(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_0uu354uu ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm1 = xmm2[0],xmm1[0] -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 -; ALL-NEXT: vpextrq $1, %xmm2, %rax -; ALL-NEXT: vmovq %rax, %xmm2 -; ALL-NEXT: vpshufd {{.*}} # xmm2 = xmm2[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm1[2,3,0,1,6,7,4,5] ; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> @@ -2178,15 +1411,9 @@ define <8 x i64> @shuffle_v8i64_0uu354uu(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_uuu3uu66(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_uuu3uu66 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm1 -; ALL-NEXT: vpextrq $1, %xmm1, %rax -; ALL-NEXT: vmovq %rax, %xmm1 -; ALL-NEXT: vpermq {{.*}} # ymm1 = ymm1[0,1,2,0] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm0 -; ALL-NEXT: vmovq %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm0 -; ALL-NEXT: vpbroadcastq %xmm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1 +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm1[0,1,0,1,4,5,4,5] +; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle @@ -2195,22 +1422,17 @@ define <8 x i64> @shuffle_v8i64_uuu3uu66(<8 x i64> %a, <8 x i64> %b) { define <8 x i64> @shuffle_v8i64_6caa87e5(<8 x i64> %a, <8 x i64> %b) { ; ALL-LABEL: @shuffle_v8i64_6caa87e5 ; ALL: # BB#0: -; ALL-NEXT: vextracti32x4 $3, %zmm1, %xmm2 -; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm3 -; ALL-NEXT: vpextrq $1, %xmm3, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm2 = xmm2[0],xmm3[0] -; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm0 -; ALL-NEXT: vpextrq $1, %xmm0, %rax -; ALL-NEXT: vmovq %rax, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm3 = xmm1[0],xmm3[0] -; ALL-NEXT: vinserti128 $1, %xmm2, %ymm3, %ymm2 -; ALL-NEXT: vextracti32x4 $2, %zmm1, %xmm3 -; ALL-NEXT: vpunpcklqdq {{.*}} # xmm0 = xmm0[0],xmm3[0] -; ALL-NEXT: vextracti32x4 $1, %zmm1, %xmm1 -; ALL-NEXT: vpshufd {{.*}} # xmm1 = xmm1[0,1,0,1] -; ALL-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0 -; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0 +; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2 +; ALL-NEXT: vpblendd {{.*}} # ymm3 = ymm1[0,1,2,3],ymm2[4,5],ymm1[6,7] +; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0 +; ALL-NEXT: vpermq {{.*}} # ymm4 = ymm0[0,3,2,1] +; ALL-NEXT: vpblendd {{.*}} # ymm3 = ymm3[0,1],ymm4[2,3],ymm3[4,5],ymm4[6,7] +; ALL-NEXT: vpshufd {{.*}} # ymm2 = ymm2[0,1,0,1,4,5,4,5] +; ALL-NEXT: vpshufd {{.*}} # ymm1 = ymm1[0,1,0,1,4,5,4,5] +; ALL-NEXT: vpblendd {{.*}} # ymm1 = ymm1[0,1],ymm2[2,3],ymm1[4,5,6,7] +; ALL-NEXT: vpermq {{.*}} # ymm0 = ymm0[2,1,2,3] +; ALL-NEXT: vpblendd {{.*}} # ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7] +; ALL-NEXT: vinserti64x4 $1, %ymm3, %zmm0, %zmm0 ; ALL-NEXT: retq %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> ret <8 x i64> %shuffle