Relocate intrinsic modules to src/video/

This commit is contained in:
Isaac Aronson 2023-09-05 23:48:52 -05:00 committed by Sam Lantinga
parent f68a7edcf8
commit 735cf5a6f9
10 changed files with 33 additions and 26 deletions

View File

@ -498,7 +498,6 @@ sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/thread/*.c"
"${SDL3_SOURCE_DIR}/src/time/*.c"
"${SDL3_SOURCE_DIR}/src/timer/*.c"
"${SDL3_SOURCE_DIR}/src/video/*.c"
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/*.c"
)
if(MSVC AND TARGET SDL3-shared)
@ -514,6 +513,12 @@ if(MSVC AND TARGET SDL3-shared)
endif()
endif()
# Exclude intrinsinc modules from general builds
file(GLOB video_sources "${SDL3_SOURCE_DIR}/src/video/*.c")
list(FILTER video_sources EXCLUDE REGEX "SDL_blit_A_avx2.c$")
list(FILTER video_sources EXCLUDE REGEX "SDL_blit_A_sse4_1.c$")
sdl_glob_sources(${video_sources})
if(USE_INTELCC)
# warning #39: division by zero
# warning #239: floating point underflow
@ -739,7 +744,7 @@ if(SDL_ASSEMBLY)
cmake_pop_check_state()
if(COMPILER_SUPPORTS_SSE4_1)
set(HAVE_SSE4_1 TRUE)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/intrin/SDL_blit_A_sse4_1.c")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/SDL_blit_A_sse4_1.c")
endif()
endif()
if(SDL_SSE4_2)
@ -803,7 +808,7 @@ if(SDL_ASSEMBLY)
return 0;
}" COMPILER_SUPPORTS_AVX2)
cmake_pop_check_state()
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/intrin/SDL_blit_A_*.c")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/SDL_blit_A_*.c")
if(COMPILER_SUPPORTS_AVX2)
set(HAVE_AVX2 TRUE)
endif()

View File

@ -529,8 +529,6 @@
<ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
<ClInclude Include="..\..\src\video\gdk\SDL_gdktextinput.h" />
<ClInclude Include="..\..\src\video\intrin\SDL_blit_A_avx2.h" />
<ClInclude Include="..\..\src\video\intrin\SDL_blit_A_sse4.1.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_icd.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_layer.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_platform.h" />
@ -553,6 +551,8 @@
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib_xrandr.h" />
<ClInclude Include="..\..\src\video\SDL_blit.h" />
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
<ClInclude Include="..\..\src\video\SDL_blit_A_avx2.h" />
<ClInclude Include="..\..\src\video\SDL_blit_A_sse4_1.h" />
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\..\src\video\SDL_clipboard_c.h" />
@ -819,13 +819,13 @@
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\video\intrin\SDL_blit_A_avx2.c" />
<ClCompile Include="..\..\src\video\intrin\SDL_blit_A_sse4_1.c" />
<ClCompile Include="..\..\src\video\SDL_blit.c" />
<ClCompile Include="..\..\src\video\SDL_blit_0.c" />
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A.c" />
<ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A_avx2.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A_sse4_1.c" />
<ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
<ClCompile Include="..\..\src\video\SDL_blit_N.c" />
<ClCompile Include="..\..\src\video\SDL_blit_slow.c" />

View File

@ -458,11 +458,11 @@
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
<ClCompile Include="..\..\src\video\intrin\SDL_blit_A_avx2.c">
<Filter>video\intrin</Filter>
<ClCompile Include="..\..\src\video\SDL_blit_A_avx2.c">
<Filter>video</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\intrin\SDL_blit_A_sse4_1.c">
<Filter>video\intrin</Filter>
<ClCompile Include="..\..\src\video\SDL_blit_A_sse4_1.c">
<Filter>video</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>

View File

@ -429,8 +429,6 @@
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
<ClInclude Include="..\..\src\video\intrin\SDL_blit_A_avx2.h" />
<ClInclude Include="..\..\src\video\intrin\SDL_blit_A_sse4.1.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_icd.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_layer.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_platform.h" />
@ -459,6 +457,8 @@
<ClInclude Include="..\..\src\video\offscreen\SDL_offscreenwindow.h" />
<ClInclude Include="..\..\src\video\SDL_blit.h" />
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
<ClInclude Include="..\..\src\video\SDL_blit_A_avx2.h" />
<ClInclude Include="..\..\src\video\SDL_blit_A_sse4_1.h" />
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\..\src\video\SDL_clipboard_c.h" />
@ -684,6 +684,8 @@
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A.c" />
<ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A_avx2.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A_sse4_1.c" />
<ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
<ClCompile Include="..\..\src\video\SDL_blit_N.c" />
<ClCompile Include="..\..\src\video\SDL_blit_slow.c" />

View File

@ -871,11 +871,11 @@
</ClInclude>
<ClInclude Include="..\..\src\hidapi\SDL_hidapi_c.h" />
<ClInclude Include="..\..\src\thread\generic\SDL_sysrwlock_c.h" />
<ClInclude Include="..\..\src\video\intrin\SDL_blit_A_avx2.h">
<Filter>video\intrin</Filter>
<ClInclude Include="..\..\src\video\SDL_blit_A_avx2.h">
<Filter>video</Filter>
</ClInclude>
<ClInclude Include="..\..\src\video\intrin\SDL_blit_A_sse4.1.h">
<Filter>video\intrin</Filter>
<ClInclude Include="..\..\src\video\SDL_blit_A_sse4_1.h">
<Filter>video</Filter>
</ClInclude>
<ClInclude Include="..\..\src\thread\generic\SDL_sysrwlock_c.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_common.h" />
@ -1525,11 +1525,11 @@
<Filter>stdlib</Filter>
</ClCompile>
<ClCompile Include="..\..\src\thread\generic\SDL_sysrwlock.c" />
<ClCompile Include="..\..\src\video\intrin\SDL_blit_A_avx2.c">
<Filter>video\intrin</Filter>
<ClCompile Include="..\..\src\video\SDL_blit_A_avx2.c">
<Filter>video</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\intrin\SDL_blit_A_sse4_1.c">
<Filter>video\intrin</Filter>
<ClCompile Include="..\..\src\video\SDL_blit_A_sse4_1.c">
<Filter>video</Filter>
</ClCompile>
<ClCompile Include="..\..\src\thread\generic\SDL_sysrwlock.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.c" />

View File

@ -25,10 +25,10 @@
#include "SDL_blit.h"
#ifdef SDL_SSE4_1_INTRINSICS
#include "intrin/SDL_blit_A_sse4.1.h"
#include "SDL_blit_A_sse4_1.h"
#endif
#ifdef SDL_AVX2_INTRINSICS
#include "intrin/SDL_blit_A_avx2.h"
#include "SDL_blit_A_avx2.h"
#endif
#if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS)
#include "SDL3/SDL_cpuinfo.h"

View File

@ -4,8 +4,8 @@
#ifdef SDL_AVX2_INTRINSICS
#include "../SDL_blit.h"
#include "SDL_blit_A_sse4.1.h"
#include "SDL_blit.h"
#include "SDL_blit_A_sse4_1.h"
#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__))
__attribute__((target("avx2")))

View File

@ -4,7 +4,7 @@
#ifdef SDL_SSE4_1_INTRINSICS
#include "../SDL_blit.h"
#include "SDL_blit.h"
#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__))
__attribute__((target("sse4.1")))