Skip to content

Commit b3dd099

Browse files
techflashYTslouken
authored andcommitted
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.
1 parent 1502c2f commit b3dd099

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ if(SDL_ASSEMBLY)
914914
set(HAVE_ALTIVEC TRUE)
915915
set(SDL_ALTIVEC_BLITTERS 1)
916916
sdl_compile_options(PRIVATE "-maltivec")
917+
sdl_compile_options(PRIVATE "-fno-tree-vectorize")
917918
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/SDL_blit_N.c" APPEND PROPERTY COMPILE_DEFINITIONS "SDL_ENABLE_ALTIVEC")
918919
set_property(SOURCE "${SDL3_SOURCE_DIR}/src/video/SDL_blit_N.c" PROPERTY SKIP_PRECOMPILE_HEADERS 1)
919920
endif()

0 commit comments

Comments
 (0)