target-supports.exp fixes for ARM NEON

Joseph S. Myers joseph@codesourcery.com
Tue Jul 1 20:12:00 GMT 2008


This patch updates the vect_* effective targets for ARM NEON.  The
targets describing vectorization capabilities supported by NEON need
to return 1, while vect_cmdline_needed must fail if the compiler
configuration is using NEON by default.  OK to commit?

(The vect_no_align handling here is correct for GCC trunk at present,
but we have an unsubmitted patch to support realignment; when that
goes in the effective target handling will be changed accordingly.)

2008-07-01  Joseph Myers  <joseph@codesourcery.com>

	* lib/target-supports.exp (check_effective_target_vect_int,
	check_effective_target_vect_shift,
	check_effective_target_vect_long,
	check_effective_target_vect_float,
	check_effective_target_vect_no_align,
	check_effective_target_vect_int_mult): Check for ARM.
	(check_effective_target_arm_neon): New.
	(check_effective_target_vect_cmdline_needed): Use it.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 137315)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -1131,7 +1131,8 @@
 	     || ([istarget powerpc*-*-*]
 		 && ([check_effective_target_powerpc_spe]
 		     || [check_effective_target_powerpc_altivec]))
-             || [istarget spu-*-*] } {
+             || [istarget spu-*-*]
+	     || ([istarget arm*-*-*] && [check_effective_target_arm_neon]) } {
 	   set et_vect_cmdline_needed_saved 0
 	}
     }
@@ -1158,7 +1159,8 @@
 	      || [istarget x86_64-*-*]
 	      || [istarget sparc*-*-*]
 	      || [istarget alpha*-*-*]
-	      || [istarget ia64-*-*] } {
+	      || [istarget ia64-*-*] 
+	      || [check_effective_target_arm32] } {
 	   set et_vect_int_saved 1
 	}
     }
@@ -1264,6 +1266,22 @@
     } "-mfpu=neon -mfloat-abi=softfp"]
 }
 
+# Return 1 if this is a ARM target with NEON enabled.
+
+proc check_effective_target_arm_neon { } {
+    if { [check_effective_target_arm32] } {
+	return [check_no_compiler_messages arm_neon object {
+	    #ifndef __ARM_NEON__
+	    #error not NEON
+	    #else
+	    int dummy;
+	    #endif
+	}]
+    } else {
+	return 0
+    }
+}
+
 # Return 1 if this a Loongson-2E or -2F target using an ABI that supports
 # the Loongson vector modes.
 
@@ -1395,7 +1413,8 @@
              && ![istarget powerpc-*-linux*paired*])
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*]
-	     || [istarget x86_64-*-*] } {
+	     || [istarget x86_64-*-*]
+	     || [check_effective_target_arm32] } {
 	   set et_vect_shift_saved 1
 	}
     }
@@ -1414,6 +1433,7 @@
               && ![istarget powerpc-*-linux*paired*]) 
               && [check_effective_target_ilp32])
 	 || [istarget x86_64-*-*]
+	 || [check_effective_target_arm32]
 	 || ([istarget sparc*-*-*] && [check_effective_target_ilp32]) } {
 	set answer 1
     } else {
@@ -1440,7 +1460,8 @@
 	      || [istarget spu-*-*]
 	      || [istarget mipsisa64*-*-*]
 	      || [istarget x86_64-*-*]
-	      || [istarget ia64-*-*] } {
+	      || [istarget ia64-*-*]
+	      || [check_effective_target_arm32] } {
 	   set et_vect_float_saved 1
 	}
     }
@@ -1819,7 +1840,8 @@
 	set et_vect_no_align_saved 0
 	if { [istarget mipsisa64*-*-*]
 	     || [istarget sparc*-*-*]
-	     || [istarget ia64-*-*] } { 
+	     || [istarget ia64-*-*]
+	     || [check_effective_target_arm32] } { 
 	    set et_vect_no_align_saved 1
 	}
     }
@@ -2008,7 +2030,8 @@
 	if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
 	     || [istarget spu-*-*]
 	     || [istarget i?86-*-*]
-	     || [istarget x86_64-*-*] } {
+	     || [istarget x86_64-*-*]
+	     || [check_effective_target_arm32] } {
 	   set et_vect_int_mult_saved 1
 	}
     }

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list