1 # Copyright (C) 1997, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # GCC testsuite that uses the `dg.exp' driver.
19 # Exit immediately if this isn't a x86 target.
20 if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then {
27 # Return 1 if ssse3 instructions can be compiled.
28 proc check_effective_target_ssse3 { } {
29 return [check_no_compiler_messages ssse3 object {
30 typedef long long __m128i __attribute__ ((__vector_size__ (16)));
31 typedef int __v4si __attribute__ ((__vector_size__ (16)));
33 __m128i _mm_abs_epi32 (__m128i __X)
35 return (__m128i) __builtin_ia32_pabsd128 ((__v4si)__X);
40 # Return 1 if sse4 instructions can be compiled.
41 proc check_effective_target_sse4 { } {
42 return [check_no_compiler_messages sse4.1 object {
43 typedef long long __m128i __attribute__ ((__vector_size__ (16)));
44 typedef int __v4si __attribute__ ((__vector_size__ (16)));
46 __m128i _mm_mullo_epi32 (__m128i __X, __m128i __Y)
48 return (__m128i) __builtin_ia32_pmulld128 ((__v4si)__X,
54 # Return 1 if sse4a instructions can be compiled.
55 proc check_effective_target_sse4a { } {
56 return [check_no_compiler_messages sse4a object {
57 typedef long long __m128i __attribute__ ((__vector_size__ (16)));
58 typedef long long __v2di __attribute__ ((__vector_size__ (16)));
60 __m128i _mm_insert_si64 (__m128i __X,__m128i __Y)
62 return (__m128i) __builtin_ia32_insertq ((__v2di)__X, (__v2di)__Y);
67 # If a testcase doesn't have special options, use these.
69 if ![info exists DEFAULT_CFLAGS] then {
70 set DEFAULT_CFLAGS " -ansi -pedantic-errors"
76 # Special case compilation of vect-args.c so we don't have to
77 # replicate it 10 times.
78 foreach type { "" -mmmx -m3dnow -msse -msse2 } {
79 foreach level { "" -O } {
80 set flags "$type $level"
81 verbose -log "Testing vect-args, $flags" 1
82 dg-test $srcdir/$subdir/vect-args.c $flags ""
87 set tests [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]]
88 set tests [prune $tests $srcdir/$subdir/vect-args.c]
91 dg-runtest $tests "" $DEFAULT_CFLAGS