Skip to contentSkip to conversation

tunes: Add support for sve instructions on armv8/armv9

PATCH Superseded Khem Raj 3 participants 6 messages Jul 11, 2023 – Jul 23, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 tunes: Add support for sve instructions on armv8/armv9

This helps in defining correct compiler options and configure options for glibc and overall ABI for toolchain

---
 meta/conf/machine/include/arm/feature-arm-sve.inc | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 meta/conf/machine/include/arm/feature-arm-sve.inc
meta/conf/machine/include/arm/feature-arm-sve.inc new file +5 -0
new file mode 100644
index 00000000000..279bf8c4862
@@ -0,0 +1,5 @@
+# Scalable Vector Extension (SVE) for:
+# armv8.2-a, armv8.3-a, armv8.4-a, armv8.5-a, armv8.6-a, armv8-r, armv9a
+
+TUNEVALID[sve] = "Enable SVE instructions for ARMv8 and ARMv9"
+TUNE_CCARGS_MARCH_OPTS .= "${@bb.utils.contains('TUNE_FEATURES', 'sve', '+sve', '', d)}"
Signature · 1 line
2.41.0
author
#1 lore raw

PATCH 2/2 arch-armv8,arch-armv9: Add sve based tune options

---
 meta/conf/machine/include/arm/arch-armv8-2a.inc | 7 ++++++-
 meta/conf/machine/include/arm/arch-armv8-4a.inc | 7 ++++++-
 meta/conf/machine/include/arm/arch-armv8-5a.inc | 7 ++++++-
 meta/conf/machine/include/arm/arch-armv9a.inc   | 7 ++++++-
 4 files changed, 24 insertions(+), 4 deletions(-)
meta/conf/machine/include/arm/arch-armv8-2a.inc +6 -1
index 95368b0af79..6f31e26e34f 100644
@@ -6,14 +6,19 @@ TUNE_CCARGS_MARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8-2a', ' -march
 MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-2a', 'armv8-2a:', '', d)}"
 
 require conf/machine/include/arm/arch-armv8a.inc
+require conf/machine/include/arm/feature-arm-sve.inc
 
 # Little Endian base configs
-AVAILTUNES += "armv8-2a armv8-2a-crypto"
+AVAILTUNES += "armv8-2a armv8-2a-crypto armv8-2a-crypto-sve"
 ARMPKGARCH:tune-armv8-2a                    ?= "armv8-2a"
 ARMPKGARCH:tune-armv8-2a-crypto             ?= "armv8-2a"
+ARMPKGARCH:tune-armv8-2a-crypto-sve         ?= "armv8-2a"
 TUNE_FEATURES:tune-armv8-2a                  = "aarch64 armv8-2a"
 TUNE_FEATURES:tune-armv8-2a-crypto           = "${TUNE_FEATURES:tune-armv8-2a} crypto"
+TUNE_FEATURES:tune-armv8-2a-crypto-sve       = "${TUNE_FEATURES:tune-armv8-2a-crypto} sve"
 PACKAGE_EXTRA_ARCHS:tune-armv8-2a            = "${PACKAGE_EXTRA_ARCHS:tune-armv8a} armv8-2a"
 PACKAGE_EXTRA_ARCHS:tune-armv8-2a-crypto     = "${PACKAGE_EXTRA_ARCHS:tune-armv8-2a} armv8-2a-crypto"
+PACKAGE_EXTRA_ARCHS:tune-armv8-2a-crypto-sve = "${PACKAGE_EXTRA_ARCHS:tune-armv8-2a-crypto} armv8-2a-crypto-sve"
 BASE_LIB:tune-armv8-2a                       = "lib64"
 BASE_LIB:tune-armv8-2a-crypto                = "lib64"
+BASE_LIB:tune-armv8-2a-crypto-sve            = "lib64"
meta/conf/machine/include/arm/arch-armv8-4a.inc +6 -1
index 29feddb64c5..b61d50daa5e 100644
@@ -6,14 +6,19 @@ TUNE_CCARGS_MARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8-4a', ' -march
 MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-4a', 'armv8-4a:', '', d)}"
 
 require conf/machine/include/arm/arch-armv8a.inc
+require conf/machine/include/arm/feature-arm-sve.inc
 
 # Little Endian base configs
