aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2011-07-21 17:53:11 +0200
committerUros Bizjak <uros@gcc.gnu.org>2011-07-21 17:53:11 +0200
commitd4add9520645abcfa2e1aabb71dfd1f8669f70ad (patch)
tree1f7f7d8207dcba4a53a83ffb2678d27442fb7e45 /gcc/testsuite
parente951472536aab778c6bd5c605fc908439cd64cff (diff)
downloadgcc-d4add9520645abcfa2e1aabb71dfd1f8669f70ad.zip
gcc-d4add9520645abcfa2e1aabb71dfd1f8669f70ad.tar.gz
gcc-d4add9520645abcfa2e1aabb71dfd1f8669f70ad.tar.bz2
target-supports.exp (check_avx_os_support_available): New.
* lib/target-supports.exp (check_avx_os_support_available): New. (check_effective_target_avx_runtime): Use it. From-SVN: r176576
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/lib/target-supports.exp30
2 files changed, 33 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 334730c..c49e0b7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-21 Uros Bizjak <ubizjak@gmail.com>
+
+ * lib/target-supports.exp (check_avx_os_support_available): New.
+ (check_effective_target_avx_runtime): Use it.
+
2011-07-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49770
@@ -13,7 +18,7 @@
* gfortran.dg/coarray_lib_token_1.f90: New.
2011-07-21 Georg-Johann Lay <avr@gjlay.de>
-
+
* gcc.dg/pr32912-2.c: Skip for AVR.
* gcc.dg/pr44674.c: Add dg-require-profiling.
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 2148f80..bec4d6f 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1070,8 +1070,8 @@ proc check_sse_os_support_available { } {
check_runtime_nocache sse_os_support_available {
int main ()
{
- __asm__ volatile ("movaps %xmm0,%xmm0");
- return 0;
+ asm volatile ("movaps %xmm0,%xmm0");
+ return 0;
}
} "-msse"
} else {
@@ -1080,6 +1080,29 @@ proc check_sse_os_support_available { } {
}]
}
+# Return 1 if the target OS supports running AVX executables, 0
+# otherwise. Cache the result.
+
+proc check_avx_os_support_available { } {
+ return [check_cached_effective_target avx_os_support_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 that OS has AVX and SSE saving enabled.
+ check_runtime_nocache avx_os_support_available {
+ int main ()
+ {
+ unsigned int eax, edx;
+
+ asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+ return (eax & 6) != 6;
+ }
+ } ""
+ }
+ }]
+}
+
# Return 1 if the target supports executing SSE instructions, 0
# otherwise. Cache the result.
@@ -1176,7 +1199,8 @@ proc check_effective_target_sse2_runtime { } {
proc check_effective_target_avx_runtime { } {
if { [check_effective_target_avx]
- && [check_avx_hw_available] } {
+ && [check_avx_hw_available]
+ && [check_avx_os_support_available] } {
return 1
}
return 0