===================================================================
@@ -20,7 +20,7 @@
return 0;
/* Run AVX test only if host has AVX support. */
- if (ecx & bit_AVX)
+ if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
{
do_test ();
#ifdef DEBUG
===================================================================
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 { target { i?86-*-* x86_64-*-* } } } */
/* { dg-options "-O2 -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */
typedef unsigned __attribute__ ((__mode__ (__pointer__))) uintptr_t;
===================================================================
@@ -1,7 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -lm" } */
/* { dg-options "-O2 -msse2 -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-require-effective-target sse2 { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-require-effective-target sse2_runtime { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
extern double fabs (double);
===================================================================
@@ -1,6 +1,6 @@
/* PR target/38736 */
/* { dg-skip-if "attribute ((aligned))" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target avx_runtime } */
/* Test compatibility of attribute ((aligned)) with and without -mavx. */
===================================================================
@@ -1,12 +1,10 @@
/* { dg-skip-if "test AVX vector" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target avx_runtime } */
/* Test compatibility of vector types: layout between separately-compiled
modules, parameter passing, and function return. This test uses
vectors of integer values. */
-#include "cpuid.h"
-
extern void vector_1_x (void);
extern void exit (int);
int fails;
@@ -14,14 +12,6 @@
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run AVX vector test only if host has AVX support. */
- if (ecx & bit_AVX)
- vector_1_x ();
-
+ vector_1_x ();
exit (0);
}
===================================================================
@@ -1,12 +1,10 @@
/* { dg-skip-if "test AVX support" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target avx_runtime } */
/* Test compatibility of vector types: layout between separately-compiled
modules, parameter passing, and function return. This test uses
vectors of floating points values. */
-#include "cpuid.h"
-
extern void vector_2_x (void);
extern void exit (int);
int fails;
@@ -14,14 +12,6 @@
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run AVX vector test only if host has AVX support. */
- if (ecx & bit_AVX)
- vector_2_x ();
-
+ vector_2_x ();
exit (0);
}
===================================================================
@@ -1,6 +1,5 @@
/* { dg-skip-if "test SSE2 support" { ! { i?86-*-* x86_64-*-* } } } */
/* { dg-options "-O" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
/* Test function argument passing. PR target/15301. */
===================================================================
@@ -1,5 +1,4 @@
/* { dg-skip-if "test SSE2 vector" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
/* Test compatibility of vector types: layout between separately-compiled
===================================================================
@@ -1,5 +1,4 @@
/* { dg-skip-if "test SSE2 support" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
/* Test compatibility of vector types: layout between separately-compiled
===================================================================
@@ -1,6 +1,5 @@
/* { dg-do run } */
/* { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-require-effective-target sse_runtime { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
typedef float v2sf __attribute__ ((vector_size (2 * sizeof(float))));
===================================================================
@@ -2,7 +2,6 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -msse -ffast-math" { target i?86-*-* x86_64-*-* } } */
-/* { dg-require-effective-target sse { target i?86-*-* x86_64-*-* } } */
void bar (float *a, float *b);
===================================================================
@@ -1,6 +1,5 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
===================================================================
@@ -1,7 +1,6 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
#include <stdarg.h>
===================================================================
@@ -1,7 +1,6 @@
/* PR middle-end/37010 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2 -mpreferred-stack-boundary=2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
===================================================================
@@ -1,7 +1,6 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
===================================================================
@@ -1,7 +1,6 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
===================================================================
@@ -1,6 +1,5 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
===================================================================
@@ -1,7 +1,6 @@
/* PR rtl-optimization/16104 */
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
extern void abort (void);
===================================================================
@@ -1,6 +1,5 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
===================================================================
@@ -1,7 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -msse2 -mtune=core2 -mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 { target { i?86-*-* x86_64-*-* } } } */
/* { dg-require-effective-target sse2_runtime { target { i?86-*-* x86_64-*-* } } } */
extern void abort (void);
===================================================================
@@ -3,7 +3,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
/* { dg-options "-O2 -fprefetch-loop-arrays -march=i686 -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
void foo (void)
{
===================================================================
@@ -2,7 +2,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
/* { dg-options "-O2 -fprefetch-loop-arrays -march=i686 -msse -w" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
__extension__ typedef __SIZE_TYPE__ size_t;
===================================================================
@@ -67,11 +67,8 @@
} elseif { [istarget "spu-*-*"] } {
set dg-do-what-default run
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
- if { ![check_effective_target_sse2] } then {
- return
- }
lappend DEFAULT_VECTCFLAGS "-msse2"
- if { [check_sse2_hw_available] && [check_sse_os_support_available] } {
+ if { [check_effective_target_sse2_runtime] } {
set dg-do-what-default run
} else {
set dg-do-what-default compile
===================================================================
@@ -1,6 +1,5 @@
/* { dg-do compile { target x86_64-*-* i?86-*-* } } */
/* { dg-options "-std=c99 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
__m64 _mm_add_si64 (__m64 __m1, __m64 __m2)
===================================================================
@@ -1,7 +1,6 @@
// PR middle-end/40446
// { dg-do run { target i?86-*-* x86_64-*-* } }
// { dg-options "-O1 -msse2" }
-// { dg-require-effective-target sse2 }
// { dg-require-effective-target sse2_runtime }
#include <emmintrin.h>
===================================================================
@@ -1,6 +1,5 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target sse2_runtime } */
#include <xmmintrin.h>
===================================================================
@@ -75,11 +75,8 @@
} elseif { [istarget "spu-*-*"] } {
set dg-do-what-default run
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
- if { ![check_effective_target_sse2] } then {
- return
- }
lappend DEFAULT_VECTCFLAGS "-msse2"
- if { [check_sse2_hw_available] && [check_sse_os_support_available] } {
+ if { [check_effective_target_sse2_runtime] } {
set dg-do-what-default run
} else {
set dg-do-what-default compile
===================================================================
@@ -953,7 +953,7 @@
#include "cpuid.h"
int main ()
{
- unsigned int eax, ebx, ecx, edx = 0;
+ unsigned int eax, ebx, ecx, edx;
if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
return !(edx & bit_SSE);
return 1;
@@ -976,7 +976,7 @@
#include "cpuid.h"
int main ()
{
- unsigned int eax, ebx, ecx, edx = 0;
+ unsigned int eax, ebx, ecx, edx;
if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
return !(edx & bit_SSE2);
return 1;
@@ -986,26 +986,62 @@
}]
}
+# Return 1 if the target supports executing AVX instructions, 0
+# otherwise. Cache the result.
+
+proc check_avx_hw_available { } {
+ return [check_cached_effective_target avx_hw_available {
+ # If this is not the right target then we can skip the test.
+ if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+ expr 0
+ } else {
+ check_runtime_nocache avx_hw_available {
+ #include "cpuid.h"
+ int main ()
+ {
+ unsigned int eax, ebx, ecx, edx;
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return ((ecx & (bit_AVX | bit_OSXSAVE))
+ != (bit_AVX | bit_OSXSAVE));
+ return 1;
+ }
+ } ""
+ }
+ }]
+}
+
# Return 1 if the target supports running SSE executables, 0 otherwise.
proc check_effective_target_sse_runtime { } {
- if { [check_sse_hw_available] && [check_sse_os_support_available] } {
+ if { [check_effective_target_sse]
+ && [check_sse_hw_available]
+ && [check_sse_os_support_available] } {
return 1
- } else {
- return 0
}
+ return 0
}
# Return 1 if the target supports running SSE2 executables, 0 otherwise.
proc check_effective_target_sse2_runtime { } {
- if { [check_sse2_hw_available] && [check_sse_os_support_available] } {
+ if { [check_effective_target_sse2]
+ && [check_sse2_hw_available]
+ && [check_sse_os_support_available] } {
return 1
- } else {
- return 0
}
+ return 0
}
+# Return 1 if the target supports running AVX executables, 0 otherwise.
+
+proc check_effective_target_avx_runtime { } {
+ if { [check_effective_target_avx]
+ && [check_avx_hw_available] } {
+ return 1
+ }
+ return 0
+}
+
# Return 1 if the target supports executing VSX instructions, 0
# otherwise. Cache the result.
===================================================================
@@ -1,7 +1,6 @@
! { dg-do compile { target i?86-*-* x86_64-*-* } }
! { dg-require-effective-target ilp32 }
! { dg-options "-O -msse -mfpmath=sse" }
-! { dg-require-effective-target sse }
subroutine yhalf(z)
complex cdexpj,z
z=cdexpj((0.d0,1.d0)*z)
===================================================================
@@ -1,7 +1,6 @@
! { dg-do compile { target i?86-*-* x86_64-*-* } }
! { dg-require-effective-target ilp32 }
! { dg-options "-O2 -msse -ftree-vectorize" }
-! { dg-require-effective-target sse }
subroutine cblank_cvb(a,ndim)
character*(*) a
character*1 blank
===================================================================
@@ -68,11 +68,8 @@
} elseif { [istarget "spu-*-*"] } {
set dg-do-what-default run
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
- if { ![check_effective_target_sse2] } then {
- return
- }
lappend DEFAULT_VECTCFLAGS "-msse2"
- if { [check_sse2_hw_available] && [check_sse_os_support_available] } {
+ if { [check_effective_target_sse2_runtime] } {
set dg-do-what-default run
} else {
set dg-do-what-default compile