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