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 18, 2024
1 parent a870754 commit db8c3ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
10 changes: 7 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,13 @@ simd_sse2_neon_flags = []
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
flags = ['-mfpu=neon', '-march=armv7-a']
if (
cc.has_argument(flags[0])
and cc.has_argument(flags[1])
and host_machine.cpu() == 'armv7l'
)
simd_sse2_neon_flags += flags
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 db8c3ab

Please sign in to comment.