Skip to content

Commit 4b8df62

Browse files
committed
Fix meson based compilation on arm32
1 parent 136215b commit 4b8df62

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ if host_machine.cpu_family() == 'arm'
293293
# first check if compiler supports the flag, and use it then. Needed only
294294
# on 32-bit armv7.
295295
flag = '-mfpu=neon'
296-
if cc.has_argument(flag)
297-
simd_sse2_neon_flags += flag
296+
if cc.has_argument(flag) and host_machine.cpu() == 'armv7l'
297+
simd_sse2_neon_flags += [flag, '-march=armv7-a']
298298
simd_sse2_neon = true
299299
endif
300300
elif host_machine.cpu_family() == 'aarch64'

src_c/simd_fill.h

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
#endif
2222
#endif
2323

24-
#if PG_ENABLE_ARM_NEON
25-
// sse2neon.h is from here: https://github.com/DLTcollab/sse2neon
26-
#include "include/sse2neon.h"
27-
#endif /* PG_ENABLE_ARM_NEON */
28-
2924
#if defined(__SSE2__)
3025
#define PG_ENABLE_SSE_NEON 1
3126
#elif PG_ENABLE_ARM_NEON

src_c/simd_shared.h

-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ pg_has_avx2();
3333
#endif
3434
#endif
3535

36-
#if PG_ENABLE_ARM_NEON
37-
// sse2neon.h is from here: https://github.com/DLTcollab/sse2neon
38-
#include "include/sse2neon.h"
39-
#endif /* PG_ENABLE_ARM_NEON */
40-
4136
/* This defines PG_ENABLE_SSE_NEON as True if either SSE or NEON is available
4237
* at compile time. Since we do compile time translation of SSE2->NEON, they
4338
* have the same code paths, so this reduces code duplication of those paths.

src_c/simd_surface_fill_sse2.c

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#include "simd_fill.h"
22

3+
#if PG_ENABLE_ARM_NEON
4+
// sse2neon.h is from here: https://github.com/DLTcollab/sse2neon
5+
#include "include/sse2neon.h"
6+
#endif /* PG_ENABLE_ARM_NEON */
7+
38
#define BAD_SSE2_FUNCTION_CALL \
49
printf( \
510
"Fatal Error: Attempted calling an SSE2 function when both compile " \

0 commit comments

Comments
 (0)