diff mbox

[3/5] aarch64: add support for HW_CAP based neon runtime detection

Message ID 1414434036-29313-4-git-send-email-j@jannau.net (mailing list archive)
State New, archived
Headers show

Commit Message

Janne Grunau Oct. 27, 2014, 6:20 p.m. UTC
---
 src/arch/neon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/arch/neon.c b/src/arch/neon.c
index 32c1f62..aa46595 100644
--- a/src/arch/neon.c
+++ b/src/arch/neon.c
@@ -10,7 +10,7 @@  int ceph_arch_neon = 0;
 #include <elf.h>
 #include <link.h> // ElfW macro
 
-#if __arm__
+#if __arm__ || __aarch64__
 #include <asm/hwcap.h>
 #endif // __arm__
 
@@ -42,6 +42,8 @@  int ceph_arch_neon_probe(void)
 {
 #if __arm__ && __linux__
 	ceph_arch_neon = (get_hwcap() & HWCAP_NEON) == HWCAP_NEON;
+#elif __aarch64__ && __linux__
+	ceph_arch_neon = (get_hwcap() & HWCAP_ASIMD) == HWCAP_ASIMD;
 #else
 	if (0)
 		get_hwcap();  // make compiler shut up