]>
Commit | Line | Data |
---|---|---|
71e45bc2 | 1 | # Copyright (C) 1997, 2004, 2005, 2006, 2007, 2010, 2012 |
d91f7526 | 2 | # Free Software Foundation, Inc. |
62612fe9 | 3 | |
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 | |
f63ff66b | 6 | # the Free Software Foundation; either version 3 of the License, or |
62612fe9 | 7 | # (at your option) any later version. |
8 | # | |
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. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
f63ff66b | 15 | # along with GCC; see the file COPYING3. If not see |
16 | # <http://www.gnu.org/licenses/>. | |
62612fe9 | 17 | |
18 | # GCC testsuite that uses the `dg.exp' driver. | |
19 | ||
20 | # Load support procs. | |
21 | load_lib gcc-dg.exp | |
22 | ||
23 | # Exit immediately if this isn't a powerpc target. | |
24 | if { ![istarget powerpc*-*-*] } then { | |
25 | return | |
26 | } | |
27 | ||
28 | # Skip targets not supporting -maltivec. | |
29 | if ![is-effective-target powerpc_altivec_ok] { | |
30 | return | |
31 | } | |
32 | ||
33 | # Set up flags used for tests that don't specify options. | |
34 | set DEFAULT_VECTCFLAGS "" | |
35 | ||
36 | # These flags are used for all targets. | |
e9cd52eb | 37 | lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model" "-fno-common" |
62612fe9 | 38 | |
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 | |
43 | # more efficient. | |
44 | global dg-do-what-default | |
45 | set save-dg-do-what-default ${dg-do-what-default} | |
46 | ||
47 | lappend DEFAULT_VECTCFLAGS "-maltivec" | |
48 | if [check_vmx_hw_available] { | |
49 | set dg-do-what-default run | |
50 | } else { | |
51 | if [is-effective-target ilp32] { | |
52 | # Specify a cpu that supports VMX for compile-only tests. | |
b4ef0ce1 | 53 | lappend DEFAULT_VECTCFLAGS "-mcpu=970" |
62612fe9 | 54 | } |
55 | set dg-do-what-default compile | |
56 | } | |
57 | ||
58 | # Initialize `dg'. | |
59 | dg-init | |
60 | ||
ad074595 | 61 | set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS |
62 | ||
62612fe9 | 63 | lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details" |
ad074595 | 64 | lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details" |
62612fe9 | 65 | |
66 | # Main loop. | |
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 | |
c6895939 | 71 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-slp-*.\[cS\]]] \ |
72 | "" $DEFAULT_VECTCFLAGS | |
ad074595 | 73 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-bb-slp*.\[cS\]]] \ |
74 | "" $VECT_SLP_CFLAGS | |
62612fe9 | 75 | |
76 | #### Tests with special options | |
77 | global SAVED_DEFAULT_VECTCFLAGS | |
78 | set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS | |
79 | ||
80 | # -ffast-math tests | |
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 | |
85 | ||
86 | # Clean up. | |
87 | set dg-do-what-default ${save-dg-do-what-default} | |
88 | ||
89 | # All done. | |
90 | dg-finish |