From a5866809bb5ee25a1057de50b5bc42f4f2b9a9a3 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 29 Aug 2024 12:38:56 +0200
Subject: [PATCH] cmake: also test ARM neon on non-gcc compilers
---
CMakeLists.txt | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed31afcca83ae..414904b4a114b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -794,6 +794,24 @@ if(SDL_ASSEMBLY)
endif()
endif()
+ if(SDL_ARMNEON)
+ check_c_source_compiles("
+ #include <arm_neon.h>
+ void floats_add(float *dest, float *a, float *b, unsigned size) {
+ for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
+ vst1q_f32(dest, vaddq_f32(vld1q_f32(a), vld1q_f32(b)));
+ }
+ }
+ int main(int argc, char *argv[]) {
+ floats_add((float*)0, (float*)0, (float*)0, 0);
+ return 0;
+ }" COMPILER_SUPPORTS_ARMNEON)
+
+ if(COMPILER_SUPPORTS_ARMNEON)
+ set(HAVE_ARMNEON TRUE)
+ endif()
+ endif()
+
if(USE_GCC OR USE_CLANG)
# TODO: Those all seem to be quite GCC specific - needs to be
# reworked for better compiler support
@@ -848,24 +866,6 @@ if(SDL_ASSEMBLY)
set(HAVE_LASX TRUE)
endif()
endif()
-
- if(SDL_ARMNEON)
- check_c_source_compiles("
- #include <arm_neon.h>
- void floats_add(float *dest, float *a, float *b, unsigned size) {
- for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) {
- vst1q_f32(dest, vaddq_f32(vld1q_f32(a), vld1q_f32(b)));
- }
- }
- int main(int argc, char *argv[]) {
- floats_add((float*)0, (float*)0, (float*)0, 0);
- return 0;
- }" COMPILER_SUPPORTS_ARMNEON)
-
- if(COMPILER_SUPPORTS_ARMNEON)
- set(HAVE_ARMNEON TRUE)
- endif()
- endif()
endif()
endif()