diff mbox

[arm] fix arm_neon_ok check on !arm_arch7

Message ID 5414B99D.3020202@codesourcery.com
State New
Headers show

Commit Message

Andrew Stubbs Sept. 13, 2014, 9:39 p.m. UTC
Hi,

I get a lot of "vect/*" and "neon-*" test failure in my armv5te testing 
because the arm_neon_ok test incorrectly detects that NEON is valid on 
arm926ej-s.

It turns out that the reason is that the compiler only disallows NEON 
for Thumb1 or soft-float configurations. Otherwise it just takes 
-mfpu=neon at face value, regardless of -march or -mcpu.

This patch limits NEON to armv7 or higher.

OK?

Andrew

Comments

Richard Earnshaw Sept. 15, 2014, 9:46 a.m. UTC | #1
On 13/09/14 22:39, Andrew Stubbs wrote:
> Hi,
> 
> I get a lot of "vect/*" and "neon-*" test failure in my armv5te testing 
> because the arm_neon_ok test incorrectly detects that NEON is valid on 
> arm926ej-s.
> 
> It turns out that the reason is that the compiler only disallows NEON 
> for Thumb1 or soft-float configurations. Otherwise it just takes 
> -mfpu=neon at face value, regardless of -march or -mcpu.
> 
> This patch limits NEON to armv7 or higher.
> 
> OK?
> 
> Andrew
> 
> 
> arm_neon_ok.patch
> 
> 
> 2014-09-13  Andrew Stubbs  <ams@codesourcery.com>
> 
> 	gcc/
> 	* config/arm/arm.h (TARGET_NEON): Ensure target is v7 or higher.
> 
> Index: gcc/config/arm/arm.h
> ===================================================================
> --- gcc/config/arm/arm.h	(revision 215228)
> +++ gcc/config/arm/arm.h	(working copy)
> @@ -323,6 +323,7 @@
>     and TARGET_HARD_FLOAT to ensure that NEON instructions are
>     available.  */
>  #define TARGET_NEON (TARGET_32BIT && TARGET_HARD_FLOAT \
> +		     && arm_arch7 \
>  		     && TARGET_VFP && arm_fpu_desc->neon)
>  
>  /* Q-bit is present.  */
> 


Hmm, I wonder if arm_override_options should reject neon + (arch < 7).

R.
diff mbox

Patch

2014-09-13  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/arm/arm.h (TARGET_NEON): Ensure target is v7 or higher.

Index: gcc/config/arm/arm.h
===================================================================
--- gcc/config/arm/arm.h	(revision 215228)
+++ gcc/config/arm/arm.h	(working copy)
@@ -323,6 +323,7 @@ 
    and TARGET_HARD_FLOAT to ensure that NEON instructions are
    available.  */
 #define TARGET_NEON (TARGET_32BIT && TARGET_HARD_FLOAT \
+		     && arm_arch7 \
 		     && TARGET_VFP && arm_fpu_desc->neon)
 
 /* Q-bit is present.  */