Skip to contentSkip to conversation

openblas: P5600 and I6400 cores only available for Codescape toolchains

PATCH New Vicente Olivert Riera 2 participants 4 messages Jul 18, 2016 – Aug 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 openblas: P5600 and I6400 cores only available for Codescape toolchains

These two MIPS cores are built with MSA support (-mmsa) which is currently in GCC trunk. The only toolchains that support it right now are Codescape MTI and Codescape IMG from Imagination Technologies.

Fixes:
http://autobuild.buildroot.net/results/af5/af5e9f10287aaf9b9be6228ad7d12b2d926f8051/
http://autobuild.buildroot.net/results/b20/b201e4072b0b634d5ac86781aee24c698f88d689/

---
Changes v1 -> v2:
- Amend commit log: s/Imagiation/Imagination/

 package/openblas/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
package/openblas/Config.in +4 -2
index 51afaec..e79b611 100644
@@ -26,9 +26,11 @@ config BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET
 	default "PPC970"       if BR2_powerpc_970
 	default "PPC440"       if BR2_powerpc_440
 	default "PPC440FP2"    if BR2_powerpc_440fp
-	default "P5600"        if BR2_mips_32r2
+	# P5600 is built with MSA support which is only available in Codescape toolchains
+	default "P5600"        if BR2_mips_32r2 && BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS
 	default "SICORTEX"     if BR2_mips_64
-	default "I6400"        if BR2_mips_64r6
+	# I6400 is built with MSA support which is only available in Codescape toolchains
+	default "I6400"        if BR2_mips_64r6 && BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS
 	default "SPARC"        if BR2_sparc
 	default "CORTEXA15"    if BR2_cortex_a15
 	default "CORTEXA9"     if BR2_cortex_a9
Signature · 1 line
2.7.3
#1 lore raw

PATCH v2 1/1 openblas: P5600 and I6400 cores only available for Codescape toolchains

Hello,

package/openblas/Config.in config BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET · line 36

Quoted 9 lines · Vicente Olivert Riera
package/openblas/Config.in +4 -1
+	# P5600 is built with MSA support which is only available in Codescape toolchains
+	default "P5600"        if BR2_mips_32r2 && BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS
 	default "SICORTEX"     if BR2_mips_64
-	default "I6400"        if BR2_mips_64r6
+	# I6400 is built with MSA support which is only available in Codescape toolchains
+	default "I6400"        if BR2_mips_64r6 && BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS
 	default "SPARC"        if BR2_sparc
 	default "CORTEXA15"    if BR2_cortex_a15
 	default "CORTEXA9"     if BR2_cortex_a9

I think I don't like this, because when an upstream gcc release appears with MSA support, it won't be used. We would then have to introduce some BR2_TOOLCHAIN_HAS_MIPS_MSA hidden boolean to indicate if the toolchain has MSA support or not. All that for the sake of a single package.

If MSA-specific assembly code used in OpenBLAS, or are they just passing -mmsa to tell the compiler to emit MSA code if possible?

In the latter case, it would be so much easier to have OpenBLAS test if the compiler has -mmsa support, and if so, use it, and if not, not use it. This can be done in make: the Linux kernel does it, with a make function called cc-option. You can then do:

FOO_FLAGS += $(call cc-option,-mmsa)

and -mmsa only gets added to FOO_FLAGS if it's supported by the compiler.

I guess such a thing could be contributed upstream to OpenBLAS.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 openblas: P5600 and I6400 cores only available for Codescape toolchains

Hello,

Quoted 2 lines · Thomas Petazzoni

If MSA-specific assembly code used in OpenBLAS, or are they just passing -mmsa to tell the compiler to emit MSA code if possible?

Answer: MSA-specific code is used, so it cannot build at all if -mmsa is not passed.

So I've applied Vicente's patch.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 1/1 openblas: P5600 and I6400 cores only available for Codescape toolchains

In reply to Vicente Olivert Riera

Hello,

Quoted 4 lines · Vicente Olivert Riera

These two MIPS cores are built with MSA support (-mmsa) which is currently in GCC trunk. The only toolchains that support it right now are Codescape MTI and Codescape IMG from Imagination Technologies.

Quoted 8 lines

Fixes:
http://autobuild.buildroot.net/results/af5/af5e9f10287aaf9b9be6228ad7d12b2d926f8051/
http://autobuild.buildroot.net/results/b20/b201e4072b0b634d5ac86781aee24c698f88d689/

---
Changes v1 -> v2:
- Amend commit log: s/Imagiation/Imagination/

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com