Skip to content

Commit 8178d44

Browse files
committed
erasure-code/isa/xor_op: avoid empty function if not ARM.
Signed-off-by: Rongqi Sun <[email protected]>
1 parent 66b2e34 commit 8178d44

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/erasure-code/isa/xor_op.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ region_sse2_xor(char** src,
197197
return;
198198
}
199199

200+
#if defined(__aarch64__) && defined(__ARM_NEON)
200201
void
201202
// -----------------------------------------------------------------------------
202203
region_neon_xor(char **src,
@@ -205,7 +206,6 @@ region_neon_xor(char **src,
205206
unsigned size)
206207
// -----------------------------------------------------------------------------
207208
{
208-
#if defined(__aarch64__) && defined(__ARM_NEON)
209209
ceph_assert(!(size % EC_ISA_VECTOR_NEON_WORDSIZE));
210210
unsigned char *p = (unsigned char *)parity;
211211
unsigned char *vbuf[256] = { NULL };
@@ -232,6 +232,6 @@ region_neon_xor(char **src,
232232
vst1q_u64((uint64_t *)(p + 16), d0_2);
233233
p += EC_ISA_VECTOR_NEON_WORDSIZE;
234234
}
235-
#endif // __aarch64__ && __ARM_NEON
236235
return;
237236
}
237+
#endif // __aarch64__ && __ARM_NEON

src/erasure-code/isa/xor_op.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ region_sse2_xor(char** src /* array of 64-byte aligned source pointer to xor */,
8383
int src_size /* size of the source pointer array */,
8484
unsigned size /* size of the region to xor */);
8585

86+
#if defined(__aarch64__) && defined(__ARM_NEON)
8687
// -------------------------------------------------------------------------
8788
// compute region XOR like parity = src[0] ^ src[1] ... ^ src[src_size-1]
8889
// using NEON 32-byte operations
@@ -92,5 +93,5 @@ region_neon_xor(char** src /* array of 64-byte aligned source pointer to xor
9293
char* parity /* 32-byte aligned output pointer containing the parity */,
9394
int src_size /* size of the source pointer array */,
9495
unsigned size /* size of the region to xor */);
95-
96+
#endif // __aarch64__ && __ARM_NEON
9697
#endif // EC_ISA_XOR_OP_H

0 commit comments

Comments
 (0)