Skip to contentSkip to conversation

arch-armv7a.inc: default to Thumb2 instruction set for armv7a and above

PATCH In review Andre McCurdy 3 participants 8 messages May 18, 2018 – May 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch-armv7a.inc: default to Thumb2 instruction set for armv7a and above

Although there may still be specific cases which can benefit from the ARM instruction set, the Thumb2 instruction set is generally a better default for armv7a class CPUs. Distros such as Debian and Fedora have been targeting Thumb2 by default for some time.

Note that setting ARM_INSTRUCTION_SET has no effect unless TUNE_FEATURES contains "thumb" (which is controlled by the "t" suffix in DEFAULTTUNE, e.g. armv7vehf-neon -vs- armv7vethf-neon, etc) so out of tree machine configs may need to update their DEFAULTTUNE to take advantage of this change.

---
 meta/conf/machine/include/arm/arch-armv7a.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/machine/include/arm/arch-armv7a.inc +1 -0
index bad1c27..a2663d8 100644
@@ -1,4 +1,5 @@
 DEFAULTTUNE ?= "armv7athf"
+ARM_INSTRUCTION_SET ?= "thumb"
 
 TUNEVALID[armv7a] = "Enable instructions for ARMv7-a"
 TUNECONFLICTS[armv7a] = "armv4 armv5 armv6 armv7"
Signature · 1 line
1.9.1
#1 lore raw
Quoted 10 lines · Andre McCurdy

Although there may still be specific cases which can benefit from the ARM instruction set, the Thumb2 instruction set is generally a better default for armv7a class CPUs. Distros such as Debian and Fedora have been targeting Thumb2 by default for some time.

Note that setting ARM_INSTRUCTION_SET has no effect unless TUNE_FEATURES contains "thumb" (which is controlled by the "t" suffix in DEFAULTTUNE, e.g. armv7vehf-neon -vs- armv7vethf-neon, etc) so out of tree machine configs may need to update their DEFAULTTUNE to take advantage of this change.

I think this is a good change and we shoudl take it in thumb2 is default ISA
for other major distros as well

Oe based distros who ship feeds might be affected

Quoted 27 lines
---
 meta/conf/machine/include/arm/arch-armv7a.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/machine/include/arm/arch-armv7a.inc +1 -1
index bad1c27..a2663d8 100644
@@ -1,4 +1,5 @@
 DEFAULTTUNE ?= "armv7athf"
+ARM_INSTRUCTION_SET ?= "thumb"
 
 TUNEVALID[armv7a] = "Enable instructions for ARMv7-a"
 TUNECONFLICTS[armv7a] = "armv4 armv5 armv6 armv7"
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw

This variable was always meant to be used from DISTRO config, why not add it to:
oe-core/meta/conf/distro/include/default-distrovars.inc
or
oe-core/meta/conf/distro/include/tcmode-default.inc

?

Quoted 55 lines · Khem Raj
Quoted 10 lines · Andre McCurdy

Although there may still be specific cases which can benefit from the ARM instruction set, the Thumb2 instruction set is generally a better default for armv7a class CPUs. Distros such as Debian and Fedora have been targeting Thumb2 by default for some time.

Note that setting ARM_INSTRUCTION_SET has no effect unless TUNE_FEATURES contains "thumb" (which is controlled by the "t" suffix in DEFAULTTUNE, e.g. armv7vehf-neon -vs- armv7vethf-neon, etc) so out of tree machine configs may need to update their DEFAULTTUNE to take advantage of this change.

I think this is a good change and we shoudl take it in thumb2 is default ISA
for other major distros as well

Oe based distros who ship feeds might be affected

Quoted 21 lines
---
 meta/conf/machine/include/arm/arch-armv7a.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/machine/include/arm/arch-armv7a.inc +1 -1
index bad1c27..a2663d8 100644
@@ -1,4 +1,5 @@
 DEFAULTTUNE ?= "armv7athf"
+ARM_INSTRUCTION_SET ?= "thumb"
 
 TUNEVALID[armv7a] = "Enable instructions for ARMv7-a"
 TUNECONFLICTS[armv7a] = "armv4 armv5 armv6 armv7"
