From 8865f70d70c216fcf01a3c50dfc0ed7b0fb54995 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 22 Nov 2015 16:52:16 +0000 Subject: [PATCH] [X86][AVX] Added load splat tests. Placeholder for upcoming patch for PR23022. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253824 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/avx-splat.ll | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/CodeGen/X86/avx-splat.ll b/test/CodeGen/X86/avx-splat.ll index 209d770f157..dadeaaf6c05 100644 --- a/test/CodeGen/X86/avx-splat.ll +++ b/test/CodeGen/X86/avx-splat.ll @@ -130,3 +130,50 @@ entry: %shuffle = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> ret <8 x float> %shuffle } + +define <2 x double> @splat_load_2f64_11(<2 x double>* %ptr) { +; CHECK-LABEL: splat_load_2f64_11: +; CHECK: ## BB#0: +; CHECK-NEXT: vmovaps (%rdi), %xmm0 +; CHECK-NEXT: vmovhlps {{.*#+}} xmm0 = xmm0[1,1] +; CHECK-NEXT: retq + %x = load <2 x double>, <2 x double>* %ptr + %x1 = shufflevector <2 x double> %x, <2 x double> undef, <2 x i32> + ret <2 x double> %x1 +} + +define <4 x double> @splat_load_4f64_2222(<4 x double>* %ptr) { +; CHECK-LABEL: splat_load_4f64_2222: +; CHECK: ## BB#0: +; CHECK-NEXT: vmovapd (%rdi), %ymm0 +; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0 +; CHECK-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq + %x = load <4 x double>, <4 x double>* %ptr + %x1 = shufflevector <4 x double> %x, <4 x double> undef, <4 x i32> + ret <4 x double> %x1 +} + +define <4 x float> @splat_load_4f32_0000(<4 x float>* %ptr) { +; CHECK-LABEL: splat_load_4f32_0000: +; CHECK: ## BB#0: +; CHECK-NEXT: vpermilps {{.*#+}} xmm0 = mem[0,0,0,0] +; CHECK-NEXT: retq + %x = load <4 x float>, <4 x float>* %ptr + %x1 = shufflevector <4 x float> %x, <4 x float> undef, <4 x i32> + ret <4 x float> %x1 +} + +define <8 x float> @splat_load_8f32_77777777(<8 x float>* %ptr) { +; CHECK-LABEL: splat_load_8f32_77777777: +; CHECK: ## BB#0: +; CHECK-NEXT: vmovaps (%rdi), %ymm0 +; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0 +; CHECK-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,3,3,3] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq + %x = load <8 x float>, <8 x float>* %ptr + %x1 = shufflevector <8 x float> %x, <8 x float> undef, <8 x i32> + ret <8 x float> %x1 +} -- 2.34.1