-AVAILTUNES += "armv8-4a armv8-4a-crypto"
+AVAILTUNES += "armv8-4a armv8-4a-crypto armv8-4a-crypto-sve"
 ARMPKGARCH:tune-armv8-4a                    ?= "armv8-4a"
 ARMPKGARCH:tune-armv8-4a-crypto             ?= "armv8-4a"
+ARMPKGARCH:tune-armv8-4a-crypto-sve         ?= "armv8-4a"
 TUNE_FEATURES:tune-armv8-4a                  = "aarch64 armv8-4a"
 TUNE_FEATURES:tune-armv8-4a-crypto           = "${TUNE_FEATURES:tune-armv8-4a} crypto"
+TUNE_FEATURES:tune-armv8-4a-crypto-sve       = "${TUNE_FEATURES:tune-armv8-4a-crypto} sve"
 PACKAGE_EXTRA_ARCHS:tune-armv8-4a            = "${PACKAGE_EXTRA_ARCHS:tune-armv8a} armv8-4a"
 PACKAGE_EXTRA_ARCHS:tune-armv8-4a-crypto     = "${PACKAGE_EXTRA_ARCHS:tune-armv8-4a} armv8-4a-crypto"
+PACKAGE_EXTRA_ARCHS:tune-armv8-4a-crypto-sve = "${PACKAGE_EXTRA_ARCHS:tune-armv8-4a-crypto} armv8-4a-crypto-sve"
 BASE_LIB:tune-armv8-4a                       = "lib64"
 BASE_LIB:tune-armv8-4a-crypto                = "lib64"
+BASE_LIB:tune-armv8-4a-crypto-sve            = "lib64"
meta/conf/machine/include/arm/arch-armv8-5a.inc +6 -1
index a1bcb7fb9a1..176bc9033c9 100644
@@ -6,14 +6,19 @@ TUNE_CCARGS_MARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8-5a', ' -march
 MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-5a', 'armv8-5a:', '', d)}"
 
 require conf/machine/include/arm/arch-armv8a.inc
+require conf/machine/include/arm/feature-arm-sve.inc
 
 # Little Endian base configs
-AVAILTUNES += "armv8-5a armv8-5a-crypto"
+AVAILTUNES += "armv8-5a armv8-5a-crypto armv8-5a-crypto-sve"
 ARMPKGARCH:tune-armv8-5a                    ?= "armv8-5a"
 ARMPKGARCH:tune-armv8-5a-crypto             ?= "armv8-5a"
+ARMPKGARCH:tune-armv8-5a-crypto-sve         ?= "armv8-5a"
 TUNE_FEATURES:tune-armv8-5a                  = "aarch64 armv8-5a"
 TUNE_FEATURES:tune-armv8-5a-crypto           = "${TUNE_FEATURES:tune-armv8-5a} crypto"
+TUNE_FEATURES:tune-armv8-5a-crypto-sve       = "${TUNE_FEATURES:tune-armv8-5a-crypto} sve"
 PACKAGE_EXTRA_ARCHS:tune-armv8-5a            = "${PACKAGE_EXTRA_ARCHS:tune-armv8a} armv8-5a"
 PACKAGE_EXTRA_ARCHS:tune-armv8-5a-crypto     = "${PACKAGE_EXTRA_ARCHS:tune-armv8-5a} armv8-5a-crypto"
+PACKAGE_EXTRA_ARCHS:tune-armv8-5a-crypto-sve = "${PACKAGE_EXTRA_ARCHS:tune-armv8-5a-crypto} armv8-5a-crypto-sve"
 BASE_LIB:tune-armv8-5a                       = "lib64"
 BASE_LIB:tune-armv8-5a-crypto                = "lib64"
+BASE_LIB:tune-armv8-5a-crypto-sve            = "lib64"
meta/conf/machine/include/arm/arch-armv9a.inc +6 -1
index c38d6cfdf60..6945dea333b 100644
@@ -7,22 +7,27 @@ MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv9a', 'armv9a:',
 require conf/machine/include/arm/arch-arm64.inc
 require conf/machine/include/arm/feature-arm-crc.inc
 require conf/machine/include/arm/feature-arm-crypto.inc
+require conf/machine/include/arm/feature-arm-sve.inc
 
 # Little Endian base configs
