re PR tree-optimization/46312 (gcc.dg/vec-scal-opt2.c fails for ARM targets.)

PR tree-optimization/46312
        * gcc.dg/vect/vect-scal-opt2.c: Rename to...
        * gcc.dg/vect/vec-scal-opt2.c: ... this. Expect to pass only
        on targets that support vector shifts with scalar shift
        argument.
        Remove dg-options.
        * gcc.dg/vect/vect-scal-opt.c: Rename to...
        * gcc.dg/vect/vec-scal-opt.c: ... this, and change likewise.
        * gcc.dg/vect/vect-scal-opt1.c: Rename to...
        * gcc.dg/vect/vec-scal-opt1.c: ... this, and change likewise.
        * gcc.dg/vect/vect.exp: Run vec-scal-* tests with relevant
        flags.
        * gcc.dg/vect/vect-114.c: Expect to pass only on targets that
        support misaligned data accesses.
        * gcc.dg/vect/pr43432.c, gcc.dg/vect/vect-15.c: Likewise.
        * gcc.dg/vect/pr43430-2.c: Remove dg-options.
        * lib/target-supports.exp
        (check_effective_target_vect_shift_scalar): New.

From-SVN: r166860
This commit is contained in:
Ira Rosen 2010-11-17 10:00:27 +00:00 committed by Ira Rosen
parent a677307de8
commit d92826beb4
10 changed files with 58 additions and 14 deletions

View File

@ -1,3 +1,22 @@
2010-11-17 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/46312
* gcc.dg/vect/vect-scal-opt2.c: Rename to...
* gcc.dg/vect/vec-scal-opt2.c: ... this. Expect to pass only
on targets that support vector shifts with scalar shift argument.
Remove dg-options.
* gcc.dg/vect/vect-scal-opt.c: Rename to...
* gcc.dg/vect/vec-scal-opt.c: ... this, and change likewise.
* gcc.dg/vect/vect-scal-opt1.c: Rename to...
* gcc.dg/vect/vec-scal-opt1.c: ... this, and change likewise.
* gcc.dg/vect/vect.exp: Run vec-scal-* tests with relevant flags.
* gcc.dg/vect/vect-114.c: Expect to pass only on targets that
support misaligned data accesses.
* gcc.dg/vect/pr43432.c, gcc.dg/vect/vect-15.c: Likewise.
* gcc.dg/vect/pr43430-2.c: Remove dg-options.
* lib/target-supports.exp
(check_effective_target_vect_shift_scalar): New.
2010-11-17 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/guality/nop.h: New file.

View File

@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
/* { dg-options "-O3 -fno-vect-cost-model -fdump-tree-vect-details" } */
typedef unsigned char uint8_t;
vsad16_c (void *c, uint8_t * s1, uint8_t * s2, int stride, int h)
{

View File

@ -10,5 +10,5 @@ int len){
dst[i] = src0[i] * src1[-i];
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm } } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm && vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target vect_shift } */
/* { dg-require-effective-target vect_int } */
/* { dg-options "-O -fdump-tree-veclower" } */
#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
#define vector(elcount, type) \
@ -20,5 +19,5 @@ int main (int argc, char *argv[]) {
return vidx(short, r1, 0);
}
/* { dg-final { scan-tree-dump-times ">> k.\[0-9_\]*" 1 "veclower" } } */
/* { dg-final { scan-tree-dump-times ">> k.\[0-9_\]*" 1 "veclower" { target vect_shift_scalar } } } */
/* { dg-final { cleanup-tree-dump "veclower" } } */

View File

@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target vect_shift } */
/* { dg-require-effective-target vect_int } */
/* { dg-options "-O -fdump-tree-veclower" } */
#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
#define vector(elcount, type) \
@ -18,5 +17,5 @@ int main (int argc, char *argv[]) {
return vidx(short, r1, 0);
}
/* { dg-final { scan-tree-dump-times ">> 2" 1 "veclower" } } */
/* { dg-final { scan-tree-dump-times ">> 2" 1 "veclower" { target vect_shift_scalar } } } */
/* { dg-final { cleanup-tree-dump "veclower" } } */

View File

@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target vect_shift } */
/* { dg-require-effective-target vect_int } */
/* { dg-options "-O -fdump-tree-veclower" } */
#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
#define vector(elcount, type) \
@ -17,5 +16,5 @@ int main (int argc, char *argv[]) {
return vidx(short, r1, 0);
}
/* { dg-final { scan-tree-dump-times ">> 2" 1 "veclower" } } */
/* { dg-final { scan-tree-dump-times ">> 2" 1 "veclower" { target vect_shift_scalar } } } */
/* { dg-final { cleanup-tree-dump "veclower" } } */

View File

@ -34,7 +34,7 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_perm } } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_perm && vect_hw_misalign } } } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm && vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -35,5 +35,5 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm && vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -23,9 +23,6 @@ load_lib gcc-dg.exp
# Set up flags used for tests that don't specify options.
set DEFAULT_VECTCFLAGS ""
# These flags are used for all targets.
lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-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
@ -118,6 +115,12 @@ if [istarget "powerpc-*paired*"] {
return
}
global VEC_FLAGS
set VEC_FLAGS $DEFAULT_VECTCFLAGS
# These flags are used for all targets.
lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model"
# Initialize `dg'.
dg-init
@ -137,6 +140,11 @@ lappend DEFAULT_VECTCFLAGS "-O2"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/nodump-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# "-O -fdump-tree-veclower"
lappend VEC_FLAGS "-O" "-fdump-tree-veclower"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vec-scal-*.\[cS\]]] \
"" $VEC_FLAGS
set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"

View File

@ -2258,6 +2258,27 @@ proc check_effective_target_vect_shift { } {
return $et_vect_shift_saved
}
# Return 1 if the target supports hardware vector shift operation with
# scalar shift argument.
proc check_effective_target_vect_shift_scalar { } {
global et_vect_shift_scalar_saved
if [info exists et_vect_shift_scalar_saved] {
verbose "check_effective_target_vect_shift_scalar: using cached result" 2
} else {
set et_vect_shift_scalar_saved 0
if { [istarget x86_64-*-*]
|| [istarget i?86-*-*] } {
set et_vect_shift_scalar_saved 1
}
}
verbose "check_effective_target_vect_shift_scalar: returning $et_vect_shift_scalar_saved" 2
return $et_vect_shift_scalar_saved
}
# Return 1 if the target supports hardware vectors of long, 0 otherwise.
#
# This can change for different subtargets so do not cache the result.