libobs: Build SIMDE on platforms without SSE2
SIMDE was introduced for aarch64 support, however, the library itself supports non-SIMD fallback, which allows us provide support to other platforms without code changes. There is another world beyond x86. So we can simply enable SIMDE for processors without SSE2 support. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
This commit is contained in:
@@ -174,20 +174,21 @@ elseif(UNIX)
|
||||
util/pipe-posix.c
|
||||
util/platform-nix.c)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
if(NEEDS_SIMDE)
|
||||
set(libobs_PLATFORM_HEADERS
|
||||
util/aarch/check.h
|
||||
util/aarch/hedley.h
|
||||
util/aarch/mmx.h
|
||||
util/aarch/simde-arch.h
|
||||
util/aarch/simde-common.h
|
||||
util/aarch/sse.h
|
||||
util/aarch/sse2.h
|
||||
util/simde/check.h
|
||||
util/simde/hedley.h
|
||||
util/simde/mmx.h
|
||||
util/simde/simde-arch.h
|
||||
util/simde/simde-common.h
|
||||
util/simde/sse.h
|
||||
util/simde/sse2.h
|
||||
util/threading-posix.h)
|
||||
else()
|
||||
set(libobs_PLATFORM_HEADERS
|
||||
util/threading-posix.h)
|
||||
endif()
|
||||
|
||||
if(HAVE_PULSEAUDIO)
|
||||
set(libobs_audio_monitoring_HEADERS
|
||||
audio-monitoring/pulse/pulseaudio-wrapper.h)
|
||||
@@ -475,22 +476,9 @@ target_compile_definitions(libobs
|
||||
PUBLIC
|
||||
HAVE_OBSCONFIG_H)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64(le)?")
|
||||
target_compile_options(libobs
|
||||
PUBLIC
|
||||
-mvsx)
|
||||
add_compile_definitions(NO_WARN_X86_INTRINSICS)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
target_compile_options(libobs
|
||||
PUBLIC)
|
||||
elseif(NOT MSVC)
|
||||
target_compile_options(libobs
|
||||
PUBLIC
|
||||
-mmmx
|
||||
-msse
|
||||
-msse2)
|
||||
endif()
|
||||
|
||||
target_compile_options(libobs
|
||||
PUBLIC
|
||||
${ARCH_SIMD_FLAGS})
|
||||
|
||||
target_compile_options(libobs
|
||||
PUBLIC
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#define HAVE_DBUS @HAVE_DBUS@
|
||||
#define HAVE_PULSEAUDIO @HAVE_PULSEAUDIO@
|
||||
#define USE_XINPUT @USE_XINPUT@
|
||||
#define NEEDS_SIMDE @NEEDS_SIMDE@
|
||||
#define LIBOBS_IMAGEMAGICK_DIR_STYLE_6L 6
|
||||
#define LIBOBS_IMAGEMAGICK_DIR_STYLE_7GE 7
|
||||
#define LIBOBS_IMAGEMAGICK_DIR_STYLE @LIBOBS_IMAGEMAGICK_DIR_STYLE@
|
||||
|
@@ -17,9 +17,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __aarch64__
|
||||
#if NEEDS_SIMDE
|
||||
|
||||
#include "aarch/sse2.h"
|
||||
#include "simde/sse2.h"
|
||||
|
||||
#define __m128 simde__m128
|
||||
#define _mm_setzero_ps simde_mm_setzero_ps
|
||||
|
Reference in New Issue
Block a user