Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ if(SDL_ASSEMBLY)
set(HAVE_ALTIVEC TRUE)
set(SDL_ALTIVEC_BLITTERS 1)
sdl_compile_options(PRIVATE "-maltivec")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If altivec is not always available on powerpc platforms, then this option must go.
Instead, we should use -maltivec for only those sources that can contain altivec implementations and/or use the SDL_TARGETING("altivec") macro (gcc supports it).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes: We allow that macro for gcc >= 4.9, and it does seem to support it: https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Function-Attributes.html#Function-Attributes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line might be a deal-breaker:

In 32-bit code, you cannot enable AltiVec instructions unless -mabi=altivec is used on the command line

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line might be a deal-breaker:

In 32-bit code, you cannot enable AltiVec instructions unless -mabi=altivec is used on the command line

Isn't that required in combination with -maltivec? (Or I remember wrong..)

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()
Expand Down
Loading