-AVAILTUNES += "armv9a armv9a-crc armv9a-crc-crypto armv9a-crypto"
+AVAILTUNES += "armv9a armv9a-crc armv9a-crc-crypto armv9a-crc-crypto-sve armv9a-crypto"
 ARMPKGARCH:tune-armv9a                    ?= "armv9a"
 ARMPKGARCH:tune-armv9a-crc                ?= "armv9a"
 ARMPKGARCH:tune-armv9a-crypto             ?= "armv9a"
 ARMPKGARCH:tune-armv9a-crc-crypto         ?= "armv9a"
+ARMPKGARCH:tune-armv9a-crc-crypto-sve     ?= "armv9a"
 TUNE_FEATURES:tune-armv9a                  = "aarch64 armv9a"
 TUNE_FEATURES:tune-armv9a-crc              = "${TUNE_FEATURES:tune-armv9a} crc"
 TUNE_FEATURES:tune-armv9a-crypto           = "${TUNE_FEATURES:tune-armv9a} crypto"
 TUNE_FEATURES:tune-armv9a-crc-crypto       = "${TUNE_FEATURES:tune-armv9a-crc} crypto"
+TUNE_FEATURES:tune-armv9a-crc-crypto-sve   = "${TUNE_FEATURES:tune-armv9a-crc-crypto} sve"
 PACKAGE_EXTRA_ARCHS:tune-armv9a            = "aarch64 armv9a"
 PACKAGE_EXTRA_ARCHS:tune-armv9a-crc        = "${PACKAGE_EXTRA_ARCHS:tune-armv9a} armv9a-crc"
 PACKAGE_EXTRA_ARCHS:tune-armv9a-crypto     = "${PACKAGE_EXTRA_ARCHS:tune-armv9a} armv9a-crypto"
 PACKAGE_EXTRA_ARCHS:tune-armv9a-crc-crypto = "${PACKAGE_EXTRA_ARCHS:tune-armv9a-crc} armv9a-crypto armv9a-crc-crypto"
+PACKAGE_EXTRA_ARCHS:tune-armv9a-crc-crypto-sve = "${PACKAGE_EXTRA_ARCHS:tune-armv9a-crc-crypto} armv9a-crc-crypto-sve"
 BASE_LIB:tune-armv9a                       = "lib64"
 BASE_LIB:tune-armv9a-crc                   = "lib64"
 BASE_LIB:tune-armv9a-crypto                = "lib64"
 BASE_LIB:tune-armv9a-crc-crypto            = "lib64"
+BASE_LIB:tune-armv9a-crc-crypto-sve        = "lib64"
Signature · 1 line
2.41.0
#2 lore raw
In reply to Khem Raj
Quoted 3 lines · Khem Raj via lists.openembedded.org

This helps in defining correct compiler options and configure options for glibc and overall ABI for toolchain

Given this, shouldn’t the glibc patch respect the tune flags instead of forcibly turning sve off?

Ross

author
#3 lore raw
Quoted 7 lines · Ross Burton
Quoted 3 lines · Khem Raj via lists.openembedded.org

This helps in defining correct compiler options and configure options for glibc and overall ABI for toolchain

Given this, shouldn’t the glibc patch respect the tune flags instead of forcibly turning sve off?

It will as a follow up.

Quoted 2 lines

Ross

#4 lore raw

Hello Khem,

Quoted 10 lines · Khem Raj
Quoted 7 lines · Ross Burton
Quoted 3 lines · Khem Raj via lists.openembedded.org

This helps in defining correct compiler options and configure options for glibc and overall ABI for toolchain

Given this, shouldn’t the glibc patch respect the tune flags instead of forcibly turning sve off?

It will as a follow up.

I think we are still waiting for the follow up.

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author
#5 lore raw
Quoted 11 lines · Alexandre Belloni

Hello Khem,

Quoted 3 lines · Khem Raj
Quoted 2 lines · Ross Burton

On 11 Jul 2023, at 21:10, Khem Raj via lists.openembedded.org

Quoted 4 lines · <[email protected]> wrote:
Quoted 4 lines
Quoted 3 lines

This helps in defining correct compiler options and configure options for glibc and overall ABI for toolchain

Quoted 6 lines
Quoted 1 line
Quoted 1 line

Given this, shouldn’t the glibc patch respect the tune flags instead

of forcibly turning sve off?

Quoted 2 lines

It will as a follow up.

I think we are still waiting for the follow up.

Hmm I was thinking of sending it separate since it does not impact this pull I am away this week perhaps will do upon return next week

Quoted 7 lines

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com