--

1.9.1

Quoted 6 lines

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 1 line · Martin Jansa

This variable was always meant to be used from DISTRO config

I'm not sure if that's true. Do you have a reference?

Quoted 7 lines

, why not add it
to:
oe-core/meta/conf/distro/include/default-distrovars.inc or oe-core/meta/conf/distro/include/tcmode-default.inc

?

Because then it would either apply to all ARM machines, including those which only support Thumb1, which isn't ideal. Keeping it as part of the machine config makes it easy to apply selectively to armv7a and above where we know it's safe and desirable. Distros can of course still over-ride (ie the machine only sets a weak default).

Is there a specific problem you see with the current patch?

Quoted 56 lines · Khem Raj
Quoted 55 lines · Andre McCurdy
Quoted 11 lines

Although there may still be specific cases which can benefit from the ARM instruction set, the Thumb2 instruction set is generally a better default for armv7a class CPUs. Distros such as Debian and Fedora have been targeting Thumb2 by default for some time.

Note that setting ARM_INSTRUCTION_SET has no effect unless TUNE_FEATURES contains "thumb" (which is controlled by the "t" suffix in DEFAULTTUNE, e.g. armv7vehf-neon -vs- armv7vethf-neon, etc) so out of tree machine configs may need to update their DEFAULTTUNE to take advantage of this change.

I think this is a good change and we shoudl take it in thumb2 is default ISA
for other major distros as well

Oe based distros who ship feeds might be affected

Quoted 22 lines
---
 meta/conf/machine/include/arm/arch-armv7a.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/machine/include/arm/arch-armv7a.inc +1 -1
index bad1c27..a2663d8 100644
@@ -1,4 +1,5 @@
 DEFAULTTUNE ?= "armv7athf"
+ARM_INSTRUCTION_SET ?= "thumb"
 
 TUNEVALID[armv7a] = "Enable instructions for ARMv7-a"
 TUNECONFLICTS[armv7a] = "armv4 armv5 armv6 armv7"
--

1.9.1

Quoted 5 lines

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw
Quoted 4 lines · Andre McCurdy
Quoted 1 line · Martin Jansa

This variable was always meant to be used from DISTRO config

I'm not sure if that's true. Do you have a reference?

http://git.openembedded.org/openembedded-core/commit/?id=951200673af27538beaef647a33308b4f15d1fb0
"in case we have MACHINE without "thumb" in TUNE_FEATURES and distro setting ARM_INSTRUCTION_SET to "thumb""

https://github.com/Angstrom-distribution/meta-angstrom/blob/master/conf/distro/include/angstrom.inc#L39
https://github.com/shr-distribution/meta-smartphone/blob/fido/meta-shr-distro/conf/distro/shr.conf#L150
...

Quoted 6 lines
Quoted 6 lines

, why not add it
to:
oe-core/meta/conf/distro/include/default-distrovars.inc or oe-core/meta/conf/distro/include/tcmode-default.inc

Quoted 7 lines
Quoted 1 line

?

Because then it would either apply to all ARM machines, including those which only support Thumb1, which isn't ideal. Keeping it as part of the machine config makes it easy to apply selectively to armv7a and above where we know it's safe and desirable. Distros can of course still over-ride (ie the machine only sets a weak default).

You can still enable it with weak assignment only for some architectures like Angstrom does. But I don't see any reason why not enable it for all architectures? Yes Thumb1 isn't as good as Thumb2 but still many people are using it, why shouldn't oe-core be tested with thumb enabled (with armv5te qemuarm?), see:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=9213
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1709

Quoted 1 line

Is there a specific problem you see with the current patch?

DISTROs doing multi machine builds already need to select the right DEFAULTTUNEs to find good compromise with common denominator of the MACHINEs they want to support (or groups of MACHINEs they want to support). Supporting or not supporting thumb at all is part of that question so DISTRO should decide that, tune files already have the thumb knob in TUNE_FEATURES to say which MACHINE is capable of supporting it.

Regards,

Quoted 57 lines
Quoted 57 lines · Khem Raj
Quoted 55 lines · Andre McCurdy
Quoted 11 lines

