OSDN Git Service

Disable -mpreferred-stack-boundary options for Windows.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / lib / target-supports.exp
index 35798a0..87b234d 100644 (file)
@@ -1813,6 +1813,18 @@ proc check_effective_target_arm32 { } {
     }]
 }
 
+# Return 1 if this is an ARM target that only supports aligned vector accesses
+proc check_effective_target_arm_vect_no_misalign { } {
+    return [check_no_compiler_messages arm_vect_no_misalign assembly {
+       #if !defined(__arm__) \
+           || (defined(__ARMEL__) \
+               && (!defined(__thumb__) || defined(__thumb2__)))
+       #error FOO
+       #endif
+    }]
+}
+
+
 # Return 1 if this is an ARM target supporting -mfpu=vfp
 # -mfloat-abi=softfp.  Some multilibs may be incompatible with these
 # options.
@@ -2776,7 +2788,7 @@ proc check_effective_target_vect_no_align { } {
        if { [istarget mipsisa64*-*-*]
             || [istarget sparc*-*-*]
             || [istarget ia64-*-*]
-            || [check_effective_target_arm32]
+            || [check_effective_target_arm_vect_no_misalign]
             || ([istarget mips*-*-*]
                 && [check_effective_target_mips_loongson]) } {
            set et_vect_no_align_saved 1
@@ -2913,6 +2925,25 @@ proc check_effective_target_vector_alignment_reachable_for_64bit { } {
     return $et_vector_alignment_reachable_for_64bit_saved
 }
 
+# Return 1 if the target only requires element alignment for vector accesses
+
+proc check_effective_target_vect_element_align { } {
+    global et_vect_element_align
+
+    if [info exists et_vect_element_align] {
+       verbose "check_effective_target_vect_element_align: using cached result" 2
+    } else {
+       set et_vect_element_align 0
+       if { [istarget arm*-*-*]
+            || [check_effective_target_vect_hw_misalign] } {
+          set et_vect_element_align 1
+       }
+    }
+
+    verbose "check_effective_target_vect_element_align: returning $et_vect_element_align" 2
+    return $et_vect_element_align
+}
+
 # Return 1 if the target supports vector conditional operations, 0 otherwise.
 
 proc check_effective_target_vect_condition { } {
@@ -3480,6 +3511,16 @@ proc add_options_for_bind_pic_locally { flags } {
     return $flags
 }
 
+# Add to FLAGS the flags needed to enable 128-bit vectors.
+
+proc add_options_for_quad_vectors { flags } {
+    if [is-effective-target arm_neon_ok] {
+       return "$flags -mvectorize-with-neon-quad"
+    }
+
+    return $flags
+}
+
 # Return 1 if the target provides a full C99 runtime.
 
 proc check_effective_target_c99_runtime { } {
@@ -3510,12 +3551,15 @@ proc check_effective_target_4byte_wchar_t { } {
 # Return 1 if the target supports automatic stack alignment.
 
 proc check_effective_target_automatic_stack_alignment  { } {
-    if { [istarget i?86*-*-*]
-        || [istarget x86_64-*-*] } then {
-       return 1
-    } else {
-       return 0
+    # Ordinarily x86 supports automatic stack alignment ...
+    if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then {
+        if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } {
+           # ... except Win64 SEH doesn't.  Succeed for Win32 though.
+           return [check_effective_target_ilp32];
+       }
+       return 1;
     }
+    return 0;
 }
 
 # Return 1 if avx instructions can be compiled.