From 26398a7d87609d3c60709b9df74bffb53e660a26 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 21 Nov 2015 13:23:14 +0000 Subject: [PATCH] [X86][AVX] Regenerate AVX splat tests Tidied up triple and regenerate tests using update_llc_test_checks.py git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253778 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/avx-splat.ll | 75 +++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 20 deletions(-) diff --git a/test/CodeGen/X86/avx-splat.ll b/test/CodeGen/X86/avx-splat.ll index 3ea7e386c42..209d770f157 100644 --- a/test/CodeGen/X86/avx-splat.ll +++ b/test/CodeGen/X86/avx-splat.ll @@ -1,26 +1,34 @@ -; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s +; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx | FileCheck %s - -; CHECK: vpshufb {{.*}} ## xmm0 = xmm0[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5] -; CHECK-NEXT: vinsertf128 $1 define <32 x i8> @funcA(<32 x i8> %a) nounwind uwtable readnone ssp { +; CHECK-LABEL: funcA: +; CHECK: ## BB#0: ## %entry +; CHECK-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq entry: %shuffle = shufflevector <32 x i8> %a, <32 x i8> undef, <32 x i32> ret <32 x i8> %shuffle } -; CHECK: vpshufb {{.*}} ## xmm0 = xmm0[10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11] -; CHECK-NEXT: vinsertf128 $1 define <16 x i16> @funcB(<16 x i16> %a) nounwind uwtable readnone ssp { +; CHECK-LABEL: funcB: +; CHECK: ## BB#0: ## %entry +; CHECK-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq entry: %shuffle = shufflevector <16 x i16> %a, <16 x i16> undef, <16 x i32> ret <16 x i16> %shuffle } -; CHECK: vmovq -; CHECK-NEXT: vmovddup %xmm -; CHECK-NEXT: vinsertf128 $1 define <4 x i64> @funcC(i64 %q) nounwind uwtable readnone ssp { +; CHECK-LABEL: funcC: +; CHECK: ## BB#0: ## %entry +; CHECK-NEXT: vmovq %rdi, %xmm0 +; CHECK-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq entry: %vecinit.i = insertelement <4 x i64> undef, i64 %q, i32 0 %vecinit2.i = insertelement <4 x i64> %vecinit.i, i64 %q, i32 1 @@ -29,9 +37,12 @@ entry: ret <4 x i64> %vecinit6.i } -; CHECK: vmovddup %xmm -; CHECK-NEXT: vinsertf128 $1 define <4 x double> @funcD(double %q) nounwind uwtable readnone ssp { +; CHECK-LABEL: funcD: +; CHECK: ## BB#0: ## %entry +; CHECK-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq entry: %vecinit.i = insertelement <4 x double> undef, double %q, i32 0 %vecinit2.i = insertelement <4 x double> %vecinit.i, double %q, i32 1 @@ -43,8 +54,23 @@ entry: ; Test this turns into a broadcast: ; shuffle (scalar_to_vector (load (ptr + 4))), undef, <0, 0, 0, 0> ; -; CHECK: vbroadcastss define <8 x float> @funcE() nounwind { +; CHECK-LABEL: funcE: +; CHECK: ## BB#0: ## %for_exit499 +; CHECK-NEXT: xorl %eax, %eax +; CHECK-NEXT: ## implicit-def: %YMM0 +; CHECK-NEXT: testb %al, %al +; CHECK-NEXT: jne LBB4_2 +; CHECK-NEXT: ## BB#1: ## %load.i1247 +; CHECK-NEXT: pushq %rbp +; CHECK-NEXT: movq %rsp, %rbp +; CHECK-NEXT: andq $-32, %rsp +; CHECK-NEXT: subq $1312, %rsp ## imm = 0x520 +; CHECK-NEXT: vbroadcastss {{[0-9]+}}(%rsp), %ymm0 +; CHECK-NEXT: movq %rbp, %rsp +; CHECK-NEXT: popq %rbp +; CHECK-NEXT: LBB4_2: ## %__load_and_broadcast_32.exit1249 +; CHECK-NEXT: retq allocas: %udx495 = alloca [18 x [18 x float]], align 32 br label %for_test505.preheader @@ -69,29 +95,38 @@ __load_and_broadcast_32.exit1249: ; preds = %load.i1247, %for_ex ret <8 x float> %load_broadcast12281250 } -; CHECK: vpermilps $4 -; CHECK-NEXT: vinsertf128 $1 define <8 x float> @funcF(i32 %val) nounwind { +; CHECK-LABEL: funcF: +; CHECK: ## BB#0: +; CHECK-NEXT: vmovd %edi, %xmm0 +; CHECK-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,0,0] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq %ret6 = insertelement <8 x i32> undef, i32 %val, i32 6 %ret7 = insertelement <8 x i32> %ret6, i32 %val, i32 7 %tmp = bitcast <8 x i32> %ret7 to <8 x float> ret <8 x float> %tmp } -; CHECK: vpermilps $0 -; CHECK-NEXT: vinsertf128 $1 define <8 x float> @funcG(<8 x float> %a) nounwind uwtable readnone ssp { +; CHECK-LABEL: funcG: +; CHECK: ## BB#0: ## %entry +; CHECK-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq entry: %shuffle = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> ret <8 x float> %shuffle } -; CHECK: vextractf128 $1 -; CHECK-NEXT: vpermilps $85 -; CHECK-NEXT: vinsertf128 $1 define <8 x float> @funcH(<8 x float> %a) nounwind uwtable readnone ssp { +; CHECK-LABEL: funcH: +; CHECK: ## BB#0: ## %entry +; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0 +; CHECK-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1] +; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; CHECK-NEXT: retq entry: %shuffle = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> ret <8 x float> %shuffle } - -- 2.34.1