Skip to contentSkip to conversation

configs: nitrogen*: enable NEON support

PATCH New Gary Bisson 2 participants 5 messages Sep 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs: nitrogen*: enable NEON support

---
 configs/nitrogen6sx_defconfig | 3 +++
 configs/nitrogen6x_defconfig  | 3 +++
 configs/nitrogen7_defconfig   | 1 +
 3 files changed, 7 insertions(+)
configs/nitrogen6sx_defconfig +3 -0
index bd92f55..1df658b 100644
@@ -1,6 +1,9 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y
 
 # system
 BR2_TARGET_GENERIC_GETTY=y
configs/nitrogen6x_defconfig +3 -0
index 85acabe..d8775f3 100644
@@ -1,6 +1,9 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y
 
 # system
 BR2_TARGET_GENERIC_GETTY=y
configs/nitrogen7_defconfig +1 -0
index a8f3b45..adce0fb 100644
@@ -1,6 +1,7 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a7=y
+BR2_ARM_FPU_NEON_VFPV4=y
 
 # system
 BR2_TARGET_GENERIC_GETTY=y
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 configs: nitrogen*: enable NEON support

Hello,

Quoted 12 lines · Gary Bisson
---
 configs/nitrogen6sx_defconfig | 3 +++
 configs/nitrogen6x_defconfig  | 3 +++
 configs/nitrogen7_defconfig   | 1 +
 3 files changed, 7 insertions(+)
configs/nitrogen6sx_defconfig +0 -0
index bd92f55..1df658b 100644

configs/nitrogen6sx_defconfig line 6

Quoted 6 lines
configs/nitrogen6sx_defconfig +3 -0
@@ -1,6 +1,9 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y

So, -mfpu=neon here

configs/nitrogen6sx_defconfig line 6

Quoted 3 lines
configs/nitrogen6sx_defconfig +3 -0
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y

And here.

configs/nitrogen7_defconfig line 4

Quoted 11 lines
configs/nitrogen6sx_defconfig +0 -0
 # system
 BR2_TARGET_GENERIC_GETTY=y
configs/nitrogen7_defconfig +1 -0
index a8f3b45..adce0fb 100644
@@ -1,6 +1,7 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a7=y
+BR2_ARM_FPU_NEON_VFPV4=y

But here, -mfpu=neon-vfpv4

Why this difference?

Thanks,

Thomas

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

PATCH 1/1 configs: nitrogen*: enable NEON support

Hi Thomas,

Quoted 45 lines · Thomas Petazzoni

Hello,

Quoted 12 lines · Gary Bisson
---
 configs/nitrogen6sx_defconfig | 3 +++
 configs/nitrogen6x_defconfig  | 3 +++
 configs/nitrogen7_defconfig   | 1 +
 3 files changed, 7 insertions(+)
configs/nitrogen6sx_defconfig +0 -0
index bd92f55..1df658b 100644

configs/nitrogen6sx_defconfig line 6

Quoted 6 lines
configs/nitrogen6sx_defconfig +3 -0
@@ -1,6 +1,9 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y

So, -mfpu=neon here

configs/nitrogen6sx_defconfig line 6

Quoted 3 lines
configs/nitrogen6sx_defconfig +3 -0
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y

And here.

configs/nitrogen7_defconfig line 4

Quoted 11 lines
configs/nitrogen6sx_defconfig +0 -0
 # system
 BR2_TARGET_GENERIC_GETTY=y
configs/nitrogen7_defconfig +1 -0
index a8f3b45..adce0fb 100644
@@ -1,6 +1,7 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a7=y
+BR2_ARM_FPU_NEON_VFPV4=y

But here, -mfpu=neon-vfpv4

Quoted 1 line

Why this difference?

Because the first two configurations are for i.MX6 (ARM Cortex-A9) whereas the last one is i.MX7 (ARM Cortex-A7).

So relying on Config.in.arm, the Cortex-A9 doesn't have VFPv4:
https://git.buildroot.net/buildroot/tree/arch/Config.in.arm#n125
https://git.buildroot.net/buildroot/tree/arch/Config.in.arm#n141

Let me know if that's not the case.

Regards,
Gary

#3 lore raw

PATCH 1/1 configs: nitrogen*: enable NEON support

Hello,

Quoted 6 lines · Gary Bisson

Because the first two configurations are for i.MX6 (ARM Cortex-A9) whereas the last one is i.MX7 (ARM Cortex-A7).

So relying on Config.in.arm, the Cortex-A9 doesn't have VFPv4:
https://git.buildroot.net/buildroot/tree/arch/Config.in.arm#n125
https://git.buildroot.net/buildroot/tree/arch/Config.in.arm#n141

OK, then you should be using the VFPv3 instead of the NEON for FPU. Indeed:

"""
If the selected floating-point hardware includes the NEON extension (e.g. '-mfpu'='neon'), note that floating-point operations are not generated by GCC's auto-vectorization pass unless '-funsafe-math-optimizations' is also specified. This is because NEON hardware does not fully implement the IEEE 754 standard for floating-point arithmetic (in particular denormal values are treated as zero), so the use of NEON instructions may lead to a loss of precision.
"""

Thomas

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

PATCH 1/1 configs: nitrogen*: enable NEON support

Hi Thomas,

Quoted 14 lines · Thomas Petazzoni

Hello,

Quoted 6 lines · Gary Bisson

Because the first two configurations are for i.MX6 (ARM Cortex-A9) whereas the last one is i.MX7 (ARM Cortex-A7).

So relying on Config.in.arm, the Cortex-A9 doesn't have VFPv4:
https://git.buildroot.net/buildroot/tree/arch/Config.in.arm#n125
https://git.buildroot.net/buildroot/tree/arch/Config.in.arm#n141

OK, then you should be using the VFPv3 instead of the NEON for FPU. Indeed:

Quoted 10 lines

"""
If the selected floating-point hardware includes the NEON extension (e.g. '-mfpu'='neon'), note that floating-point operations are not generated by GCC's auto-vectorization pass unless '-funsafe-math-optimizations' is also specified. This is because NEON hardware does not fully implement the IEEE 754 standard for floating-point arithmetic (in particular denormal values are treated as zero), so the use of NEON instructions may lead to a loss of precision.
"""

Ok, didn't know that. I'll submit a v2 with BR2_ARM_FPU_VFPV3 instead.

Maybe the alterasoc configs should be changed as well?
https://git.buildroot.net/buildroot/tree/configs/altera_socdk_defconfig#n6
https://git.buildroot.net/buildroot/tree/configs/altera_sockit_defconfig#n6

Regards,
Gary