Commit 31589ec6 by Richard Henderson Committed by Richard Henderson

pr18425.c: Use effective target vect_long.

        * gcc.dg/vect/pr18425.c: Use effective target vect_long.
        * gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
        gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
        gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
        gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
        gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.

        * gcc.dg/vect/vect.exp: Add check for alpha.
        * lib/target-supports.exp (check_alpha_max_hw_available): New.
        (check_effective_target_vect_int): Enable for alpha.
        (check_effective_target_vect_long): New.
        (is-effective-target): Add it.

From-SVN: r91105
parent f8af9e28
2004-11-23 Richard Henderson <rth@redhat.com>
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
2004-11-23 Uros Bizjak <uros@kss-loka.si>
* gcc.dg/pr18614-1.c: New test.
......
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
#include <stdarg.h>
#include "tree-vect.h"
#define N 16
/* ??? Using "long" isn't quite right; we're testing vectors of pointers here.
But since no extant target supports sizeof(long) != sizeof(void*)... */
/* { dg-require-effective-target vect_long } */
char ** _M_allocate();
void
......@@ -16,5 +13,4 @@ _M_fill_insert(unsigned int __n)
*__new_start = __tmp;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
......@@ -38,4 +38,4 @@ int main (void)
/* These fail to vectorize on targets that don't have or model a vector
max operation. */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* alpha*-*-* } } } */
......@@ -126,4 +126,4 @@ int main (void)
/* These fail to vectorize on targets that don't have or model vector
bitwise operations. */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-*} } } */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-* alpha*-*-* } } } */
......@@ -125,4 +125,4 @@ int main (void)
/* These fail to vectorize on targets that don't have or model vector
bitwise operations. */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-*} } } */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-* alpha*-*-* } } } */
......@@ -125,4 +125,4 @@ int main (void)
/* These fail to vectorize on targets that don't have or model vector
bitwise operations. */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-*} } } */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-* alpha*-*-* } } } */
......@@ -97,4 +97,4 @@ int main (void)
/* These fail to vectorize on targets that don't have or model vector
bitwise operations. */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-*} } } */
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-* alpha*-*-* } } } */
......@@ -53,4 +53,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail sparc*-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail sparc*-*-* alpha*-*-* } } } */
......@@ -51,4 +51,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail sparc*-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail sparc*-*-* alpha*-*-* } } } */
......@@ -45,4 +45,5 @@ int main (void)
return main1 ();
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* Fails for targets that don't vectorize PLUS. */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail alpha*-*-* } } } */
......@@ -41,5 +41,4 @@ int main (void)
/* These are not yet vectorized on targets that do not model alignment-handling
mechanisms. */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* alpha*-*-* } } } */
......@@ -43,5 +43,4 @@ int main (void)
/* This fails to vectorize for 64-bit powerpc but there's no way to
specify that in an xfail list. */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail sparc*-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail sparc*-*-* alpha*-*-* } } } */
......@@ -40,6 +40,4 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* sparc*-*-* alpha*-*-* } } } */
......@@ -45,4 +45,5 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* Fails for targets that don't vectorize PLUS. */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail alpha*-*-* } } } */
......@@ -49,4 +49,5 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* Fails for targets that don't vectorize PLUS. */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail alpha*-*-* } } } */
......@@ -49,4 +49,5 @@ int main (void)
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* Fails for targets that don't vectorize PLUS. */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail alpha*-*-* } } } */
......@@ -58,6 +58,13 @@ if [istarget "powerpc*-*-*"] {
} elseif [istarget "sparc*-*-*"] {
lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
set dg-do-what-default run
} elseif [istarget "alpha*-*-*"] {
lappend DEFAULT_VECTCFLAGS "-mmax"
if [check_alpha_max_hw_available] {
set dg-do-what-default run
} else {
set dg-do-what-default compile
}
} else {
return
}
......
......@@ -368,6 +368,46 @@ proc check_vmx_hw_available { } {
return $vmx_hw_available_saved
}
proc check_alpha_max_hw_available { } {
global alpha_max_hw_available_saved
global tool
if [info exists alpha_max_hw_available_saved] {
verbose "check_alpha_max_hw_available returning saved $alpha_max_hw_available_saved" 2
} else {
set alpha_max_hw_available_saved 0
# Set up, compile, and execute a test program probing bit 8 of the
# architecture mask, which indicates presence of MAX instructions.
set src max[pid].c
set exe max[pid].x
set f [open $src "w"]
puts $f "int main() { return __builtin_alpha_amask(1<<8) != 0; }"
close $f
verbose "check_alpha_max_hw_available compiling testfile $src" 2
set lines [${tool}_target_compile $src $exe executable ""]
file delete $src
if [string match "" $lines] then {
# No error message, compilation succeeded.
set result [${tool}_load "./$exe" "" ""]
set status [lindex $result 0]
remote_file build delete $exe
verbose "check_alpha_max_hw_available testfile status is <$status>" 2
if { $status == "pass" } then {
set alpha_max_hw_available_saved 1
}
} else {
verbose "check_alpha_max_hw_availalble testfile compilation failed" 2
}
}
return $alpha_max_hw_available_saved
}
# Return 1 if we're generating 32-bit code using default options, 0
# otherwise.
......@@ -406,7 +446,8 @@ proc check_effective_target_vect_int { } {
if { [istarget i?86-*-*]
|| [istarget powerpc*-*-*]
|| [istarget x86_64-*-*]
|| [istarget sparc*-*-*] } {
|| [istarget sparc*-*-*]
|| [istarget alpha*-*-*] } {
set et_vect_int_saved 1
}
}
......@@ -415,6 +456,29 @@ proc check_effective_target_vect_int { } {
return $et_vect_int_saved
}
# Return 1 if the target supports hardware vectors of long, 0 otherwise.
#
# This won't change for different subtargets so cache the result.
proc check_effective_target_vect_long { } {
global et_vect_long_saved
if [info exists et_vect_long_saved] {
verbose "check_effective_target_vect_long: using cached result" 2
} else {
set et_vect_long_saved 0
if { [istarget i?86-*-*]
|| [istarget powerpc*-*-*]
|| [istarget x86_64-*-*]
|| ([istarget sparc*-*-*] && [check_effective_target_ilp32]) } {
set et_vect_long_saved 1
}
}
verbose "check_effective_target_vect_long: returning $et_vect_long_saved" 2
return $et_vect_long_saved
}
# Return 1 if the target supports hardware vectors of float, 0 otherwise.
#
# This won't change for different subtargets so cache the result.
......@@ -473,6 +537,7 @@ proc is-effective-target { arg } {
"named_sections" { set selected [check_named_sections_available] }
"gc_sections" { set selected [check_gc_sections_available] }
"vect_int" { set selected [check_effective_target_vect_int] }
"vect_long" { set selected [check_effective_target_vect_long] }
"vect_float" { set selected [check_effective_target_vect_float] }
"vect_double" { set selected [check_effective_target_vect_double] }
default { error "unknown effective target selector `$arg'" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment