Skip to content

Commit e5de417

Browse files
authored
Fix build on 32-bit ARM by only using NEON on AArch64 (#2873)
Only enable `HAVE_ARM_NEON` on AArch64 because it supports vaddvq and all needed compiler intrinsics. Fixes the following error when building for machine `qemuarm` using the Yocto Project and OpenEmbedded: ``` | bitops.c: In function 'popcountNEON': | bitops.c:219:23: error: implicit declaration of function 'vaddvq_u16'; did you mean 'vaddq_u16'? [-Wimplicit-function-declaration] | 219 | uint32_t t1 = vaddvq_u16(sc); | | ^~~~~~~~~~ | | vaddq_u16 | bitops.c:225:14: error: implicit declaration of function 'vaddvq_u8'; did you mean 'vaddq_u8'? [-Wimplicit-function-declaration] | 225 | t += vaddvq_u8(vcntq_u8(vld1q_u8(p))); | | ^~~~~~~~~ | | vaddq_u8 ``` More details are available in the following log: https://errors.yoctoproject.org/Errors/Details/889836/ Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
1 parent dd2827a commit e5de417

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ void setcpuaffinity(const char *cpulist);
392392
#endif
393393

394394
/* Check if we can compile ARM SIMD code */
395-
#if defined(__ARM_NEON) || defined(__ARM_NEON__)
395+
#if defined(__aarch64__) && (defined(__ARM_NEON) || defined(__ARM_NEON__))
396396
#define HAVE_ARM_NEON 1
397397
#else
398398
#define HAVE_ARM_NEON 0

0 commit comments

Comments
 (0)