All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] configs: nitrogen*: enable NEON support
@ 2016-09-16 13:09 Gary Bisson
  2016-09-16 14:13 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Bisson @ 2016-09-16 13:09 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
 configs/nitrogen6sx_defconfig | 3 +++
 configs/nitrogen6x_defconfig  | 3 +++
 configs/nitrogen7_defconfig   | 1 +
 3 files changed, 7 insertions(+)

diff --git a/configs/nitrogen6sx_defconfig b/configs/nitrogen6sx_defconfig
index bd92f55..1df658b 100644
--- a/configs/nitrogen6sx_defconfig
+++ b/configs/nitrogen6sx_defconfig
@@ -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
diff --git a/configs/nitrogen6x_defconfig b/configs/nitrogen6x_defconfig
index 85acabe..d8775f3 100644
--- a/configs/nitrogen6x_defconfig
+++ b/configs/nitrogen6x_defconfig
@@ -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
diff --git a/configs/nitrogen7_defconfig b/configs/nitrogen7_defconfig
index a8f3b45..adce0fb 100644
--- a/configs/nitrogen7_defconfig
+++ b/configs/nitrogen7_defconfig
@@ -1,6 +1,7 @@
 # architecture
 BR2_arm=y
 BR2_cortex_a7=y
+BR2_ARM_FPU_NEON_VFPV4=y
 
 # system
 BR2_TARGET_GENERIC_GETTY=y
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] configs: nitrogen*: enable NEON support
  2016-09-16 13:09 [Buildroot] [PATCH] configs: nitrogen*: enable NEON support Gary Bisson
@ 2016-09-16 14:13 ` Thomas Petazzoni
  2016-09-16 14:20   ` Gary Bisson
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2016-09-16 14:13 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 16 Sep 2016 15:09:02 +0200, Gary Bisson wrote:
> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> ---
>  configs/nitrogen6sx_defconfig | 3 +++
>  configs/nitrogen6x_defconfig  | 3 +++
>  configs/nitrogen7_defconfig   | 1 +
>  3 files changed, 7 insertions(+)
> 
> diff --git a/configs/nitrogen6sx_defconfig b/configs/nitrogen6sx_defconfig
> index bd92f55..1df658b 100644
> --- a/configs/nitrogen6sx_defconfig
> +++ b/configs/nitrogen6sx_defconfig
> @@ -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

> +BR2_ARM_ENABLE_NEON=y
> +BR2_ARM_ENABLE_VFP=y
> +BR2_ARM_FPU_NEON=y

And here.

>  # system
>  BR2_TARGET_GENERIC_GETTY=y
> diff --git a/configs/nitrogen7_defconfig b/configs/nitrogen7_defconfig
> index a8f3b45..adce0fb 100644
> --- a/configs/nitrogen7_defconfig
> +++ b/configs/nitrogen7_defconfig
> @@ -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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] configs: nitrogen*: enable NEON support
  2016-09-16 14:13 ` Thomas Petazzoni
@ 2016-09-16 14:20   ` Gary Bisson
  2016-09-16 16:26     ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Bisson @ 2016-09-16 14:20 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Fri, Sep 16, 2016 at 4:13 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
>
> Hello,
>
> On Fri, 16 Sep 2016 15:09:02 +0200, Gary Bisson wrote:
> > Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> > ---
> >  configs/nitrogen6sx_defconfig | 3 +++
> >  configs/nitrogen6x_defconfig  | 3 +++
> >  configs/nitrogen7_defconfig   | 1 +
> >  3 files changed, 7 insertions(+)
> >
> > diff --git a/configs/nitrogen6sx_defconfig b/configs/nitrogen6sx_defconfig
> > index bd92f55..1df658b 100644
> > --- a/configs/nitrogen6sx_defconfig
> > +++ b/configs/nitrogen6sx_defconfig
> > @@ -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
>
> > +BR2_ARM_ENABLE_NEON=y
> > +BR2_ARM_ENABLE_VFP=y
> > +BR2_ARM_FPU_NEON=y
>
> And here.
>
> >  # system
> >  BR2_TARGET_GENERIC_GETTY=y
> > diff --git a/configs/nitrogen7_defconfig b/configs/nitrogen7_defconfig
> > index a8f3b45..adce0fb 100644
> > --- a/configs/nitrogen7_defconfig
> > +++ b/configs/nitrogen7_defconfig
> > @@ -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?

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] configs: nitrogen*: enable NEON support
  2016-09-16 14:20   ` Gary Bisson
@ 2016-09-16 16:26     ` Thomas Petazzoni
  2016-09-16 16:44       ` Gary Bisson
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2016-09-16 16:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 16 Sep 2016 16:20:42 +0200, Gary Bisson wrote:

> 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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] configs: nitrogen*: enable NEON support
  2016-09-16 16:26     ` Thomas Petazzoni
@ 2016-09-16 16:44       ` Gary Bisson
  0 siblings, 0 replies; 5+ messages in thread
From: Gary Bisson @ 2016-09-16 16:44 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Fri, Sep 16, 2016 at 6:26 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Fri, 16 Sep 2016 16:20:42 +0200, Gary Bisson wrote:
>
>> 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.
> """

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-16 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-16 13:09 [Buildroot] [PATCH] configs: nitrogen*: enable NEON support Gary Bisson
2016-09-16 14:13 ` Thomas Petazzoni
2016-09-16 14:20   ` Gary Bisson
2016-09-16 16:26     ` Thomas Petazzoni
2016-09-16 16:44       ` Gary Bisson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.