Skip to content

Commit

Permalink
aarch64: add support for HW_CAP based neon runtime detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jannau authored and ldachary committed Nov 25, 2014
1 parent cec00c9 commit 987d54b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/arch/neon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand Down Expand Up @@ -45,6 +45,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
Expand Down

0 comments on commit 987d54b

Please sign in to comment.