libarch_la_SOURCES = \
arch/intel.c \
- arch/neon.c \
+ arch/arm.c \
arch/probe.cc
noinst_LTLIBRARIES += libarch.la
noinst_HEADERS += \
arch/intel.h \
- arch/neon.h \
+ arch/arm.h \
arch/probe.h
--- /dev/null
+#include "arch/probe.h"
+
+/* flags we export */
+int ceph_arch_neon = 0;
+
+#include <stdio.h>
+
+#if __linux__
+
+#include <elf.h>
+#include <link.h> // ElfW macro
+
+#if __arm__ || __aarch64__
+#include <asm/hwcap.h>
+#endif // __arm__
+
+static unsigned long get_auxval(unsigned long type)
+{
+ unsigned long result = 0;
+ int read = 0;
+ FILE *f = fopen("/proc/self/auxv", "r");
+ if (f) {
+ ElfW(auxv_t) entry;
+ while ((read = fread(&entry, sizeof(entry), 1, f)) > 0) {
+ if (read != 1)
+ break;
+ if (entry.a_type == type) {
+ result = entry.a_un.a_val;
+ break;
+ }
+ }
+ fclose(f);
+ }
+ return result;
+}
+
+static unsigned long get_hwcap(void)
+{
+ return get_auxval(AT_HWCAP);
+}
+
+#endif // __linux__
+
+int ceph_arch_arm_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
+#endif
+ return 0;
+}
+
--- /dev/null
+#ifndef CEPH_ARCH_ARM_H
+#define CEPH_ARCH_ARM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int ceph_arch_neon; /* true if we have ARM NEON or ASIMD abilities */
+
+extern int ceph_arch_arm_probe(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+++ /dev/null
-#include "arch/probe.h"
-
-/* flags we export */
-int ceph_arch_neon = 0;
-
-#include <stdio.h>
-
-#if __linux__
-
-#include <elf.h>
-#include <link.h> // ElfW macro
-
-#if __arm__ || __aarch64__
-#include <asm/hwcap.h>
-#endif // __arm__
-
-static unsigned long get_auxval(unsigned long type)
-{
- unsigned long result = 0;
- int read = 0;
- FILE *f = fopen("/proc/self/auxv", "r");
- if (f) {
- ElfW(auxv_t) entry;
- while ((read = fread(&entry, sizeof(entry), 1, f)) > 0) {
- if (read != 1)
- break;
- if (entry.a_type == type) {
- result = entry.a_un.a_val;
- break;
- }
- }
- fclose(f);
- }
- return result;
-}
-
-static unsigned long get_hwcap(void)
-{
- return get_auxval(AT_HWCAP);
-}
-
-#endif // __linux__
-
-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
-#endif
- return 0;
-}
-
+++ /dev/null
-#ifndef CEPH_ARCH_NEON_H
-#define CEPH_ARCH_NEON_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int ceph_arch_neon; /* true if we have ARM NEON abilities */
-
-extern int ceph_arch_neon_probe(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
#include "arch/probe.h"
#include "arch/intel.h"
-#include "arch/neon.h"
+#include "arch/arm.h"
int ceph_arch_probe(void)
{
return 1;
ceph_arch_intel_probe();
- ceph_arch_neon_probe();
+ ceph_arch_arm_probe();
ceph_arch_probed = 1;
return 1;
#include "common/debug.h"
#include "arch/probe.h"
#include "arch/intel.h"
-#include "arch/neon.h"
+#include "arch/arm.h"
#include "erasure-code/ErasureCodePlugin.h"
#define dout_subsys ceph_subsys_osd
#include <errno.h>
#include "arch/probe.h"
#include "arch/intel.h"
-#include "arch/neon.h"
+#include "arch/arm.h"
#include "global/global_init.h"
#include "erasure-code/ErasureCodePlugin.h"
#include "common/ceph_argparse.h"
#include "arch/probe.h"
#include "arch/intel.h"
-#include "arch/neon.h"
+#include "arch/arm.h"
#include "global/global_init.h"
#include "common/ceph_argparse.h"
#include "global/global_context.h"
int expected;
- expected = strstr(flags, " neon ") ? 1 : 0;
+ expected = (strstr(flags, " neon ") || strstr(flags, " asimd ")) ? 1 : 0;
EXPECT_EQ(expected, ceph_arch_neon);
expected = strstr(flags, " pclmulqdq ") ? 1 : 0;