Although there may still be specific cases which can benefit from the ARM instruction set, the Thumb2 instruction set is generally a better default for armv7a class CPUs. Distros such as Debian and Fedora have been targeting Thumb2 by default for some time.

Note that setting ARM_INSTRUCTION_SET has no effect unless TUNE_FEATURES contains "thumb" (which is controlled by the "t" suffix in DEFAULTTUNE, e.g. armv7vehf-neon -vs- armv7vethf-neon, etc) so out of tree machine configs may need to update their DEFAULTTUNE to take advantage of this change.

I think this is a good change and we shoudl take it in thumb2 is default ISA
for other major distros as well

Oe based distros who ship feeds might be affected

Quoted 22 lines
---
 meta/conf/machine/include/arm/arch-armv7a.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/machine/include/arm/arch-armv7a.inc +1 -1
index bad1c27..a2663d8 100644
@@ -1,4 +1,5 @@
 DEFAULTTUNE ?= "armv7athf"
+ARM_INSTRUCTION_SET ?= "thumb"
 
 TUNEVALID[armv7a] = "Enable instructions for ARMv7-a"
 TUNECONFLICTS[armv7a] = "armv4 armv5 armv6 armv7"
--

1.9.1

Quoted 5 lines

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#5 lore raw
Quoted 11 lines · Martin Jansa
Quoted 4 lines · Andre McCurdy
Quoted 1 line · Martin Jansa

This variable was always meant to be used from DISTRO config

I'm not sure if that's true. Do you have a reference?

http://git.openembedded.org/openembedded-core/commit/?id=951200673af27538beaef647a33308b4f15d1fb0
"in case we have MACHINE without "thumb" in TUNE_FEATURES and distro setting ARM_INSTRUCTION_SET to "thumb""

https://github.com/Angstrom-distribution/meta-angstrom/blob/master/conf/distro/include/angstrom.inc#L39
https://github.com/shr-distribution/meta-smartphone/blob/fido/meta-shr-distro/conf/distro/shr.conf#L150

Certainly there are distros which force ARM_INSTRUCTION_SET. I'm not sure if that's evidence that machines shouldn't set a default though?

Quoted 14 lines
Quoted 6 lines
Quoted 6 lines

, why not add it
to:
oe-core/meta/conf/distro/include/default-distrovars.inc or oe-core/meta/conf/distro/include/tcmode-default.inc

Quoted 7 lines
Quoted 1 line

?

Because then it would either apply to all ARM machines, including those which only support Thumb1, which isn't ideal. Keeping it as part of the machine config makes it easy to apply selectively to armv7a and above where we know it's safe and desirable. Distros can of course still over-ride (ie the machine only sets a weak default).

Quoted 4 lines

You can still enable it with weak assignment only for some architectures like Angstrom does. But I don't see any reason why not enable it for all architectures? Yes Thumb1 isn't as good as Thumb2 but still many people are using it

I'm not sure if there are "many people" still trying to persevere with Thumb1. Maybe there are a few masochists left, but I guess they probably have their own distros and don't rely on the oe-core defaults.

My approach is to try to make small, safe, incremental improvements and doing anything which might change the default instruction set to Thumb for CPUs which can only support Thumb1 doesn't fit that approach.

Quoted 6 lines

, why shouldn't oe-core be tested with thumb enabled (with armv5te qemuarm?), see:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=9213
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1709

Quoted 8 lines
Quoted 1 line

Is there a specific problem you see with the current patch?

DISTROs doing multi machine builds already need to select the right DEFAULTTUNEs to find good compromise with common denominator of the MACHINEs they want to support (or groups of MACHINEs they want to support). Supporting or not supporting thumb at all is part of that question so DISTRO should decide that, tune files already have the thumb knob in TUNE_FEATURES to say which MACHINE is capable of supporting it.

Setting a weak default for armv7a and above from the machine config doesn't change any of that. Distros still have full control.

#6 lore raw
Quoted 7 lines · Andre McCurdy
Quoted 6 lines · Martin Jansa
Quoted 4 lines · Andre McCurdy
Quoted 1 line · Martin Jansa

