diff mbox

[v2,7/8] arch: add support for AMD steamroller

Message ID 1425397951-30603-7-git-send-email-gustavo@zacarias.com.ar
State Accepted
Headers show

Commit Message

Gustavo Zacarias March 3, 2015, 3:52 p.m. UTC
Add support for AMD steamroller optimizations, available in gcc 4.8+ as
bdver3.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 arch/Config.in.x86                     | 11 +++++++++++
 package/gcc/Config.in.host             |  4 ++--
 toolchain/toolchain-external/Config.in |  3 +++
 3 files changed, 16 insertions(+), 2 deletions(-)

Comments

Thomas Petazzoni March 4, 2015, 2:59 p.m. UTC | #1
Dear Gustavo Zacarias,

On Tue,  3 Mar 2015 12:52:30 -0300, Gustavo Zacarias wrote:

> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
> index 4321e43..e70c3ce 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -676,6 +676,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201209
>  	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
>  	depends on !BR2_STATIC_LIBS
>  	depends on !BR2_x86_jaguar
> +	depends on !BR2_x86_steamroller

Why do we need this new dependency? Same question for x86_jaguar in
fact. Are those toolchains not working at all, or are they just not
"optimal" ?

Thomas
Gustavo Zacarias March 4, 2015, 3:18 p.m. UTC | #2
On 03/04/2015 11:59 AM, Thomas Petazzoni wrote:

> Dear Gustavo Zacarias,
> 
> On Tue,  3 Mar 2015 12:52:30 -0300, Gustavo Zacarias wrote:
> 
>> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
>> index 4321e43..e70c3ce 100644
>> --- a/toolchain/toolchain-external/Config.in
>> +++ b/toolchain/toolchain-external/Config.in
>> @@ -676,6 +676,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201209
>>  	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
>>  	depends on !BR2_STATIC_LIBS
>>  	depends on !BR2_x86_jaguar
>> +	depends on !BR2_x86_steamroller
> 
> Why do we need this new dependency? Same question for x86_jaguar in
> fact. Are those toolchains not working at all, or are they just not
> "optimal" ?

Because older GCCs won't understand bdver3/btver2 and break.
Regards.
Thomas Petazzoni March 4, 2015, 3:21 p.m. UTC | #3
Dear Gustavo Zacarias,

On Wed, 04 Mar 2015 12:18:11 -0300, Gustavo Zacarias wrote:

> > Why do we need this new dependency? Same question for x86_jaguar in
> > fact. Are those toolchains not working at all, or are they just not
> > "optimal" ?
> 
> Because older GCCs won't understand bdver3/btver2 and break.
> Regards.

Ah, hum, yes, makes sense. Thanks for the clarification.

Thomas
diff mbox

Patch

diff --git a/arch/Config.in.x86 b/arch/Config.in.x86
index 8a844db..d5788b1 100644
--- a/arch/Config.in.x86
+++ b/arch/Config.in.x86
@@ -139,6 +139,15 @@  config BR2_x86_jaguar
 	select BR2_X86_CPU_HAS_SSSE3
 	select BR2_X86_CPU_HAS_SSE4
 	select BR2_X86_CPU_HAS_SSE42
+config BR2_x86_steamroller
+	bool "steamroller"
+	select BR2_X86_CPU_HAS_MMX
+	select BR2_X86_CPU_HAS_SSE
+	select BR2_X86_CPU_HAS_SSE2
+	select BR2_X86_CPU_HAS_SSE3
+	select BR2_X86_CPU_HAS_SSSE3
+	select BR2_X86_CPU_HAS_SSE4
+	select BR2_X86_CPU_HAS_SSE42
 config BR2_x86_geode
 	bool "geode"
 	# Don't include MMX support because there several variant of geode
@@ -189,6 +198,7 @@  config BR2_ARCH
 	default "i686"		if BR2_x86_opteron_sse3 && BR2_i386
 	default "i686"		if BR2_x86_barcelona && BR2_i386
 	default "i686"		if BR2_x86_jaguar && BR2_i386
+	default "i686"		if BR2_x86_steamroller && BR2_i386
 	default "i686"		if BR2_x86_k6
 	default "i686"		if BR2_x86_k6_2
 	default "i686"		if BR2_x86_athlon
@@ -221,6 +231,7 @@  config BR2_GCC_TARGET_ARCH
 	default "k8-sse3"	if BR2_x86_opteron_sse3
 	default "barcelona"	if BR2_x86_barcelona
 	default "btver2"	if BR2_x86_jaguar
+	default "bdver3"	if BR2_x86_steamroller
 	default "k6"		if BR2_x86_k6
 	default "k6-2"		if BR2_x86_k6_2
 	default "athlon"	if BR2_x86_athlon
diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
index dd61f51..e07d881 100644
--- a/package/gcc/Config.in.host
+++ b/package/gcc/Config.in.host
@@ -29,7 +29,7 @@  choice
 		# SPARC -mcpu=leon3 appeared in gcc 4.8.x
 		depends on !BR2_sparc_leon3
 		# Broken or unsupported X86 cores
-		depends on !BR2_x86_corei7 && !BR2_x86_jaguar
+		depends on !BR2_x86_corei7 && !BR2_x86_jaguar && !BR2_x86_steamroller
 		# ARM EABIhf support appeared in gcc 4.6
 		depends on !BR2_ARM_EABIHF
 		# musl patches only for gcc 4.7+
@@ -49,7 +49,7 @@  choice
 		# SPARC -mcpu=leon3 appeared in gcc 4.8.x
 		depends on !BR2_sparc_leon3
 		# Broken or unsupported x86 cores
-		depends on !BR2_x86_jaguar
+		depends on !BR2_x86_jaguar && !BR2_x86_steamroller
 		select BR2_GCC_NEEDS_MPC
 
 	config BR2_GCC_VERSION_4_8_X
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 4321e43..e70c3ce 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -676,6 +676,7 @@  config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201209
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_x86_jaguar
+	depends on !BR2_x86_steamroller
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -703,6 +704,7 @@  config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201203
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_x86_jaguar
+	depends on !BR2_x86_steamroller
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
@@ -729,6 +731,7 @@  config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201109
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_x86_jaguar
+	depends on !BR2_x86_steamroller
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP