Skip to content

Commit 5d907c2

Browse files
committed
rjpeg: detect __ARM_NEON in addition to __ARM_NEON__
Modern aarch64-linux-gnu-gcc defines __ARM_NEON (no trailing underscore) but not __ARM_NEON__. rjpeg's auto-detect at line 189 tested __ARM_NEON__ only, so modern aarch64 builds silently ran the scalar kernel unless the user passed -D__ARM_NEON__ or -DHAVE_NEON explicitly. rpng at libretro-common/formats/png/rpng.c:38 already accepts both spellings: #elif defined(__ARM_NEON) || defined(__ARM_NEON__) Match that. One real change (add `defined(__ARM_NEON) ||`); the #if is split across two lines because the condition grew long. Verified on an aarch64 cross-compile with no explicit -D__ARM_NEON__: with the fix, rjpeg now selects its NEON kernels automatically. Reproduced the old behaviour (scalar fallback) by temporarily reverting this one-line change and confirming that sabotaging NEON kernels has no effect on test output -- the NEON code was unreachable. With the fix, the same sabotage correctly causes test failures, proving the NEON kernels are now entered from `__ARM_NEON` alone.
1 parent 4c5f3c3 commit 5d907c2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • libretro-common/formats/jpeg

libretro-common/formats/jpeg/rjpeg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ struct rjpeg
186186
#endif
187187

188188
/* Auto-detect NEON support */
189-
#if !defined(RJPEG_NO_SIMD) && !defined(RJPEG_NEON) && (defined(__ARM_NEON__) || defined(HAVE_NEON))
189+
#if !defined(RJPEG_NO_SIMD) && !defined(RJPEG_NEON) \
190+
&& (defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(HAVE_NEON))
190191
#define RJPEG_NEON
191192
#endif
192193

0 commit comments

Comments
 (0)