[llvm] r301583 - [X86][SSE] Add tests for broadcast from larger vector loads
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 27 13:19:00 PDT 2017
Author: rksimon
Date: Thu Apr 27 15:19:00 2017
New Revision: 301583
URL: http://llvm.org/viewvc/llvm-project?rev=301583&view=rev
Log:
[X86][SSE] Add tests for broadcast from larger vector loads
Modified:
llvm/trunk/test/CodeGen/X86/widened-broadcast.ll
Modified: llvm/trunk/test/CodeGen/X86/widened-broadcast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widened-broadcast.ll?rev=301583&r1=301582&r2=301583&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/widened-broadcast.ll (original)
+++ llvm/trunk/test/CodeGen/X86/widened-broadcast.ll Thu Apr 27 15:19:00 2017
@@ -579,3 +579,72 @@ entry:
%ret = shufflevector <32 x i8> %ld, <32 x i8> undef, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
ret <32 x i8> %ret
}
+
+define <4 x float> @load_splat_4f32_8f32_0000(<8 x float>* %ptr) nounwind uwtable readnone ssp {
+; SSE-LABEL: load_splat_4f32_8f32_0000:
+; SSE: # BB#0: # %entry
+; SSE-NEXT: movaps (%rdi), %xmm0
+; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,0,0,0]
+; SSE-NEXT: retq
+;
+; AVX1-LABEL: load_splat_4f32_8f32_0000:
+; AVX1: # BB#0: # %entry
+; AVX1-NEXT: vmovaps (%rdi), %ymm0
+; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
+; AVX1-NEXT: vzeroupper
+; AVX1-NEXT: retq
+;
+; AVX2-LABEL: load_splat_4f32_8f32_0000:
+; AVX2: # BB#0: # %entry
+; AVX2-NEXT: vmovaps (%rdi), %ymm0
+; AVX2-NEXT: vbroadcastss %xmm0, %xmm0
+; AVX2-NEXT: vzeroupper
+; AVX2-NEXT: retq
+;
+; AVX512-LABEL: load_splat_4f32_8f32_0000:
+; AVX512: # BB#0: # %entry
+; AVX512-NEXT: vmovaps (%rdi), %ymm0
+; AVX512-NEXT: vbroadcastss %xmm0, %xmm0
+; AVX512-NEXT: vzeroupper
+; AVX512-NEXT: retq
+entry:
+ %ld = load <8 x float>, <8 x float>* %ptr
+ %ret = shufflevector <8 x float> %ld, <8 x float> undef, <4 x i32> zeroinitializer
+ ret <4 x float> %ret
+}
+
+define <8 x float> @load_splat_8f32_16f32_89898989(<16 x float>* %ptr) nounwind uwtable readnone ssp {
+; SSE2-LABEL: load_splat_8f32_16f32_89898989:
+; SSE2: # BB#0: # %entry
+; SSE2-NEXT: movaps 32(%rdi), %xmm0
+; SSE2-NEXT: movlhps {{.*#+}} xmm0 = xmm0[0,0]
+; SSE2-NEXT: movaps %xmm0, %xmm1
+; SSE2-NEXT: retq
+;
+; SSE42-LABEL: load_splat_8f32_16f32_89898989:
+; SSE42: # BB#0: # %entry
+; SSE42-NEXT: movddup {{.*#+}} xmm0 = mem[0,0]
+; SSE42-NEXT: movapd %xmm0, %xmm1
+; SSE42-NEXT: retq
+;
+; AVX1-LABEL: load_splat_8f32_16f32_89898989:
+; AVX1: # BB#0: # %entry
+; AVX1-NEXT: vbroadcastsd 32(%rdi), %ymm0
+; AVX1-NEXT: retq
+;
+; AVX2-LABEL: load_splat_8f32_16f32_89898989:
+; AVX2: # BB#0: # %entry
+; AVX2-NEXT: vbroadcastsd 32(%rdi), %ymm0
+; AVX2-NEXT: retq
+;
+; AVX512-LABEL: load_splat_8f32_16f32_89898989:
+; AVX512: # BB#0: # %entry
+; AVX512-NEXT: vmovapd (%rdi), %zmm0
+; AVX512-NEXT: vextractf64x4 $1, %zmm0, %ymm0
+; AVX512-NEXT: vbroadcastsd %xmm0, %ymm0
+; AVX512-NEXT: retq
+entry:
+ %ld = load <16 x float>, <16 x float>* %ptr
+ %ret = shufflevector <16 x float> %ld, <16 x float> undef, <8 x i32> <i32 8, i32 9, i32 8, i32 9, i32 8, i32 9, i32 8, i32 9>
+ ret <8 x float> %ret
+}
More information about the llvm-commits
mailing list