diff mbox series

Default to an ARM cpu that exists

Message ID 20181021045317.GA18038@SDF.ORG
State New
Headers show
Series Default to an ARM cpu that exists | expand

Commit Message

Maya Rashish Oct. 21, 2018, 4:53 a.m. UTC
Regarding target/86383, it wasn't sufficient to not just pick arm6 for
netbsd, as the default -mcpu is still arm6, which also fails to build.

I assume the default is expected to be the oldest support, and I think
now that's arm8, so maybe default to that.

Comments

Richard Earnshaw (lists) Oct. 22, 2018, 2:56 p.m. UTC | #1
On 21/10/2018 05:53, coypu@sdf.org wrote:
> Regarding target/86383, it wasn't sufficient to not just pick arm6 for
> netbsd, as the default -mcpu is still arm6, which also fails to build.
> 
> I assume the default is expected to be the oldest support, and I think
> now that's arm8, so maybe default to that.
> 
> diff --git a/gcc/config.gcc b/gcc/config.gcc
> index 720e6a737..278c48287 100644
> --- a/gcc/config.gcc
> +++ b/gcc/config.gcc
> @@ -3987,7 +3987,7 @@ case "${target}" in
>  				TM_MULTILIB_CONFIG="$with_multilib_list"
>  			fi
>  		fi
> -		target_cpu_cname=${target_cpu_cname:-arm6}
> +		target_cpu_cname=${target_cpu_cname:-arm8}
>  		with_cpu=${with_cpu:-$target_cpu_cname}
>  		;;
>  
> 

I think strongarm would be a better choice.  I'm not aware of anyone
running NetBSD on Arm8 cpus.

Otherwise, this is fine with a suitable ChangeLog entry.

R.
Maya Rashish Oct. 22, 2018, 3:36 p.m. UTC | #2
On Mon, Oct 22, 2018 at 03:56:24PM +0100, Richard Earnshaw (lists) wrote:
> I think strongarm would be a better choice.  I'm not aware of anyone
> running NetBSD on Arm8 cpus.

Clarifying: this is the global default for all GCC ARM targets,
not just netbsd. Is strongarm still the preferred choice?

Thanks.
Richard Earnshaw (lists) Oct. 22, 2018, 3:47 p.m. UTC | #3
On 22/10/2018 16:36, coypu@sdf.org wrote:
> On Mon, Oct 22, 2018 at 03:56:24PM +0100, Richard Earnshaw (lists) wrote:
>> I think strongarm would be a better choice.  I'm not aware of anyone
>> running NetBSD on Arm8 cpus.
> 
> Clarifying: this is the global default for all GCC ARM targets,
> not just netbsd. Is strongarm still the preferred choice?
> 
> Thanks.
> 

Yes, I think so.  The two are architecturally compatible (and not that
dissimilar in terms of optimization strategies), so StrongArm is
probably a better choice for that generation.

R.
Maya Rashish Oct. 22, 2018, 6:14 p.m. UTC | #4
On Mon, Oct 22, 2018 at 03:56:24PM +0100, Richard Earnshaw (lists) wrote:
> I think strongarm would be a better choice.  I'm not aware of anyone
> running NetBSD on Arm8 cpus.
> 
> Otherwise, this is fine with a suitable ChangeLog entry.
> 
> R.

I hope this is OK. Thanks!

Maya Rashish  <coypu@sdf.org>

PR target/86383
* config.gcc (arm*-*-*): Change default -mcpu to strongarm.


diff --git a/gcc/config.gcc b/gcc/config.gcc
index 720e6a737..23e2e85c8 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3987,7 +3987,7 @@ case "${target}" in
 				TM_MULTILIB_CONFIG="$with_multilib_list"
 			fi
 		fi
-		target_cpu_cname=${target_cpu_cname:-arm6}
+		target_cpu_cname=${target_cpu_cname:-strongarm}
 		with_cpu=${with_cpu:-$target_cpu_cname}
 		;;
Richard Earnshaw (lists) Oct. 23, 2018, 10:22 a.m. UTC | #5
On 22/10/2018 19:14, coypu@sdf.org wrote:
> On Mon, Oct 22, 2018 at 03:56:24PM +0100, Richard Earnshaw (lists) wrote:
>> I think strongarm would be a better choice.  I'm not aware of anyone
>> running NetBSD on Arm8 cpus.
>>
>> Otherwise, this is fine with a suitable ChangeLog entry.
>>
>> R.
> 
> I hope this is OK. Thanks!
> 
> Maya Rashish  <coypu@sdf.org>
> 
> PR target/86383
> * config.gcc (arm*-*-*): Change default -mcpu to strongarm.
> 
> 
> diff --git a/gcc/config.gcc b/gcc/config.gcc
> index 720e6a737..23e2e85c8 100644
> --- a/gcc/config.gcc
> +++ b/gcc/config.gcc
> @@ -3987,7 +3987,7 @@ case "${target}" in
>  				TM_MULTILIB_CONFIG="$with_multilib_list"
>  			fi
>  		fi
> -		target_cpu_cname=${target_cpu_cname:-arm6}
> +		target_cpu_cname=${target_cpu_cname:-strongarm}
>  		with_cpu=${with_cpu:-$target_cpu_cname}
>  		;;
>  
> 

Thinking about this overnight and discussing with some colleagues, we've
concluded that the best generic default is probably ARM7TDMI, since
StrongArm is now on the deprecated list (note, not obsolete - yet) as it
lacks support for Thumb.  Because of this I've changed the NetBSD
default to StrongARM as that reflects that this target can still support
ARMv4 devices.

So I've committed this patch:

        PR target/86383
        * config.gcc (arm*-*-netbsdelf*): Default to StrongARM if no CPU
        specified to configure.
        (arm*-*-*): Use ARM7TDMI as the target CPU if no default provided.

R.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 720e6a7373d..a2e89e23706 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1134,7 +1134,7 @@ arm*-*-netbsdelf*)
 	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
 	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 	tmake_file="${tmake_file} arm/t-arm"
-	target_cpu_cname="arm6"
+	target_cpu_cname="strongarm"
 	;;
 arm*-*-linux-*)			# ARM GNU/Linux with ELF
 	tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
@@ -3987,7 +3987,7 @@ case "${target}" in
 				TM_MULTILIB_CONFIG="$with_multilib_list"
 			fi
 		fi
-		target_cpu_cname=${target_cpu_cname:-arm6}
+		target_cpu_cname=${target_cpu_cname:-arm7tdmi}
 		with_cpu=${with_cpu:-$target_cpu_cname}
 		;;
diff mbox series

Patch

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 720e6a737..278c48287 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3987,7 +3987,7 @@  case "${target}" in
 				TM_MULTILIB_CONFIG="$with_multilib_list"
 			fi
 		fi
-		target_cpu_cname=${target_cpu_cname:-arm6}
+		target_cpu_cname=${target_cpu_cname:-arm8}
 		with_cpu=${with_cpu:-$target_cpu_cname}
 		;;