浏览代码

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.
techflashYT 5 月之前
父节点
当前提交
b3dd0995df
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      CMakeLists.txt

+ 1 - 0
CMakeLists.txt

@@ -914,6 +914,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()