diff options
| -rw-r--r-- | llvm/test/CodeGen/X86/vector-shuffle-512-v16.ll | 22 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll | 36 |
2 files changed, 58 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/vector-shuffle-512-v16.ll b/llvm/test/CodeGen/X86/vector-shuffle-512-v16.ll index 983360184fb..482f07bb0bb 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-512-v16.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-512-v16.ll @@ -548,3 +548,25 @@ define <16 x i32> @mask_shuffle_v16i32_00_01_02_03_16_17_18_19_08_09_10_11_12_13 %res = select <16 x i1> %mask.cast, <16 x i32> %shuffle, <16 x i32> %passthru ret <16 x i32> %res } + +define <16 x i32> @mask_shuffle_v4i32_v16i32_00_01_02_03_00_01_02_03_00_01_02_03_00_01_02_03(<4 x i32> %a) { +; ALL-LABEL: mask_shuffle_v4i32_v16i32_00_01_02_03_00_01_02_03_00_01_02_03_00_01_02_03: +; ALL: # BB#0: +; ALL-NEXT: # kill: %XMM0<def> %XMM0<kill> %YMM0<def> +; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0 +; ALL-NEXT: vinserti32x8 $1, %ymm0, %zmm0, %zmm0 +; ALL-NEXT: retq + %res = shufflevector <4 x i32> %a, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3> + ret <16 x i32> %res +} + +define <16 x float> @mask_shuffle_v4f32_v16f32_00_01_02_03_00_01_02_03_00_01_02_03_00_01_02_03(<4 x float> %a) { +; ALL-LABEL: mask_shuffle_v4f32_v16f32_00_01_02_03_00_01_02_03_00_01_02_03_00_01_02_03: +; ALL: # BB#0: +; ALL-NEXT: # kill: %XMM0<def> %XMM0<kill> %YMM0<def> +; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; ALL-NEXT: vinsertf32x8 $1, %ymm0, %zmm0, %zmm0 +; ALL-NEXT: retq + %res = shufflevector <4 x float> %a, <4 x float> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3> + ret <16 x float> %res +} diff --git a/llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll b/llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll index 26e08d365e0..a85e74b363b 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll @@ -2571,3 +2571,39 @@ define <8 x i64> @shuffle_v8i64_01234589(<8 x i64> %a, <8 x i64> %b) { %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 8, i32 9> ret <8 x i64> %shuffle } + +define <8 x i64> @shuffle_v2i64_v8i64_01010101(<2 x i64> %a) { +; AVX512F-LABEL: shuffle_v2i64_v8i64_01010101: +; AVX512F: # BB#0: +; AVX512F-NEXT: # kill: %XMM0<def> %XMM0<kill> %YMM0<def> +; AVX512F-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0 +; AVX512F-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0 +; AVX512F-NEXT: retq +; +; AVX512F-32-LABEL: shuffle_v2i64_v8i64_01010101: +; AVX512F-32: # BB#0: +; AVX512F-32-NEXT: # kill: %XMM0<def> %XMM0<kill> %YMM0<def> +; AVX512F-32-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0 +; AVX512F-32-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0 +; AVX512F-32-NEXT: retl + %shuffle = shufflevector <2 x i64> %a, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1> + ret <8 x i64> %shuffle +} + +define <8 x double> @shuffle_v2f64_v8f64_01010101(<2 x double> %a) { +; AVX512F-LABEL: shuffle_v2f64_v8f64_01010101: +; AVX512F: # BB#0: +; AVX512F-NEXT: # kill: %XMM0<def> %XMM0<kill> %YMM0<def> +; AVX512F-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; AVX512F-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0 +; AVX512F-NEXT: retq +; +; AVX512F-32-LABEL: shuffle_v2f64_v8f64_01010101: +; AVX512F-32: # BB#0: +; AVX512F-32-NEXT: # kill: %XMM0<def> %XMM0<kill> %YMM0<def> +; AVX512F-32-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; AVX512F-32-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0 +; AVX512F-32-NEXT: retl + %shuffle = shufflevector <2 x double> %a, <2 x double> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1> + ret <8 x double> %shuffle +} |

