From b369fedd6e0e5d8e12061dbead86f6aa5619df8a Mon Sep 17 00:00:00 2001 From: techflashYT Date: Sat, 5 Jul 2025 01:31:25 -0700 Subject: [PATCH] cmake: don't auto vectorize with AltiVec on PPC Allowing GCC/Clang to auto-vectorize with AltiVec support breaks support for non-AltiVec compatible processors. Adding this option allows the existing AltiVec specific code to function as it always did, but prevents the compiler from inserting AltiVec instructions into arbitrary codepaths that SDL can't gate off via the existing CPUInfo code. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f66b7726054d4..96620afe7fcdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -893,6 +893,7 @@ if(SDL_ASSEMBLY) set(HAVE_ALTIVEC TRUE) set(SDL_ALTIVEC_BLITTERS 1) sdl_compile_options(PRIVATE "-maltivec") + sdl_compile_options(PRIVATE "-fno-tree-vectorize") set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/SDL_blit_N.c" APPEND PROPERTY COMPILE_DEFINITIONS "SDL_ENABLE_ALTIVEC") set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/SDL_blit_N.c" PROPERTY SKIP_PRECOMPILE_HEADERS 1) endif()