From d7e36f9f5b875a79f24ec4664a9c1504a11bc226 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 18 Aug 2020 15:50:50 +0300 Subject: [PATCH 1/4] cmake: Conditionalize -fopenmp-simd --- CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 56bb1a3da..63d68fae6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,8 @@ set(SCRIPTING_ENABLED OFF CACHE BOOL "Internal global cmake variable" FORCE) include(ObsHelpers) include(ObsCpack) include(GNUInstallDirs) +include(CheckCCompilerFlag) +include(CheckCXXCompilerFlag) # Must be a string in the format of "x.x.x-rcx" if(DEFINED RELEASE_CANDIDATE) @@ -133,8 +135,16 @@ else() set(NEEDS_SIMDE "1") add_definitions(-DNEEDS_SIMDE=1) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp-simd -DSIMDE_ENABLE_OPENMP") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp-simd -DSIMDE_ENABLE_OPENMP") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSIMDE_ENABLE_OPENMP") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSIMDE_ENABLE_OPENMP") + CHECK_C_COMPILER_FLAG("-fopenmp-simd" C_COMPILER_SUPPORTS_OPENMP_SIMD) + if(C_COMPILER_SUPPORTS_OPENMP_SIMD) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp-simd") + endif() + CHECK_CXX_COMPILER_FLAG("-fopenmp-simd" CXX_COMPILER_SUPPORTS_OPENMP_SIMD) + if(CXX_COMPILER_SUPPORTS_OPENMP_SIMD) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp-simd") + endif() endif() set(ARCH_SIMD_FLAGS "") message(STATUS "No Native SSE2 SIMD Support - Using SIMDE") From ad1978a31fd0adaf0dce6ea40931f2da356bb240 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 18 Aug 2020 15:57:05 +0300 Subject: [PATCH 2/4] cmake: Enable SIMD for Elbrus architecture --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63d68fae6..6ac2c5cae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,7 +122,7 @@ else () string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR) endif () -if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86|x64|x86_64|amd64)") +if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86|x64|x86_64|amd64|e2k)") set(NEEDS_SIMDE "0") if(NOT MSVC) set(ARCH_SIMD_FLAGS "-mmmx" "-msse" "-msse2") From 006443b8c367268d3e81e2470132103293560b34 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 18 Aug 2020 16:50:46 +0300 Subject: [PATCH 3/4] cmake: Discard excess warnings for e2k --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ac2c5cae..5bdfe21f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -214,6 +214,21 @@ elseif(UNIX) endif() endif() +if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "e2k") + foreach(TEST_C_FLAG "-Wno-unused-parameter" "-Wno-ignored-qualifiers" "-Wno-pointer-sign" "-Wno-unused-variable" "-Wno-sign-compare" "-Wno-bad-return-value-type" "-Wno-maybe-uninitialized") + CHECK_C_COMPILER_FLAG(${TEST_C_FLAG} C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG}) + if(C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEST_C_FLAG}") + endif() + endforeach() + foreach(TEST_CXX_FLAG "-Wno-invalid-offsetof" "-Wno-maybe-uninitialized") + CHECK_CXX_COMPILER_FLAG(${TEST_CXX_FLAG} CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG}) + if(CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_CXX_FLAG}") + endif() + endforeach() +endif() + option(BUILD_TESTS "Build test directory (includes test sources and possibly a platform test executable)" FALSE) mark_as_advanced(BUILD_TESTS) From 543a3767c794ccf3d89a95d29acbc7a26feaa4b4 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 18 Aug 2020 16:52:05 +0300 Subject: [PATCH 4/4] obs-x264: Discard excess warning for e2k --- plugins/obs-x264/obs-x264-options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/obs-x264/obs-x264-options.c b/plugins/obs-x264/obs-x264-options.c index a1e7a66b7..2e807ee83 100644 --- a/plugins/obs-x264/obs-x264-options.c +++ b/plugins/obs-x264/obs-x264-options.c @@ -45,7 +45,7 @@ struct obs_x264_options obs_x264_parse_options(const char *options_string) struct obs_x264_option *out_option = out_options; for (char **input_word = input_words; *input_word; ++input_word) { if (getparam(*input_word, &out_option->name, - &out_option->value)) { + (const char **)&out_option->value)) { ++out_option; } else { *ignored_word = *input_word;