From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../x86_64/costmodel-fast-math-vect-pr29925.c | 40 ++++++++++ .../vect/costmodel/x86_64/costmodel-pr30843.c | 26 +++++++ .../vect/costmodel/x86_64/costmodel-vect-31.c | 91 ++++++++++++++++++++++ .../vect/costmodel/x86_64/costmodel-vect-33.c | 40 ++++++++++ .../vect/costmodel/x86_64/costmodel-vect-68.c | 88 +++++++++++++++++++++ .../costmodel/x86_64/costmodel-vect-reduc-1char.c | 52 +++++++++++++ .../costmodel/x86_64/x86_64-costmodel-vect.exp | 75 ++++++++++++++++++ 7 files changed, 412 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp (limited to 'gcc/testsuite/gcc.dg/vect/costmodel/x86_64') diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c new file mode 100644 index 000000000..d5c0a1a13 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c @@ -0,0 +1,40 @@ +/* { dg-require-effective-target vect_float } */ + +#include +#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 +#include "../../tree-vect.h" + +#define N 16 + +void dacP98FillRGBMap (unsigned char *pBuffer) +{ + unsigned long dw, dw1; + unsigned long *pdw = (unsigned long *)(pBuffer); + + for( dw = 256, dw1 = 0; dw; dw--, dw1 += 0x01010101) + { + *pdw++ = dw1; + *pdw++ = dw1; + *pdw++ = dw1; + *pdw++ = dw1; + } +} + +/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target vect_interleave +} } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c new file mode 100644 index 000000000..b109be232 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c @@ -0,0 +1,91 @@ +/* { dg-require-effective-target vect_int } */ + +#include +#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) */ +}; + +struct s tmp; + +int main1 () +{ + int i; + + /* unaligned */ + for (i = 0; i < N/2; i++) + { + tmp.b[i] = 5; + } + + /* check results: */ + for (i = 0; i +#include "../../tree-vect.h" + +#define N 16 +struct test { + char ca[N]; +}; + +extern struct test s; + +__attribute__ ((noinline)) +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 (); +} + +/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c new file mode 100644 index 000000000..b916cd91d --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c @@ -0,0 +1,88 @@ +/* { dg-require-effective-target vect_int } */ + +#include +#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 +#include "../../tree-vect.h" + +#define N 16 +#define DIFF 242 + +unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + +void +main1 (unsigned char x, unsigned char max_result, unsigned char min_result) +{ + int i; + unsigned char udiff = 2; + unsigned char umax = x; + unsigned char umin = x; + + for (i = 0; i < N; i++) { + udiff += (unsigned char)(ub[i] - uc[i]); + } + + for (i = 0; i < N; i++) { + umax = umax < uc[i] ? uc[i] : umax; + } + + for (i = 0; i < N; i++) { + umin = umin > uc[i] ? uc[i] : umin; + } + + /* check results: */ + if (udiff != DIFF) + abort (); + if (umax != max_result) + abort (); + if (umin != min_result) + abort (); +} + +int main (void) +{ + check_vect (); + + main1 (100, 100, 1); + main1 (0, 15, 0); + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */ +/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp new file mode 100644 index 000000000..ff3650ce2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp @@ -0,0 +1,75 @@ +# Copyright (C) 1997, 2004, 2005, 2006, 2007, 2008 +# 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 +# . + +# GCC testsuite that uses the `dg.exp' driver. + +# Load support procs. +load_lib gcc-dg.exp + +# Exit immediately if this isn't a x86 target. +if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) + || ![is-effective-target lp64] } 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" + +# 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} + +lappend DEFAULT_VECTCFLAGS "-msse2" +if [check_sse2_hw_available] { + set dg-do-what-default run +} else { + set dg-do-what-default compile +} + +# 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 -- cgit v1.2.3