OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gfortran.dg/] [vect/] [vect.exp] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
# Copyright (C) 1997, 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
2
 
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.
7
#
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.
12
#
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
# .
16
 
17
# GCC testsuite that uses the `dg.exp' driver.
18
 
19
# Load support procs.
20
load_lib gfortran-dg.exp
21
load_lib target-supports.exp
22
 
23
# Set up flags used for tests that don't specify options.
24
set DEFAULT_VECTCFLAGS ""
25
 
26
# These flags are used for all targets.
27
lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" \
28
  "-ftree-vectorizer-verbose=4" "-fdump-tree-vect-stats"
29
 
30
# If the target system supports vector instructions, the default action
31
# for a test is 'run', otherwise it's 'compile'.  Save current default.
32
# Executing vector instructions on a system without hardware vector support
33
# is also disabled by a call to check_vect, but disabling execution here is
34
# more efficient.
35
global dg-do-what-default
36
set save-dg-do-what-default ${dg-do-what-default}
37
 
38
# Skip these tests for targets that do not support generating vector
39
# code.  Set additional target-dependent vector flags, which can be
40
# overridden by using dg-options in individual tests.
41
if  [istarget "powerpc-*paired*"]  {
42
   lappend DEFAULT_VECTCFLAGS "-mpaired"
43
    if [check_750cl_hw_available] {
44
        set dg-do-what-default run
45
    } else {
46
        set dg-do-what-default compile
47
    }
48
} elseif [istarget "powerpc*-*-*"] {
49
    # Skip targets not supporting -maltivec.
50
    if ![is-effective-target powerpc_altivec_ok] {
51
        return
52
    }
53
 
54
    lappend DEFAULT_VECTCFLAGS "-maltivec"
55
    if [check_vsx_hw_available]  {
56
      lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
57
    }
58
 
59
    if [check_vmx_hw_available] {
60
        set dg-do-what-default run
61
    } else {
62
        if [is-effective-target ilp32] {
63
            # Specify a cpu that supports VMX for compile-only tests.
64
            lappend DEFAULT_VECTCFLAGS "-mcpu=970"
65
        }
66
        set dg-do-what-default compile
67
    }
68
} elseif { [istarget  "spu-*-*"] } {
69
   set dg-do-what-default run
70
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
71
    if { ![check_effective_target_sse2] } then {
72
        return
73
    }
74
    lappend DEFAULT_VECTCFLAGS "-msse2"
75
    if { [check_sse2_hw_available] && [check_sse_os_support_available] } {
76
        set dg-do-what-default run
77
    } else {
78
        set dg-do-what-default compile
79
    }
80
} elseif { [istarget "mips*-*-*"]
81
           && [check_effective_target_mpaired_single]
82
           && [check_effective_target_nomips16] } {
83
    lappend DEFAULT_VECTCFLAGS "-mpaired-single"
84
    set dg-do-what-default run
85
} elseif [istarget "sparc*-*-*"] {
86
    lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
87
    if [check_effective_target_ultrasparc_hw] {
88
        set dg-do-what-default run
89
    } else {
90
        set dg-do-what-default compile
91
    }
92
} elseif [istarget "alpha*-*-*"] {
93
    # Alpha's vectorization capabilities are extremely limited.
94
    # It's more effort than its worth disabling all of the tests
95
    # that it cannot pass.  But if you actually want to see what
96
    # does work, command out the return.
97
    return
98
 
99
    lappend DEFAULT_VECTCFLAGS "-mmax"
100
    if [check_alpha_max_hw_available] {
101
        set dg-do-what-default run
102
    } else {
103
        set dg-do-what-default compile
104
    }
105
} elseif [istarget "ia64-*-*"] {
106
    set dg-do-what-default run
107
} elseif [is-effective-target arm_neon_ok] {
108
    lappend DEFAULT_VECTCFLAGS "-mfpu=neon" "-mfloat-abi=softfp"
109
    if [is-effective-target arm_neon_hw] {
110
      set dg-do-what-default run
111
    } else {
112
      set dg-do-what-default compile
113
    }
114
} else {
115
    return
116
}
117
 
118
# Initialize `dg'.
119
dg-init
120
 
121
# Main loop.
122
gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[fF\]{,90,95,03,08} ]] $DEFAULT_VECTCFLAGS
123
gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[fF\]{,90,95,03,08} ]] $DEFAULT_VECTCFLAGS
124
 
125
#### Tests with special options
126
global SAVED_DEFAULT_VECTCFLAGS
127
set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
128
 
129
# -ffast-math tests
130
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
131
lappend DEFAULT_VECTCFLAGS "-ffast-math"
132
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-*.\[fF\]{,90,95,03,08} ]]  \
133
        "" $DEFAULT_VECTCFLAGS
134
 
135
# -ffast-math tests
136
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
137
lappend DEFAULT_VECTCFLAGS "-ffast-math" "-fdefault-real-8"
138
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-real8*.\[fF\]{,90,95,03,08} ]]  \
139
        "" $DEFAULT_VECTCFLAGS
140
 
141
# -fvect-cost-model tests
142
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
143
lappend DEFAULT_VECTCFLAGS "-fvect-cost-model"
144
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/cost-model-*.\[fF\]{,90,95,03,08} ]]  \
145
        "" $DEFAULT_VECTCFLAGS
146
 
147
# --param vect-max-version-for-alias-checks=0 tests
148
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
149
lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=0"
150
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[fF\]{,90,95,03,08} ]]  \
151
        "" $DEFAULT_VECTCFLAGS
152
 
153
# With -O3
154
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
155
lappend DEFAULT_VECTCFLAGS "-O3"
156
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-*.\[fF\]{,90,95,03,08} ]]  \
157
        "" $DEFAULT_VECTCFLAGS
158
 
159
# Clean up.
160
set dg-do-what-default ${save-dg-do-what-default}
161
 
162
# All done.
163
dg-finish

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.