1 # Copyright (C) 2002 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 2 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 this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # Test that the correct data prefetch instructions (SSE or 3DNow! variant,
18 # or none) are used for various i386 cpu-type and instruction set
19 # extension options for __builtin_prefetch.
21 # Failure reports do not include the compile option that was used; that
22 # information can be seen in the compile line in the log file.
24 # Do not generate prefetch instructions for the following options.
26 set PREFETCH_NONE [list \
42 # For options in PREFETCH_SSE, generate SSE prefetch instructions for
43 # __builtin_prefetch. This includes -mcpu for targets that treat prefetch
44 # instructions as nops.
46 set PREFETCH_SSE [list \
54 # Generate 3DNow! prefetch instructions for the following.
56 set PREFETCH_3DNOW [list \
60 # Athlon supports both 3DNow! and SSE prefetch instructions. For
61 # __builtin_prefetch, generate the 3DNow! instruction for write
62 # prefetches but SSE prefetch instructions for read prefetches.
64 set PREFETCH_ATHLON [list \
78 set torture_with_loops $PREFETCH_NONE
79 set torture_without_loops $PREFETCH_NONE
80 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-none-*.c]] ""
82 set torture_with_loops $PREFETCH_SSE
83 set torture_without_loops $PREFETCH_SSE
84 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-sse-*.c]] ""
86 set torture_with_loops $PREFETCH_3DNOW
87 set torture_without_loops $PREFETCH_3DNOW
88 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-3dnow-*.c]] ""
90 set torture_with_loops $PREFETCH_ATHLON
91 set torture_without_loops $PREFETCH_ATHLON
92 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-athlon-*.c]] ""