diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/costmodel')
15 files changed, 0 insertions, 716 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-fast-math-vect-pr29925.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-fast-math-vect-pr29925.c deleted file mode 100644 index d8fe35c6091..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-fast-math-vect-pr29925.c +++ /dev/null @@ -1,39 +0,0 @@ -/* { dg-require-effective-target vect_float } */ - -#include <stdlib.h> -#include "../../tree-vect.h" - -__attribute__ ((noinline)) void -interp_pitch(float *exc, float *interp, int pitch, int len) -{ - int i,k; - int maxj; - - maxj=3; - for (i=0;i<len;i++) - { - float tmp = 0; - for (k=0;k<7;k++) - { - tmp += exc[i-pitch+k+maxj-6]; - } - interp[i] = tmp; - } -} - -int main() -{ - float *exc = calloc(126,sizeof(float)); - float *interp = calloc(80,sizeof(float)); - int pitch = -35; - - check_vect (); - - interp_pitch(exc, interp, pitch, 80); - free(exc); - free(interp); - return 0; -} - -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */ - diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31a.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31a.c deleted file mode 100644 index 9f75ce81aff..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31a.c +++ /dev/null @@ -1,50 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 32 - -struct t{ - int k[N]; - int l; -}; - -struct s{ - char a; /* aligned */ - char b[N-1]; /* unaligned (offset 1B) */ - char c[N]; /* aligned (offset NB) */ - struct t d; /* aligned (offset 2NB) */ - struct t e; /* unaligned (offset 2N+4N+4 B) */ -}; - -int main1 () -{ - int i; - struct s tmp; - - /* unaligned */ - for (i = 0; i < N/2; i++) - { - tmp.b[i] = 5; - } - - /* check results: */ - for (i = 0; i <N/2; i++) - { - if (tmp.b[i] != 5) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31b.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31b.c deleted file mode 100644 index b0f193f042e..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31b.c +++ /dev/null @@ -1,49 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 32 - -struct t{ - int k[N]; - int l; -}; - -struct s{ - char a; /* aligned */ - char b[N-1]; /* unaligned (offset 1B) */ - char c[N]; /* aligned (offset NB) */ - struct t d; /* aligned (offset 2NB) */ - struct t e; /* unaligned (offset 2N+4N+4 B) */ -}; - -int main1 () -{ - int i; - struct s tmp; - - /* aligned */ - for (i = 0; i < N/2; i++) - { - tmp.c[i] = 6; - } - - /* check results: */ - for (i = 0; i <N/2; i++) - { - if (tmp.c[i] != 6) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31c.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31c.c deleted file mode 100644 index d062d659ffb..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31c.c +++ /dev/null @@ -1,49 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 32 - -struct t{ - int k[N]; - int l; -}; - -struct s{ - char a; /* aligned */ - char b[N-1]; /* unaligned (offset 1B) */ - char c[N]; /* aligned (offset NB) */ - struct t d; /* aligned (offset 2NB) */ - struct t e; /* unaligned (offset 2N+4N+4 B) */ -}; - -int main1 () -{ - int i; - struct s tmp; - - /* aligned */ - for (i = 0; i < N/2; i++) - { - tmp.d.k[i] = 7; - } - - /* check results: */ - for (i = 0; i <N/2; i++) - { - if (tmp.d.k[i] != 7) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31d.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31d.c deleted file mode 100644 index 843d739af4d..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31d.c +++ /dev/null @@ -1,50 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 32 - -struct t{ - int k[N]; - int l; -}; - -struct s{ - char a; /* aligned */ - char b[N-1]; /* unaligned (offset 1B) */ - char c[N]; /* aligned (offset NB) */ - struct t d; /* aligned (offset 2NB) */ - struct t e; /* unaligned (offset 2N+4N+4 B) */ -}; - -int main1 () -{ - int i; - struct s tmp; - - /* unaligned */ - for (i = 0; i < N/2; i++) - { - tmp.e.k[i] = 8; - } - - /* check results: */ - for (i = 0; i <N/2; i++) - { - if (tmp.e.k[i] != 8) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c deleted file mode 100644 index e0764f877f6..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c +++ /dev/null @@ -1,42 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 16 -struct test { - char ca[N]; -}; - -extern struct test s; - -int main1 () -{ - int i; - - for (i = 0; i < N; i++) - { - s.ca[i] = 5; - } - - /* check results: */ - for (i = 0; i < N; i++) - { - if (s.ca[i] != 5) - abort (); - } - - return 0; -} - -int main (void) -{ - return main1 (); -} - -/* Peeling to align the store is used. Overhead of peeling is too high. */ -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target vector_alignment_reachable } } } */ - -/* Versioning to align the store is used. Overhead of versioning is not too high. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vector_alignment_reachable} } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68a.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68a.c deleted file mode 100644 index ce27e4f0821..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68a.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 32 - -struct s{ - int m; - int n[N][N][N]; -}; - -struct test1{ - struct s a; /* array a.n is unaligned */ - int b; - int c; - struct s e; /* array e.n is aligned */ -}; - -int main1 () -{ - int i,j; - struct test1 tmp1; - - /* 1. unaligned */ - for (i = 0; i < N; i++) - { - tmp1.a.n[1][2][i] = 5; - } - - /* check results: */ - for (i = 0; i <N; i++) - { - if (tmp1.a.n[1][2][i] != 5) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68b.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68b.c deleted file mode 100644 index dae5a78808f..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68b.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 32 - -struct s{ - int m; - int n[N][N][N]; -}; - -struct test1{ - struct s a; /* array a.n is unaligned */ - int b; - int c; - struct s e; /* array e.n is aligned */ -}; - -int main1 () -{ - int i,j; - struct test1 tmp1; - - /* 2. aligned */ - for (i = 3; i < N-1; i++) - { - tmp1.a.n[1][2][i] = 6; - } - - /* check results: */ - for (i = 3; i < N-1; i++) - { - if (tmp1.a.n[1][2][i] != 6) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68c.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68c.c deleted file mode 100644 index 8221f9e49f8..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68c.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 32 - -struct s{ - int m; - int n[N][N][N]; -}; - -struct test1{ - struct s a; /* array a.n is unaligned */ - int b; - int c; - struct s e; /* array e.n is aligned */ -}; - -int main1 () -{ - int i,j; - struct test1 tmp1; - - /* 3. aligned */ - for (i = 0; i < N; i++) - { - tmp1.e.n[1][2][i] = 7; - } - - /* check results: */ - for (i = 0; i < N; i++) - { - if (tmp1.e.n[1][2][i] != 7) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68d.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68d.c deleted file mode 100644 index 0468455ccc7..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68d.c +++ /dev/null @@ -1,49 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 20 - -struct s{ - int m; - int n[N][N][N]; -}; - -struct test1{ - struct s a; /* array a.n is unaligned */ - int b; - int c; - struct s e; /* array e.n is aligned */ -}; - -int main1 () -{ - int i,j; - struct test1 tmp1; - - /* 4. unaligned */ - for (i = 3; i < N-3; i++) - { - tmp1.e.n[1][2][i] = 8; - } - - /* check results: */ - for (i = 3; i <N-3; i++) - { - if (tmp1.e.n[1][2][i] != 8) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - return main1 (); -} - -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c deleted file mode 100644 index e18822c93f5..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c +++ /dev/null @@ -1,46 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 16 -#define OFF 4 - -/* Check handling of accesses for which the "initial condition" - - the expression that represents the first location accessed - is - more involved than just an ssa_name. */ - -int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10}; - -int main1 (int *pib) -{ - int i; - int ia[N+OFF]; - int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10}; - - for (i = OFF; i < N; i++) - { - ia[i] = pib[i - OFF]; - } - - - /* check results: */ - for (i = OFF; i < N; i++) - { - if (ia[i] != pib[i - OFF]) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - main1 (&ib[OFF]); - return 0; -} - - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c deleted file mode 100644 index 1d6075e1a4c..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c +++ /dev/null @@ -1,46 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 16 -#define OFF 4 - -/* Check handling of accesses for which the "initial condition" - - the expression that represents the first location accessed - is - more involved than just an ssa_name. */ - -int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 0, 1, 3, 5, 7, 11, 13, 17}; -int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 0, 1, 3, 5, 7, 11, 13, 17}; - -int main1 (int *pib) -{ - int i; - int ia[N+OFF]; - - for (i = OFF; i < N; i++) - { - pib[i - OFF] = ic[i]; - } - - - /* check results: */ - for (i = OFF; i < N; i++) - { - if (pib[i - OFF] != ic[i]) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - main1 (&ib[OFF]); - return 0; -} - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c deleted file mode 100644 index 672e967ec2e..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c +++ /dev/null @@ -1,46 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 32 -#define OFF 4 - -/* Check handling of accesses for which the "initial condition" - - the expression that represents the first location accessed - is - more involved than just an ssa_name. */ - -int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10}; -int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10}; - -int main1 (int *pib) -{ - int i; - int ia[N+OFF]; - - for (i = OFF; i < N; i++) - { - ia[i] = ic[i - OFF]; - } - - - /* check results: */ - for (i = OFF; i < N; i++) - { - if (ia[i] != ic[i - OFF]) - abort (); - } - - return 0; -} - -int main (void) -{ - check_vect (); - - main1 (&ib[OFF]); - return 0; -} - - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c deleted file mode 100644 index 0f09405b89a..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c +++ /dev/null @@ -1,37 +0,0 @@ -/* { dg-require-effective-target vect_int } */ - -#include <stdarg.h> -#include "../../tree-vect.h" - -#define N 26 -int a[N]; - -__attribute__ ((noinline)) int main1 (int X) -{ - int s = X; - int i; - - /* vectorization of reduction with induction. */ - for (i = 0; i < N; i++) - s += (i + a[i]); - - return s; -} - -int main (void) -{ - int s, i; - check_vect (); - - for (i = 0; i < N; i++) - a[i] = 2*i; - - s = main1 (3); - if (s != 978) - abort (); - - return 0; -} - -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_int_mult } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vect_int_mult } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp b/gcc/testsuite/gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp deleted file mode 100644 index fb3da51ed28..00000000000 --- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (C) 1997-2019 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GCC; see the file COPYING3. If not see -# <http://www.gnu.org/licenses/>. - -# GCC testsuite that uses the `dg.exp' driver. - -# Load support procs. -load_lib gcc-dg.exp - -# Exit immediately if this isn't a powerpc target. -if { ![istarget spu*-*-*] } then { - return -} - - -# Set up flags used for tests that don't specify options. -set DEFAULT_VECTCFLAGS "" - -# These flags are used for all targets. -lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=dynamic" - -# If the target system supports vector instructions, the default action -# for a test is 'run', otherwise it's 'compile'. Save current default. -# Executing vector instructions on a system without hardware vector support -# is also disabled by a call to check_vect, but disabling execution here is -# more efficient. -global dg-do-what-default -set save-dg-do-what-default ${dg-do-what-default} - -set dg-do-what-default run - -# Initialize `dg'. -dg-init - -lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details" - -# Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-pr*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-vect-*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS - -#### Tests with special options -global SAVED_DEFAULT_VECTCFLAGS -set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS - -# -ffast-math tests -set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS -lappend DEFAULT_VECTCFLAGS "-ffast-math" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-fast-math-vect*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS - -# Clean up. -set dg-do-what-default ${save-dg-do-what-default} - -# All done. -dg-finish |