summaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib/target-supports.exp
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-21 19:37:05 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-21 19:37:05 +0000
commitb2009e332c150356085f0fb0e35a3a452b10c378 (patch)
treec188ce224e4d028d0ab5f3313b2bc6e749eb88e9 /gcc/testsuite/lib/target-supports.exp
parent323d3e1d50a7a2022e587b786d010c22812a6d5a (diff)
downloadgcc-b2009e332c150356085f0fb0e35a3a452b10c378.tar.gz
2011-07-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 176576 using svnmerge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@176583 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib/target-supports.exp')
-rw-r--r--gcc/testsuite/lib/target-supports.exp36
1 files changed, 27 insertions, 9 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 213118503c5..bec4d6fd762 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -290,11 +290,6 @@ proc check_weak_override_available { } {
# The argument is the kind of visibility, default/protected/hidden/internal.
proc check_visibility_available { what_kind } {
- # On NetWare, support makes no sense.
- if { [istarget *-*-netware*] } {
- return 0
- }
-
if [string match "" $what_kind] { set what_kind "hidden" }
return [check_no_compiler_messages visibility_available_$what_kind object "
@@ -571,7 +566,6 @@ proc check_profiling_available { test_what } {
|| [istarget tic6x-*-elf]
|| [istarget xstormy16-*]
|| [istarget xtensa*-*-elf]
- || [istarget *-*-netware*]
|| [istarget *-*-rtems*]
|| [istarget *-*-vxworks*] } {
set profiling_available_saved 0
@@ -1076,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 {
@@ -1086,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.
@@ -1182,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