[v2] build: enable Arm NEON flags when __aarch64__ is defined

Message ID 1535913328-22493-1-git-send-email-honnappa.nagarahalli@arm.com
State New
Headers show
Series
  • [v2] build: enable Arm NEON flags when __aarch64__ is defined
Related show

Commit Message

Honnappa Nagarahalli Sept. 2, 2018, 6:35 p.m.
GCC version 4.8.5 does not pre-define __ARM_NEON. NEON is not
optional for ArmV8. Hence NEON related code can be enabled
when __aarch64__ is defined.

Bugzilla ID: 82
Cc: stable@dpdk.org

Reported-by: Raslan Darawsheh <rasland@mellanox.com>
Reported-by: Thomas F Herbert <therbert@redhat.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

Reviewed-by: Phil Yang <phil.yang@arm.com>

Reviewed-by: Gavin Hu <gavin.hu@arm.com>

Acked-by: Gavin Hu <gavin.hu@arm.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

---
V2:
* Corrected the order of contribution tags
* Added Jerin's Ack

 config/arm/meson.build | 3 ++-
 mk/rte.cpuflags.mk     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.7.4

Comments

Thomas Monjalon Sept. 16, 2018, 8:33 a.m. | #1
02/09/2018 20:35, Honnappa Nagarahalli:
> GCC version 4.8.5 does not pre-define __ARM_NEON. NEON is not

> optional for ArmV8. Hence NEON related code can be enabled

> when __aarch64__ is defined.

> 

> Bugzilla ID: 82

> Cc: stable@dpdk.org

> 

> Reported-by: Raslan Darawsheh <rasland@mellanox.com>

> Reported-by: Thomas F Herbert <therbert@redhat.com>

> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> Reviewed-by: Phil Yang <phil.yang@arm.com>

> Reviewed-by: Gavin Hu <gavin.hu@arm.com>

> Acked-by: Gavin Hu <gavin.hu@arm.com>

> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>


Applied, thanks

Patch

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 40dbc87..94cca49 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -157,7 +157,8 @@  else
 endif
 message(machine_args)
 
-if cc.get_define('__ARM_NEON', args: machine_args) != ''
+if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
+    cc.get_define('__aarch64__', args: machine_args) != '')
 	dpdk_conf.set('RTE_MACHINE_CPUFLAG_NEON', 1)
 	compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
 endif
diff --git a/mk/rte.cpuflags.mk b/mk/rte.cpuflags.mk
index 6071313..43ed841 100644
--- a/mk/rte.cpuflags.mk
+++ b/mk/rte.cpuflags.mk
@@ -89,7 +89,7 @@  CPUFLAGS += VSX
 endif
 
 # ARM flags
-ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_NEON),)
+ifneq ($(filter __ARM_NEON __aarch64__,$(AUTO_CPUFLAGS)),)
 CPUFLAGS += NEON
 endif