mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-06 02:34:38 +00:00
cmake: also test ARM neon on non-gcc compilers
This commit is contained in:
@@ -794,6 +794,24 @@ if(SDL_ASSEMBLY)
|
|||||||
endif()
|
endif()
|
||||||
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)
|
if(USE_GCC OR USE_CLANG)
|
||||||
# TODO: Those all seem to be quite GCC specific - needs to be
|
# TODO: Those all seem to be quite GCC specific - needs to be
|
||||||
# reworked for better compiler support
|
# reworked for better compiler support
|
||||||
@@ -848,24 +866,6 @@ if(SDL_ASSEMBLY)
|
|||||||
set(HAVE_LASX TRUE)
|
set(HAVE_LASX TRUE)
|
||||||
endif()
|
endif()
|
||||||
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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user