Skip to content

Commit

Permalink
Fix meson based compilation on arm32
Browse files Browse the repository at this point in the history
  • Loading branch information
ankith26 committed Apr 21, 2024
1 parent 136215b commit 4b8df62
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ if host_machine.cpu_family() == 'arm'
# first check if compiler supports the flag, and use it then. Needed only
# on 32-bit armv7.
flag = '-mfpu=neon'
if cc.has_argument(flag)
simd_sse2_neon_flags += flag
if cc.has_argument(flag) and host_machine.cpu() == 'armv7l'
simd_sse2_neon_flags += [flag, '-march=armv7-a']
simd_sse2_neon = true
endif
elif host_machine.cpu_family() == 'aarch64'
Expand Down
5 changes: 0 additions & 5 deletions src_c/simd_fill.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
#endif
#endif

#if PG_ENABLE_ARM_NEON
// sse2neon.h is from here: https://github.com/DLTcollab/sse2neon
#include "include/sse2neon.h"
#endif /* PG_ENABLE_ARM_NEON */

#if defined(__SSE2__)
#define PG_ENABLE_SSE_NEON 1
#elif PG_ENABLE_ARM_NEON
Expand Down
5 changes: 0 additions & 5 deletions src_c/simd_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ pg_has_avx2();
#endif
#endif

#if PG_ENABLE_ARM_NEON
// sse2neon.h is from here: https://github.com/DLTcollab/sse2neon
#include "include/sse2neon.h"
#endif /* PG_ENABLE_ARM_NEON */

/* This defines PG_ENABLE_SSE_NEON as True if either SSE or NEON is available
* at compile time. Since we do compile time translation of SSE2->NEON, they
* have the same code paths, so this reduces code duplication of those paths.
Expand Down
5 changes: 5 additions & 0 deletions src_c/simd_surface_fill_sse2.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "simd_fill.h"

#if PG_ENABLE_ARM_NEON
// sse2neon.h is from here: https://github.com/DLTcollab/sse2neon
#include "include/sse2neon.h"
#endif /* PG_ENABLE_ARM_NEON */

#define BAD_SSE2_FUNCTION_CALL \
printf( \
"Fatal Error: Attempted calling an SSE2 function when both compile " \
Expand Down

0 comments on commit 4b8df62

Please sign in to comment.