This variable was always meant to be used from DISTRO config

I'm not sure if that's true. Do you have a reference?

Quoted 8 lines
Quoted 5 lines

http://git.openembedded.org/openembedded-core/commit/?id=951200673af27538beaef647a33308b4f15d1fb0
"in case we have MACHINE without "thumb" in TUNE_FEATURES and distro setting ARM_INSTRUCTION_SET to "thumb""

https://github.com/Angstrom-distribution/meta-angstrom/blob/master/conf/distro/include/angstrom.inc#L39
https://github.com/shr-distribution/meta-smartphone/blob/fido/meta-shr-distro/conf/distro/shr.conf#L150

Certainly there are distros which force ARM_INSTRUCTION_SET. I'm not sure if that's evidence that machines shouldn't set a default though?

It's still more evidence then what you've shown that it should be in machine config.

Quoted 24 lines
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines

, why not add it
to:
oe-core/meta/conf/distro/include/default-distrovars.inc or oe-core/meta/conf/distro/include/tcmode-default.inc

Quoted 7 lines
Quoted 1 line

?

Because then it would either apply to all ARM machines, including those which only support Thumb1, which isn't ideal. Keeping it as part of the machine config makes it easy to apply selectively to armv7a and above where we know it's safe and desirable. Distros can of course still over-ride (ie the machine only sets a weak default).

Quoted 4 lines

You can still enable it with weak assignment only for some architectures like Angstrom does. But I don't see any reason why not enable it for all architectures? Yes Thumb1 isn't as good as Thumb2 but still many people are using it

I'm not sure if there are "many people" still trying to persevere with Thumb1. Maybe there are a few masochists left, but I guess they probably have their own distros and don't rely on the oe-core defaults.

Quoted 4 lines

My approach is to try to make small, safe, incremental improvements and doing anything which might change the default instruction set to Thumb for CPUs which can only support Thumb1 doesn't fit that approach.

You can still apply it only for some architectures as mentioned before.

Quoted 15 lines
Quoted 6 lines

, why shouldn't oe-core be tested with thumb enabled (with armv5te qemuarm?), see:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=9213
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1709

Quoted 8 lines
Quoted 1 line

Is there a specific problem you see with the current patch?

DISTROs doing multi machine builds already need to select the right DEFAULTTUNEs to find good compromise with common denominator of the MACHINEs they want to support (or groups of MACHINEs they want to support). Supporting or not supporting thumb at all is part of that question so DISTRO should decide that, tune files already have the thumb knob in TUNE_FEATURES to say which MACHINE is capable of supporting it.

Quoted 2 lines

Setting a weak default for armv7a and above from the machine config doesn't change any of that. Distros still have full control.

If it's in distros control, then it should be in distros default config.

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#7 lore raw
Quoted 11 lines · Martin Jansa
Quoted 10 lines · Andre McCurdy
Quoted 9 lines · Martin Jansa
Quoted 4 lines · Andre McCurdy
Quoted 1 line · Martin Jansa

This variable was always meant to be used from DISTRO config

I'm not sure if that's true. Do you have a reference?

http://git.openembedded.org/openembedded-core/commit/?id=951200673af27538beaef647a33308b4f15d1fb0
"in case we have MACHINE without "thumb" in TUNE_FEATURES and distro setting ARM_INSTRUCTION_SET to "thumb""

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

https://github.com/Angstrom-distribution/meta-angstrom/blob/master/conf/distro/include/angstrom.inc#L39
https://github.com/shr-distribution/meta-smartphone/blob/fido/meta-shr-distro/conf/distro/shr.conf#L150

Certainly there are distros which force ARM_INSTRUCTION_SET. I'm not sure if that's evidence that machines shouldn't set a default though?

It's still more evidence then what you've shown that it should be in machine config.

I had two criteria for this change:

1) Only change the default for cores which support Thumb2.

2) Don't have any effect on distros or recipes which already define
their own policy for setting ARM_INSTRUCTION_SET (ie don't use over-rides).

Setting a weak default from armv7a.inc seems to be the simplest and cleanest way to meet those two criteria.