1 # Copyright (C) 1997, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with GCC; see the file COPYING3. If not see
15 # <http://www.gnu.org/licenses/>.
17 # GCC testsuite that uses the `dg.exp' driver.
22 # Exit immediately if this isn't a powerpc target.
23 if { ![istarget powerpc*-*-*] } then {
27 # Skip targets not supporting -maltivec.
28 if ![is-effective-target powerpc_altivec_ok] {
32 # Set up flags used for tests that don't specify options.
33 set DEFAULT_VECTCFLAGS ""
35 # These flags are used for all targets.
36 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model"
38 # If the target system supports vector instructions, the default action
39 # for a test is 'run', otherwise it's 'compile'. Save current default.
40 # Executing vector instructions on a system without hardware vector support
41 # is also disabled by a call to check_vect, but disabling execution here is
43 global dg-do-what-default
44 set save-dg-do-what-default ${dg-do-what-default}
46 lappend DEFAULT_VECTCFLAGS "-maltivec"
47 if [check_vmx_hw_available] {
48 set dg-do-what-default run
50 if [is-effective-target ilp32] {
51 # Specify a cpu that supports VMX for compile-only tests.
52 lappend DEFAULT_VECTCFLAGS "-mcpu=7400"
54 set dg-do-what-default compile
60 lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
63 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-pr*.\[cS\]]] \
64 "" $DEFAULT_VECTCFLAGS
65 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-vect-*.\[cS\]]] \
66 "" $DEFAULT_VECTCFLAGS
68 #### Tests with special options
69 global SAVED_DEFAULT_VECTCFLAGS
70 set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
73 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
74 lappend DEFAULT_VECTCFLAGS "-ffast-math"
75 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-fast-math-vect*.\[cS\]]] \
76 "" $DEFAULT_VECTCFLAGS
79 set dg-do-what-default ${save-dg-do-what-default}