Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ARM NEON on ARM64 processors by default #1435

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@ typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];
#define STBI__X64_TARGET
#elif defined(__i386) || defined(_M_IX86)
#define STBI__X86_TARGET
#elif defined(__aarch64__) || defined(_M_ARM64)
#define STBI__ARM64_TARGET
#endif

#if defined(__GNUC__) && defined(STBI__X86_TARGET) && !defined(__SSE2__) && !defined(STBI_NO_SIMD)
Expand Down Expand Up @@ -774,9 +776,15 @@ static int stbi__sse2_available(void)
#endif

// ARM NEON
#if defined(STBI_NO_SIMD) && defined(STBI_NEON)
#if defined(STBI_NO_SIMD)
#if defined(STBI_NEON)
#undef STBI_NEON
#endif
#elif defined(STBI__ARM64_TARGET)
#if !defined(STBI_NEON)
#define STBI_NEON
#endif
#endif

#ifdef STBI_NEON
#include <arm_neon.h>
Expand Down