From 8178d440ec94b7c9505de6de1c5825fd44033bcb Mon Sep 17 00:00:00 2001 From: Rongqi Sun Date: Tue, 19 Dec 2023 15:15:02 +0800 Subject: [PATCH] erasure-code/isa/xor_op: avoid empty function if not ARM. Signed-off-by: Rongqi Sun --- src/erasure-code/isa/xor_op.cc | 4 ++-- src/erasure-code/isa/xor_op.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/erasure-code/isa/xor_op.cc b/src/erasure-code/isa/xor_op.cc index 4f507c9b262..33f133539d5 100644 --- a/src/erasure-code/isa/xor_op.cc +++ b/src/erasure-code/isa/xor_op.cc @@ -197,6 +197,7 @@ region_sse2_xor(char** src, return; } +#if defined(__aarch64__) && defined(__ARM_NEON) void // ----------------------------------------------------------------------------- region_neon_xor(char **src, @@ -205,7 +206,6 @@ region_neon_xor(char **src, unsigned size) // ----------------------------------------------------------------------------- { -#if defined(__aarch64__) && defined(__ARM_NEON) ceph_assert(!(size % EC_ISA_VECTOR_NEON_WORDSIZE)); unsigned char *p = (unsigned char *)parity; unsigned char *vbuf[256] = { NULL }; @@ -232,6 +232,6 @@ region_neon_xor(char **src, vst1q_u64((uint64_t *)(p + 16), d0_2); p += EC_ISA_VECTOR_NEON_WORDSIZE; } -#endif // __aarch64__ && __ARM_NEON return; } +#endif // __aarch64__ && __ARM_NEON diff --git a/src/erasure-code/isa/xor_op.h b/src/erasure-code/isa/xor_op.h index 46304eee1cc..86b1645b616 100644 --- a/src/erasure-code/isa/xor_op.h +++ b/src/erasure-code/isa/xor_op.h @@ -83,6 +83,7 @@ region_sse2_xor(char** src /* array of 64-byte aligned source pointer to xor */, int src_size /* size of the source pointer array */, unsigned size /* size of the region to xor */); +#if defined(__aarch64__) && defined(__ARM_NEON) // ------------------------------------------------------------------------- // compute region XOR like parity = src[0] ^ src[1] ... ^ src[src_size-1] // using NEON 32-byte operations @@ -92,5 +93,5 @@ region_neon_xor(char** src /* array of 64-byte aligned source pointer to xor char* parity /* 32-byte aligned output pointer containing the parity */, int src_size /* size of the source pointer array */, unsigned size /* size of the region to xor */); - +#endif // __aarch64__ && __ARM_NEON #endif // EC_ISA_XOR_OP_H -- 2.39.5